Merge pull request #864 from danielluckas-rse/fix-npe-linecalculator
#863 Fixes NPE in LineCalculator
This commit is contained in:
@@ -74,14 +74,16 @@ public class LineCalculator {
|
|||||||
// delta=delta.divide(currentItem.getQuantity(), 18, RoundingMode.HALF_UP);
|
// delta=delta.divide(currentItem.getQuantity(), 18, RoundingMode.HALF_UP);
|
||||||
|
|
||||||
BigDecimal delta=BigDecimal.ZERO;
|
BigDecimal delta=BigDecimal.ZERO;
|
||||||
if (currentItem.getProduct().getAllowances()!=null) {
|
if(currentItem.getProduct()!=null){
|
||||||
for (IZUGFeRDAllowanceCharge ccaf:currentItem.getProduct().getAllowances()) {
|
if (currentItem.getProduct().getAllowances()!=null) {
|
||||||
delta=delta.subtract(ccaf.getTotalAmount(currentItem));
|
for (IZUGFeRDAllowanceCharge ccaf:currentItem.getProduct().getAllowances()) {
|
||||||
|
delta=delta.subtract(ccaf.getTotalAmount(currentItem));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
if (currentItem.getProduct().getCharges()!=null) {
|
||||||
if (currentItem.getProduct().getCharges()!=null) {
|
for (IZUGFeRDAllowanceCharge ccaf : currentItem.getProduct().getCharges()) {
|
||||||
for (IZUGFeRDAllowanceCharge ccaf : currentItem.getProduct().getCharges()) {
|
delta = delta.subtract(ccaf.getTotalAmount(currentItem));
|
||||||
delta = delta.subtract(ccaf.getTotalAmount(currentItem));
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user