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

Rule BR-CO-19 not working correctly #219

Closed
midran opened this issue Jun 23, 2020 · 7 comments
Closed

Rule BR-CO-19 not working correctly #219

midran opened this issue Jun 23, 2020 · 7 comments

Comments

@midran
Copy link
Collaborator

midran commented Jun 23, 2020

Requester name
Henry Buck
PEPPOL member company
MBIE
PEPPOL Area / components
POACC (PostAward) Ex: e-Ordering, e-Invoicing
Description

I have been creating test files to trigger the errors when a file fails the tests in the A-NZ schematron.
Rule BR-CO-19 is a PEPPOL standard, and the only way I could trigger this error was to
have nothing within the invoice period as follows:

<cac:InvoicePeriod> </cac:InvoicePeriod>

The problem may be that the condition is missing parentheses and should read as follows:

(exists(cbc:StartDate) or exists(cbc:EndDate) or (exists(cbc:DescriptionCode)) and not(exists(cbc:StartDate)) and not(exists(cbc:EndDate)))

Issue orignitated from Peppol https://openpeppol.atlassian.net/browse/PEPPOL-2857

@oriol oriol added this to the v1.3.3 milestone Sep 13, 2020
oriol added a commit that referenced this issue Sep 15, 2020
@oriol oriol closed this as completed Sep 15, 2020
@phax
Copy link
Collaborator

phax commented Dec 2, 2020

@oriol the "DescriptionCode" element is a requirement from BT-8. You change for 1.3.3 somehow broke InvoicePeriod that contains StartDate, EndDate and DescriptionCode...

@sarafacchinettiIC

@oriol oriol reopened this Dec 3, 2020
@oriol
Copy link
Collaborator

oriol commented Jan 20, 2021

Reverting to the previous Xpath as it correctly implemented the rule plus the effect of mapping the DescriptionCode to BT-8.

exists(cbc:StartDate) or exists(cbc:EndDate) or (exists(cbc:DescriptionCode) and not(exists(cbc:StartDate)) and not(exists(cbc:EndDate)))

This checks positive when any of StartDate and EndDate are in the InvoicePeriod and the case where the InvoicePeriod is used just to carry information on the DescriptionCode to support BT-8

@oriol oriol closed this as completed in 1a3068d Jan 20, 2021
@phax
Copy link
Collaborator

phax commented Jan 20, 2021

Did you test with the example above:

<cac:InvoicePeriod> </cac:InvoicePeriod>

@oriol
Copy link
Collaborator

oriol commented Jan 20, 2021

@phax
Copy link
Collaborator

phax commented Jan 20, 2021

Great thanks :)

@sarafacchinettiIC
Copy link

The test case might also include as success test

<cac:InvoicePeriod>
			<cbc:StartDate>2020-11-01</cbc:StartDate>
			<cbc:EndDate>2020-11-30</cbc:EndDate>
			<cbc:DescriptionCode>3</cbc:DescriptionCode>
</cac:InvoicePeriod>

@oriol
Copy link
Collaborator

oriol commented Jan 20, 2021

Added the test

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

4 participants