Reading BT17 in UBL
This commit is contained in:
@@ -610,6 +610,14 @@ public class ZUGFeRDInvoiceImporter {
|
||||
String tenderReference = extractString("/*[local-name()=\"Invoice\" or local-name()=\"CreditNote\"]/*[local-name()=\"OriginatorDocumentReference\"]/*[local-name()=\"ID\"]").trim();
|
||||
String tenderReferenceDate = extractString("/*[local-name()=\"Invoice\" or local-name()=\"CreditNote\"]/*[local-name()=\"OriginatorDocumentReference\"]/*[local-name()=\"ID\"]").trim();
|
||||
//if (tenderReference!=null) zpp... @todo bt-17 create a ubl with a date and set up an according xpath and if only tenderReference!=null only set that but if tenderReference!=null&&date!=null set both in zpp
|
||||
if(tenderReference != null){
|
||||
if(tenderReferenceDate != null){
|
||||
zpp.setTenderReferencedDocument(new DatedReference(tenderReference, parseDate(tenderReferenceDate, "yyyy-MM-dd")));
|
||||
} else {
|
||||
zpp.setTenderReferencedDocument(tenderReference);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
String dueDt = extractString("/*[local-name()=\"Invoice\" or local-name()=\"CreditNote\"]/*[local-name()=\"DueDate\"]").trim();
|
||||
if (!dueDt.isEmpty()) {
|
||||
|
||||
182
library/src/test/resources/bt17/responseDate.xml
Normal file
182
library/src/test/resources/bt17/responseDate.xml
Normal file
@@ -0,0 +1,182 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Invoice xmlns="urn:oasis:names:specification:ubl:schema:xsd:Invoice-2" xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2" xmlns:cec="urn:oasis:names:specification:ubl:schema:xsd:CommonExtensionComponents-2" xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2">
|
||||
<cbc:CustomizationID>urn:cen.eu:en16931:2017#conformant#urn:factur-x.eu:1p0:extended</cbc:CustomizationID>
|
||||
<cbc:ID>RE-20170509/505</cbc:ID>
|
||||
<cbc:IssueDate>2017-05-09</cbc:IssueDate>
|
||||
<cbc:DueDate>2022-02-28</cbc:DueDate>
|
||||
<cbc:InvoiceTypeCode>380</cbc:InvoiceTypeCode>
|
||||
<cbc:DocumentCurrencyCode>USD</cbc:DocumentCurrencyCode>
|
||||
<cbc:BuyerReference>AB321</cbc:BuyerReference>
|
||||
<cac:DespatchDocumentReference>
|
||||
<cbc:ID>123</cbc:ID>
|
||||
</cac:DespatchDocumentReference>
|
||||
<cac:OriginatorDocumentReference>
|
||||
<cbc:ID>Testing1</cbc:ID>
|
||||
<cbc:IssueDate>2018-10-04</cbc:IssueDate>
|
||||
</cac:OriginatorDocumentReference>
|
||||
<cac:AccountingSupplierParty>
|
||||
<cac:Party>
|
||||
<cac:PostalAddress>
|
||||
<cbc:StreetName>Ecke 12</cbc:StreetName>
|
||||
<cbc:CityName>Stadthausen</cbc:CityName>
|
||||
<cbc:PostalZone>12345</cbc:PostalZone>
|
||||
<cac:Country>
|
||||
<cbc:IdentificationCode>DE</cbc:IdentificationCode>
|
||||
</cac:Country>
|
||||
</cac:PostalAddress>
|
||||
<cac:PartyTaxScheme>
|
||||
<cbc:CompanyID>DE0815</cbc:CompanyID>
|
||||
<cac:TaxScheme>
|
||||
<cbc:ID>VAT</cbc:ID>
|
||||
</cac:TaxScheme>
|
||||
</cac:PartyTaxScheme>
|
||||
<cac:PartyTaxScheme>
|
||||
<cbc:CompanyID>0815</cbc:CompanyID>
|
||||
<cac:TaxScheme>
|
||||
<cbc:ID>FC</cbc:ID>
|
||||
</cac:TaxScheme>
|
||||
</cac:PartyTaxScheme>
|
||||
<cac:PartyLegalEntity>
|
||||
<cbc:RegistrationName>Bei Spiel GmbH</cbc:RegistrationName>
|
||||
</cac:PartyLegalEntity>
|
||||
</cac:Party>
|
||||
</cac:AccountingSupplierParty>
|
||||
<cac:AccountingCustomerParty>
|
||||
<cac:Party>
|
||||
<cac:PostalAddress>
|
||||
<cbc:StreetName>Bahnstr. 42</cbc:StreetName>
|
||||
<cbc:AdditionalStreetName>Hinterhaus</cbc:AdditionalStreetName>
|
||||
<cbc:CityName>Spielkreis</cbc:CityName>
|
||||
<cbc:PostalZone>88802</cbc:PostalZone>
|
||||
<cac:AddressLine>
|
||||
<cbc:Line>Zweiter Stock</cbc:Line>
|
||||
</cac:AddressLine>
|
||||
<cac:Country>
|
||||
<cbc:IdentificationCode>DE</cbc:IdentificationCode>
|
||||
</cac:Country>
|
||||
</cac:PostalAddress>
|
||||
<cac:PartyTaxScheme>
|
||||
<cbc:CompanyID>DE999999999</cbc:CompanyID>
|
||||
<cac:TaxScheme>
|
||||
<cbc:ID>VAT</cbc:ID>
|
||||
</cac:TaxScheme>
|
||||
</cac:PartyTaxScheme>
|
||||
<cac:PartyLegalEntity>
|
||||
<cbc:RegistrationName>Theodor Est</cbc:RegistrationName>
|
||||
</cac:PartyLegalEntity>
|
||||
</cac:Party>
|
||||
</cac:AccountingCustomerParty>
|
||||
<cac:Delivery>
|
||||
<cbc:ActualDeliveryDate>2017-05-07</cbc:ActualDeliveryDate>
|
||||
<cac:DeliveryLocation>
|
||||
<cac:Address>
|
||||
<cbc:StreetName>Bahnstr. 42</cbc:StreetName>
|
||||
<cbc:AdditionalStreetName>Hinterhaus</cbc:AdditionalStreetName>
|
||||
<cbc:CityName>Spielkreis</cbc:CityName>
|
||||
<cbc:PostalZone>88802</cbc:PostalZone>
|
||||
<cac:AddressLine>
|
||||
<cbc:Line>Zweiter Stock</cbc:Line>
|
||||
</cac:AddressLine>
|
||||
<cac:Country>
|
||||
<cbc:IdentificationCode>DE</cbc:IdentificationCode>
|
||||
</cac:Country>
|
||||
</cac:Address>
|
||||
</cac:DeliveryLocation>
|
||||
<cac:DeliveryParty>
|
||||
<cac:PartyName>
|
||||
<cbc:Name>Theodor Est</cbc:Name>
|
||||
</cac:PartyName>
|
||||
</cac:DeliveryParty>
|
||||
</cac:Delivery>
|
||||
<cac:PaymentMeans>
|
||||
<cbc:PaymentMeansCode name="Credit Card">54</cbc:PaymentMeansCode>
|
||||
</cac:PaymentMeans>
|
||||
<cac:PaymentTerms>
|
||||
<cbc:Note>14 Tage 2% Skonto, 30 Tage rein netto</cbc:Note>
|
||||
</cac:PaymentTerms>
|
||||
<cac:TaxTotal>
|
||||
<cbc:TaxAmount currencyID="USD">0</cbc:TaxAmount>
|
||||
<cac:TaxSubtotal>
|
||||
<cbc:TaxableAmount currencyID="USD">337.6</cbc:TaxableAmount>
|
||||
<cbc:TaxAmount currencyID="USD">0</cbc:TaxAmount>
|
||||
<cac:TaxCategory>
|
||||
<cbc:ID>K</cbc:ID>
|
||||
<cbc:Percent>0</cbc:Percent>
|
||||
<cbc:TaxExemptionReason>Intra-community supply</cbc:TaxExemptionReason>
|
||||
<cac:TaxScheme>
|
||||
<cbc:ID>VAT</cbc:ID>
|
||||
</cac:TaxScheme>
|
||||
</cac:TaxCategory>
|
||||
</cac:TaxSubtotal>
|
||||
</cac:TaxTotal>
|
||||
<cac:LegalMonetaryTotal>
|
||||
<cbc:LineExtensionAmount currencyID="USD">337.6</cbc:LineExtensionAmount>
|
||||
<cbc:TaxExclusiveAmount currencyID="USD">337.6</cbc:TaxExclusiveAmount>
|
||||
<cbc:TaxInclusiveAmount currencyID="USD">337.6</cbc:TaxInclusiveAmount>
|
||||
<cbc:AllowanceTotalAmount currencyID="USD">0</cbc:AllowanceTotalAmount>
|
||||
<cbc:ChargeTotalAmount currencyID="USD">0</cbc:ChargeTotalAmount>
|
||||
<cbc:PrepaidAmount currencyID="USD">0</cbc:PrepaidAmount>
|
||||
<cbc:PayableAmount currencyID="USD">337.6</cbc:PayableAmount>
|
||||
</cac:LegalMonetaryTotal>
|
||||
<cac:InvoiceLine>
|
||||
<cbc:ID>1</cbc:ID>
|
||||
<cbc:InvoicedQuantity unitCode="HUR">1</cbc:InvoicedQuantity>
|
||||
<cbc:LineExtensionAmount currencyID="USD">1.6</cbc:LineExtensionAmount>
|
||||
<cac:DocumentReference>
|
||||
<cbc:ID>1825</cbc:ID>
|
||||
<cbc:DocumentTypeCode>130</cbc:DocumentTypeCode>
|
||||
</cac:DocumentReference>
|
||||
<cac:Item>
|
||||
<cbc:Name>Künstlerische Gestaltung (Stunde): Einer Beispielrechnung</cbc:Name>
|
||||
<cac:ClassifiedTaxCategory>
|
||||
<cbc:ID>K</cbc:ID>
|
||||
<cbc:Percent>0</cbc:Percent>
|
||||
<cac:TaxScheme>
|
||||
<cbc:ID>VAT</cbc:ID>
|
||||
</cac:TaxScheme>
|
||||
</cac:ClassifiedTaxCategory>
|
||||
</cac:Item>
|
||||
<cac:Price>
|
||||
<cbc:PriceAmount currencyID="USD">160</cbc:PriceAmount>
|
||||
<cbc:BaseQuantity>100</cbc:BaseQuantity>
|
||||
</cac:Price>
|
||||
</cac:InvoiceLine>
|
||||
<cac:InvoiceLine>
|
||||
<cbc:ID>2</cbc:ID>
|
||||
<cbc:InvoicedQuantity unitCode="C62">400</cbc:InvoicedQuantity>
|
||||
<cbc:LineExtensionAmount currencyID="USD">316</cbc:LineExtensionAmount>
|
||||
<cac:Item>
|
||||
<cbc:Name>Bestellerweiterung für E&F Umbau</cbc:Name>
|
||||
<cac:ClassifiedTaxCategory>
|
||||
<cbc:ID>K</cbc:ID>
|
||||
<cbc:Percent>0</cbc:Percent>
|
||||
<cac:TaxScheme>
|
||||
<cbc:ID>VAT</cbc:ID>
|
||||
</cac:TaxScheme>
|
||||
</cac:ClassifiedTaxCategory>
|
||||
</cac:Item>
|
||||
<cac:Price>
|
||||
<cbc:PriceAmount currencyID="USD">0.79</cbc:PriceAmount>
|
||||
<cbc:BaseQuantity>1</cbc:BaseQuantity>
|
||||
</cac:Price>
|
||||
</cac:InvoiceLine>
|
||||
<cac:InvoiceLine>
|
||||
<cbc:ID>3</cbc:ID>
|
||||
<cbc:InvoicedQuantity unitCode="LTR">200</cbc:InvoicedQuantity>
|
||||
<cbc:LineExtensionAmount currencyID="USD">20</cbc:LineExtensionAmount>
|
||||
<cac:Item>
|
||||
<cbc:Name>Heiße Luft pro Liter</cbc:Name>
|
||||
<cac:ClassifiedTaxCategory>
|
||||
<cbc:ID>K</cbc:ID>
|
||||
<cbc:Percent>0</cbc:Percent>
|
||||
<cac:TaxScheme>
|
||||
<cbc:ID>VAT</cbc:ID>
|
||||
</cac:TaxScheme>
|
||||
</cac:ClassifiedTaxCategory>
|
||||
</cac:Item>
|
||||
<cac:Price>
|
||||
<cbc:PriceAmount currencyID="USD">0.1</cbc:PriceAmount>
|
||||
<cbc:BaseQuantity>1</cbc:BaseQuantity>
|
||||
</cac:Price>
|
||||
</cac:InvoiceLine>
|
||||
</Invoice>
|
||||
Reference in New Issue
Block a user