# PEPPOL-EN16931-R040-SG

Source: https://xmlvalid.com/rules/PEPPOL-EN16931-R040-SG

> Allowance/charge amount must equal base amount * percentage/100 if base amount and percentage exists

- Level: error
- Rule sets: PINT SG rules (Singapore) 1.4.1
- Context: `ubl:Invoice/cac:AllowanceCharge | ubl:Invoice/cac:InvoiceLine/cac:AllowanceCharge | cn:CreditNote/cac:AllowanceCharge | cn:CreditNote/cac:CreditNoteLine/cac:AllowanceCharge`
- Test: `not(cbc:MultiplierFactorNumeric and cbc:BaseAmount) or u:slack(if (cbc:Amount) then cbc:Amount else 0, (xs:decimal(cbc:BaseAmount) * xs:decimal(cbc:MultiplierFactorNumeric)) div 100, 0.02)`

Validate a document against these rules: https://xmlvalid.com/validate
