This commit is contained in:
Andre Kemper
2019-03-28 07:45:32 +01:00
parent 08956fd7a5
commit 543f1cd207
12 changed files with 86 additions and 8 deletions

View File

@@ -101,6 +101,12 @@ public interface IZUGFeRDExportableTransaction {
*/ */
String getOwnIBAN(); String getOwnIBAN();
/**
* IBAN of the sender
* @return the Account Number of the invoice sender's bank account
*/
String getOwnKto();
/** /**
* Tax ID (not VAT ID) of the sender * Tax ID (not VAT ID) of the sender
* @return Tax ID (not VAT ID) of the sender * @return Tax ID (not VAT ID) of the sender

View File

@@ -344,9 +344,11 @@ public class ZUGFeRD2PullProvider implements IXMLProvider {
+ " <ram:Information>Überweisung</ram:Information>\n" //$NON-NLS-1$ + " <ram:Information>Überweisung</ram:Information>\n" //$NON-NLS-1$
+ " <ram:PayeePartyCreditorFinancialAccount>\n" //$NON-NLS-1$ + " <ram:PayeePartyCreditorFinancialAccount>\n" //$NON-NLS-1$
+ " <ram:IBANID>"+trans.getOwnIBAN()+"</ram:IBANID>\n" //$NON-NLS-1$ //$NON-NLS-2$ + " <ram:IBANID>"+trans.getOwnIBAN()+"</ram:IBANID>\n" //$NON-NLS-1$ //$NON-NLS-2$
+ " <ram:ProprietaryID>"+trans.getOwnKto()+"</ram:ProprietaryID>\n" //$NON-NLS-1$ //$NON-NLS-2$
+ " </ram:PayeePartyCreditorFinancialAccount>\n" //$NON-NLS-1$ + " </ram:PayeePartyCreditorFinancialAccount>\n" //$NON-NLS-1$
+ " <ram:PayeeSpecifiedCreditorFinancialInstitution>\n" //$NON-NLS-1$ + " <ram:PayeeSpecifiedCreditorFinancialInstitution>\n" //$NON-NLS-1$
+ " <ram:BICID>"+trans.getOwnBIC()+"</ram:BICID>\n" //$NON-NLS-1$ //$NON-NLS-2$ + " <ram:BICID>"+trans.getOwnBIC()+"</ram:BICID>\n" //$NON-NLS-1$ //$NON-NLS-2$
+ " <ram:GermanBankleitzahlID>"+ trans.getOwnBLZ()+"</ram:GermanBankleitzahlID>\n" //$NON-NLS-1$ //$NON-NLS-2$
// + " <ram:Name>"+trans.getOwnBankName()+"</ram:Name>\n" //$NON-NLS-1$ //$NON-NLS-2$ // + " <ram:Name>"+trans.getOwnBankName()+"</ram:Name>\n" //$NON-NLS-1$ //$NON-NLS-2$
+ " </ram:PayeeSpecifiedCreditorFinancialInstitution>\n" //$NON-NLS-1$ + " </ram:PayeeSpecifiedCreditorFinancialInstitution>\n" //$NON-NLS-1$
+ " </ram:SpecifiedTradeSettlementPaymentMeans>\n"; //$NON-NLS-1$ + " </ram:SpecifiedTradeSettlementPaymentMeans>\n"; //$NON-NLS-1$

View File

@@ -66,6 +66,7 @@ public class ZUGFeRDImporter {
private String BLZ; private String BLZ;
private String BIC; private String BIC;
private String IBAN; private String IBAN;
private String KTO;
private String holder; private String holder;
private String amount; private String amount;
private String dueDate; private String dueDate;
@@ -284,6 +285,9 @@ public class ZUGFeRDImporter {
Node detail = bookingDetails.item(detailIndex); Node detail = bookingDetails.item(detailIndex);
if ((detail.getLocalName() != null) && (detail.getLocalName().equals("IBANID"))) { //$NON-NLS-1$ if ((detail.getLocalName() != null) && (detail.getLocalName().equals("IBANID"))) { //$NON-NLS-1$
setIBAN(detail.getTextContent()); setIBAN(detail.getTextContent());
}
if ((detail.getLocalName() != null) && (detail.getLocalName().equals("ProprietaryID"))) { //$NON-NLS-1$
setKTO(detail.getTextContent());
} }
} }
@@ -455,6 +459,20 @@ public class ZUGFeRDImporter {
return IBAN; return IBAN;
} }
/**
*
* @return the sender's KTO
*/
public String getKTO() {
if (!parsed) {
throw new RuntimeException("use extract() before requesting a value");
}
if (KTO==null) {
parse();
}
return KTO;
}
/** /**
* *
* @return the sender's bank name * @return the sender's bank name
@@ -473,6 +491,10 @@ public class ZUGFeRDImporter {
this.IBAN = IBAN; this.IBAN = IBAN;
} }
private void setKTO(String KTO) {
this.KTO = KTO;
}
/** /**
* *
* @return the name of the owner of the sender's bank account * @return the name of the owner of the sender's bank account

View File

@@ -363,6 +363,9 @@ class ZUGFeRDTransactionModelConverter {
IDType iban = xmlFactory.createIDType(); IDType iban = xmlFactory.createIDType();
iban.setValue(trans.getOwnIBAN()); iban.setValue(trans.getOwnIBAN());
bankAccount.setIBANID(iban); bankAccount.setIBANID(iban);
IDType kto = xmlFactory.createIDType();
kto.setValue(trans.getOwnKto());
bankAccount.setProprietaryID(kto);
paymentData.setPayeePartyCreditorFinancialAccount(bankAccount); paymentData.setPayeePartyCreditorFinancialAccount(bankAccount);
CreditorFinancialInstitutionType bankData = xmlFactory CreditorFinancialInstitutionType bankData = xmlFactory

View File

@@ -30,6 +30,7 @@ public class IZUGFeRDExportableTransactionImpl implements IZUGFeRDExportableTran
private IZUGFeRDAllowanceCharge[] zFLogisticsServiceCharges; private IZUGFeRDAllowanceCharge[] zFLogisticsServiceCharges;
private IZUGFeRDExportableItem[] zFItems; private IZUGFeRDExportableItem[] zFItems;
private IZUGFeRDExportableContact recipient; private IZUGFeRDExportableContact recipient;
private String ownKto;
private String ownBLZ; private String ownBLZ;
private String ownBIC; private String ownBIC;
private String ownBankName; private String ownBankName;
@@ -92,6 +93,11 @@ public class IZUGFeRDExportableTransactionImpl implements IZUGFeRDExportableTran
return recipient; return recipient;
} }
@Override
public String getOwnKto() {
return ownKto;
}
@Override @Override
public String getOwnBLZ() { public String getOwnBLZ() {
return ownBLZ; return ownBLZ;
@@ -232,6 +238,11 @@ public class IZUGFeRDExportableTransactionImpl implements IZUGFeRDExportableTran
return this; return this;
} }
public IZUGFeRDExportableTransactionImpl setOwnKto(String ownKto) {
this.ownKto = ownKto;
return this;
}
public IZUGFeRDExportableTransactionImpl setOwnIBAN(String ownIBAN) { public IZUGFeRDExportableTransactionImpl setOwnIBAN(String ownIBAN) {
this.ownIBAN = ownIBAN; this.ownIBAN = ownIBAN;
return this; return this;

View File

@@ -217,6 +217,7 @@ public class MustangReaderWriterCustomXMLTest extends TestCase {
" <ram:Information>Überweisung</ram:Information>\n" + " <ram:Information>Überweisung</ram:Information>\n" +
" <ram:PayeePartyCreditorFinancialAccount>\n" + " <ram:PayeePartyCreditorFinancialAccount>\n" +
" <ram:IBANID>DE88 2008 0000 0970 3757 00</ram:IBANID>\n" + " <ram:IBANID>DE88 2008 0000 0970 3757 00</ram:IBANID>\n" +
" <ram:ProprietaryID>44421800</ram:ProprietaryID>\n" +
" </ram:PayeePartyCreditorFinancialAccount>\n" + " </ram:PayeePartyCreditorFinancialAccount>\n" +
" <ram:PayeeSpecifiedCreditorFinancialInstitution>\n" + " <ram:PayeeSpecifiedCreditorFinancialInstitution>\n" +
" <ram:BICID>COBADEFFXXX</ram:BICID>\n" + " <ram:BICID>COBADEFFXXX</ram:BICID>\n" +
@@ -279,6 +280,7 @@ public class MustangReaderWriterCustomXMLTest extends TestCase {
String bic = null; String bic = null;
String blz = null; String blz = null;
String iban = null; String iban = null;
String kto = null;
String holder = null; String holder = null;
String ref = null; String ref = null;
@@ -288,6 +290,7 @@ public class MustangReaderWriterCustomXMLTest extends TestCase {
blz = zi.getBLZ(); blz = zi.getBLZ();
bic = zi.getBIC(); bic = zi.getBIC();
iban = zi.getIBAN(); iban = zi.getIBAN();
kto = zi.getKTO();
holder = zi.getHolder(); holder = zi.getHolder();
ref = zi.getForeignReference(); ref = zi.getForeignReference();
} }
@@ -296,6 +299,7 @@ public class MustangReaderWriterCustomXMLTest extends TestCase {
assertEquals(blz, "41441604"); assertEquals(blz, "41441604");
assertEquals(bic, "COBADEFFXXX"); assertEquals(bic, "COBADEFFXXX");
assertEquals(iban, "DE88 2008 0000 0970 3757 00"); assertEquals(iban, "DE88 2008 0000 0970 3757 00");
assertEquals(kto, "44421800");
assertEquals(holder, "Bei Spiel GmbH"); assertEquals(holder, "Bei Spiel GmbH");
assertEquals(ref, "RE-20171118/506"); assertEquals(ref, "RE-20171118/506");
} }
@@ -354,6 +358,7 @@ public class MustangReaderWriterCustomXMLTest extends TestCase {
+ "<ram:SpecifiedTradeSettlementPaymentMeans>\n" + "<ram:TypeCode>42</ram:TypeCode>\n" + "<ram:SpecifiedTradeSettlementPaymentMeans>\n" + "<ram:TypeCode>42</ram:TypeCode>\n"
+ "<ram:Information>Überweisung</ram:Information>\n" + "<ram:PayeePartyCreditorFinancialAccount>\n" + "<ram:Information>Überweisung</ram:Information>\n" + "<ram:PayeePartyCreditorFinancialAccount>\n"
+ "<ram:IBANID>DE88 2008 0000 0970 3757 00</ram:IBANID>\n" + "<ram:IBANID>DE88 2008 0000 0970 3757 00</ram:IBANID>\n"
+ "<ram:ProprietaryID>44421800</ram:ProprietaryID>\n"
+ "</ram:PayeePartyCreditorFinancialAccount>\n" + "</ram:PayeePartyCreditorFinancialAccount>\n"
+ "<ram:PayeeSpecifiedCreditorFinancialInstitution>\n" + "<ram:PayeeSpecifiedCreditorFinancialInstitution>\n"
+ "<ram:BICID>COBADEFFXXX</ram:BICID>\n" + "<ram:BICID>COBADEFFXXX</ram:BICID>\n"
@@ -476,6 +481,7 @@ public class MustangReaderWriterCustomXMLTest extends TestCase {
String bic = null; String bic = null;
String blz = null; String blz = null;
String iban = null; String iban = null;
String kto = null;
String holder = null; String holder = null;
String ref = null; String ref = null;
@@ -485,6 +491,7 @@ public class MustangReaderWriterCustomXMLTest extends TestCase {
bic = zi.getBIC(); bic = zi.getBIC();
blz = zi.getBLZ(); blz = zi.getBLZ();
iban = zi.getIBAN(); iban = zi.getIBAN();
kto = zi.getKTO();
holder = zi.getHolder(); holder = zi.getHolder();
ref = zi.getForeignReference(); ref = zi.getForeignReference();
} }
@@ -493,6 +500,7 @@ public class MustangReaderWriterCustomXMLTest extends TestCase {
assertEquals(bic, "COBADEFFXXX"); assertEquals(bic, "COBADEFFXXX");
assertEquals(blz, "41441604"); assertEquals(blz, "41441604");
assertEquals(iban, "DE88 2008 0000 0970 3757 00"); assertEquals(iban, "DE88 2008 0000 0970 3757 00");
assertEquals(kto, "44421800");
assertEquals(holder, "Bei Spiel GmbH"); assertEquals(holder, "Bei Spiel GmbH");
assertEquals(ref, "RE-20170509/505"); assertEquals(ref, "RE-20170509/505");
} }

View File

@@ -59,6 +59,12 @@ public class MustangReaderWriterEdgeTest extends TestCase implements IZUGFeRDExp
return "RE-20170509/505"; return "RE-20170509/505";
} }
@Override
public String getOwnKto()
{
return "44421800";
}
@Override @Override
public String getOwnBLZ() public String getOwnBLZ()
{ {
@@ -370,7 +376,7 @@ public class MustangReaderWriterEdgeTest extends TestCase implements IZUGFeRDExp
// //////// TESTS ////////////////////////////////////////////////////////////////////////////////////////// // //////// TESTS //////////////////////////////////////////////////////////////////////////////////////////
/** /**
* The importer test imports from ./src/test/MustangGnuaccountingBeispielRE-20151008_504.pdf to check the values. * The importer test imports from ./src/test/MustangGnuaccountingBeispielRE-20170509_505.pdf to check the values.
* --> as only Name Ascending is supported for Test Unit sequence, I renamed the this test-A-Export to run before * --> as only Name Ascending is supported for Test Unit sequence, I renamed the this test-A-Export to run before
* testZExport * testZExport
* *
@@ -387,6 +393,7 @@ public class MustangReaderWriterEdgeTest extends TestCase implements IZUGFeRDExp
String bic = null; String bic = null;
String blz = null; String blz = null;
String iban = null; String iban = null;
String kto = null;
String holder = null; String holder = null;
String ref = null; String ref = null;
String dueDate = null; String dueDate = null;
@@ -398,6 +405,7 @@ public class MustangReaderWriterEdgeTest extends TestCase implements IZUGFeRDExp
bic = zi.getBIC(); bic = zi.getBIC();
blz = zi.getBLZ(); blz = zi.getBLZ();
iban = zi.getIBAN(); iban = zi.getIBAN();
kto = zi.getKTO();
holder = zi.getHolder(); holder = zi.getHolder();
dueDate = zi.getDueDate(); dueDate = zi.getDueDate();
ref = zi.getForeignReference(); ref = zi.getForeignReference();
@@ -407,6 +415,7 @@ public class MustangReaderWriterEdgeTest extends TestCase implements IZUGFeRDExp
assertEquals(bic, getOwnBIC()); assertEquals(bic, getOwnBIC());
assertEquals(blz, getOwnBLZ()); assertEquals(blz, getOwnBLZ());
assertEquals(iban, getOwnIBAN()); assertEquals(iban, getOwnIBAN());
assertEquals(kto, getOwnKto());
assertEquals(holder, getOwnOrganisationName()); assertEquals(holder, getOwnOrganisationName());
assertEquals(dueDate, "20170530"); assertEquals(dueDate, "20170530");
@@ -450,6 +459,7 @@ public class MustangReaderWriterEdgeTest extends TestCase implements IZUGFeRDExp
String bic = null; String bic = null;
String blz = null; String blz = null;
String iban = null; String iban = null;
String kto = null;
String holder = null; String holder = null;
String ref = null; String ref = null;
@@ -460,6 +470,7 @@ public class MustangReaderWriterEdgeTest extends TestCase implements IZUGFeRDExp
bic = zi.getBIC(); bic = zi.getBIC();
blz = zi.getBLZ(); blz = zi.getBLZ();
iban = zi.getIBAN(); iban = zi.getIBAN();
kto = zi.getKTO();
holder = zi.getHolder(); holder = zi.getHolder();
ref = zi.getForeignReference(); ref = zi.getForeignReference();
} }
@@ -468,6 +479,7 @@ public class MustangReaderWriterEdgeTest extends TestCase implements IZUGFeRDExp
assertEquals(bic, getOwnBIC()); assertEquals(bic, getOwnBIC());
assertEquals(blz, getOwnBLZ()); assertEquals(blz, getOwnBLZ());
assertEquals(iban, getOwnIBAN()); assertEquals(iban, getOwnIBAN());
assertEquals(kto, getOwnKto());
assertEquals(holder, getOwnOrganisationName()); assertEquals(holder, getOwnOrganisationName());
assertEquals(ref, getNumber()); assertEquals(ref, getNumber());

View File

@@ -56,6 +56,11 @@ public class MustangReaderWriterTest extends TestCase implements IZUGFeRDExporta
return "RE-20171118/506"; return "RE-20171118/506";
} }
@Override
public String getOwnKto() {
return "44421800";
}
@Override @Override
public String getOwnBLZ() { public String getOwnBLZ() {
return "41441604"; return "41441604";
@@ -353,6 +358,7 @@ public class MustangReaderWriterTest extends TestCase implements IZUGFeRDExporta
String blz = null; String blz = null;
String bic = null; String bic = null;
String iban = null; String iban = null;
String kto = null;
String holder = null; String holder = null;
String ref = null; String ref = null;
@@ -362,6 +368,7 @@ public class MustangReaderWriterTest extends TestCase implements IZUGFeRDExporta
blz = zi.getBLZ(); blz = zi.getBLZ();
bic = zi.getBIC(); bic = zi.getBIC();
iban = zi.getIBAN(); iban = zi.getIBAN();
kto = zi.getKTO();
holder = zi.getHolder(); holder = zi.getHolder();
ref = zi.getForeignReference(); ref = zi.getForeignReference();
} }
@@ -370,6 +377,7 @@ public class MustangReaderWriterTest extends TestCase implements IZUGFeRDExporta
assertEquals(blz, "41441604"); assertEquals(blz, "41441604");
assertEquals(bic, "COBADEFFXXX"); assertEquals(bic, "COBADEFFXXX");
assertEquals(iban, "DE88 2008 0000 0970 3757 00"); assertEquals(iban, "DE88 2008 0000 0970 3757 00");
assertEquals(kto, "44421800");
assertEquals(holder, "Bei Spiel GmbH"); assertEquals(holder, "Bei Spiel GmbH");
assertEquals(ref, "RE-20170509/505"); assertEquals(ref, "RE-20170509/505");
@@ -522,6 +530,7 @@ public class MustangReaderWriterTest extends TestCase implements IZUGFeRDExporta
String amount = null; String amount = null;
String bic = null; String bic = null;
String iban = null; String iban = null;
String kto = null;
String holder = null; String holder = null;
String ref = null; String ref = null;
if (zi.canParse()) { if (zi.canParse()) {
@@ -529,6 +538,7 @@ public class MustangReaderWriterTest extends TestCase implements IZUGFeRDExporta
amount = zi.getAmount(); amount = zi.getAmount();
bic = zi.getBIC(); bic = zi.getBIC();
iban = zi.getIBAN(); iban = zi.getIBAN();
kto = zi.getKTO();
holder = zi.getHolder(); holder = zi.getHolder();
ref = zi.getForeignReference(); ref = zi.getForeignReference();
} }
@@ -536,6 +546,7 @@ public class MustangReaderWriterTest extends TestCase implements IZUGFeRDExporta
assertEquals(amount, "571.04"); assertEquals(amount, "571.04");
assertEquals(bic, getOwnBIC()); assertEquals(bic, getOwnBIC());
assertEquals(iban, getOwnIBAN()); assertEquals(iban, getOwnIBAN());
assertEquals(kto, getOwnKto());
assertEquals(holder, getOwnOrganisationName()); assertEquals(holder, getOwnOrganisationName());
assertEquals(ref, getNumber()); assertEquals(ref, getNumber());

View File

@@ -77,6 +77,7 @@
<ram:Information>Überweisung</ram:Information> <ram:Information>Überweisung</ram:Information>
<ram:PayeePartyCreditorFinancialAccount> <ram:PayeePartyCreditorFinancialAccount>
<ram:IBANID>DE88 2008 0000 0970 3757 00</ram:IBANID> <ram:IBANID>DE88 2008 0000 0970 3757 00</ram:IBANID>
<ram:ProprietaryID>44421800</ram:ProprietaryID>
</ram:PayeePartyCreditorFinancialAccount> </ram:PayeePartyCreditorFinancialAccount>
<ram:PayeeSpecifiedCreditorFinancialInstitution> <ram:PayeeSpecifiedCreditorFinancialInstitution>
<ram:BICID>COBADEFFXXX</ram:BICID> <ram:BICID>COBADEFFXXX</ram:BICID>

View File

@@ -77,6 +77,7 @@
<ram:Information>Überweisung</ram:Information> <ram:Information>Überweisung</ram:Information>
<ram:PayeePartyCreditorFinancialAccount> <ram:PayeePartyCreditorFinancialAccount>
<ram:IBANID>DE88 2008 0000 0970 3757 00</ram:IBANID> <ram:IBANID>DE88 2008 0000 0970 3757 00</ram:IBANID>
<ram:ProprietaryID>44421800</ram:ProprietaryID>
</ram:PayeePartyCreditorFinancialAccount> </ram:PayeePartyCreditorFinancialAccount>
<ram:PayeeSpecifiedCreditorFinancialInstitution> <ram:PayeeSpecifiedCreditorFinancialInstitution>
<ram:BICID>COBADEFFXXX</ram:BICID> <ram:BICID>COBADEFFXXX</ram:BICID>

View File

@@ -177,6 +177,7 @@ Migrated by Mustangproject XSLT
<ram:Information>Überweisung</ram:Information> <ram:Information>Überweisung</ram:Information>
<ram:PayeePartyCreditorFinancialAccount> <ram:PayeePartyCreditorFinancialAccount>
<ram:IBANID>DE88 2008 0000 0970 3757 00</ram:IBANID> <ram:IBANID>DE88 2008 0000 0970 3757 00</ram:IBANID>
<ram:ProprietaryID>44421800</ram:ProprietaryID>
</ram:PayeePartyCreditorFinancialAccount> </ram:PayeePartyCreditorFinancialAccount>
<ram:PayeeSpecifiedCreditorFinancialInstitution> <ram:PayeeSpecifiedCreditorFinancialInstitution>
<ram:BICID>COBADEFFXXX</ram:BICID> <ram:BICID>COBADEFFXXX</ram:BICID>