Rules / IBR-158-AE
IBR-158-AE error
Where the Invoice type code is 'Credit note', Credit note reason code must be there
Where the Invoice type code [IBT-003] is 'Credit note', Credit note reason code [BTAE-03] must be there .
Fails
<cbc:InvoiceTypeCode>381</cbc:InvoiceTypeCode>
<!-- the data this document type requires is missing or wrong -->
Fix
Type code 381 triggers this rule. Add what it asks for, or check the type code is right.
Schematron
- Context
/ubl:Invoice | /cn:CreditNote- Test
not((cbc:InvoiceTypeCode | cbc:CreditNoteTypeCode) = "381" and not(exists(cac:DiscrepancyResponse/cbc:ResponseCode)))
Official text: Where the Invoice type code [IBT-003] is 'Credit note', Credit note reason code [BTAE-03] MUST be there .