Message

[UBL-DT-01]-Amounts shall be decimal up to two fraction digits

Context
//*[ends-with(name(), 'Amount') and not(ends-with(name(),'PriceAmount')) and not(ancestor::cac:Price/cac:AllowanceCharge)]
Test
string-length(substring-after(.,'.'))<=2
Usage
/ ubl:Invoice / cac:AllowanceCharge / cbc:Amount
/ ubl:Invoice / cac:AllowanceCharge / cbc:BaseAmount
/ ubl:Invoice / cac:TaxTotal / cbc:TaxAmount
/ ubl:Invoice / cac:TaxTotal / cac:TaxSubtotal / cbc:TaxableAmount
/ ubl:Invoice / cac:TaxTotal / cac:TaxSubtotal / cbc:TaxAmount
/ ubl:Invoice / cac:LegalMonetaryTotal / cbc:LineExtensionAmount
/ ubl:Invoice / cac:LegalMonetaryTotal / cbc:TaxExclusiveAmount
/ ubl:Invoice / cac:LegalMonetaryTotal / cbc:TaxInclusiveAmount
/ ubl:Invoice / cac:LegalMonetaryTotal / cbc:AllowanceTotalAmount
/ ubl:Invoice / cac:LegalMonetaryTotal / cbc:ChargeTotalAmount
/ ubl:Invoice / cac:LegalMonetaryTotal / cbc:PrepaidAmount
/ ubl:Invoice / cac:LegalMonetaryTotal / cbc:PayableRoundingAmount
/ ubl:Invoice / cac:LegalMonetaryTotal / cbc:PayableAmount
/ ubl:Invoice / cac:InvoiceLine / cbc:LineExtensionAmount
/ ubl:Invoice / cac:InvoiceLine / cac:AllowanceCharge / cbc:Amount
/ ubl:Invoice / cac:InvoiceLine / cac:AllowanceCharge / cbc:BaseAmount