no message
This commit is contained in:
@@ -1,26 +0,0 @@
|
|||||||
|
|
||||||
/** **********************************************************************
|
|
||||||
*
|
|
||||||
* Copyright 2019 Jochen Staerk
|
|
||||||
*
|
|
||||||
* Use is subject to license terms.
|
|
||||||
*
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
|
|
||||||
* use this file except in compliance with the License. You may obtain a copy
|
|
||||||
* of the License at http://www.apache.org/licenses/LICENSE-2.0.
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
||||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
*
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
*
|
|
||||||
*********************************************************************** */
|
|
||||||
package org.mustangproject.ZUGFeRD;
|
|
||||||
|
|
||||||
public interface IZUGFeRDExportableOrganization {
|
|
||||||
public String getID();
|
|
||||||
|
|
||||||
public String getName();
|
|
||||||
}
|
|
||||||
@@ -83,10 +83,6 @@ public interface IZUGFeRDExportableTransaction {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
default IZUGFeRDExportableOrganization getOwnOrganization() {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* who processed the order
|
* who processed the order
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -326,14 +326,15 @@ public class ZUGFeRD2PullProvider implements IXMLProvider, IProfileProvider {
|
|||||||
xml = xml + " <ram:SellerTradeParty>\n" //$NON-NLS-1$
|
xml = xml + " <ram:SellerTradeParty>\n" //$NON-NLS-1$
|
||||||
// + " <GlobalID schemeID=\"0088\">4000001123452</GlobalID>\n"
|
// + " <GlobalID schemeID=\"0088\">4000001123452</GlobalID>\n"
|
||||||
+ " <ram:Name>" + trans.getOwnOrganisationName() + "</ram:Name>\n"; //$NON-NLS-1$ //$NON-NLS-2$
|
+ " <ram:Name>" + trans.getOwnOrganisationName() + "</ram:Name>\n"; //$NON-NLS-1$ //$NON-NLS-2$
|
||||||
if (trans.getOwnOrganization() != null) {
|
|
||||||
|
|
||||||
xml = xml + " <ram:SpecifiedLegalOrganization>\n" + " <ram:ID>"
|
if ((trans.getOwnVATID()!=null)&&(trans.getOwnOrganisationName()!=null)) {
|
||||||
+ trans.getOwnOrganization().getID() + "</ram:ID>\n" + " <ram:TradingBusinessName>"
|
|
||||||
+ trans.getOwnOrganization().getName() + "</ram:TradingBusinessName>\n"
|
xml = xml + " <ram:SpecifiedLegalOrganization>\n" + " <ram:ID schemeID='9930'>"
|
||||||
|
+ trans.getOwnVATID() + "</ram:ID>\n" + " <ram:TradingBusinessName>"
|
||||||
|
+ trans.getOwnOrganisationName() + "</ram:TradingBusinessName>\n"
|
||||||
+ " </ram:SpecifiedLegalOrganization>";
|
+ " </ram:SpecifiedLegalOrganization>";
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (trans.getOwnContact() != null) {
|
if (trans.getOwnContact() != null) {
|
||||||
xml = xml + "<ram:DefinedTradeContact>\n" + " <ram:PersonName>" + trans.getOwnContact().getName()
|
xml = xml + "<ram:DefinedTradeContact>\n" + " <ram:PersonName>" + trans.getOwnContact().getName()
|
||||||
+ "</ram:PersonName>\n";
|
+ "</ram:PersonName>\n";
|
||||||
|
|||||||
@@ -28,9 +28,6 @@ public abstract class MustangReaderTestCase extends TestCase implements IZUGFeRD
|
|||||||
super(testName);
|
super(testName);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override public IZUGFeRDExportableOrganization getOwnOrganization() {
|
|
||||||
return new SenderOrganization();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IZUGFeRDTradeSettlementPayment[] getTradeSettlementPayment() {
|
public IZUGFeRDTradeSettlementPayment[] getTradeSettlementPayment() {
|
||||||
@@ -105,38 +102,23 @@ public abstract class MustangReaderTestCase extends TestCase implements IZUGFeRD
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected class SenderOrganization implements IZUGFeRDExportableOrganization {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getID() {
|
|
||||||
|
|
||||||
return "HRA-555123456";
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getName() {
|
|
||||||
return "Bei Spiel GmbH";
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
protected class SenderContact implements IZUGFeRDExportableContact {
|
protected class SenderContact implements IZUGFeRDExportableContact {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getName() {
|
public String getName() {
|
||||||
return "Dieter Mara";
|
return "Ingmar N. Fo";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getPhone() {
|
public String getPhone() {
|
||||||
return "++49(0)1771234567";
|
return "++49(0)237823";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getEMail() {
|
public String getEMail() {
|
||||||
return "Dieter@Mara.de";
|
return "info@localhost.local";
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -36,22 +36,22 @@ public class MustangReaderWriterTest extends MustangReaderTestCase {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Date getDeliveryDate() {
|
public Date getDeliveryDate() {
|
||||||
return new GregorianCalendar(2017, Calendar.NOVEMBER, 17).getTime();
|
return new GregorianCalendar(2019, Calendar.JUNE, 10).getTime();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Date getDueDate() {
|
public Date getDueDate() {
|
||||||
return new GregorianCalendar(2017, Calendar.DECEMBER, 9).getTime();
|
return new GregorianCalendar(2019, Calendar.JULY, 1).getTime();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Date getIssueDate() {
|
public Date getIssueDate() {
|
||||||
return new GregorianCalendar(2017, Calendar.NOVEMBER, 18).getTime();
|
return new GregorianCalendar(2019, Calendar.JUNE, 10).getTime();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getNumber() {
|
public String getNumber() {
|
||||||
return "RE-20171118/506";
|
return "RE-20190610/507";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -112,21 +112,21 @@ public class MustangReaderWriterTest extends MustangReaderTestCase {
|
|||||||
@Override
|
@Override
|
||||||
public IZUGFeRDExportableItem[] getZFItems() {
|
public IZUGFeRDExportableItem[] getZFItems() {
|
||||||
Item[] allItems = new Item[3];
|
Item[] allItems = new Item[3];
|
||||||
Product designProduct = new Product("", "Künstlerische Gestaltung (Stunde): Einer Beispielrechnung", "HUR",
|
Product designProduct = new Product("", "Design (hours): Of a sample invoice", "HUR",
|
||||||
new BigDecimal("7.000000"));
|
new BigDecimal("7.000000"));
|
||||||
Product balloonProduct = new Product("", "Luftballon: Bunt, ca. 500ml", "C62", new BigDecimal("19.000000"));
|
Product balloonProduct = new Product("", "Ballons: various colors, ~2000ml", "C62", new BigDecimal("19.000000"));
|
||||||
Product airProduct = new Product("", "Heiße Luft pro Liter", "LTR", new BigDecimal("19.000000"));
|
Product airProduct = new Product("", "Hot air „heiße Luft“ (litres)", "LTR", new BigDecimal("19.000000"));
|
||||||
|
|
||||||
allItems[0] = new Item(new BigDecimal("160"), new BigDecimal("1"), designProduct);
|
allItems[0] = new Item(new BigDecimal("160"), new BigDecimal("1"), designProduct);
|
||||||
allItems[1] = new Item(new BigDecimal("0.79"), new BigDecimal("400"), balloonProduct);
|
allItems[1] = new Item(new BigDecimal("0.79"), new BigDecimal("400"), balloonProduct);
|
||||||
allItems[2] = new Item(new BigDecimal("0.10"), new BigDecimal("200"), airProduct);
|
allItems[2] = new Item(new BigDecimal("0.025"), new BigDecimal("800"), airProduct);
|
||||||
return allItems;
|
return allItems;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getPaymentTermDescription() {
|
public String getPaymentTermDescription() {
|
||||||
SimpleDateFormat germanDateFormat = new SimpleDateFormat("dd.MM.yyyy");
|
SimpleDateFormat isoDateFormat = new SimpleDateFormat("yyyy-MM-dd");
|
||||||
return "Zahlbar ohne Abzug bis zum " + germanDateFormat.format(getDueDate());
|
return "Remit until " + isoDateFormat.format(getDueDate());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -152,7 +152,7 @@ public class MustangReaderWriterTest extends MustangReaderTestCase {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getReferenceNumber() {
|
public String getReferenceNumber() {
|
||||||
return "AB32";
|
return "AB321";
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -312,7 +312,7 @@ public class MustangReaderWriterTest extends MustangReaderTestCase {
|
|||||||
|
|
||||||
// the writing part
|
// the writing part
|
||||||
try (InputStream SOURCE_PDF = this.getClass()
|
try (InputStream SOURCE_PDF = this.getClass()
|
||||||
.getResourceAsStream("/MustangGnuaccountingBeispielRE-20171118_506blanko.pdf");
|
.getResourceAsStream("/MustangGnuaccountingBeispielRE-20190610_507blanko.pdf");
|
||||||
|
|
||||||
ZUGFeRDExporter ze = new ZUGFeRDExporterFromA1Factory().setZUGFeRDVersion(2).setZUGFeRDConformanceLevel(ZUGFeRDConformanceLevel.EN16931).load(SOURCE_PDF)) {
|
ZUGFeRDExporter ze = new ZUGFeRDExporterFromA1Factory().setZUGFeRDVersion(2).setZUGFeRDConformanceLevel(ZUGFeRDConformanceLevel.EN16931).load(SOURCE_PDF)) {
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user