Skip to content

line[].tradeSettlement.allowances is missing ChargeIndicator #116

Description

@kilbiller

To Reproduce

  1. Create a EN16931 invoice with discounts on line items in the form of allowances
  2. Check the xml output

Current vs. Expected behavior

A Charge indicator set to false should be present at the top but nothing is set, i also tried adding chargeIndicator: false to the object but it does nothing.

Here is what is generated :

<ram:IncludedSupplyChainTradeLineItem>
      <ram:AssociatedDocumentLineDocument>
        <ram:LineID>2</ram:LineID>
      </ram:AssociatedDocumentLineDocument>
      <ram:SpecifiedTradeProduct>
        <ram:Name>Billets - Billet 2</ram:Name>
      </ram:SpecifiedTradeProduct>
      <ram:SpecifiedLineTradeAgreement>
        <ram:GrossPriceProductTradePrice>
          <ram:ChargeAmount>65</ram:ChargeAmount>
          <ram:BasisQuantity unitCode="C62">1</ram:BasisQuantity>
        </ram:GrossPriceProductTradePrice>
        <ram:NetPriceProductTradePrice>
          <ram:ChargeAmount>52.5</ram:ChargeAmount>
          <ram:BasisQuantity unitCode="C62">1</ram:BasisQuantity>
        </ram:NetPriceProductTradePrice>
      </ram:SpecifiedLineTradeAgreement>
      <ram:SpecifiedLineTradeDelivery>
        <ram:BilledQuantity unitCode="C62">1</ram:BilledQuantity>
      </ram:SpecifiedLineTradeDelivery>
      <ram:SpecifiedLineTradeSettlement>
        <ram:ApplicableTradeTax>
          <ram:TypeCode>VAT</ram:TypeCode>
          <ram:CategoryCode>S</ram:CategoryCode>
          <ram:RateApplicablePercent>20</ram:RateApplicablePercent>
        </ram:ApplicableTradeTax>
        <ram:SpecifiedTradeAllowanceCharge>
          <ram:ActualAmount>12.5</ram:ActualAmount>
          <ram:Reason>BILLETPASCHER applied on Billets - Billet 2</ram:Reason>
        </ram:SpecifiedTradeAllowanceCharge>
        <ram:SpecifiedTradeSettlementLineMonetarySummation>
          <ram:LineTotalAmount>52.5</ram:LineTotalAmount>
        </ram:SpecifiedTradeSettlementLineMonetarySummation>
      </ram:SpecifiedLineTradeSettlement>
    </ram:IncludedSupplyChainTradeLineItem>

Notice SpecifiedTradeAllowanceCharge is missing ChargeIndicator.

Here is the error report from Mustang:

schema validation fails:org.xml.sax.SAXParseException; lineNumber: 93; columnNumber: 29; cvc-complex-type.2.4.a: Invalid content was found starting with element ‘{“urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100”:ActualAmount}’. One of ‘{“urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100”:ChargeIndicator}’ is expected.

[CII-SR-463]-Each Specified Trade Allowance Charge (BG-20)(BG-21) shall contain a Charge Indicator. [ID FX-SCH-A-000348] from /xslt/ZF_240/FACTUR-X_EN16931.xslt)

[CII-SR-463]-Each Specified Trade Allowance Charge (BG-20)(BG-21) shall contain a Charge Indicator. [ID FX-SCH-A-000348] from /xslt/ZF_240/FACTUR-X_EN16931.xslt)

What version of node-zugferd are you using?

0.1.1-beta.1

Provide environment information

Node v24.14.1

Which area(s) are affected? (Select all that apply)

Package

Config (if applicable)

import { zugferd } from 'node-zugferd';
import { EN16931, type ProfileEN16931 } from 'node-zugferd/profile/en16931';

const invoicer = zugferd({
			profile: EN16931,
			strict: false,
		});

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions