From 3ca65185f665a3ff6d35646762b04e3d107d5314 Mon Sep 17 00:00:00 2001 From: Saloni-eGov Date: Thu, 7 Mar 2024 11:51:21 +0530 Subject: [PATCH] PFM-5564 --- .../egov/wscalculation/service/DemandService.java | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/municipal-services/ws-calculator/src/main/java/org/egov/wscalculation/service/DemandService.java b/municipal-services/ws-calculator/src/main/java/org/egov/wscalculation/service/DemandService.java index e4a03511b..641d01f87 100644 --- a/municipal-services/ws-calculator/src/main/java/org/egov/wscalculation/service/DemandService.java +++ b/municipal-services/ws-calculator/src/main/java/org/egov/wscalculation/service/DemandService.java @@ -378,10 +378,21 @@ private void sendDownloadBillSMSNotification(RequestInfo requestInfo, String ten messageString = messageString.replace("{ownername}", owner.getName()); messageString = messageString.replace("{Period}", billCycle); messageString = messageString.replace("{consumerno}", consumerCode); - messageString = messageString.replace("{billamount}", totalamount.toString()); +// messageString = messageString.replace("{billamount}", totalamount.toString()); + BigDecimal demandAmount= demandDetails.stream() + .map(DemandDetail::getTaxAmount).reduce(BigDecimal.ZERO, BigDecimal::add); + BigDecimal arrears=totalamount.subtract(demandAmount); + if(arrears.compareTo(BigDecimal.ZERO)>0) + { + messageString = messageString.replace("{billamount}", totalamount.toString()+"(includes Rs."+ arrears.toString()+ " arrears)"); + } + else + { + messageString = messageString.replace("{billamount}", totalamount.toString()); + } messageString = messageString.replace("{BILL_LINK}", getShortenedUrl(actionLink)); - // System.out.println("Demand genaration Message get bill::" + messageString); + System.out.println("Demand genaration Message get bill::" + messageString); SMSRequest sms = SMSRequest.builder().mobileNumber(owner.getMobileNumber()).message(messageString).tenantid(tenantId) .category(Category.TRANSACTION).build();