fix(compliance): improve compliance

This commit is contained in:
2025-05-28 10:43:22 +00:00
parent bc6e2e1829
commit 0140267eb2
2 changed files with 306 additions and 17 deletions

View File

@ -32,7 +32,41 @@ tap.test('CONV-08: Extension Preservation - ZUGFeRD extensions', async () => {
<ram:LanguageID>de</ram:LanguageID>
</rsm:ExchangedDocument>
<rsm:SupplyChainTradeTransaction>
<ram:IncludedSupplyChainTradeLineItem>
<ram:AssociatedDocumentLineDocument>
<ram:LineID>1</ram:LineID>
</ram:AssociatedDocumentLineDocument>
<ram:SpecifiedTradeProduct>
<ram:Name>Test Product</ram:Name>
</ram:SpecifiedTradeProduct>
<ram:SpecifiedLineTradeDelivery>
<ram:BilledQuantity unitCode="C62">1</ram:BilledQuantity>
</ram:SpecifiedLineTradeDelivery>
<ram:SpecifiedLineTradeSettlement>
<ram:SpecifiedTradeSettlementLineMonetarySummation>
<ram:LineTotalAmount>100.00</ram:LineTotalAmount>
</ram:SpecifiedTradeSettlementLineMonetarySummation>
</ram:SpecifiedLineTradeSettlement>
</ram:IncludedSupplyChainTradeLineItem>
<ram:ApplicableHeaderTradeAgreement>
<ram:SellerTradeParty>
<ram:Name>Test Seller GmbH</ram:Name>
<ram:PostalTradeAddress>
<ram:LineOne>Hauptstraße 1</ram:LineOne>
<ram:CityName>Berlin</ram:CityName>
<ram:PostcodeCode>10115</ram:PostcodeCode>
<ram:CountryID>DE</ram:CountryID>
</ram:PostalTradeAddress>
</ram:SellerTradeParty>
<ram:BuyerTradeParty>
<ram:Name>Test Buyer AG</ram:Name>
<ram:PostalTradeAddress>
<ram:LineOne>Kundenweg 10</ram:LineOne>
<ram:CityName>Hamburg</ram:CityName>
<ram:PostcodeCode>20095</ram:PostcodeCode>
<ram:CountryID>DE</ram:CountryID>
</ram:PostalTradeAddress>
</ram:BuyerTradeParty>
<ram:ContractReferencedDocument>
<ram:IssuerAssignedID>CONTRACT-2024-001</ram:IssuerAssignedID>
</ram:ContractReferencedDocument>
@ -41,6 +75,16 @@ tap.test('CONV-08: Extension Preservation - ZUGFeRD extensions', async () => {
<ram:TypeCode>916</ram:TypeCode>
</ram:AdditionalReferencedDocument>
</ram:ApplicableHeaderTradeAgreement>
<ram:ApplicableHeaderTradeDelivery/>
<ram:ApplicableHeaderTradeSettlement>
<ram:InvoiceCurrencyCode>EUR</ram:InvoiceCurrencyCode>
<ram:SpecifiedTradeSettlementHeaderMonetarySummation>
<ram:TaxBasisTotalAmount>100.00</ram:TaxBasisTotalAmount>
<ram:TaxTotalAmount currencyID="EUR">0.00</ram:TaxTotalAmount>
<ram:GrandTotalAmount>100.00</ram:GrandTotalAmount>
<ram:DuePayableAmount>100.00</ram:DuePayableAmount>
</ram:SpecifiedTradeSettlementHeaderMonetarySummation>
</ram:ApplicableHeaderTradeSettlement>
</rsm:SupplyChainTradeTransaction>
</rsm:CrossIndustryInvoice>`;
@ -93,6 +137,14 @@ tap.test('CONV-08: Extension Preservation - PEPPOL BIS extensions', async () =>
<cac:PartyName>
<cbc:Name>PEPPOL Supplier AS</cbc:Name>
</cac:PartyName>
<cac:PostalAddress>
<cbc:StreetName>Leverandørvej 123</cbc:StreetName>
<cbc:CityName>København</cbc:CityName>
<cbc:PostalZone>1234</cbc:PostalZone>
<cac:Country>
<cbc:IdentificationCode>DK</cbc:IdentificationCode>
</cac:Country>
</cac:PostalAddress>
</cac:Party>
</cac:AccountingSupplierParty>
<cac:AccountingCustomerParty>
@ -101,8 +153,27 @@ tap.test('CONV-08: Extension Preservation - PEPPOL BIS extensions', async () =>
<cac:PartyName>
<cbc:Name>PEPPOL Buyer AB</cbc:Name>
</cac:PartyName>
<cac:PostalAddress>
<cbc:StreetName>Köparvägen 456</cbc:StreetName>
<cbc:CityName>Stockholm</cbc:CityName>
<cbc:PostalZone>11122</cbc:PostalZone>
<cac:Country>
<cbc:IdentificationCode>SE</cbc:IdentificationCode>
</cac:Country>
</cac:PostalAddress>
</cac:Party>
</cac:AccountingCustomerParty>
<cac:LegalMonetaryTotal>
<cbc:PayableAmount currencyID="EUR">100.00</cbc:PayableAmount>
</cac:LegalMonetaryTotal>
<cac:InvoiceLine>
<cbc:ID>1</cbc:ID>
<cbc:InvoicedQuantity unitCode="C62">1</cbc:InvoicedQuantity>
<cbc:LineExtensionAmount currencyID="EUR">100.00</cbc:LineExtensionAmount>
<cac:Item>
<cbc:Name>PEPPOL Test Product</cbc:Name>
</cac:Item>
</cac:InvoiceLine>
</Invoice>`;
const einvoice = new EInvoice();
@ -170,8 +241,27 @@ tap.test('CONV-08: Extension Preservation - XRechnung routing information', asyn
<cac:PartyName>
<cbc:Name>Öffentliche Einrichtung</cbc:Name>
</cac:PartyName>
<cac:PostalAddress>
<cbc:StreetName>Amtsweg 10</cbc:StreetName>
<cbc:CityName>München</cbc:CityName>
<cbc:PostalZone>80331</cbc:PostalZone>
<cac:Country>
<cbc:IdentificationCode>DE</cbc:IdentificationCode>
</cac:Country>
</cac:PostalAddress>
</cac:Party>
</cac:AccountingCustomerParty>
<cac:LegalMonetaryTotal>
<cbc:PayableAmount currencyID="EUR">100.00</cbc:PayableAmount>
</cac:LegalMonetaryTotal>
<cac:InvoiceLine>
<cbc:ID>1</cbc:ID>
<cbc:InvoicedQuantity unitCode="C62">1</cbc:InvoicedQuantity>
<cbc:LineExtensionAmount currencyID="EUR">100.00</cbc:LineExtensionAmount>
<cac:Item>
<cbc:Name>Dienstleistung</cbc:Name>
</cac:Item>
</cac:InvoiceLine>
</ubl:Invoice>`;
const einvoice = new EInvoice();
@ -206,6 +296,36 @@ tap.test('CONV-08: Extension Preservation - Custom namespace extensions', async
<cbc:DocumentCurrencyCode>EUR</cbc:DocumentCurrencyCode>
<!-- Standard elements with custom attributes -->
<cbc:Note custom:priority="HIGH" custom:department="IT">Urgent invoice with custom metadata</cbc:Note>
<cac:AccountingSupplierParty>
<cac:Party>
<cac:PartyName>
<cbc:Name>Custom Supplier Ltd</cbc:Name>
</cac:PartyName>
<cac:PostalAddress>
<cbc:StreetName>Custom Street 1</cbc:StreetName>
<cbc:CityName>Custom City</cbc:CityName>
<cbc:PostalZone>12345</cbc:PostalZone>
<cac:Country>
<cbc:IdentificationCode>DE</cbc:IdentificationCode>
</cac:Country>
</cac:PostalAddress>
</cac:Party>
</cac:AccountingSupplierParty>
<cac:AccountingCustomerParty>
<cac:Party>
<cac:PartyName>
<cbc:Name>Custom Buyer GmbH</cbc:Name>
</cac:PartyName>
<cac:PostalAddress>
<cbc:StreetName>Buyer Street 10</cbc:StreetName>
<cbc:CityName>Buyer City</cbc:CityName>
<cbc:PostalZone>54321</cbc:PostalZone>
<cac:Country>
<cbc:IdentificationCode>DE</cbc:IdentificationCode>
</cac:Country>
</cac:PostalAddress>
</cac:Party>
</cac:AccountingCustomerParty>
<cac:InvoiceLine>
<cbc:ID>1</cbc:ID>
<cbc:InvoicedQuantity unitCode="C62">1</cbc:InvoicedQuantity>