Skip to content

Add DebitNote support#159

Merged
brtdv merged 1 commit intomasterfrom
feature/debit-note-support
Jan 22, 2026
Merged

Add DebitNote support#159
brtdv merged 1 commit intomasterfrom
feature/debit-note-support

Conversation

@debeira
Copy link
Copy Markdown
Contributor

@debeira debeira commented Jan 19, 2026

Summary

  • Add support for UBL 2.1 DebitNote documents, similar to existing CreditNote support
  • DebitNote differs from Invoice/CreditNote: no TypeCode element, uses RequestedMonetaryTotal instead of LegalMonetaryTotal, uses DebitedQuantity instead of InvoicedQuantity
  • Includes new DebitNote and DebitNoteLine classes, Generator method, Reader support, and tests

Test plan

  • Run ./vendor/bin/phpunit tests/Write/SimpleDebitNoteTest.php - validates against UBL 2.1 schema
  • Run full test suite ./vendor/bin/phpunit - all 31 tests pass
  • Verify generated XML is Peppol compliant

Add support for UBL 2.1 DebitNote documents, similar to existing
CreditNote support. DebitNote differs from Invoice/CreditNote in that:
- It has no TypeCode element
- Uses RequestedMonetaryTotal instead of LegalMonetaryTotal
- Uses DebitedQuantity instead of InvoicedQuantity

New files:
- src/DebitNote.php - DebitNote class extending Invoice
- src/DebitNoteLine.php - DebitNoteLine class extending InvoiceLine
- tests/Write/SimpleDebitNoteTest.php - Test for writing DebitNote

Modified files:
- src/Invoice.php - Add conditional logic for DebitNote specifics
- src/InvoiceLine.php - Add DebitedQuantity support
- src/Generator.php - Add debitNote() method
- src/Reader.php - Add DebitNote deserializer mappings
- src/Schema.php - Add DEBITNOTE constant
@brtdv brtdv merged commit 11b6cb1 into master Jan 22, 2026
5 checks passed
@brtdv brtdv deleted the feature/debit-note-support branch January 22, 2026 18:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants