Updated exporter to ZUGFeRD 1.0, Added preliminary documentation

This commit is contained in:
jstaerk
2014-06-25 22:19:20 +02:00
parent c414bc16a5
commit be9bf0fdbd
13 changed files with 153 additions and 117 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -4,7 +4,7 @@
<groupId>org.mustangproject.ZUGFeRD</groupId> <groupId>org.mustangproject.ZUGFeRD</groupId>
<artifactId>mustang</artifactId> <artifactId>mustang</artifactId>
<version>1.0</version> <version>1.0.2</version>
<packaging>jar</packaging> <packaging>jar</packaging>
<name>mustang</name> <name>mustang</name>

View File

@@ -3,8 +3,8 @@ package org.mustangproject.ZUGFeRD;
* Mustangproject's ZUGFeRD implementation * Mustangproject's ZUGFeRD implementation
* Neccessary interface for ZUGFeRD exporter * Neccessary interface for ZUGFeRD exporter
* Licensed under the APLv2 * Licensed under the APLv2
* @date 2014-05-10 * @date 2014-05-10 to 2014-06-25
* @version 1.0 * @version 1.0.2
* @author jstaerk * @author jstaerk
* */ * */
@@ -90,13 +90,45 @@ public interface IZUGFeRDExportableTransaction {
*/ */
String getOwnOrganisationName(); String getOwnOrganisationName();
/**
* own street address
* @return
*/
String getOwnStreet();
/**
* own street postal code
* @return
*/
String getOwnZIP();
/**
* own city
* @return
*/
String getOwnLocation();
/**
* own two digit country code
* @return
*/
String getOwnCountry();
/**
* get delivery date
* @return
*/
Date getDeliveryDate();
/** /**
* which taxes have been used with which amounts in this transaction, * which taxes have been used with which amounts in this transaction,
* empty for no taxes, or e.g. 19=>190 and 7=>14 if 1000 Eur were applicable * empty for no taxes, or e.g. 19=>190 and 7=>14 if 1000 Eur were applicable
* to 19% VAT (=>190 EUR VAT) and 200 EUR were applicable to 7% (=>14 EUR VAT) * to 19% VAT (=>190 EUR VAT) and 200 EUR were applicable to 7% (=>14 EUR VAT)
* 190 Eur * 190 Eur
* @return * @return
*/ *
HashMap<BigDecimal, BigDecimal> getVATPercentAmountMap(); HashMap<BigDecimal, BigDecimal> getVATPercentAmountMap();
*/
} }

View File

