phax / en16931-cii2ubl

Converter for EN16931 invoices from CII to UBL
Apache License 2.0
18 stars 6 forks source link

TypeCode missing after AdditionalReferencedDocument conversion #18

Closed L3Mars closed 1 year ago

L3Mars commented 1 year ago

There seems to be a problem converting the AdditionalReferencedDocument field to cac:DocumentReference, the TypeCode is missing on the output xml.

// Input CII
<am:ApplicableHeaderTradeAgreement>
...
    <ram:AdditionalReferencedDocument>
        <ram:IssuerAssignedID schemeID="AAJ">18088852:20221215</ram:IssuerAssignedID>
        <ram:TypeCode>130</ram:TypeCode>
    </ram:AdditionalReferencedDocument>
...
</ram:ApplicableHeaderTradeAgreement>
// Output UBL
<cac:InvoiceLine>
...
  <cac:DocumentReference>
      <cbc:ID>18088852:20221215</cbc:ID>
  </cac:DocumentReference>
...
</cac:InvoiceLine>
phax commented 1 year ago

Mapping the CII TypeCode to UBL DocumentTypeCode But only if the value is either 50 (BT-17) or 130 (BT-18).

Other values are explicitly forbidden and checked by the EN-16931 validation artefacts.

phax commented 1 year ago

@L3Mars if that suits you, I will release v1.4.10 immediately.

L3Mars commented 1 year ago

@phax That would be great, thank you !

phax commented 1 year ago

Release 1.4.10 is out. Thanks for reporting