Read missing fields for Invoice import.
This commit is contained in:
@@ -203,12 +203,10 @@ public class TradeParty implements IZUGFeRDExportableTradeParty {
|
||||
if (taxChilds.item(taxChildIndex).getAttributes().getNamedItem("schemeID") != null) {
|
||||
Node firstChild = taxChilds.item(taxChildIndex).getFirstChild();
|
||||
if (firstChild != null) {
|
||||
if (taxChilds.item(taxChildIndex).getAttributes()
|
||||
.getNamedItem("schemeID").getNodeValue().equals("VA")) {
|
||||
if (taxChilds.item(taxChildIndex).getAttributes().getNamedItem("schemeID").getNodeValue().equals("VA")) {
|
||||
setVATID(firstChild.getNodeValue());
|
||||
}
|
||||
if (taxChilds.item(taxChildIndex).getAttributes()
|
||||
.getNamedItem("schemeID").getNodeValue().equals("FC")) {
|
||||
if (taxChilds.item(taxChildIndex).getAttributes().getNamedItem("schemeID").getNodeValue().equals("FC")) {
|
||||
setTaxID(firstChild.getNodeValue());
|
||||
}
|
||||
}
|
||||
@@ -298,6 +296,9 @@ public class TradeParty implements IZUGFeRDExportableTradeParty {
|
||||
NodeList itemChilds = currentItemNode.getChildNodes();
|
||||
for (int itemChildIndex = 0; itemChildIndex < itemChilds.getLength(); itemChildIndex++) {
|
||||
if (itemChilds.item(itemChildIndex).getLocalName() != null) {
|
||||
if (itemChilds.item(itemChildIndex).getLocalName().equals("ID")) {
|
||||
setID(itemChilds.item(itemChildIndex).getTextContent());
|
||||
}
|
||||
if (itemChilds.item(itemChildIndex).getLocalName().equals("Name")) {
|
||||
setName(itemChilds.item(itemChildIndex).getTextContent());
|
||||
}
|
||||
@@ -358,12 +359,10 @@ public class TradeParty implements IZUGFeRDExportableTradeParty {
|
||||
if (taxChilds.item(taxChildIndex).getAttributes().getNamedItem("schemeID") != null) {
|
||||
Node firstChild = taxChilds.item(taxChildIndex).getFirstChild();
|
||||
if (firstChild != null) {
|
||||
if (taxChilds.item(taxChildIndex).getAttributes()
|
||||
.getNamedItem("schemeID").getNodeValue().equals("VA")) {
|
||||
if (taxChilds.item(taxChildIndex).getAttributes().getNamedItem("schemeID").getNodeValue().equals("VA")) {
|
||||
setVATID(firstChild.getNodeValue());
|
||||
}
|
||||
if (taxChilds.item(taxChildIndex).getAttributes()
|
||||
.getNamedItem("schemeID").getNodeValue().equals("FC")) {
|
||||
if (taxChilds.item(taxChildIndex).getAttributes().getNamedItem("schemeID").getNodeValue().equals("FC")) {
|
||||
setTaxID(firstChild.getNodeValue());
|
||||
}
|
||||
}
|
||||
@@ -630,9 +629,7 @@ public class TradeParty implements IZUGFeRDExportableTradeParty {
|
||||
if (bankDetails.isEmpty() && debitDetails.isEmpty()) {
|
||||
return null;
|
||||
}
|
||||
List<IZUGFeRDTradeSettlement> tradeSettlements = Stream.concat(bankDetails.stream(), debitDetails.stream())
|
||||
.map(IZUGFeRDTradeSettlement.class::cast)
|
||||
.collect(Collectors.toList());
|
||||
List<IZUGFeRDTradeSettlement> tradeSettlements = Stream.concat(bankDetails.stream(), debitDetails.stream()).map(IZUGFeRDTradeSettlement.class::cast).collect(Collectors.toList());
|
||||
|
||||
IZUGFeRDTradeSettlement[] result = new IZUGFeRDTradeSettlement[tradeSettlements.size()];
|
||||
for (int i = 0; i < tradeSettlements.size(); i++) {
|
||||
|
||||
@@ -61,6 +61,7 @@ public class ZUGFeRDInvoiceImporter extends ZUGFeRDImporter {
|
||||
public Invoice extractInto(Invoice zpp) throws XPathExpressionException, ParseException {
|
||||
|
||||
String number = "";
|
||||
String typeCode = null;
|
||||
/*
|
||||
* dummywerte sind derzeit noch setDueDate setIssueDate setDeliveryDate
|
||||
* setSender setRecipient setnumber bspw. due date
|
||||
@@ -86,26 +87,26 @@ public class ZUGFeRDInvoiceImporter extends ZUGFeRDImporter {
|
||||
Date issueDate = null;
|
||||
Date dueDate = null;
|
||||
Date deliveryDate = null;
|
||||
String despatchAdviceReferencedDocument = null;
|
||||
for (int i = 0; i < ExchangedDocumentNodes.getLength(); i++) {
|
||||
|
||||
// nodes.item(i).getTextContent())) {
|
||||
Node exchangedDocumentNode = ExchangedDocumentNodes.item(i);
|
||||
NodeList exchangedDocumentChilds = exchangedDocumentNode.getChildNodes();
|
||||
for (int documentChildIndex = 0; documentChildIndex < exchangedDocumentChilds
|
||||
.getLength(); documentChildIndex++) {
|
||||
for (int documentChildIndex = 0; documentChildIndex < exchangedDocumentChilds.getLength(); documentChildIndex++) {
|
||||
Node item = exchangedDocumentChilds.item(documentChildIndex);
|
||||
if ((item.getLocalName() != null) && (item.getLocalName().equals("ID"))) {
|
||||
number = item.getTextContent();
|
||||
}
|
||||
if ((item.getLocalName() != null) && (item.getLocalName().equals("TypeCode"))) {
|
||||
typeCode = item.getTextContent();
|
||||
}
|
||||
if ((item.getLocalName() != null) && (item.getLocalName().equals("IssueDateTime"))) {
|
||||
NodeList issueDateTimeChilds = item.getChildNodes();
|
||||
for (int issueDateChildIndex = 0; issueDateChildIndex < issueDateTimeChilds
|
||||
.getLength(); issueDateChildIndex++) {
|
||||
for (int issueDateChildIndex = 0; issueDateChildIndex < issueDateTimeChilds.getLength(); issueDateChildIndex++) {
|
||||
if ((issueDateTimeChilds.item(issueDateChildIndex).getLocalName() != null)
|
||||
&& (issueDateTimeChilds.item(issueDateChildIndex).getLocalName()
|
||||
.equals("DateTimeString"))) {
|
||||
issueDate = new SimpleDateFormat("yyyyMMdd")
|
||||
.parse(issueDateTimeChilds.item(issueDateChildIndex).getTextContent());
|
||||
&& (issueDateTimeChilds.item(issueDateChildIndex).getLocalName().equals("DateTimeString"))) {
|
||||
issueDate = new SimpleDateFormat("yyyyMMdd").parse(issueDateTimeChilds.item(issueDateChildIndex).getTextContent());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -115,17 +116,14 @@ public class ZUGFeRDInvoiceImporter extends ZUGFeRDImporter {
|
||||
if (rootNode.equals("Invoice")) {
|
||||
// UBL...
|
||||
number = extractString("//*[local-name()=\"Invoice\"]/*[local-name()=\"ID\"]").trim();
|
||||
issueDate = new SimpleDateFormat("yyyy-MM-dd")
|
||||
.parse(extractString("//*[local-name()=\"Invoice\"]/*[local-name()=\"IssueDate\"]").trim());
|
||||
issueDate = new SimpleDateFormat("yyyy-MM-dd").parse(extractString("//*[local-name()=\"Invoice\"]/*[local-name()=\"IssueDate\"]").trim());
|
||||
String dueDt = extractString("//*[local-name()=\"Invoice\"]/*[local-name()=\"DueDate\"]").trim();
|
||||
if (dueDt.length() > 0) {
|
||||
dueDate = new SimpleDateFormat("yyyy-MM-dd")
|
||||
.parse(dueDt);
|
||||
dueDate = new SimpleDateFormat("yyyy-MM-dd").parse(dueDt);
|
||||
}
|
||||
String deliveryDt = extractString("//*[local-name()=\"Delivery\"]/*[local-name()=\"ActualDeliveryDate\"]").trim();
|
||||
if (deliveryDt.length() > 0) {
|
||||
deliveryDate = new SimpleDateFormat("yyyy-MM-dd")
|
||||
.parse(deliveryDt);
|
||||
deliveryDate = new SimpleDateFormat("yyyy-MM-dd").parse(deliveryDt);
|
||||
}
|
||||
}
|
||||
xpr = xpath.compile("//*[local-name()=\"ApplicableHeaderTradeDelivery\"]");
|
||||
@@ -135,31 +133,34 @@ public class ZUGFeRDInvoiceImporter extends ZUGFeRDImporter {
|
||||
// nodes.item(i).getTextContent())) {
|
||||
Node headerTradeDeliveryNode = headerTradeDeliveryNodes.item(i);
|
||||
NodeList headerTradeDeliveryChilds = headerTradeDeliveryNode.getChildNodes();
|
||||
for (int deliveryChildIndex = 0; deliveryChildIndex < headerTradeDeliveryChilds
|
||||
.getLength(); deliveryChildIndex++) {
|
||||
if ((headerTradeDeliveryChilds.item(deliveryChildIndex).getLocalName() != null)
|
||||
&& (headerTradeDeliveryChilds.item(deliveryChildIndex).getLocalName()
|
||||
.equals("ActualDeliverySupplyChainEvent"))) {
|
||||
for (int deliveryChildIndex = 0; deliveryChildIndex < headerTradeDeliveryChilds.getLength(); deliveryChildIndex++) {
|
||||
if (headerTradeDeliveryChilds.item(deliveryChildIndex).getLocalName() != null) {
|
||||
if (headerTradeDeliveryChilds.item(deliveryChildIndex).getLocalName().equals("ActualDeliverySupplyChainEvent")) {
|
||||
NodeList actualDeliveryChilds = headerTradeDeliveryChilds.item(deliveryChildIndex).getChildNodes();
|
||||
for (int actualDeliveryChildIndex = 0; actualDeliveryChildIndex < actualDeliveryChilds
|
||||
.getLength(); actualDeliveryChildIndex++) {
|
||||
for (int actualDeliveryChildIndex = 0; actualDeliveryChildIndex < actualDeliveryChilds.getLength(); actualDeliveryChildIndex++) {
|
||||
if ((actualDeliveryChilds.item(actualDeliveryChildIndex).getLocalName() != null)
|
||||
&& (actualDeliveryChilds.item(actualDeliveryChildIndex).getLocalName()
|
||||
.equals("OccurrenceDateTime"))) {
|
||||
NodeList occurenceChilds = actualDeliveryChilds.item(actualDeliveryChildIndex)
|
||||
.getChildNodes();
|
||||
for (int occurenceChildIndex = 0; occurenceChildIndex < occurenceChilds
|
||||
.getLength(); occurenceChildIndex++) {
|
||||
&& (actualDeliveryChilds.item(actualDeliveryChildIndex).getLocalName().equals("OccurrenceDateTime"))) {
|
||||
NodeList occurenceChilds = actualDeliveryChilds.item(actualDeliveryChildIndex).getChildNodes();
|
||||
for (int occurenceChildIndex = 0; occurenceChildIndex < occurenceChilds.getLength(); occurenceChildIndex++) {
|
||||
if ((occurenceChilds.item(occurenceChildIndex).getLocalName() != null)
|
||||
&& (occurenceChilds.item(occurenceChildIndex).getLocalName()
|
||||
.equals("DateTimeString"))) {
|
||||
deliveryDate = new SimpleDateFormat("yyyyMMdd")
|
||||
.parse(occurenceChilds.item(occurenceChildIndex).getTextContent());
|
||||
&& (occurenceChilds.item(occurenceChildIndex).getLocalName().equals("DateTimeString"))) {
|
||||
deliveryDate = new SimpleDateFormat("yyyyMMdd").parse(occurenceChilds.item(occurenceChildIndex).getTextContent());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (headerTradeDeliveryChilds.item(deliveryChildIndex).getLocalName().equals("DespatchAdviceReferencedDocument")) {
|
||||
NodeList despatchAdviceChilds = headerTradeDeliveryChilds.item(deliveryChildIndex).getChildNodes();
|
||||
for (int despatchAdviceChildIndex = 0; despatchAdviceChildIndex < despatchAdviceChilds.getLength(); despatchAdviceChildIndex++) {
|
||||
if (despatchAdviceChilds.item(despatchAdviceChildIndex).getLocalName() != null
|
||||
&& despatchAdviceChilds.item(despatchAdviceChildIndex).getLocalName().equals("IssuerAssignedID")) {
|
||||
despatchAdviceReferencedDocument = despatchAdviceChilds.item(despatchAdviceChildIndex).getTextContent();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -171,35 +172,29 @@ public class ZUGFeRDInvoiceImporter extends ZUGFeRDImporter {
|
||||
// nodes.item(i).getTextContent())) {
|
||||
Node headerTradeAgreementNode = headerTradeAgreementNodes.item(i);
|
||||
NodeList headerTradeAgreementChilds = headerTradeAgreementNode.getChildNodes();
|
||||
for (int agreementChildIndex = 0; agreementChildIndex < headerTradeAgreementChilds
|
||||
.getLength(); agreementChildIndex++) {
|
||||
if ((headerTradeAgreementChilds.item(agreementChildIndex).getLocalName() != null)
|
||||
&& (headerTradeAgreementChilds.item(agreementChildIndex).getLocalName()
|
||||
.equals("BuyerOrderReferencedDocument"))) {
|
||||
for (int agreementChildIndex = 0; agreementChildIndex < headerTradeAgreementChilds.getLength(); agreementChildIndex++) {
|
||||
if (headerTradeAgreementChilds.item(agreementChildIndex).getLocalName() != null) {
|
||||
if (headerTradeAgreementChilds.item(agreementChildIndex).getLocalName().equals("BuyerOrderReferencedDocument")) {
|
||||
NodeList buyerOrderChilds = headerTradeAgreementChilds.item(agreementChildIndex).getChildNodes();
|
||||
for (int buyerOrderChildIndex = 0; buyerOrderChildIndex < buyerOrderChilds
|
||||
.getLength(); buyerOrderChildIndex++) {
|
||||
for (int buyerOrderChildIndex = 0; buyerOrderChildIndex < buyerOrderChilds.getLength(); buyerOrderChildIndex++) {
|
||||
if ((buyerOrderChilds.item(buyerOrderChildIndex).getLocalName() != null)
|
||||
&& (buyerOrderChilds.item(buyerOrderChildIndex).getLocalName()
|
||||
.equals("IssuerAssignedID"))) {
|
||||
&& (buyerOrderChilds.item(buyerOrderChildIndex).getLocalName().equals("IssuerAssignedID"))) {
|
||||
buyerOrderIssuerAssignedID = buyerOrderChilds.item(buyerOrderChildIndex).getTextContent();
|
||||
}
|
||||
}
|
||||
}
|
||||
if ((headerTradeAgreementChilds.item(agreementChildIndex).getLocalName() != null)
|
||||
&& (headerTradeAgreementChilds.item(agreementChildIndex).getLocalName()
|
||||
.equals("SellerOrderReferencedDocument"))) {
|
||||
|
||||
if (headerTradeAgreementChilds.item(agreementChildIndex).getLocalName().equals("SellerOrderReferencedDocument")) {
|
||||
NodeList sellerOrderChilds = headerTradeAgreementChilds.item(agreementChildIndex).getChildNodes();
|
||||
for (int sellerOrderChildIndex = 0; sellerOrderChildIndex < sellerOrderChilds
|
||||
.getLength(); sellerOrderChildIndex++) {
|
||||
for (int sellerOrderChildIndex = 0; sellerOrderChildIndex < sellerOrderChilds.getLength(); sellerOrderChildIndex++) {
|
||||
if ((sellerOrderChilds.item(sellerOrderChildIndex).getLocalName() != null)
|
||||
&& (sellerOrderChilds.item(sellerOrderChildIndex).getLocalName()
|
||||
.equals("IssuerAssignedID"))) {
|
||||
&& (sellerOrderChilds.item(sellerOrderChildIndex).getLocalName().equals("IssuerAssignedID"))) {
|
||||
sellerOrderIssuerAssignedID = sellerOrderChilds.item(sellerOrderChildIndex).getTextContent();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -212,23 +207,16 @@ public class ZUGFeRDInvoiceImporter extends ZUGFeRDImporter {
|
||||
// nodes.item(i).getTextContent())) {
|
||||
Node headerTradeSettlementNode = headerTradeSettlementNodes.item(i);
|
||||
NodeList headerTradeSettlementChilds = headerTradeSettlementNode.getChildNodes();
|
||||
for (int settlementChildIndex = 0; settlementChildIndex < headerTradeSettlementChilds
|
||||
.getLength(); settlementChildIndex++) {
|
||||
for (int settlementChildIndex = 0; settlementChildIndex < headerTradeSettlementChilds.getLength(); settlementChildIndex++) {
|
||||
if ((headerTradeSettlementChilds.item(settlementChildIndex).getLocalName() != null)
|
||||
&& (headerTradeSettlementChilds.item(settlementChildIndex).getLocalName()
|
||||
.equals("SpecifiedTradePaymentTerms"))) {
|
||||
&& (headerTradeSettlementChilds.item(settlementChildIndex).getLocalName().equals("SpecifiedTradePaymentTerms"))) {
|
||||
NodeList paymentTermChilds = headerTradeSettlementChilds.item(settlementChildIndex).getChildNodes();
|
||||
for (int paymentTermChildIndex = 0; paymentTermChildIndex < paymentTermChilds
|
||||
.getLength(); paymentTermChildIndex++) {
|
||||
if ((paymentTermChilds.item(paymentTermChildIndex).getLocalName() != null) && (paymentTermChilds
|
||||
.item(paymentTermChildIndex).getLocalName().equals("DueDateDateTime"))) {
|
||||
for (int paymentTermChildIndex = 0; paymentTermChildIndex < paymentTermChilds.getLength(); paymentTermChildIndex++) {
|
||||
if ((paymentTermChilds.item(paymentTermChildIndex).getLocalName() != null) && (paymentTermChilds.item(paymentTermChildIndex).getLocalName().equals("DueDateDateTime"))) {
|
||||
NodeList dueDateChilds = paymentTermChilds.item(paymentTermChildIndex).getChildNodes();
|
||||
for (int dueDateChildIndex = 0; dueDateChildIndex < dueDateChilds
|
||||
.getLength(); dueDateChildIndex++) {
|
||||
if ((dueDateChilds.item(dueDateChildIndex).getLocalName() != null) && (dueDateChilds
|
||||
.item(dueDateChildIndex).getLocalName().equals("DateTimeString"))) {
|
||||
dueDate = new SimpleDateFormat("yyyyMMdd")
|
||||
.parse(dueDateChilds.item(dueDateChildIndex).getTextContent());
|
||||
for (int dueDateChildIndex = 0; dueDateChildIndex < dueDateChilds.getLength(); dueDateChildIndex++) {
|
||||
if ((dueDateChilds.item(dueDateChildIndex).getLocalName() != null) && (dueDateChilds.item(dueDateChildIndex).getLocalName().equals("DateTimeString"))) {
|
||||
dueDate = new SimpleDateFormat("yyyyMMdd").parse(dueDateChilds.item(dueDateChildIndex).getTextContent());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -236,30 +224,22 @@ public class ZUGFeRDInvoiceImporter extends ZUGFeRDImporter {
|
||||
}
|
||||
|
||||
if ((headerTradeSettlementChilds.item(settlementChildIndex).getLocalName() != null)
|
||||
&& (headerTradeSettlementChilds.item(settlementChildIndex).getLocalName()
|
||||
.equals("SpecifiedTradeSettlementPaymentMeans"))) {
|
||||
&& (headerTradeSettlementChilds.item(settlementChildIndex).getLocalName().equals("SpecifiedTradeSettlementPaymentMeans"))) {
|
||||
NodeList paymentMeansChilds = headerTradeSettlementChilds.item(settlementChildIndex).getChildNodes();
|
||||
for (int paymentMeansChildIndex = 0; paymentMeansChildIndex < paymentMeansChilds
|
||||
.getLength(); paymentMeansChildIndex++) {
|
||||
for (int paymentMeansChildIndex = 0; paymentMeansChildIndex < paymentMeansChilds.getLength(); paymentMeansChildIndex++) {
|
||||
String IBAN = null, BIC = null;
|
||||
if ((paymentMeansChilds.item(paymentMeansChildIndex).getLocalName() != null) && (paymentMeansChilds
|
||||
.item(paymentMeansChildIndex).getLocalName().equals("PayeePartyCreditorFinancialAccount"))) {
|
||||
if ((paymentMeansChilds.item(paymentMeansChildIndex).getLocalName() != null) && (paymentMeansChilds.item(paymentMeansChildIndex).getLocalName().equals("PayeePartyCreditorFinancialAccount"))) {
|
||||
NodeList accountChilds = paymentMeansChilds.item(paymentMeansChildIndex).getChildNodes();
|
||||
for (int accountChildIndex = 0; accountChildIndex < accountChilds
|
||||
.getLength(); accountChildIndex++) {
|
||||
if ((accountChilds.item(accountChildIndex).getLocalName() != null) && (accountChilds
|
||||
.item(accountChildIndex).getLocalName().equals("IBANID"))) {//CII
|
||||
for (int accountChildIndex = 0; accountChildIndex < accountChilds.getLength(); accountChildIndex++) {
|
||||
if ((accountChilds.item(accountChildIndex).getLocalName() != null) && (accountChilds.item(accountChildIndex).getLocalName().equals("IBANID"))) {//CII
|
||||
IBAN = accountChilds.item(accountChildIndex).getTextContent();
|
||||
}
|
||||
}
|
||||
}
|
||||
if ((paymentMeansChilds.item(paymentMeansChildIndex).getLocalName() != null) && (paymentMeansChilds
|
||||
.item(paymentMeansChildIndex).getLocalName().equals("PayeePartyCreditorFinancialInstitution"))) {
|
||||
if ((paymentMeansChilds.item(paymentMeansChildIndex).getLocalName() != null) && (paymentMeansChilds.item(paymentMeansChildIndex).getLocalName().equals("PayeePartyCreditorFinancialInstitution"))) {
|
||||
NodeList accountChilds = paymentMeansChilds.item(paymentMeansChildIndex).getChildNodes();
|
||||
for (int accountChildIndex = 0; accountChildIndex < accountChilds
|
||||
.getLength(); accountChildIndex++) {
|
||||
if ((accountChilds.item(accountChildIndex).getLocalName() != null) && (accountChilds
|
||||
.item(accountChildIndex).getLocalName().equals("BICID"))) {//CII
|
||||
for (int accountChildIndex = 0; accountChildIndex < accountChilds.getLength(); accountChildIndex++) {
|
||||
if ((accountChilds.item(accountChildIndex).getLocalName() != null) && (accountChilds.item(accountChildIndex).getLocalName().equals("BICID"))) {//CII
|
||||
BIC = accountChilds.item(accountChildIndex).getTextContent();
|
||||
}
|
||||
}
|
||||
@@ -284,16 +264,12 @@ public class ZUGFeRDInvoiceImporter extends ZUGFeRDImporter {
|
||||
// nodes.item(i).getTextContent())) {
|
||||
Node paymentMeansNode = paymentMeansNodes.item(i);
|
||||
NodeList paymentMeansChilds = paymentMeansNode.getChildNodes();
|
||||
for (int meansChildIndex = 0; meansChildIndex < paymentMeansChilds
|
||||
.getLength(); meansChildIndex++) {
|
||||
for (int meansChildIndex = 0; meansChildIndex < paymentMeansChilds.getLength(); meansChildIndex++) {
|
||||
if ((paymentMeansChilds.item(meansChildIndex).getLocalName() != null)
|
||||
&& (paymentMeansChilds.item(meansChildIndex).getLocalName()
|
||||
.equals("PayeeFinancialAccount"))) {
|
||||
&& (paymentMeansChilds.item(meansChildIndex).getLocalName().equals("PayeeFinancialAccount"))) {
|
||||
NodeList paymentTermChilds = paymentMeansChilds.item(meansChildIndex).getChildNodes();
|
||||
for (int paymentTermChildIndex = 0; paymentTermChildIndex < paymentTermChilds
|
||||
.getLength(); paymentTermChildIndex++) {
|
||||
if ((paymentTermChilds.item(paymentTermChildIndex).getLocalName() != null) && (paymentTermChilds
|
||||
.item(paymentTermChildIndex).getLocalName().equals("ID"))) {
|
||||
for (int paymentTermChildIndex = 0; paymentTermChildIndex < paymentTermChilds.getLength(); paymentTermChildIndex++) {
|
||||
if ((paymentTermChilds.item(paymentTermChildIndex).getLocalName() != null) && (paymentTermChilds.item(paymentTermChildIndex).getLocalName().equals("ID"))) {
|
||||
String IBAN = paymentTermChilds.item(paymentTermChildIndex).getTextContent();
|
||||
if (IBAN != null) {
|
||||
BankDetails bd = new BankDetails(IBAN);
|
||||
@@ -305,8 +281,7 @@ public class ZUGFeRDInvoiceImporter extends ZUGFeRDImporter {
|
||||
}
|
||||
}
|
||||
|
||||
zpp.setDueDate(dueDate).setDeliveryDate(deliveryDate).setIssueDate(issueDate)
|
||||
.setSender(new TradeParty(SellerNodes)).setRecipient(new TradeParty(BuyerNodes)).setNumber(number);
|
||||
zpp.setDueDate(dueDate).setDeliveryDate(deliveryDate).setIssueDate(issueDate).setSender(new TradeParty(SellerNodes)).setRecipient(new TradeParty(BuyerNodes)).setNumber(number).setDocumentCode(typeCode);
|
||||
bankDetails.forEach(bankDetail -> zpp.getSender().addBankDetails(bankDetail));
|
||||
|
||||
if (buyerOrderIssuerAssignedID != null) {
|
||||
@@ -315,8 +290,10 @@ public class ZUGFeRDInvoiceImporter extends ZUGFeRDImporter {
|
||||
if (sellerOrderIssuerAssignedID != null) {
|
||||
zpp.setSellerOrderReferencedDocumentID(sellerOrderIssuerAssignedID);
|
||||
}
|
||||
if (despatchAdviceReferencedDocument != null) {
|
||||
zpp.setDespatchAdviceReferencedDocumentID(despatchAdviceReferencedDocument);
|
||||
}
|
||||
|
||||
//.addItem(new Item(new Product("Testprodukt","","C62",BigDecimal.ZERO),amount,new BigDecimal(1.0)))
|
||||
zpp.setOwnOrganisationName(extractString("//*[local-name()=\"SellerTradeParty\"]/*[local-name()=\"Name\"]|//*[local-name()=\"AccountingSupplierParty\"]/*[local-name()=\"Party\"]/*[local-name()=\"PartyName\"]").trim());
|
||||
|
||||
xpr = xpath.compile("//*[local-name()=\"BuyerReference\"]");
|
||||
@@ -370,13 +347,10 @@ public class ZUGFeRDInvoiceImporter extends ZUGFeRDImporter {
|
||||
|
||||
if (chargeChildName.equals("ChargeIndicator")) {
|
||||
NodeList indicatorChilds = chargeNodeChilds.item(chargeChildIndex).getChildNodes();
|
||||
for (int indicatorChildIndex = 0; indicatorChildIndex < indicatorChilds
|
||||
.getLength(); indicatorChildIndex++) {
|
||||
for (int indicatorChildIndex = 0; indicatorChildIndex < indicatorChilds.getLength(); indicatorChildIndex++) {
|
||||
if ((indicatorChilds.item(indicatorChildIndex).getLocalName() != null)
|
||||
&& (indicatorChilds.item(indicatorChildIndex).getLocalName()
|
||||
.equals("Indicator"))) {
|
||||
isCharge = indicatorChilds.item(indicatorChildIndex).getTextContent()
|
||||
.equalsIgnoreCase("true");
|
||||
&& (indicatorChilds.item(indicatorChildIndex).getLocalName().equals("Indicator"))) {
|
||||
isCharge = indicatorChilds.item(indicatorChildIndex).getTextContent().equalsIgnoreCase("true");
|
||||
}
|
||||
}
|
||||
} else if (chargeChildName.equals("ActualAmount")) {
|
||||
@@ -389,8 +363,7 @@ public class ZUGFeRDInvoiceImporter extends ZUGFeRDImporter {
|
||||
NodeList taxChilds = chargeNodeChilds.item(chargeChildIndex).getChildNodes();
|
||||
for (int taxChildIndex = 0; taxChildIndex < taxChilds.getLength(); taxChildIndex++) {
|
||||
String taxItemName = taxChilds.item(taxChildIndex).getLocalName();
|
||||
if ((taxItemName != null) && (taxItemName.equals("RateApplicablePercent")
|
||||
|| taxItemName.equals("ApplicablePercent"))) {
|
||||
if ((taxItemName != null) && (taxItemName.equals("RateApplicablePercent") || taxItemName.equals("ApplicablePercent"))) {
|
||||
taxPercent = taxChilds.item(taxChildIndex).getTextContent();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user