E-invoice error explained
The invoice net total (BT-109) must follow from the lines: sum of lines minus document-level allowances plus document-level charges.
The invoice net total (BT-109) must follow from the lines: sum of lines minus document-level allowances plus document-level charges. If a discount or freight is included in the total, it must also be in the file as its own allowance or charge.
Invoice total amount without VAT (BT-109) = Σ Invoice line net amount (BT-131) – Sum of allowances on document level (BT-107) + Sum of charges on document level (BT-108).
Source: KoSIT configuration XRechnung 3.0.2 (31 Jan 2026).
Write each document-level discount as ram:SpecifiedTradeAllowanceCharge with ram:ChargeIndicator false, and each charge with true. Set ram:AllowanceTotalAmount (BT-107) and ram:ChargeTotalAmount (BT-108) to their sums and ram:TaxBasisTotalAmount (BT-109) to BT-106 – BT-107 + BT-108.
Wrong (CII)
<ram:SpecifiedTradeSettlementHeaderMonetarySummation>
<ram:LineTotalAmount>1000.00</ram:LineTotalAmount>
<ram:TaxBasisTotalAmount>950.00</ram:TaxBasisTotalAmount>
<!-- 50.00 discount, but no allowance and no AllowanceTotalAmount -->
</ram:SpecifiedTradeSettlementHeaderMonetarySummation>Right (CII)
<ram:SpecifiedTradeSettlementHeaderMonetarySummation>
<ram:LineTotalAmount>1000.00</ram:LineTotalAmount>
<ram:ChargeTotalAmount>0.00</ram:ChargeTotalAmount>
<ram:AllowanceTotalAmount>50.00</ram:AllowanceTotalAmount>
<ram:TaxBasisTotalAmount>950.00</ram:TaxBasisTotalAmount>
<ram:TaxTotalAmount currencyID="EUR">180.50</ram:TaxTotalAmount>
<ram:GrandTotalAmount>1130.50</ram:GrandTotalAmount>
<ram:TotalPrepaidAmount>0.00</ram:TotalPrepaidAmount>
<ram:DuePayableAmount>1130.50</ram:DuePayableAmount>
</ram:SpecifiedTradeSettlementHeaderMonetarySummation>Sales / Project Operations: Sales and Project Operations have no e-invoice output out of the box. In the WBS Invoice Accelerator for Dynamics 365 the Accelerator computes every total of the e-invoice from the lines it writes to the file. If this rule appears for a file from the Accelerator, send the whole message to WBS. An invoice-wide discount is written as a document-level allowance.
Check your invoice for free. The validator shows every finding with an explanation and its location in the XML.