Merge branch 'master' of github.com:ZUGFeRD/mustangproject
This commit is contained in:
@@ -6,7 +6,9 @@ import java.math.BigDecimal;
|
|||||||
import java.nio.charset.StandardCharsets;
|
import java.nio.charset.StandardCharsets;
|
||||||
import java.text.ParseException;
|
import java.text.ParseException;
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
import javax.xml.xpath.XPath;
|
import javax.xml.xpath.XPath;
|
||||||
import javax.xml.xpath.XPathConstants;
|
import javax.xml.xpath.XPathConstants;
|
||||||
@@ -209,7 +211,7 @@ public class ZUGFeRDInvoiceImporter extends ZUGFeRDImporter {
|
|||||||
|
|
||||||
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);
|
||||||
String IBAN = null, BIC = null;
|
List<BankDetails> bankDetails = new ArrayList<>();
|
||||||
|
|
||||||
for (int i = 0; i < headerTradeSettlementNodes.getLength(); i++) {
|
for (int i = 0; i < headerTradeSettlementNodes.getLength(); i++) {
|
||||||
// nodes.item(i).getTextContent())) {
|
// nodes.item(i).getTextContent())) {
|
||||||
@@ -244,6 +246,7 @@ public class ZUGFeRDInvoiceImporter extends ZUGFeRDImporter {
|
|||||||
NodeList paymentMeansChilds = headerTradeSettlementChilds.item(settlementChildIndex).getChildNodes();
|
NodeList paymentMeansChilds = headerTradeSettlementChilds.item(settlementChildIndex).getChildNodes();
|
||||||
for (int paymentMeansChildIndex = 0; paymentMeansChildIndex < paymentMeansChilds
|
for (int paymentMeansChildIndex = 0; paymentMeansChildIndex < paymentMeansChilds
|
||||||
.getLength(); paymentMeansChildIndex++) {
|
.getLength(); paymentMeansChildIndex++) {
|
||||||
|
String IBAN = null, BIC = null;
|
||||||
if ((paymentMeansChilds.item(paymentMeansChildIndex).getLocalName() != null) && (paymentMeansChilds
|
if ((paymentMeansChilds.item(paymentMeansChildIndex).getLocalName() != null) && (paymentMeansChilds
|
||||||
.item(paymentMeansChildIndex).getLocalName().equals("PayeePartyCreditorFinancialAccount"))) {
|
.item(paymentMeansChildIndex).getLocalName().equals("PayeePartyCreditorFinancialAccount"))) {
|
||||||
NodeList accountChilds = paymentMeansChilds.item(paymentMeansChildIndex).getChildNodes();
|
NodeList accountChilds = paymentMeansChilds.item(paymentMeansChildIndex).getChildNodes();
|
||||||
@@ -266,6 +269,13 @@ public class ZUGFeRDInvoiceImporter extends ZUGFeRDImporter {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (IBAN != null) {
|
||||||
|
BankDetails bd = new BankDetails(IBAN);
|
||||||
|
if (BIC != null) {
|
||||||
|
bd.setBIC(BIC);
|
||||||
|
}
|
||||||
|
bankDetails.add(bd);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -289,7 +299,11 @@ public class ZUGFeRDInvoiceImporter extends ZUGFeRDImporter {
|
|||||||
.getLength(); paymentTermChildIndex++) {
|
.getLength(); paymentTermChildIndex++) {
|
||||||
if ((paymentTermChilds.item(paymentTermChildIndex).getLocalName() != null) && (paymentTermChilds
|
if ((paymentTermChilds.item(paymentTermChildIndex).getLocalName() != null) && (paymentTermChilds
|
||||||
.item(paymentTermChildIndex).getLocalName().equals("ID"))) {
|
.item(paymentTermChildIndex).getLocalName().equals("ID"))) {
|
||||||
IBAN = paymentTermChilds.item(paymentTermChildIndex).getTextContent();
|
String IBAN = paymentTermChilds.item(paymentTermChildIndex).getTextContent();
|
||||||
|
if (IBAN != null) {
|
||||||
|
BankDetails bd = new BankDetails(IBAN);
|
||||||
|
bankDetails.add(bd);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -298,13 +312,7 @@ public class ZUGFeRDInvoiceImporter extends ZUGFeRDImporter {
|
|||||||
|
|
||||||
zpp.setDueDate(dueDate).setDeliveryDate(deliveryDate).setIssueDate(issueDate)
|
zpp.setDueDate(dueDate).setDeliveryDate(deliveryDate).setIssueDate(issueDate)
|
||||||
.setSender(new TradeParty(SellerNodes)).setRecipient(new TradeParty(BuyerNodes)).setNumber(number);
|
.setSender(new TradeParty(SellerNodes)).setRecipient(new TradeParty(BuyerNodes)).setNumber(number);
|
||||||
if (IBAN != null) {
|
bankDetails.forEach(bankDetail -> zpp.getSender().addBankDetails(bankDetail));
|
||||||
BankDetails bd = new BankDetails(IBAN);
|
|
||||||
if (BIC != null) {
|
|
||||||
bd.setBIC(BIC);
|
|
||||||
}
|
|
||||||
zpp.getSender().addBankDetails(bd);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (buyerOrderIssuerAssignedID != null) {
|
if (buyerOrderIssuerAssignedID != null) {
|
||||||
zpp.setBuyerOrderReferencedDocumentID(buyerOrderIssuerAssignedID);
|
zpp.setBuyerOrderReferencedDocumentID(buyerOrderIssuerAssignedID);
|
||||||
|
|||||||
Reference in New Issue
Block a user