This commit is contained in:
Andre Kemper
2019-03-27 15:01:06 +01:00
parent de56dfcf60
commit 80710bd984
12 changed files with 87 additions and 10 deletions

View File

@@ -26,7 +26,7 @@ Migrated by Mustangproject XSLT
<ram:LineID>1</ram:LineID>
</ram:AssociatedDocumentLineDocument>
<ram:SpecifiedTradeProduct>
<ram:Name>Künstlerische Gestaltung (Stunde): Einer Beispielrechnung</ram:Name>
<ram:Name>Künstlerische Gestaltung (Stunde): Einer Beispielrechnung</ram:Name>
<ram:Description/>
</ram:SpecifiedTradeProduct>
<ram:SpecifiedLineTradeAgreement>
@@ -90,7 +90,7 @@ Migrated by Mustangproject XSLT
<ram:LineID>3</ram:LineID>
</ram:AssociatedDocumentLineDocument>
<ram:SpecifiedTradeProduct>
<ram:Name>Heiße Luft pro Liter</ram:Name>
<ram:Name>Heiße Luft pro Liter</ram:Name>
<ram:Description/>
</ram:SpecifiedTradeProduct>
<ram:SpecifiedLineTradeAgreement>
@@ -158,12 +158,13 @@ Migrated by Mustangproject XSLT
<ram:InvoiceCurrencyCode>EUR</ram:InvoiceCurrencyCode>
<ram:SpecifiedTradeSettlementPaymentMeans>
<ram:TypeCode>42</ram:TypeCode>
<ram:Information>Überweisung</ram:Information>
<ram:Information>Überweisung</ram:Information>
<ram:PayeePartyCreditorFinancialAccount>
<ram:IBANID>DE88 2008 0000 0970 3757 00</ram:IBANID>
</ram:PayeePartyCreditorFinancialAccount>
<ram:PayeeSpecifiedCreditorFinancialInstitution>
<ram:BICID>COBADEFFXXX</ram:BICID>
<ram:GermanBankleitzahlID>41441604</ram:GermanBankleitzahlID>
<ram:Name>Commerzbank</ram:Name>
</ram:PayeeSpecifiedCreditorFinancialInstitution>
</ram:SpecifiedTradeSettlementPaymentMeans>

View File

