-
Notifications
You must be signed in to change notification settings - Fork 31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support credit note type code #36
Support credit note type code #36
Conversation
8a30733
to
cca1eb2
Compare
I'm not too sure what to do about those CI failures.. The constant is referenced from tests, but I guess that folder is excluded. Also I wonder if the rules are maybe too tight? Maybe a warning should be sufficient for a non-referenced constant? Let me know what you want me to do about it :) |
Thanks for the PR, @ChristianVermeulen! I've been browsing the specification for a bit and apparently Credit Notes are more complicated that I've thought. Some additional changes will be required, but it's still feasible. EN 16931 defines BT-3 (Invoice type code) as "A code specifying the functional type of the Invoice". It also specifies that "a Credit Note is similar to an Invoice except that the Invoice Type is set to Credit Note". So far so good. However, when importing/exporting UBL documents, PEPPOL has two separate profiles (
There's also rule PEPPOL-EN16931-P0101, that sets which profile should be used. With all that in mind, I'll push some changes this week and hopefully have it merged before February. |
Ah, I didn't notice there was an actual difference in the profile node as well. I guess i then boils down to 2 possibilities: Invoice:
Credit Note
The test you mentioned seems to just make sure all type codes not equal to I think the biggest question is if you want to fully support the credit note as profile/type and have a separate type / reader / writer for it, or just have an "$invoice" in general which can be recognised by the typecode to know which of the different types it is. My personal opinion would be the latter. I don't really see why the spec even has different nodes. A credit note actually is a type of invoice (a negative / correcting one). So I think I would've had only That being said, let me know if there is anything I can do to help! |
- Added constants from UNCL1001 subset to Invoice class
- Updated UblWriter class - Updated unit tests
- Updated UblReader class - Updated unit tests
- Updated tests - Created peppol-credit-note.xml example
I've made some changes to fully support credit notes. Now, developers can set the invoice type code and the UBL profile will be changed seamlessly to use Merging to develop! 🎉 |
When importing a customers administration we noticed all credit notes were imported as invoices. As it turnes out this library does not support credit notes.
This PR makes sure it does.
To be discussed: Can we live with the fact that everything is still called "invoice"? The
CreditNoteTypeCode
is really the only and single different node from the invoice spec. (personally I wonder why it wasn't just calledTypeCode
but yeah.