fix item calc in case allowance and charges are null
This commit is contained in:
@@ -87,12 +87,16 @@ public class ZUGFeRDExporter {
|
|||||||
BigDecimal totalAllowance = BigDecimal.ZERO;
|
BigDecimal totalAllowance = BigDecimal.ZERO;
|
||||||
BigDecimal totalCharge = BigDecimal.ZERO;
|
BigDecimal totalCharge = BigDecimal.ZERO;
|
||||||
|
|
||||||
for(IZUGFeRDAllowanceCharge itemAllowance : currentItem.getItemAllowances()){
|
if(currentItem.getItemAllowances() != null){
|
||||||
totalAllowance = itemAllowance.getTotalAmount().add(totalAllowance);
|
for(IZUGFeRDAllowanceCharge itemAllowance : currentItem.getItemAllowances()){
|
||||||
|
totalAllowance = itemAllowance.getTotalAmount().add(totalAllowance);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for(IZUGFeRDAllowanceCharge itemCharge : currentItem.getItemCharges()){
|
if(currentItem.getItemCharges() != null){
|
||||||
totalCharge = itemCharge.getTotalAmount().add(totalCharge);
|
for(IZUGFeRDAllowanceCharge itemCharge : currentItem.getItemCharges()){
|
||||||
|
totalCharge = itemCharge.getTotalAmount().add(totalCharge);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
BigDecimal multiplicator = currentItem.getProduct().getVATPercent().divide(new BigDecimal(100), 4, BigDecimal.ROUND_HALF_UP).add(BigDecimal.ONE);
|
BigDecimal multiplicator = currentItem.getProduct().getVATPercent().divide(new BigDecimal(100), 4, BigDecimal.ROUND_HALF_UP).add(BigDecimal.ONE);
|
||||||
|
|||||||
Reference in New Issue
Block a user