Closed phax closed 3 years ago
No, the problem is the expression. Should be
(exists(cbc:PrepaidAmount) and not(exists(cbc:PayableRoundingAmount)) and (xs:decimal(cbc:PayableAmount) = (round((xs:decimal(cbc:TaxInclusiveAmount) - xs:decimal(cbc:PrepaidAmount)) 10 10) div 100))) or (not(exists(xs:decimal(cbc:PrepaidAmount))) and not(exists(xs:decimal(cbc:PayableRoundingAmount))) and xs:decimal(cbc:PayableAmount) = xs:decimal(cbc:TaxInclusiveAmount)) or (exists(xs:decimal(cbc:PrepaidAmount)) and exists(xs:decimal(cbc:PayableRoundingAmount)) and ((round((xs:decimal(cbc:PayableAmount) - xs:decimal(cbc:PayableRoundingAmount)) 10 10) div 100) = (round((xs:decimal(cbc:TaxInclusiveAmount) - xs:decimal(cbc:PrepaidAmount)) 10 10) div 100))) or (not(exists(xs:decimal(cbc:PrepaidAmount))) and exists(xs:decimal(cbc:PayableRoundingAmount)) and ((round((xs:decimal(cbc:PayableAmount) - xs:decimal(cbc:PayableRoundingAmount)) 10 10) div 100) = xs:decimal(cbc:TaxInclusiveAmount)))
Okay thanks. Meaning there will be a 1.3.4 release soon?
spring 2021 release
Ah okay. That renders the 1.3.3 release quite useless if such a showstopper bug is in it. Can you eventually consider releasing a 1.3.3.1 bugfix release?
This is an old bug. The error has not been noticed because it only appears when there is a PayableRoundingAmount with value 0.
I would then suggest waiting to the next release to fix the bug.
The issue poped up when converting CII documents to UBL and that was not changed. The output validated with 1.3.2 validation artefacts but fails with 1.3.3 - so something in this regard was changed.
The problem was caused by commit https://github.com/ConnectingEurope/eInvoicing-EN16931/commit/d925641ab610079574dfad6425d54de1591ac40f which was meant to resolve #222
I guess your proposal can be simplified to:
(exists(cbc:PrepaidAmount) and not(exists(cbc:PayableRoundingAmount)) and (xs:decimal(cbc:PayableAmount) = (round((xs:decimal(cbc:TaxInclusiveAmount) - xs:decimal(cbc:PrepaidAmount)) * 10 * 10) div 100))) or
(not(exists(cbc:PrepaidAmount)) and not(exists(cbc:PayableRoundingAmount)) and xs:decimal(cbc:PayableAmount) = xs:decimal(cbc:TaxInclusiveAmount)) or
(exists(cbc:PrepaidAmount) and exists(cbc:PayableRoundingAmount) and ((round((xs:decimal(cbc:PayableAmount) - xs:decimal(cbc:PayableRoundingAmount)) * 10 * 10) div 100) = (round((xs:decimal(cbc:TaxInclusiveAmount) - xs:decimal(cbc:PrepaidAmount)) * 10 * 10) div 100))) or
(not(exists(cbc:PrepaidAmount)) and exists(cbc:PayableRoundingAmount) and ((round((xs:decimal(cbc:PayableAmount) - xs:decimal(cbc:PayableRoundingAmount)) * 10 * 10) div 100) = xs:decimal(cbc:TaxInclusiveAmount)))
Not emitting PayableRoundingAmount
if the value is 0
is a suitable work around
Ok @phax, I have added a test on this and will fix it for the next release.
Should this introduced bug be communicated somehow? At least mentioned in "News and noteworthy" section ✌️
Should this introduced bug be communicated somehow? At least mentioned in "News and noteworthy" section ✌️
Added a Note in the Release explaining the error.
@oriol where is this note added? Can't see it commited to README.
Hi guys, since the latest 1.3.3 update, the following UBL block is invalid:
I think the calculation model would now require
TaxInclusiveAmount
to be 0???