@@ -83,7 +83,13 @@ public interface IZUGFeRDExportableTransaction {
*/
String getOwnBIC();
/***
/***
* BLZ of the sender
* @return the BLZ code of the recipient sender's bank
*/
String getOwnBLZ();
/***
* Bank name of the sender
* @return the name of the sender's bank
*/

View File

@@ -63,6 +63,7 @@ public class ZUGFeRDImporter {
private boolean containsMeta = false;
/** @var the reference (i.e. invoice number) of the sender */
private String foreignReference;
private String BLZ;
private String BIC;
private String IBAN;
private String holder;
@@ -127,7 +128,7 @@ public class ZUGFeRDImporter {
//start
InputStream XMP=doc.getDocumentCatalog().getMetadata().exportXMPMetadata();
xmpString=convertStreamToString(XMP);
xmpString=convertStreamToString(XMP);
etn = names.getEmbeddedFiles();
if (etn == null) {
return;
@@ -299,6 +300,9 @@ public class ZUGFeRDImporter {
if ((detail.getLocalName() != null) && (detail.getLocalName().equals("BICID"))) { //$NON-NLS-1$
setBIC(detail.getTextContent());
}
if ((detail.getLocalName() != null) && (detail.getLocalName().equals("GermanBankleitzahlID"))) { //$NON-NLS-1$
setBLZ(detail.getTextContent());
}
if ((detail.getLocalName() != null) && (detail.getLocalName().equals("Name"))) { //$NON-NLS-1$
setBankName(detail.getTextContent());
}
@@ -393,6 +397,24 @@ public class ZUGFeRDImporter {
this.foreignReference = foreignReference;
}
/**
*
* @return the sender's bank's BLZ code
*/
public String getBLZ() {
if (!parsed) {
throw new RuntimeException("use extract() before requesting a value");
}
if (BLZ==null) {
parse();
}
return BLZ;
}
private void setBLZ(String blz) {
this.BLZ = blz;
}
/**
*
* @return the sender's bank's BIC code

View File

@@ -373,6 +373,10 @@ class ZUGFeRDTransactionModelConverter {
TextType bankName = xmlFactory.createTextType();
bankName.setValue(trans.getOwnBankName());
bankData.setName(bankName);
IDType blz = xmlFactory.createIDType();
blz.setValue(trans.getOwnBLZ());
bankData.setGermanBankleitzahlID(blz);
paymentData.setPayeeSpecifiedCreditorFinancialInstitution(bankData);
return paymentData;
}

View File

@@ -30,6 +30,7 @@ public class IZUGFeRDExportableTransactionImpl implements IZUGFeRDExportableTran
private IZUGFeRDAllowanceCharge[] zFLogisticsServiceCharges;
private IZUGFeRDExportableItem[] zFItems;
private IZUGFeRDExportableContact recipient;
private String ownBLZ;
private String ownBIC;
private String ownBankName;
private String ownIBAN;
@@ -91,6 +92,11 @@ public class IZUGFeRDExportableTransactionImpl implements IZUGFeRDExportableTran
return recipient;
}
@Override
public String getOwnBLZ() {
return ownBLZ;
}
@Override
public String getOwnBIC() {
return ownBIC;
@@ -211,6 +217,11 @@ public class IZUGFeRDExportableTransactionImpl implements IZUGFeRDExportableTran
return this;
}
public IZUGFeRDExportableTransactionImpl setOwnBLZ(String ownBLZ) {
this.ownBLZ = ownBLZ;
return this;
}
public IZUGFeRDExportableTransactionImpl setOwnBIC(String ownBIC) {
this.ownBIC = ownBIC;
return this;

View File

@@ -219,7 +219,8 @@ public class MustangReaderWriterCustomXMLTest extends TestCase {
" <ram:IBANID>DE88 2008 0000 0970 3757 00</ram:IBANID>\n" +
" </ram:PayeePartyCreditorFinancialAccount>\n" +
" <ram:PayeeSpecifiedCreditorFinancialInstitution>\n" +
" <ram:BICID>COBADEFFXXX</ram:BICID>\n" +
" <ram:BICID>COBADEFFXXX</ram:BICID>\n" +
" <ram:GermanBankleitzahlID>41441604</ram:GermanBankleitzahlID>\n" +
" <ram:Name>Commerzbank</ram:Name>\n" +
" </ram:PayeeSpecifiedCreditorFinancialInstitution>\n" +
" </ram:SpecifiedTradeSettlementPaymentMeans>\n" +
@@ -276,6 +277,7 @@ public class MustangReaderWriterCustomXMLTest extends TestCase {
String amount = null;
String bic = null;
String blz = null;
String iban = null;
String holder = null;
String ref = null;
@@ -283,6 +285,7 @@ public class MustangReaderWriterCustomXMLTest extends TestCase {
if (zi.canParse()) {
zi.parse();
amount = zi.getAmount();
blz = zi.getBLZ();
bic = zi.getBIC();
iban = zi.getIBAN();
holder = zi.getHolder();
@@ -290,6 +293,7 @@ public class MustangReaderWriterCustomXMLTest extends TestCase {
}
assertEquals(amount, "571.04");
assertEquals(blz, "41441604");
assertEquals(bic, "COBADEFFXXX");
assertEquals(iban, "DE88 2008 0000 0970 3757 00");
assertEquals(holder, "Bei Spiel GmbH");
@@ -351,8 +355,11 @@ public class MustangReaderWriterCustomXMLTest extends TestCase {
+ "<ram:Information>Überweisung</ram:Information>\n" + "<ram:PayeePartyCreditorFinancialAccount>\n"
+ "<ram:IBANID>DE88 2008 0000 0970 3757 00</ram:IBANID>\n"
+ "</ram:PayeePartyCreditorFinancialAccount>\n"
+ "<ram:PayeeSpecifiedCreditorFinancialInstitution>\n" + "<ram:BICID>COBADEFFXXX</ram:BICID>\n"
+ "<ram:Name>Commerzbank</ram:Name>\n" + "</ram:PayeeSpecifiedCreditorFinancialInstitution>\n"
+ "<ram:PayeeSpecifiedCreditorFinancialInstitution>\n"
+ "<ram:BICID>COBADEFFXXX</ram:BICID>\n"
+ "<ram:GermanBankleitzahlID>41441604</ram:GermanBankleitzahlID>\n"
+ "<ram:Name>Commerzbank</ram:Name>\n"
+ "</ram:PayeeSpecifiedCreditorFinancialInstitution>\n"
+ "</ram:SpecifiedTradeSettlementPaymentMeans>\n" + "<ram:ApplicableTradeTax>\n"
+ "<ram:CalculatedAmount currencyID=\"EUR\">11.20</ram:CalculatedAmount>\n"
+ "<ram:TypeCode>VAT</ram:TypeCode>\n"
@@ -467,6 +474,7 @@ public class MustangReaderWriterCustomXMLTest extends TestCase {
String amount = null;
String bic = null;
String blz = null;
String iban = null;
String holder = null;
String ref = null;
@@ -475,6 +483,7 @@ public class MustangReaderWriterCustomXMLTest extends TestCase {
zi.parse();
amount = zi.getAmount();
bic = zi.getBIC();
blz = zi.getBLZ();
iban = zi.getIBAN();
holder = zi.getHolder();
ref = zi.getForeignReference();
@@ -482,6 +491,7 @@ public class MustangReaderWriterCustomXMLTest extends TestCase {
assertEquals(amount, "571.04");
assertEquals(bic, "COBADEFFXXX");
assertEquals(blz, "41441604");
assertEquals(iban, "DE88 2008 0000 0970 3757 00");
assertEquals(holder, "Bei Spiel GmbH");
assertEquals(ref, "RE-20170509/505");

View File

@@ -59,6 +59,12 @@ public class MustangReaderWriterEdgeTest extends TestCase implements IZUGFeRDExp
return "RE-20170509/505";
}
@Override
public String getOwnBLZ()
{
return "41441604";
}
@Override
public String getOwnBIC()
{
@@ -379,6 +385,7 @@ public class MustangReaderWriterEdgeTest extends TestCase implements IZUGFeRDExp
String amount = null;
String bic = null;
String blz = null;
String iban = null;
String holder = null;
String ref = null;
@@ -389,6 +396,7 @@ public class MustangReaderWriterEdgeTest extends TestCase implements IZUGFeRDExp
zi.parse();
amount = zi.getAmount();
bic = zi.getBIC();
blz = zi.getBLZ();
iban = zi.getIBAN();
holder = zi.getHolder();
dueDate = zi.getDueDate();
@@ -397,6 +405,7 @@ public class MustangReaderWriterEdgeTest extends TestCase implements IZUGFeRDExp
assertEquals(amount, "571.04");
assertEquals(bic, getOwnBIC());
assertEquals(blz, getOwnBLZ());
assertEquals(iban, getOwnIBAN());
assertEquals(holder, getOwnOrganisationName());
@@ -439,6 +448,7 @@ public class MustangReaderWriterEdgeTest extends TestCase implements IZUGFeRDExp
String amount = null;
String bic = null;
String blz = null;
String iban = null;
String holder = null;
String ref = null;
@@ -448,6 +458,7 @@ public class MustangReaderWriterEdgeTest extends TestCase implements IZUGFeRDExp
zi.parse();
amount = zi.getAmount();
bic = zi.getBIC();
blz = zi.getBLZ();
iban = zi.getIBAN();
holder = zi.getHolder();
ref = zi.getForeignReference();
@@ -455,6 +466,7 @@ public class MustangReaderWriterEdgeTest extends TestCase implements IZUGFeRDExp
assertEquals(amount, "571.04");
assertEquals(bic, getOwnBIC());
assertEquals(blz, getOwnBLZ());
assertEquals(iban, getOwnIBAN());
assertEquals(holder, getOwnOrganisationName());
assertEquals(ref, getNumber());

View File

@@ -56,7 +56,12 @@ public class MustangReaderWriterTest extends TestCase implements IZUGFeRDExporta
return "RE-20171118/506";
}
@Override
@Override
public String getOwnBLZ() {
return "41441604";
}
@Override
public String getOwnBIC() {
return "COBADEFFXXX";
}
@@ -345,6 +350,7 @@ public class MustangReaderWriterTest extends TestCase implements IZUGFeRDExporta
// Reading ZUGFeRD
String amount = null;
String blz = null;
String bic = null;
String iban = null;
String holder = null;
@@ -353,6 +359,7 @@ public class MustangReaderWriterTest extends TestCase implements IZUGFeRDExporta
if (zi.canParse()) {
zi.parse();
amount = zi.getAmount();
blz = zi.getBLZ();
bic = zi.getBIC();
iban = zi.getIBAN();
holder = zi.getHolder();
@@ -360,7 +367,8 @@ public class MustangReaderWriterTest extends TestCase implements IZUGFeRDExporta
}
// this resembles the data written in MustangReaderWriterCustomXMLTest
assertEquals(amount, "571.04");
assertEquals(bic, "COBADEFFXXX");
assertEquals(blz, "41441604");
assertEquals(bic, "COBADEFFXXX");
assertEquals(iban, "DE88 2008 0000 0970 3757 00");
assertEquals(holder, "Bei Spiel GmbH");
assertEquals(ref, "RE-20170509/505");

View File

@@ -80,6 +80,7 @@
</ram:PayeePartyCreditorFinancialAccount>
<ram:PayeeSpecifiedCreditorFinancialInstitution>
<ram:BICID>COBADEFFXXX</ram:BICID>
<ram:GermanBankleitzahlID>41441604</ram:GermanBankleitzahlID>
<ram:Name>Commerzbank</ram:Name>
</ram:PayeeSpecifiedCreditorFinancialInstitution>
</ram:SpecifiedTradeSettlementPaymentMeans>

View File

@@ -80,6 +80,7 @@
</ram:PayeePartyCreditorFinancialAccount>
<ram:PayeeSpecifiedCreditorFinancialInstitution>
<ram:BICID>COBADEFFXXX</ram:BICID>
<ram:GermanBankleitzahlID>41441604</ram:GermanBankleitzahlID>
<ram:Name>Commerzbank</ram:Name>
</ram:PayeeSpecifiedCreditorFinancialInstitution>
</ram:SpecifiedTradeSettlementPaymentMeans>

View File

@@ -180,6 +180,7 @@ Migrated by Mustangproject XSLT
</ram:PayeePartyCreditorFinancialAccount>
<ram:PayeeSpecifiedCreditorFinancialInstitution>
<ram:BICID>COBADEFFXXX</ram:BICID>
<ram:GermanBankleitzahlID>41441604</ram:GermanBankleitzahlID>
<ram:Name>Commerzbank</ram:Name>
</ram:PayeeSpecifiedCreditorFinancialInstitution>
</ram:SpecifiedTradeSettlementPaymentMeans>