use calculated price after allowances/charges and do focus on document level allowances/charges for document level allowance/charge processing only
This commit is contained in:
@@ -55,7 +55,7 @@ public class LineCalculator {
|
|||||||
BigDecimal basisQuantity = currentItem.getBasisQuantity().compareTo(BigDecimal.ZERO) == 0
|
BigDecimal basisQuantity = currentItem.getBasisQuantity().compareTo(BigDecimal.ZERO) == 0
|
||||||
? BigDecimal.ONE.setScale(4)
|
? BigDecimal.ONE.setScale(4)
|
||||||
: currentItem.getBasisQuantity();
|
: currentItem.getBasisQuantity();
|
||||||
itemTotalNetAmount = quantity.multiply(getPrice()).divide(basisQuantity, 18, RoundingMode.HALF_UP)
|
itemTotalNetAmount = quantity.multiply(price).divide(basisQuantity, 18, RoundingMode.HALF_UP)
|
||||||
.subtract(allowanceItemTotal).setScale(2, RoundingMode.HALF_UP);
|
.subtract(allowanceItemTotal).setScale(2, RoundingMode.HALF_UP);
|
||||||
itemTotalVATAmount = itemTotalNetAmount.multiply(multiplicator);
|
itemTotalVATAmount = itemTotalNetAmount.multiply(multiplicator);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -897,7 +897,7 @@ public class ZUGFeRDInvoiceImporter {
|
|||||||
// be read,
|
// be read,
|
||||||
// so the invoice remains arithmetically correct
|
// so the invoice remains arithmetically correct
|
||||||
// -> parse document level charges+allowances
|
// -> parse document level charges+allowances
|
||||||
xpr = xpath.compile("//*[local-name()=\"SpecifiedTradeAllowanceCharge\"]|//*[local-name()=\"AllowanceCharge\"]");//CII and UBL
|
xpr = xpath.compile("//*[local-name()=\"ApplicableHeaderTradeSettlement\"]/*[local-name()=\"SpecifiedTradeAllowanceCharge\"]|/*[local-name()=\"AllowanceCharge\"]");//CII and UBL
|
||||||
NodeList chargeNodes = (NodeList) xpr.evaluate(getDocument(), XPathConstants.NODESET);
|
NodeList chargeNodes = (NodeList) xpr.evaluate(getDocument(), XPathConstants.NODESET);
|
||||||
for (int i = 0; i < chargeNodes.getLength(); i++) {
|
for (int i = 0; i < chargeNodes.getLength(); i++) {
|
||||||
NodeList chargeNodeChilds = chargeNodes.item(i).getChildNodes();
|
NodeList chargeNodeChilds = chargeNodes.item(i).getChildNodes();
|
||||||
|
|||||||
Reference in New Issue
Block a user