VRBL-INV-SG-1p4-46

Basic Info

Rule An Invoice that contains a Tax Subtotal Category ID used for GST where the Tax Category ID is "VRBL:SG:NG", shall not contain Document level charges (BG-20) where Document level charge GST category code (BT-9-GST5) is not "VRBL:SG:NG"
Context /ubl:Invoice
Pattern vrbl-invoice-sg-1p4
Severity fatal

Implementation

not(
	cac:TaxTotal/cac:TaxSubtotal/cac:TaxCategory[cac:TaxScheme/cbc:ID = 'GST']/cbc:ID = 'VRBL:SG:NG'
)
or
(
	count(cac:AllowanceCharge[string(cbc:ChargeIndicator) = 'true']/cac:TaxCategory[cac:TaxScheme/cbc:ID = 'GST' and cbc:ID != 'VRBL:SG:NG']) = 0
)