fatalPeppol BIS Billing 3.0profileCIIUBL
For Danish Suppliers, a Credit note cannot have a negative total (PayableAmount)
A Danish credit note has a negative payable amount.
A credit note already means "we owe you": state the amounts as positive numbers on the CreditNote document. Negating them on top double-counts the direction.
CII — context rsm:CrossIndustryInvoice[$DKSupplierCountry = 'DK']
not((($DKCustomerCountry = 'DK') and (normalize-space(rsm:ExchangedDocument/ram:TypeCode/text()) = '381')) and (number(rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeSettlement/ram:SpecifiedTradeSettlementHeaderMonetarySummation/ram:DuePayableAmount/text()) < 0) )
UBL — context ubl-creditnote:CreditNote[$DKSupplierCountry = 'DK'] | ubl-invoice:Invoice[$DKSupplierCountry = 'DK']
not((boolean(/ubl-creditnote:CreditNote) and ($DKCustomerCountry = 'DK')) and (number(cac:LegalMonetaryTotal/cbc:PayableAmount/text()) < 0) )