XRechnung 2.2/2.1 Validation fails with BR-S-08 & BR-CO-10 because of only 2 fraction digits for SpecifiedTradeSettlementLineMonetarySummation
I tried this with both the release and the current snapshot.
The SpecifiedTradeSettlementLineMonetarySummation of a line item has the total net price with 2 fraction digits (the default value for _formatDecimal), this results in validators erroring in some cases (see attached samples). Changing line 422 in InvoiceDescriptor21Writer.cs to Writer.WriteValue(_formatDecimal(_total, 4)); fixes the issue for me.
The two errors I receive:
[BR-S-08]-For each different value of VAT category rate (BT-119) where the VAT category code (BT-118) is "Standard rated", the VAT category taxable amount (BT-116) in a VAT breakdown (BG-23) shall equal the sum of Invoice line net amounts (BT-131) plus the sum of document level charge amounts (BT-99) minus the sum of document level allowance amounts (BT-92) where the VAT category code (BT-151, BT-102, BT-95) is "Standard rated" and the VAT rate (BT-152, BT-103, BT-96) equals the VAT category rate (BT-119).
Pfad: /rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction[1]/ram:ApplicableHeaderTradeSettlement[1]/ram:ApplicableTradeTax[1]/ram:CategoryCode[1]
[BR-CO-10]-Sum of Invoice line net amount (BT-106) = Σ Invoice line net amount (BT-131).
Pfad: /rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction[1]/ram:ApplicableHeaderTradeSettlement[1]/ram:SpecifiedTradeSettlementHeaderMonetarySummation[1]
Zipped examples because apparently GH hates XML examples-working-and-fixed.zip