PintLint

Rules / IBR-158-AE

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:CreditNoteTypeCode>381</cbc:CreditNoteTypeCode>
<!-- no cac:DiscrepancyResponse/cbc:ResponseCode -->

Fix

Add the credit note reason code in cac:DiscrepancyResponse/cbc:ResponseCode.

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 .

Official · PINT AE (UAE) rules. Severity: error. Runs on UBL XML.

Check your invoice for this rule