closes #618
This commit is contained in:
@@ -1,7 +1,8 @@
|
|||||||
- correcly write charge reason codes also for non-Xrechnung
|
- correcly write charge reason codes also for non-Xrechnung #617
|
||||||
- correctly import additional referenced documents into invoice/corrected setting of attachments from jackson
|
- correctly import additional referenced documents into invoice/corrected setting of attachments from jackson
|
||||||
- corrected parseException structure
|
- corrected parseException structure
|
||||||
- allow 1p0 as potential xmp version number
|
- allow 1p0 as potential xmp version number
|
||||||
|
- #618 import BT-20
|
||||||
|
|
||||||
2.15.1
|
2.15.1
|
||||||
=======
|
=======
|
||||||
|
|||||||
@@ -262,7 +262,7 @@ public class ZUGFeRDImporter extends ZUGFeRDInvoiceImporter {
|
|||||||
* @return the Payment Terms
|
* @return the Payment Terms
|
||||||
*/
|
*/
|
||||||
public String getPaymentTerms() {
|
public String getPaymentTerms() {
|
||||||
return extractString("//*[local-name() = 'SpecifiedTradePaymentTerms']//*[local-name() = 'Description']");
|
return importedInvoice.getPaymentTermDescription();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -644,6 +644,12 @@ public class ZUGFeRDInvoiceImporter {
|
|||||||
String currency = extractString("//*[local-name()=\"ApplicableHeaderTradeSettlement\"]/*[local-name()=\"InvoiceCurrencyCode\"]|//*[local-name()=\"DocumentCurrencyCode\"]");
|
String currency = extractString("//*[local-name()=\"ApplicableHeaderTradeSettlement\"]/*[local-name()=\"InvoiceCurrencyCode\"]|//*[local-name()=\"DocumentCurrencyCode\"]");
|
||||||
zpp.setCurrency(currency);
|
zpp.setCurrency(currency);
|
||||||
|
|
||||||
|
String paymentTermsDescription = extractString("//*[local-name()=\"SpecifiedTradePaymentTerms\"]/*[local-name()=\"Description\"]|//*[local-name()=\"PaymentTerms\"]/*[local-name()=\"Note\"]");
|
||||||
|
if ((paymentTermsDescription!=null)&&(!paymentTermsDescription.isEmpty())) {
|
||||||
|
zpp.setPaymentTermDescription(paymentTermsDescription);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
xpr = xpath.compile("//*[local-name()=\"ApplicableHeaderTradeSettlement\"]|//*[local-name()=\"ApplicableSupplyChainTradeSettlement\"]");
|
xpr = xpath.compile("//*[local-name()=\"ApplicableHeaderTradeSettlement\"]|//*[local-name()=\"ApplicableSupplyChainTradeSettlement\"]");
|
||||||
NodeList headerTradeSettlementNodes = (NodeList) xpr.evaluate(getDocument(), XPathConstants.NODESET);
|
NodeList headerTradeSettlementNodes = (NodeList) xpr.evaluate(getDocument(), XPathConstants.NODESET);
|
||||||
List<BankDetails> bankDetails = new ArrayList<>();
|
List<BankDetails> bankDetails = new ArrayList<>();
|
||||||
@@ -660,6 +666,9 @@ public class ZUGFeRDInvoiceImporter {
|
|||||||
&& (headerTradeSettlementChilds.item(settlementChildIndex).getLocalName().equals("SpecifiedTradePaymentTerms"))) {
|
&& (headerTradeSettlementChilds.item(settlementChildIndex).getLocalName().equals("SpecifiedTradePaymentTerms"))) {
|
||||||
NodeList paymentTermChilds = headerTradeSettlementChilds.item(settlementChildIndex).getChildNodes();
|
NodeList paymentTermChilds = headerTradeSettlementChilds.item(settlementChildIndex).getChildNodes();
|
||||||
for (int paymentTermChildIndex = 0; paymentTermChildIndex < paymentTermChilds.getLength(); paymentTermChildIndex++) {
|
for (int paymentTermChildIndex = 0; paymentTermChildIndex < paymentTermChilds.getLength(); paymentTermChildIndex++) {
|
||||||
|
if ((paymentTermChilds.item(paymentTermChildIndex).getLocalName() != null) && (paymentTermChilds.item(paymentTermChildIndex).getLocalName().equals("Description"))) {
|
||||||
|
zpp.setPaymentTermDescription(paymentTermChilds.item(paymentTermChildIndex).getTextContent());
|
||||||
|
}
|
||||||
if ((paymentTermChilds.item(paymentTermChildIndex).getLocalName() != null) && (paymentTermChilds.item(paymentTermChildIndex).getLocalName().equals("DueDateDateTime"))) {
|
if ((paymentTermChilds.item(paymentTermChildIndex).getLocalName() != null) && (paymentTermChilds.item(paymentTermChildIndex).getLocalName().equals("DueDateDateTime"))) {
|
||||||
NodeList dueDateChilds = paymentTermChilds.item(paymentTermChildIndex).getChildNodes();
|
NodeList dueDateChilds = paymentTermChilds.item(paymentTermChildIndex).getChildNodes();
|
||||||
for (int dueDateChildIndex = 0; dueDateChildIndex < dueDateChilds.getLength(); dueDateChildIndex++) {
|
for (int dueDateChildIndex = 0; dueDateChildIndex < dueDateChilds.getLength(); dueDateChildIndex++) {
|
||||||
|
|||||||
@@ -76,6 +76,7 @@ public class ZF2ZInvoiceImporterTest extends ResourceCase {
|
|||||||
assertEquals("LTR", invoice.getZFItems()[2].getProduct().getUnit());
|
assertEquals("LTR", invoice.getZFItems()[2].getProduct().getUnit());
|
||||||
assertEquals("7.00", invoice.getZFItems()[0].getProduct().getVATPercent().toString());
|
assertEquals("7.00", invoice.getZFItems()[0].getProduct().getVATPercent().toString());
|
||||||
assertEquals("RE-20170509/505", invoice.getNumber());
|
assertEquals("RE-20170509/505", invoice.getNumber());
|
||||||
|
assertEquals("Zahlbar ohne Abzug bis zum 30.05.2017", invoice.getPaymentTermDescription());
|
||||||
|
|
||||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
||||||
assertEquals("2017-05-09", sdf.format(invoice.getIssueDate()));
|
assertEquals("2017-05-09", sdf.format(invoice.getIssueDate()));
|
||||||
@@ -127,7 +128,7 @@ public class ZF2ZInvoiceImporterTest extends ResourceCase {
|
|||||||
assertEquals(invoice.getZFItems()[0].getNotesWithSubjectCode().get(0).getContent(),"Something");
|
assertEquals(invoice.getZFItems()[0].getNotesWithSubjectCode().get(0).getContent(),"Something");
|
||||||
assertEquals(invoice.getZFItems()[0].getNotesWithSubjectCode().size(),1);
|
assertEquals(invoice.getZFItems()[0].getNotesWithSubjectCode().size(),1);
|
||||||
assertEquals("400", invoice.getZFItems()[1].getQuantity().toString());
|
assertEquals("400", invoice.getZFItems()[1].getQuantity().toString());
|
||||||
|
assertEquals("Zahlbar ohne Abzug bis zum 30.05.2017", invoice.getPaymentTermDescription());
|
||||||
assertEquals("AB321", invoice.getReferenceNumber());
|
assertEquals("AB321", invoice.getReferenceNumber());
|
||||||
assertEquals("160", invoice.getZFItems()[0].getPrice().toString());
|
assertEquals("160", invoice.getZFItems()[0].getPrice().toString());
|
||||||
assertEquals("Heiße Luft pro Liter", invoice.getZFItems()[2].getProduct().getName());
|
assertEquals("Heiße Luft pro Liter", invoice.getZFItems()[2].getProduct().getName());
|
||||||
|
|||||||
Reference in New Issue
Block a user