Skip to content

Commit

Permalink
handling scenario 7
Browse files Browse the repository at this point in the history
  • Loading branch information
snehal-gothe committed Sep 9, 2022
1 parent 02811fc commit d5040c8
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,10 @@ public void listenUpdate(final HashMap<String, Object> record, @Header(KafkaHead
for(DemandDetail dd : demandDetails) {
totalAmount = totalAmount.add(dd.getTaxAmount()).subtract(dd.getCollectionAmount());
}
if(totalAmount.compareTo(BigDecimal.ZERO) > 0){
if(totalAmount.compareTo(BigDecimal.ZERO) == 0){
demandListToRemove.add(demand);
}
else {
totalAmount = totalAmount.negate();
log.info("totalAmount: "+totalAmount);

Expand All @@ -100,9 +103,6 @@ public void listenUpdate(final HashMap<String, Object> record, @Header(KafkaHead
}
demand.getDemandDetails().get(0).setTaxAmount(totalAmount);
}
else {
demandListToRemove.add(demand);
}

}
}
Expand Down

0 comments on commit d5040c8

Please sign in to comment.