- be able to extract data into existing invoice objects
This commit is contained in:
@@ -1,3 +1,8 @@
|
||||
- #317 (support conversion towards peppol #282)
|
||||
- #313
|
||||
- https://github.com/ZUGFeRD/mustangproject/pull/315 invoiceimporter constructor for InputStream
|
||||
- be able to extract data into existing invoice objects
|
||||
|
||||
2.7.0
|
||||
=======
|
||||
2023-04-17
|
||||
|
||||
@@ -57,12 +57,7 @@ public class ZUGFeRDInvoiceImporter extends ZUGFeRDImporter {
|
||||
}
|
||||
}
|
||||
|
||||
/***
|
||||
* This will parse a XML into a invoice object
|
||||
*
|
||||
* @return the parsed invoice object
|
||||
*/
|
||||
public Invoice extractInvoice() throws XPathExpressionException, ParseException {
|
||||
public Invoice extractInto(Invoice zpp) throws XPathExpressionException, ParseException {
|
||||
|
||||
String number = "";
|
||||
/*
|
||||
@@ -72,7 +67,6 @@ public class ZUGFeRDInvoiceImporter extends ZUGFeRDImporter {
|
||||
*/
|
||||
XPathFactory xpathFact = XPathFactory.newInstance();
|
||||
XPath xpath = xpathFact.newXPath();
|
||||
Invoice zpp = null;
|
||||
XPathExpression xpr = xpath.compile("//*[local-name()=\"SellerTradeParty\"]");
|
||||
NodeList SellerNodes = (NodeList) xpr.evaluate(getDocument(), XPathConstants.NODESET);
|
||||
|
||||
@@ -184,7 +178,7 @@ public class ZUGFeRDInvoiceImporter extends ZUGFeRDImporter {
|
||||
}
|
||||
}
|
||||
|
||||
zpp = new Invoice().setDueDate(dueDate).setDeliveryDate(deliveryDate).setIssueDate(issueDate)
|
||||
zpp.setDueDate(dueDate).setDeliveryDate(deliveryDate).setIssueDate(issueDate)
|
||||
.setSender(new TradeParty(SellerNodes)).setRecipient(new TradeParty(BuyerNodes)).setNumber(number);
|
||||
//.addItem(new Item(new Product("Testprodukt","","C62",BigDecimal.ZERO),amount,new BigDecimal(1.0)))
|
||||
zpp.setOwnOrganisationName(extractString("//*[local-name()=\"SellerTradeParty\"]/*[local-name()=\"Name\"]"));
|
||||
@@ -454,6 +448,18 @@ public class ZUGFeRDInvoiceImporter extends ZUGFeRDImporter {
|
||||
|
||||
}
|
||||
|
||||
/***
|
||||
* This will parse a XML into a invoice object
|
||||
*
|
||||
* @return the parsed invoice object
|
||||
*/
|
||||
public Invoice extractInvoice() throws XPathExpressionException, ParseException {
|
||||
Invoice i=new Invoice();
|
||||
return extractInto(i);
|
||||
|
||||
|
||||
}
|
||||
|
||||
public void doRecalculateItemPricesFromLineTotals() {
|
||||
recalcPrice = true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user