From d5040c8770404c66fcb10efeeae7cabf50fbc1ea Mon Sep 17 00:00:00 2001 From: snehal-gothe Date: Fri, 9 Sep 2022 15:26:28 +0530 Subject: [PATCH] handling scenario 7 --- .../consumer/MgramsevaAdapterDemandConsumer.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/municipal-services/mgramseva-ifix-adapter/src/main/java/org/egov/mgramsevaifixadaptor/consumer/MgramsevaAdapterDemandConsumer.java b/municipal-services/mgramseva-ifix-adapter/src/main/java/org/egov/mgramsevaifixadaptor/consumer/MgramsevaAdapterDemandConsumer.java index faed856b2..66f370968 100644 --- a/municipal-services/mgramseva-ifix-adapter/src/main/java/org/egov/mgramsevaifixadaptor/consumer/MgramsevaAdapterDemandConsumer.java +++ b/municipal-services/mgramseva-ifix-adapter/src/main/java/org/egov/mgramsevaifixadaptor/consumer/MgramsevaAdapterDemandConsumer.java @@ -88,7 +88,10 @@ public void listenUpdate(final HashMap 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); @@ -100,9 +103,6 @@ public void listenUpdate(final HashMap record, @Header(KafkaHead } demand.getDemandDetails().get(0).setTaxAmount(totalAmount); } - else { - demandListToRemove.add(demand); - } } }