Skip to content
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

Error in validation of rule BR-CO-25 #84

Closed
SiwMeckelborg opened this issue Nov 2, 2018 · 2 comments
Closed

Error in validation of rule BR-CO-25 #84

SiwMeckelborg opened this issue Nov 2, 2018 · 2 comments

Comments

@SiwMeckelborg
Copy link
Contributor

The following issue has been reported to openPEPPOL: "When validating a credit note file using PEPPOL bis 3, if you populate the cbc:PayableAmount then the schematron expect either the DueDate or PaymentTerms/Notes to be popoulated (BR-CO-25] -In case the Amount due for payment (BT-115) is positive, either the Payment due date (BT-9) or the Payment terms (BT-20) shall be present.).

However, the Schematron is looking for the DueDate in the root of the XML, but this isn't a valid element according to the PEPPOL bis 3 credit note specification.

please can someone confirm if this is an issue and let us know if this will address in the fall 2018 release."

I did look into this a bit, and there is a problem that the rule does not check the PaymentDueDate that is used in the CreditNote schema, but I think maybe there should be some further consideration regarding the meaning of the rule text, it states (my emphasis): "In case the Amount due for payment (BT-115) is positive, either the Payment due date (BT-9) or the Payment terms (BT-20) shall be present.)"

On a credit note, a positive amount actually means you should not pay, so I think this rule should either be changed to only fire on an Invoice and not on a CreditNote, or test for positive amount on Invoice and negative amount on CreditNote.

@oriol
Copy link
Collaborator

oriol commented Feb 6, 2019

There is an issue in the Syntax Binding of UBL, as the Credit Note Payment Due Date is mapped to ubl:CreditNote/cbc:DueDate when this element does not exist in UBL 2.1. It was introduced in UBL 2.2.

Therefore, this needs to be added in a future corrigenda of the mapping.

In order to solve this issue, I'd suggest not checking this rule for CreditNote until the mapping and the business rules are reviewed by the TC.

@SiwMeckelborg
Copy link
Contributor Author

In table 4.4 in the TS, BT-9, Payment Due date is mapped to: "/CreditNote/cac:PaymentMeans/cbc:PaymentDueDate", so I think that is correct. My suggestion is to fix this validation by changing the context so it only matches Invoices, not Credit notes. In my opinion, the intention of this rule, is to say that if the invoice has an amount to be paid, a due date or payment terms must be sent. For a CreditNote however, a positive amount is not indicating you need to pay, hence the due date is not needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants