no message

This commit is contained in:
Jochen Stärk
2019-06-17 21:17:04 +02:00
parent 6662f987f6
commit 35fc56cb53
5 changed files with 21 additions and 68 deletions

View File

@@ -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();
}

View File

@@ -83,10 +83,6 @@ public interface IZUGFeRDExportableTransaction {
return null;
}
default IZUGFeRDExportableOrganization getOwnOrganization() {
return null;
}
/**
* who processed the order
*

View File

@@ -326,14 +326,15 @@ public class ZUGFeRD2PullProvider implements IXMLProvider, IProfileProvider {
xml = xml + " <ram:SellerTradeParty>\n" //$NON-NLS-1$
// + " <GlobalID schemeID=\"0088\">4000001123452</GlobalID>\n"
+ " <ram:Name>" + trans.getOwnOrganisationName() + "</ram:Name>\n"; //$NON-NLS-1$ //$NON-NLS-2$
if (trans.getOwnOrganization() != null) {
xml = xml + " <ram:SpecifiedLegalOrganization>\n" + " <ram:ID>"
+ trans.getOwnOrganization().getID() + "</ram:ID>\n" + " <ram:TradingBusinessName>"
+ trans.getOwnOrganization().getName() + "</ram:TradingBusinessName>\n"
if ((trans.getOwnVATID()!=null)&&(trans.getOwnOrganisationName()!=null)) {
xml = xml + " <ram:SpecifiedLegalOrganization>\n" + " <ram:ID schemeID='9930'>"
+ trans.getOwnVATID() + "</ram:ID>\n" + " <ram:TradingBusinessName>"
+ trans.getOwnOrganisationName() + "</ram:TradingBusinessName>\n"
+ " </ram:SpecifiedLegalOrganization>";
}
if (trans.getOwnContact() != null) {
xml = xml + "<ram:DefinedTradeContact>\n" + " <ram:PersonName>" + trans.getOwnContact().getName()
+ "</ram:PersonName>\n";

View File

@@ -28,9 +28,6 @@ public abstract class MustangReaderTestCase extends TestCase implements IZUGFeRD
super(testName);
}
@Override public IZUGFeRDExportableOrganization getOwnOrganization() {
return new SenderOrganization();
}
@Override
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 {
@Override
public String getName() {
return "Dieter Mara";
return "Ingmar N. Fo";
}
@Override
public String getPhone() {
return "++49(0)1771234567";
return "++49(0)237823";
}
@Override
public String getEMail() {
return "Dieter@Mara.de";
return "info@localhost.local";
}
}

View File

@@ -36,22 +36,22 @@ public class MustangReaderWriterTest extends MustangReaderTestCase {
@Override
public Date getDeliveryDate() {
return new GregorianCalendar(2017, Calendar.NOVEMBER, 17).getTime();
return new GregorianCalendar(2019, Calendar.JUNE, 10).getTime();
}
@Override
public Date getDueDate() {
return new GregorianCalendar(2017, Calendar.DECEMBER, 9).getTime();
return new GregorianCalendar(2019, Calendar.JULY, 1).getTime();
}
@Override
public Date getIssueDate() {
return new GregorianCalendar(2017, Calendar.NOVEMBER, 18).getTime();
return new GregorianCalendar(2019, Calendar.JUNE, 10).getTime();
}
@Override
public String getNumber() {
return "RE-20171118/506";
return "RE-20190610/507";
}
@Override
@@ -112,21 +112,21 @@ public class MustangReaderWriterTest extends MustangReaderTestCase {
@Override
public IZUGFeRDExportableItem[] getZFItems() {
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"));
Product balloonProduct = new Product("", "Luftballon: Bunt, ca. 500ml", "C62", new BigDecimal("19.000000"));
Product airProduct = new Product("", "Heiße Luft pro Liter", "LTR", new BigDecimal("19.000000"));
Product balloonProduct = new Product("", "Ballons: various colors, ~2000ml", "C62", 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[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;
}
@Override
public String getPaymentTermDescription() {
SimpleDateFormat germanDateFormat = new SimpleDateFormat("dd.MM.yyyy");
return "Zahlbar ohne Abzug bis zum " + germanDateFormat.format(getDueDate());
SimpleDateFormat isoDateFormat = new SimpleDateFormat("yyyy-MM-dd");
return "Remit until " + isoDateFormat.format(getDueDate());
}
@Override
@@ -152,7 +152,7 @@ public class MustangReaderWriterTest extends MustangReaderTestCase {
@Override
public String getReferenceNumber() {
return "AB32";
return "AB321";
}
/**
@@ -312,7 +312,7 @@ public class MustangReaderWriterTest extends MustangReaderTestCase {
// the writing part
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)) {