PHP Developer Explains How a Hidden Schematron Variable Broke Credit Note Validation
A PHP developer building a Croatian e-invoicing library encountered a subtle but critical bug while reimplementing EN 16931 national validation rules. Croatia's Schematron file contains 73 fatal assertions, and the developer chose to reimplement them in PHP rather than rely on XSLT 2.0 or external services. A rule requiring a payment due date for positive invoice amounts appeared to incorrectly flag every credit note lacking a due date. The root cause was a variable defined 30 lines above the assertion that multiplies the payable amount by -1 for credit notes, meaning the rule was never meant to apply to them. The developer warns that when manually reimplementing Schematron rules, reading the full context including variable declarations is essential to avoid false positives.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.
Discussion (0)
Log in to join the discussion and vote.
Log in