add a usnit test for https://github.com/ZUGFeRD/mustangproject/pull/292
This commit is contained in:
@@ -44,9 +44,6 @@ public class Invoice implements IExportableTransaction {
|
||||
|
||||
protected String documentName = null, documentCode = null, number = null, ownOrganisationFullPlaintextInfo = null, referenceNumber = null, shipToOrganisationID = null, shipToOrganisationName = null, shipToStreet = null, shipToZIP = null, shipToLocation = null, shipToCountry = null, buyerOrderReferencedDocumentID = null, invoiceReferencedDocumentID = null, buyerOrderReferencedDocumentIssueDateTime = null, ownForeignOrganisationID = null, ownOrganisationName = null, currency = null, paymentTermDescription = null;
|
||||
protected Date issueDate = null, dueDate = null, deliveryDate = null;
|
||||
protected BigDecimal totalPrepaidAmount = null;
|
||||
protected BigDecimal grandTotalAmount = null;
|
||||
protected BigDecimal duePayableAmount = null;
|
||||
protected TradeParty sender = null, recipient = null, deliveryAddress = null;
|
||||
@JsonDeserialize(contentAs=Item.class)
|
||||
protected ArrayList<IZUGFeRDExportableItem> ZFItems = null;
|
||||
@@ -431,34 +428,6 @@ public class Invoice implements IExportableTransaction {
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BigDecimal getTotalPrepaidAmount() {
|
||||
return totalPrepaidAmount;
|
||||
}
|
||||
|
||||
public Invoice setTotalPrepaidAmount(BigDecimal totalPrepaidAmount) {
|
||||
this.totalPrepaidAmount = totalPrepaidAmount;
|
||||
return this;
|
||||
}
|
||||
|
||||
public BigDecimal getGrandTotalAmount() {
|
||||
return grandTotalAmount;
|
||||
}
|
||||
|
||||
public Invoice setGrandTotalAmount(BigDecimal grandTotalAmount) {
|
||||
this.grandTotalAmount = grandTotalAmount;
|
||||
return this;
|
||||
}
|
||||
|
||||
public BigDecimal getDuePayableAmount() {
|
||||
return duePayableAmount;
|
||||
}
|
||||
|
||||
public Invoice setDuePayableAmount(BigDecimal duePayableAmount) {
|
||||
this.duePayableAmount = duePayableAmount;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IZUGFeRDExportableTradeParty getSender() {
|
||||
return sender;
|
||||
|
||||
@@ -73,7 +73,7 @@ public class ZUGFeRDInvoiceImporter extends ZUGFeRDImporter {
|
||||
|
||||
xpr = xpath.compile("//*[local-name()=\"BuyerTradeParty\"]");
|
||||
NodeList BuyerNodes = (NodeList) xpr.evaluate(getDocument(), XPathConstants.NODESET);
|
||||
xpr = xpath.compile("//*[local-name()=\"ExchangedDocument\"]");
|
||||
xpr = xpath.compile("//*[local-name()=\"ExchangedDocument\"]|//*[local-name()=\"HeaderExchangedDocument\"]");
|
||||
NodeList ExchangedDocumentNodes = (NodeList) xpr.evaluate(getDocument(), XPathConstants.NODESET);
|
||||
|
||||
xpr = xpath.compile("//*[local-name()=\"GrandTotalAmount\"]");
|
||||
@@ -147,7 +147,7 @@ public class ZUGFeRDInvoiceImporter extends ZUGFeRDImporter {
|
||||
}
|
||||
}
|
||||
|
||||
xpr = xpath.compile("//*[local-name()=\"ApplicableHeaderTradeSettlement\"]");
|
||||
xpr = xpath.compile("//*[local-name()=\"ApplicableHeaderTradeSettlement\"]|//*[local-name()=\"ApplicableSupplyChainTradeSettlement\"]");
|
||||
NodeList headerTradeSettlementNodes = (NodeList) xpr.evaluate(getDocument(), XPathConstants.NODESET);
|
||||
|
||||
for (int i = 0; i < headerTradeSettlementNodes.getLength(); i++) {
|
||||
@@ -419,9 +419,6 @@ public class ZUGFeRDInvoiceImporter extends ZUGFeRDImporter {
|
||||
|
||||
TransactionCalculator tc = new TransactionCalculator(zpp);
|
||||
String expectedStringTotalGross = tc.getGrandTotal().toPlainString();
|
||||
zpp.setGrandTotalAmount(tc.getGrandTotal());
|
||||
zpp.setTotalPrepaidAmount(tc.getTotalPrepaid());
|
||||
zpp.setDuePayableAmount(tc.getGrandTotal().add(tc.getTotalPrepaid().negate()));
|
||||
EStandard whichType;
|
||||
try {
|
||||
whichType = getStandard();
|
||||
|
||||
Reference in New Issue
Block a user