@@ -195,18 +195,22 @@ public class ZUGFeRDExporter {
private String getZugferdXMLForTransaction(IZUGFeRDExportableTransaction trans) { private String getZugferdXMLForTransaction(IZUGFeRDExportableTransaction trans) {
SimpleDateFormat zugferdDateFormat = new SimpleDateFormat("yyyyMMdd"); //$NON-NLS-1$ SimpleDateFormat zugferdDateFormat = new SimpleDateFormat("yyyyMMdd"); //$NON-NLS-1$
String xml= "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" //$NON-NLS-1$ String xml= "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" //$NON-NLS-1$
+ "<rsm:Invoice xmlns:xs=\"http://www.w3.org/2001/XMLSchema\" xmlns:rsm=\"urn:un:unece:uncefact:data:standard:CBFBUY:5\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"urn:un:unece:uncefact:data:standard:CBFBUY:5 ../Schema/Invoice.xsd\">\n" //$NON-NLS-1$
+ "<rsm:CrossIndustryDocument xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:rsm=\"urn:ferd:CrossIndustryDocument:invoice:1p0\""
+ " xsi:schemaLocation=\"urn:ferd:CrossIndustryDocument:invoice:1p0 ../Schema/ZUGFeRD_1p0.xsd\""
+ " xmlns:ram=\"urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:12\""
+ " xmlns:udt=\"urn:un:unece:uncefact:data:standard:UnqualifiedDataType:15\">\n" //$NON-NLS-1$
+ " <rsm:SpecifiedExchangedDocumentContext>\n" //$NON-NLS-1$ + " <rsm:SpecifiedExchangedDocumentContext>\n" //$NON-NLS-1$
+ " <TestIndicator>false</TestIndicator>\n" //$NON-NLS-1$ + " <ram:TestIndicator><udt:Indicator>false</udt:Indicator></ram:TestIndicator>\n" //$NON-NLS-1$
+ " <GuidelineSpecifiedDocumentContextParameter>\n" //$NON-NLS-1$ + " <ram:GuidelineSpecifiedDocumentContextParameter>\n" //$NON-NLS-1$
+ " <ID>urn:ferd:invoice:rc:comfort</ID>\n" //$NON-NLS-1$ + " <ram:ID>urn:ferd:invoice:rc:comfort</ram:ID>\n" //$NON-NLS-1$
+ " </GuidelineSpecifiedDocumentContextParameter>\n" //$NON-NLS-1$ + " </ram:GuidelineSpecifiedDocumentContextParameter>\n" //$NON-NLS-1$
+ " </rsm:SpecifiedExchangedDocumentContext>\n" //$NON-NLS-1$ + " </rsm:SpecifiedExchangedDocumentContext>\n" //$NON-NLS-1$
+ " <rsm:HeaderExchangedDocument>\n" //$NON-NLS-1$ + " <rsm:HeaderExchangedDocument>\n" //$NON-NLS-1$
+ " <ID>"+trans.getNumber()+"</ID>\n" //$NON-NLS-1$ //$NON-NLS-2$ + " <ram:ID>"+trans.getNumber()+"</ram:ID>\n" //$NON-NLS-1$ //$NON-NLS-2$
+ " <Name>RECHNUNG</Name>\n" //$NON-NLS-1$ + " <ram:Name>RECHNUNG</ram:Name>\n" //$NON-NLS-1$
+ " <TypeCode>380</TypeCode>\n" //$NON-NLS-1$ + " <ram:TypeCode>380</ram:TypeCode>\n" //$NON-NLS-1$
+ " <IssueDateTime format=\"102\">"+zugferdDateFormat.format(trans.getIssueDate())+"</IssueDateTime>\n" //date format was 20130605 //$NON-NLS-1$ //$NON-NLS-2$ + " <ram:IssueDateTime><udt:DateTimeString format=\"102\">"+zugferdDateFormat.format(trans.getIssueDate())+"</udt:DateTimeString></ram:IssueDateTime>\n" //date format was 20130605 //$NON-NLS-1$ //$NON-NLS-2$
// + " <IncludedNote>\n" // + " <IncludedNote>\n"
// + " <Content>\n" // + " <Content>\n"
// + "Rechnung gemäß Bestellung Nr. 2013-471331 vom 01.03.2013.\n" // + "Rechnung gemäß Bestellung Nr. 2013-471331 vom 01.03.2013.\n"
@@ -221,73 +225,73 @@ public class ZUGFeRDExporter {
// + " </IncludedNote>\n" // + " </IncludedNote>\n"
+ " </rsm:HeaderExchangedDocument>\n" //$NON-NLS-1$ + " </rsm:HeaderExchangedDocument>\n" //$NON-NLS-1$
+ " <rsm:SpecifiedSupplyChainTradeTransaction>\n" //$NON-NLS-1$ + " <rsm:SpecifiedSupplyChainTradeTransaction>\n" //$NON-NLS-1$
+ " <ApplicableSupplyChainTradeAgreement>\n" //$NON-NLS-1$ + " <ram:ApplicableSupplyChainTradeAgreement>\n" //$NON-NLS-1$
// + " <BuyerReference>AB-312</BuyerReference>\n" // + " <BuyerReference>AB-312</BuyerReference>\n"
+ " <SellerTradeParty>\n" //$NON-NLS-1$ + " <ram:SellerTradeParty>\n" //$NON-NLS-1$
// + " <GlobalID schemeID=\"0088\">4000001123452</GlobalID>\n" // + " <GlobalID schemeID=\"0088\">4000001123452</GlobalID>\n"
+ " <Name>"+trans.getOwnOrganisationName()+"</Name>\n" //$NON-NLS-1$ //$NON-NLS-2$ + " <ram:Name>"+trans.getOwnOrganisationName()+"</ram:Name>\n" //$NON-NLS-1$ //$NON-NLS-2$
/* + " <PostalTradeAddress>\n" + " <ram:PostalTradeAddress>\n"
+ " <PostcodeCode>80333</PostcodeCode>\n" + " <ram:PostcodeCode>"+trans.getOwnZIP()+"</ram:PostcodeCode>\n"
+ " <LineOne>Lieferantenstraße 20</LineOne>\n" + " <ram:LineOne>"+trans.getOwnStreet()+"</ram:LineOne>\n"
+ " <CityName>München</CityName>\n" + " <ram:CityName>"+trans.getOwnLocation()+"</ram:CityName>\n"
+ " <CountryID>DE</CountryID>\n" + " <ram:CountryID>"+trans.getOwnCountry()+"</ram:CountryID>\n"
+ " </PostalTradeAddress>\n"*/ + " </ram:PostalTradeAddress>\n"
+ " <SpecifiedTaxRegistration>\n" //$NON-NLS-1$ + " <ram:SpecifiedTaxRegistration>\n" //$NON-NLS-1$
+ " <ID schemeID=\"FC\">"+trans.getOwnTaxID()+"</ID>\n" //$NON-NLS-1$ //$NON-NLS-2$ + " <ram:ID schemeID=\"FC\">"+trans.getOwnTaxID()+"</ram:ID>\n" //$NON-NLS-1$ //$NON-NLS-2$
+ " </SpecifiedTaxRegistration>\n" //$NON-NLS-1$ + " </ram:SpecifiedTaxRegistration>\n" //$NON-NLS-1$
+ " <SpecifiedTaxRegistration>\n" //$NON-NLS-1$ + " <ram:SpecifiedTaxRegistration>\n" //$NON-NLS-1$
+ " <ID schemeID=\"VA\">"+trans.getOwnVATID()+"</ID>\n" //$NON-NLS-1$ //$NON-NLS-2$ + " <ram:ID schemeID=\"VA\">"+trans.getOwnVATID()+"</ram:ID>\n" //$NON-NLS-1$ //$NON-NLS-2$
+ " </SpecifiedTaxRegistration>\n" //$NON-NLS-1$ + " </ram:SpecifiedTaxRegistration>\n" //$NON-NLS-1$
+ " </SellerTradeParty>\n" //$NON-NLS-1$ + " </ram:SellerTradeParty>\n" //$NON-NLS-1$
+ " <BuyerTradeParty>\n" //$NON-NLS-1$ + " <ram:BuyerTradeParty>\n" //$NON-NLS-1$
// + " <ID>GE2020211</ID>\n" // + " <ID>GE2020211</ID>\n"
// + " <GlobalID schemeID=\"0088\">4000001987658</GlobalID>\n" // + " <GlobalID schemeID=\"0088\">4000001987658</GlobalID>\n"
+ " <Name>"+trans.getRecipient().getName()+"</Name>\n" //$NON-NLS-1$ //$NON-NLS-2$ + " <ram:Name>"+trans.getRecipient().getName()+"</ram:Name>\n" //$NON-NLS-1$ //$NON-NLS-2$
// + " <DefinedTradeContact>\n" // + " <DefinedTradeContact>\n"
// + " <PersonName>xxx</PersonName>\n" // + " <PersonName>xxx</PersonName>\n"
// + " </DefinedTradeContact>\n" // + " </DefinedTradeContact>\n"
+ " <PostalTradeAddress>\n" //$NON-NLS-1$ + " <ram:PostalTradeAddress>\n" //$NON-NLS-1$
+ " <PostcodeCode>"+trans.getRecipient().getZIP()+"</PostcodeCode>\n" //$NON-NLS-1$ //$NON-NLS-2$ + " <ram:PostcodeCode>"+trans.getRecipient().getZIP()+"</ram:PostcodeCode>\n" //$NON-NLS-1$ //$NON-NLS-2$
+ " <LineOne>"+trans.getRecipient().getStreet()+"</LineOne>\n" //$NON-NLS-1$ //$NON-NLS-2$ + " <ram:LineOne>"+trans.getRecipient().getStreet()+"</ram:LineOne>\n" //$NON-NLS-1$ //$NON-NLS-2$
+ " <CityName>"+trans.getRecipient().getLocation()+"</CityName>\n" //$NON-NLS-1$ //$NON-NLS-2$ + " <ram:CityName>"+trans.getRecipient().getLocation()+"</ram:CityName>\n" //$NON-NLS-1$ //$NON-NLS-2$
+ " <CountryID>"+trans.getRecipient().getCountry()+"</CountryID>\n" //$NON-NLS-1$ //$NON-NLS-2$ + " <ram:CountryID>"+trans.getRecipient().getCountry()+"</ram:CountryID>\n" //$NON-NLS-1$ //$NON-NLS-2$
+ " </PostalTradeAddress>\n" //$NON-NLS-1$ + " </ram:PostalTradeAddress>\n" //$NON-NLS-1$
+ " <SpecifiedTaxRegistration>\n" //$NON-NLS-1$ + " <ram:SpecifiedTaxRegistration>\n" //$NON-NLS-1$
+ " <ID schemeID=\"VA\">"+trans.getRecipient().getVATID()+"</ID>\n" //$NON-NLS-1$ //$NON-NLS-2$ + " <ram:ID schemeID=\"VA\">"+trans.getRecipient().getVATID()+"</ram:ID>\n" //$NON-NLS-1$ //$NON-NLS-2$
+ " </SpecifiedTaxRegistration>\n" //$NON-NLS-1$ + " </ram:SpecifiedTaxRegistration>\n" //$NON-NLS-1$
+ " </BuyerTradeParty>\n" //$NON-NLS-1$ + " </ram:BuyerTradeParty>\n" //$NON-NLS-1$
// + " <BuyerOrderReferencedDocument>\n" // + " <BuyerOrderReferencedDocument>\n"
// + " <IssueDateTime format=\"102\">20130301</IssueDateTime>\n" // + " <IssueDateTime format=\"102\">20130301</IssueDateTime>\n"
// + " <ID>2013-471331</ID>\n" // + " <ID>2013-471331</ID>\n"
// + " </BuyerOrderReferencedDocument>\n" // + " </BuyerOrderReferencedDocument>\n"
+ " </ApplicableSupplyChainTradeAgreement>\n" //$NON-NLS-1$ + " </ram:ApplicableSupplyChainTradeAgreement>\n" //$NON-NLS-1$
/* + " <ApplicableSupplyChainTradeDelivery>\n" + " <ram:ApplicableSupplyChainTradeDelivery>\n"
+ " <ActualDeliverySupplyChainEvent>\n" + " <ram:ActualDeliverySupplyChainEvent>\n"
+ " <OccurrenceDateTime format=\"102\">20130603</OccurrenceDateTime>\n" + " <ram:OccurrenceDateTime><udt:DateTimeString format=\"102\">"+zugferdDateFormat.format(trans.getDeliveryDate())+"</udt:DateTimeString></ram:OccurrenceDateTime>\n"
+ " </ActualDeliverySupplyChainEvent>\n" + " </ram:ActualDeliverySupplyChainEvent>\n"
/*
+ " <DeliveryNoteReferencedDocument>\n" + " <DeliveryNoteReferencedDocument>\n"
+ " <IssueDateTime format=\"102\">20130603</IssueDateTime>\n" + " <IssueDateTime format=\"102\">20130603</IssueDateTime>\n"
+ " <ID>2013-51112</ID>\n" + " <ID>2013-51112</ID>\n"
+ " </DeliveryNoteReferencedDocument>\n" + " </DeliveryNoteReferencedDocument>\n" */
+ " </ApplicableSupplyChainTradeDelivery>\n"*/ + " </ram:ApplicableSupplyChainTradeDelivery>\n"
+ " <ApplicableSupplyChainTradeSettlement>\n" //$NON-NLS-1$ + " <ram:ApplicableSupplyChainTradeSettlement>\n" //$NON-NLS-1$
// it's unclear if this is supposed to refer to the SEPA mandate or the transaction purpose + " <ram:PaymentReference>"+trans.getNumber()+"</ram:PaymentReference>\n" //$NON-NLS-1$ //$NON-NLS-2$
// + " <PaymentReference>"+trans.getNumber()+"</PaymentReference>\n" //$NON-NLS-1$ //$NON-NLS-2$ + " <ram:InvoiceCurrencyCode>EUR</ram:InvoiceCurrencyCode>\n" //$NON-NLS-1$
+ " <InvoiceCurrencyCode>EUR</InvoiceCurrencyCode>\n" //$NON-NLS-1$ + " <ram:SpecifiedTradeSettlementPaymentMeans>\n" //$NON-NLS-1$
+ " <SpecifiedTradeSettlementPaymentMeans>\n" //$NON-NLS-1$ + " <ram:TypeCode>42</ram:TypeCode>\n" //$NON-NLS-1$
+ " <TypeCode>42</TypeCode>\n" //$NON-NLS-1$ + " <ram:Information>Überweisung</ram:Information>\n" //$NON-NLS-1$
+ " <Information>Überweisung</Information>\n" //$NON-NLS-1$ + " <ram:PayeePartyCreditorFinancialAccount>\n" //$NON-NLS-1$
+ " <PayeePartyCreditorFinancialAccount>\n" //$NON-NLS-1$ + " <ram:IBANID>"+trans.getOwnIBAN()+"</ram:IBANID>\n" //$NON-NLS-1$ //$NON-NLS-2$
+ " <IBANID>"+trans.getOwnIBAN()+"</IBANID>\n" //$NON-NLS-1$ //$NON-NLS-2$ + " </ram:PayeePartyCreditorFinancialAccount>\n" //$NON-NLS-1$
+ " </PayeePartyCreditorFinancialAccount>\n" //$NON-NLS-1$ + " <ram:PayeeSpecifiedCreditorFinancialInstitution>\n" //$NON-NLS-1$
+ " <PayeeSpecifiedCreditorFinancialInstitution>\n" //$NON-NLS-1$ + " <ram:BICID>"+trans.getOwnBIC()+"</ram:BICID>\n" //$NON-NLS-1$ //$NON-NLS-2$
+ " <BICID>"+trans.getOwnBIC()+"</BICID>\n" //$NON-NLS-1$ //$NON-NLS-2$ + " <ram:Name>"+trans.getOwnBankName()+"</ram:Name>\n" //$NON-NLS-1$ //$NON-NLS-2$
+ " <Name>"+trans.getOwnBankName()+"</Name>\n" //$NON-NLS-1$ //$NON-NLS-2$ + " </ram:PayeeSpecifiedCreditorFinancialInstitution>\n" //$NON-NLS-1$
+ " </PayeeSpecifiedCreditorFinancialInstitution>\n" //$NON-NLS-1$ + " </ram:SpecifiedTradeSettlementPaymentMeans>\n"; //$NON-NLS-1$
+ " </SpecifiedTradeSettlementPaymentMeans>\n"; //$NON-NLS-1$
/*
HashMap<BigDecimal, BigDecimal> VATPercentAmountMap=trans.getVATPercentAmountMap(); HashMap<BigDecimal, BigDecimal> VATPercentAmountMap=trans.getVATPercentAmountMap();
for (BigDecimal currentTaxPercent : VATPercentAmountMap.keySet()) { for (BigDecimal currentTaxPercent : VATPercentAmountMap.keySet()) {
BigDecimal amount = VATPercentAmountMap.get(currentTaxPercent); BigDecimal amount = VATPercentAmountMap.get(currentTaxPercent);
@@ -303,7 +307,7 @@ public class ZUGFeRDExporter {
} }
} }*/
/* xml+= " /* xml+= "
+ " <SpecifiedTradeAllowanceCharge>\n" + " <SpecifiedTradeAllowanceCharge>\n"
+ " <ChargeIndicator>false</ChargeIndicator>\n" + " <ChargeIndicator>false</ChargeIndicator>\n"
@@ -337,21 +341,21 @@ public class ZUGFeRDExporter {
+ " </AppliedTradeTax>\n" + " </AppliedTradeTax>\n"
+ " </SpecifiedLogisticsServiceCharge>\n"*/ + " </SpecifiedLogisticsServiceCharge>\n"*/
xml=xml+ " <SpecifiedTradePaymentTerms>\n" //$NON-NLS-1$ xml=xml+ " <ram:SpecifiedTradePaymentTerms>\n" //$NON-NLS-1$
// + " <Description>Zahlbar innerhalb 30 Tagen netto bis 04.07.2013, 3% Skonto innerhalb 10 Tagen bis 15.06.2013</Description>\n" // + " <Description>Zahlbar innerhalb 30 Tagen netto bis 04.07.2013, 3% Skonto innerhalb 10 Tagen bis 15.06.2013</Description>\n"
+ " <DueDateDateTime format=\"102\">"+zugferdDateFormat.format(trans.getDueDate())+"</DueDateDateTime>\n"//20130704 //$NON-NLS-1$ //$NON-NLS-2$ + " <ram:DueDateDateTime><udt:DateTimeString format=\"102\">"+zugferdDateFormat.format(trans.getDueDate())+"</udt:DateTimeString></ram:DueDateDateTime>\n"//20130704 //$NON-NLS-1$ //$NON-NLS-2$
+ " </SpecifiedTradePaymentTerms>\n" //$NON-NLS-1$ + " </ram:SpecifiedTradePaymentTerms>\n" //$NON-NLS-1$
+ " <SpecifiedTradeSettlementMonetarySummation>\n" //$NON-NLS-1$ + " <ram:SpecifiedTradeSettlementMonetarySummation>\n" //$NON-NLS-1$
+ " <LineTotalAmount currencyID=\"EUR\">"+currencyFormat(trans.getTotal(), '.')+"</LineTotalAmount>\n" //$NON-NLS-1$ //$NON-NLS-2$ + " <ram:LineTotalAmount currencyID=\"EUR\">"+currencyFormat(trans.getTotal(), '.')+"</ram:LineTotalAmount>\n" //$NON-NLS-1$ //$NON-NLS-2$
// + " <ChargeTotalAmount currencyID=\"EUR\">5.80</ChargeTotalAmount>\n" // + " <ChargeTotalAmount currencyID=\"EUR\">5.80</ChargeTotalAmount>\n"
// + " <AllowanceTotalAmount currencyID=\"EUR\">14.73</AllowanceTotalAmount>\n" // + " <AllowanceTotalAmount currencyID=\"EUR\">14.73</AllowanceTotalAmount>\n"
+ " <TaxBasisTotalAmount currencyID=\"EUR\">"+currencyFormat(trans.getTotal(), '.')+"</TaxBasisTotalAmount>\n" //$NON-NLS-1$ //$NON-NLS-2$ + " <ram:TaxBasisTotalAmount currencyID=\"EUR\">"+currencyFormat(trans.getTotal(), '.')+"</ram:TaxBasisTotalAmount>\n" //$NON-NLS-1$ //$NON-NLS-2$
+ " <TaxTotalAmount currencyID=\"EUR\">"+currencyFormat(trans.getTotalGross().subtract(trans.getTotal()), '.')+"</TaxTotalAmount>\n" //$NON-NLS-1$ //$NON-NLS-2$ + " <ram:TaxTotalAmount currencyID=\"EUR\">"+currencyFormat(trans.getTotalGross().subtract(trans.getTotal()), '.')+"</ram:TaxTotalAmount>\n" //$NON-NLS-1$ //$NON-NLS-2$
+ " <GrandTotalAmount currencyID=\"EUR\">"+currencyFormat(trans.getTotalGross(), '.')+"</GrandTotalAmount>\n" //$NON-NLS-1$ //$NON-NLS-2$ + " <ram:GrandTotalAmount currencyID=\"EUR\">"+currencyFormat(trans.getTotalGross(), '.')+"</ram:GrandTotalAmount>\n" //$NON-NLS-1$ //$NON-NLS-2$
// + " <TotalPrepaidAmount currencyID=\"EUR\">0.00</TotalPrepaidAmount>\n" // + " <TotalPrepaidAmount currencyID=\"EUR\">0.00</TotalPrepaidAmount>\n"
+ " <DuePayableAmount currencyID=\"EUR\">"+currencyFormat(trans.getTotalGross(), '.')+"</DuePayableAmount>\n" //$NON-NLS-1$ //$NON-NLS-2$ + " <ram:DuePayableAmount currencyID=\"EUR\">"+currencyFormat(trans.getTotalGross(), '.')+"</ram:DuePayableAmount>\n" //$NON-NLS-1$ //$NON-NLS-2$
+ " </SpecifiedTradeSettlementMonetarySummation>\n" //$NON-NLS-1$ + " </ram:SpecifiedTradeSettlementMonetarySummation>\n" //$NON-NLS-1$
+ " </ApplicableSupplyChainTradeSettlement>\n"; //$NON-NLS-1$ + " </ram:ApplicableSupplyChainTradeSettlement>\n"; //$NON-NLS-1$
// + " <IncludedSupplyChainTradeLineItem>\n" // + " <IncludedSupplyChainTradeLineItem>\n"
// + " <AssociatedDocumentLineDocument>\n" // + " <AssociatedDocumentLineDocument>\n"
// + " <IncludedNote>\n" // + " <IncludedNote>\n"
@@ -364,48 +368,48 @@ public class ZUGFeRDExporter {
int lineID=0; int lineID=0;
for (IZUGFeRDExportableItem currentItem : trans.getZFItems()) { for (IZUGFeRDExportableItem currentItem : trans.getZFItems()) {
lineID++; lineID++;
xml=xml+ " <IncludedSupplyChainTradeLineItem>\n"+ //$NON-NLS-1$ xml=xml+ " <ram:IncludedSupplyChainTradeLineItem>\n"+ //$NON-NLS-1$
" <AssociatedDocumentLineDocument>\n" //$NON-NLS-1$ " <ram:AssociatedDocumentLineDocument>\n" //$NON-NLS-1$
+ " <LineID>"+lineID+"</LineID>\n" //$NON-NLS-1$ //$NON-NLS-2$ + " <ram:LineID>"+lineID+"</ram:LineID>\n" //$NON-NLS-1$ //$NON-NLS-2$
+ " </AssociatedDocumentLineDocument>\n" //$NON-NLS-1$ + " </ram:AssociatedDocumentLineDocument>\n" //$NON-NLS-1$
+ " <SpecifiedSupplyChainTradeAgreement>\n" //$NON-NLS-1$ + " <ram:SpecifiedSupplyChainTradeAgreement>\n" //$NON-NLS-1$
+ " <GrossPriceProductTradePrice>\n" //$NON-NLS-1$ + " <ram:GrossPriceProductTradePrice>\n" //$NON-NLS-1$
+ " <ChargeAmount currencyID=\"EUR\">"+currencyFormat(currentItem.getPriceGross(),'.')+"</ChargeAmount>\n" //$NON-NLS-1$ //$NON-NLS-2$ + " <ram:ChargeAmount currencyID=\"EUR\">"+currencyFormat(currentItem.getPriceGross(),'.')+"</ram:ChargeAmount>\n" //$NON-NLS-1$ //$NON-NLS-2$
+ " <BasisQuantity unitCode=\""+currentItem.getProduct().getUnit()+"\">1</BasisQuantity>\n" //$NON-NLS-1$ //$NON-NLS-2$ + " <ram:BasisQuantity unitCode=\""+currentItem.getProduct().getUnit()+"\">1</ram:BasisQuantity>\n" //$NON-NLS-1$ //$NON-NLS-2$
// + " <AppliedTradeAllowanceCharge>\n" // + " <AppliedTradeAllowanceCharge>\n"
// + " <ChargeIndicator>false</ChargeIndicator>\n" // + " <ChargeIndicator>false</ChargeIndicator>\n"
// + " <ActualAmount currencyID=\"EUR\">0.6667</ActualAmount>\n" // + " <ActualAmount currencyID=\"EUR\">0.6667</ActualAmount>\n"
// + " <Reason>Rabatt</Reason>\n" // + " <Reason>Rabatt</Reason>\n"
// + " </AppliedTradeAllowanceCharge>\n" // + " </AppliedTradeAllowanceCharge>\n"
+ " </GrossPriceProductTradePrice>\n" //$NON-NLS-1$ + " </ram:GrossPriceProductTradePrice>\n" //$NON-NLS-1$
+ " <NetPriceProductTradePrice>\n" //$NON-NLS-1$ + " <ram:NetPriceProductTradePrice>\n" //$NON-NLS-1$
+ " <ChargeAmount currencyID=\"EUR\">"+currencyFormat(currentItem.getPrice(),'.')+"</ChargeAmount>\n" //$NON-NLS-1$ //$NON-NLS-2$ + " <ram:ChargeAmount currencyID=\"EUR\">"+currencyFormat(currentItem.getPrice(),'.')+"</ram:ChargeAmount>\n" //$NON-NLS-1$ //$NON-NLS-2$
+ " <BasisQuantity unitCode=\""+currentItem.getProduct().getUnit()+"\">1</BasisQuantity>\n" //$NON-NLS-1$ //$NON-NLS-2$ + " <ram:BasisQuantity unitCode=\""+currentItem.getProduct().getUnit()+"\">1</ram:BasisQuantity>\n" //$NON-NLS-1$ //$NON-NLS-2$
+ " </NetPriceProductTradePrice>\n" //$NON-NLS-1$ + " </ram:NetPriceProductTradePrice>\n" //$NON-NLS-1$
+ " </SpecifiedSupplyChainTradeAgreement>\n" //$NON-NLS-1$ + " </ram:SpecifiedSupplyChainTradeAgreement>\n" //$NON-NLS-1$
+ " <SpecifiedSupplyChainTradeDelivery>\n" //$NON-NLS-1$ + " <ram:SpecifiedSupplyChainTradeDelivery>\n" //$NON-NLS-1$
+ " <BilledQuantity unitCode=\""+currentItem.getProduct().getUnit()+"\">"+currentItem.getQuantity()+"</BilledQuantity>\n" //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ + " <ram:BilledQuantity unitCode=\""+currentItem.getProduct().getUnit()+"\">"+currentItem.getQuantity()+"</ram:BilledQuantity>\n" //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ " </SpecifiedSupplyChainTradeDelivery>\n" //$NON-NLS-1$ + " </ram:SpecifiedSupplyChainTradeDelivery>\n" //$NON-NLS-1$
+ " <SpecifiedSupplyChainTradeSettlement>\n" //$NON-NLS-1$ + " <ram:SpecifiedSupplyChainTradeSettlement>\n" //$NON-NLS-1$
+ " <ApplicableTradeTax>\n" //$NON-NLS-1$ + " <ram:ApplicableTradeTax>\n" //$NON-NLS-1$
+ " <TypeCode>VAT</TypeCode>\n" //$NON-NLS-1$ + " <ram:TypeCode>VAT</ram:TypeCode>\n" //$NON-NLS-1$
+ " <CategoryCode>S</CategoryCode>\n" //$NON-NLS-1$ + " <ram:CategoryCode>S</ram:CategoryCode>\n" //$NON-NLS-1$
+ " <ApplicablePercent>"+currentItem.getProduct().getVATPercent()+"</ApplicablePercent>\n" //$NON-NLS-1$ //$NON-NLS-2$ + " <ram:ApplicablePercent>"+currentItem.getProduct().getVATPercent()+"</ram:ApplicablePercent>\n" //$NON-NLS-1$ //$NON-NLS-2$
+ " </ApplicableTradeTax>\n" //$NON-NLS-1$ + " </ram:ApplicableTradeTax>\n" //$NON-NLS-1$
+ " <SpecifiedTradeSettlementMonetarySummation>\n" //$NON-NLS-1$ + " <ram:SpecifiedTradeSettlementMonetarySummation>\n" //$NON-NLS-1$
+ " <LineTotalAmount currencyID=\"EUR\">"+currencyFormat(currentItem.getTotalGross(),'.')+"</LineTotalAmount>\n" //$NON-NLS-1$ //$NON-NLS-2$ + " <ram:LineTotalAmount currencyID=\"EUR\">"+currencyFormat(currentItem.getTotalGross(),'.')+"</ram:LineTotalAmount>\n" //$NON-NLS-1$ //$NON-NLS-2$
+ " </SpecifiedTradeSettlementMonetarySummation>\n" //$NON-NLS-1$ + " </ram:SpecifiedTradeSettlementMonetarySummation>\n" //$NON-NLS-1$
+ " </SpecifiedSupplyChainTradeSettlement>\n" //$NON-NLS-1$ + " </ram:SpecifiedSupplyChainTradeSettlement>\n" //$NON-NLS-1$
+ " <SpecifiedTradeProduct>\n" //$NON-NLS-1$ + " <ram:SpecifiedTradeProduct>\n" //$NON-NLS-1$
// + " <GlobalID schemeID=\"0160\">4012345001235</GlobalID>\n" // + " <GlobalID schemeID=\"0160\">4012345001235</GlobalID>\n"
// + " <SellerAssignedID>KR3M</SellerAssignedID>\n" // + " <SellerAssignedID>KR3M</SellerAssignedID>\n"
// + " <BuyerAssignedID>55T01</BuyerAssignedID>\n" // + " <BuyerAssignedID>55T01</BuyerAssignedID>\n"
+ " <Name>"+currentItem.getProduct().getName()+"</Name>\n" //$NON-NLS-1$ //$NON-NLS-2$ + " <ram:Name>"+currentItem.getProduct().getName()+"</ram:Name>\n" //$NON-NLS-1$ //$NON-NLS-2$
+ " <Description>"+currentItem.getProduct().getDescription()+"</Description>\n" //$NON-NLS-1$ //$NON-NLS-2$ + " <ram:Description>"+currentItem.getProduct().getDescription()+"</ram:Description>\n" //$NON-NLS-1$ //$NON-NLS-2$
+ " </SpecifiedTradeProduct>\n" //$NON-NLS-1$ + " </ram:SpecifiedTradeProduct>\n" //$NON-NLS-1$
+ " </IncludedSupplyChainTradeLineItem>\n"; //$NON-NLS-1$ + " </ram:IncludedSupplyChainTradeLineItem>\n"; //$NON-NLS-1$
@@ -413,7 +417,7 @@ public class ZUGFeRDExporter {
xml=xml + " </rsm:SpecifiedSupplyChainTradeTransaction>\n" //$NON-NLS-1$ xml=xml + " </rsm:SpecifiedSupplyChainTradeTransaction>\n" //$NON-NLS-1$
+ "</rsm:Invoice>"; //$NON-NLS-1$ + "</rsm:CrossIndustryDocument>"; //$NON-NLS-1$
return xml; return xml;
} }

View File

@@ -3,8 +3,8 @@ package org.mustangproject.ZUGFeRD;
* Mustangproject's ZUGFeRD implementation * Mustangproject's ZUGFeRD implementation
* ZUGFeRD importer * ZUGFeRD importer
* Licensed under the APLv2 * Licensed under the APLv2
* @date 2014-05-10 * @date 2014-06-20
* @version 1.0 * @version 1.0.1
* @author jstaerk * @author jstaerk
* */ * */

View File

@@ -1,5 +1,5 @@
#Generated by Maven #Generated by Maven
#Mon May 26 19:06:40 CEST 2014 #Wed Jun 25 21:50:56 CEST 2014
version=1.0 version=1.0.2
groupId=org.mustangproject.ZUGFeRD groupId=org.mustangproject.ZUGFeRD
artifactId=mustang artifactId=mustang

Binary file not shown.

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?> <?xml version="1.0" encoding="UTF-8" ?>
<testsuite failures="0" time="0.014" errors="0" skipped="0" tests="1" name="org.mustangproject.ZUGFeRD.AppTest"> <testsuite failures="0" time="0.011" errors="0" skipped="0" tests="1" name="org.mustangproject.ZUGFeRD.AppTest">
<properties> <properties>
<property name="java.runtime.name" value="OpenJDK Runtime Environment"/> <property name="java.runtime.name" value="OpenJDK Runtime Environment"/>
<property name="sun.boot.library.path" value="/usr/lib/jvm/java-6-openjdk-amd64/jre/lib/amd64"/> <property name="sun.boot.library.path" value="/usr/lib/jvm/java-6-openjdk-amd64/jre/lib/amd64"/>
@@ -13,7 +13,7 @@
<property name="sun.java.launcher" value="SUN_STANDARD"/> <property name="sun.java.launcher" value="SUN_STANDARD"/>
<property name="sun.os.patch.level" value="unknown"/> <property name="sun.os.patch.level" value="unknown"/>
<property name="java.vm.specification.name" value="Java Virtual Machine Specification"/> <property name="java.vm.specification.name" value="Java Virtual Machine Specification"/>
<property name="user.dir" value="/home/jstaerk/workspace/mustangSample/PDFA3-master/mustang"/> <property name="user.dir" value="/home/jstaerk/workspace/PDFA3/mustang"/>
<property name="java.runtime.version" value="1.6.0_31-b31"/> <property name="java.runtime.version" value="1.6.0_31-b31"/>
<property name="java.awt.graphicsenv" value="sun.awt.X11GraphicsEnvironment"/> <property name="java.awt.graphicsenv" value="sun.awt.X11GraphicsEnvironment"/>
<property name="java.endorsed.dirs" value="/usr/lib/jvm/java-6-openjdk-amd64/jre/lib/endorsed"/> <property name="java.endorsed.dirs" value="/usr/lib/jvm/java-6-openjdk-amd64/jre/lib/endorsed"/>
@@ -29,7 +29,7 @@
<property name="java.specification.name" value="Java Platform API Specification"/> <property name="java.specification.name" value="Java Platform API Specification"/>
<property name="java.class.version" value="50.0"/> <property name="java.class.version" value="50.0"/>
<property name="sun.management.compiler" value="HotSpot 64-Bit Tiered Compilers"/> <property name="sun.management.compiler" value="HotSpot 64-Bit Tiered Compilers"/>
<property name="os.version" value="3.5.0-49-generic"/> <property name="os.version" value="3.5.0-51-generic"/>
<property name="user.home" value="/home/jstaerk"/> <property name="user.home" value="/home/jstaerk"/>
<property name="user.timezone" value="Europe/Berlin"/> <property name="user.timezone" value="Europe/Berlin"/>
<property name="java.awt.printerjob" value="sun.print.PSPrinterJob"/> <property name="java.awt.printerjob" value="sun.print.PSPrinterJob"/>