diff --git a/business-services/billing-service/src/main/java/org/egov/demand/service/DemandService.java b/business-services/billing-service/src/main/java/org/egov/demand/service/DemandService.java index 45bcb2899..70c80ee3e 100644 --- a/business-services/billing-service/src/main/java/org/egov/demand/service/DemandService.java +++ b/business-services/billing-service/src/main/java/org/egov/demand/service/DemandService.java @@ -530,7 +530,6 @@ public DemandHistory getDemandHistory(@Valid DemandCriteria demandCriteria, Requ List demandList = getDemands(demandCriteria, requestInfo); demands = demandRepository.getDemandHistory(demandCriteria); List demList = demandList.stream().filter(i->(!i.getIsPaymentCompleted().booleanValue())).collect(Collectors.toList()); - List paymentCompletedDemandList = demandList.stream().filter(i->(i.getIsPaymentCompleted().booleanValue())).collect(Collectors.toList()); BigDecimal advanceAdjustedAmount = BigDecimal.ZERO; BigDecimal waterCharge = demList.get(demList.size() - 1).getDemandDetails().get(0).getTaxAmount(); @@ -541,7 +540,7 @@ public DemandHistory getDemandHistory(@Valid DemandCriteria demandCriteria, Requ } } } - if(paymentCompletedDemandList.size()>0) { + if(demList.size() == 1) { waterCharge = demList.get(demList.size() - 1).getDemandDetails().get(0).getTaxAmount(). subtract(demList.get(demList.size() - 1).getDemandDetails().get(0).getCollectionAmount()); }