From 4a11e7f51f7b53b68ad5d1da1c8e18ca42dce1c1 Mon Sep 17 00:00:00 2001 From: Saloni-eGov Date: Tue, 6 Aug 2024 14:50:26 +0530 Subject: [PATCH 01/10] ISTE-229 --- .../rowmapper/LedgerReportRowMapper.java | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/municipal-services/ws-services/src/main/java/org/egov/waterconnection/repository/rowmapper/LedgerReportRowMapper.java b/municipal-services/ws-services/src/main/java/org/egov/waterconnection/repository/rowmapper/LedgerReportRowMapper.java index b3e49e72d..9696d7008 100644 --- a/municipal-services/ws-services/src/main/java/org/egov/waterconnection/repository/rowmapper/LedgerReportRowMapper.java +++ b/municipal-services/ws-services/src/main/java/org/egov/waterconnection/repository/rowmapper/LedgerReportRowMapper.java @@ -76,10 +76,15 @@ public List> extractData(ResultSet resultSet) throws SQLExce while (!currentMonth.isAfter(endMonth)) { String monthAndYear = currentMonth.format(DateTimeFormatter.ofPattern("MMMM yyyy")); + LocalDate startOfMonth = currentMonth.atDay(1); + Long epochTime = startOfMonth.atStartOfDay(ZoneId.systemDefault()).toInstant().toEpochMilli(); LedgerReport ledgerReport = new LedgerReport(); ledgerReport.setDemand(new DemandLedgerReport()); ledgerReport.getDemand().setMonthAndYear(monthAndYear); ledgerReport.getDemand().setConnectionNo(consumerCode); + BigDecimal taxAmountResult = getMonthlyTaxAmount(epochTime, consumerCode); + BigDecimal totalAmountPaidResult = getMonthlyTotalAmountPaid(epochTime, consumerCode); + ledgerReport.getDemand().setArrears(taxAmountResult.subtract(totalAmountPaidResult)); ledgerReports.put(monthAndYear, ledgerReport); currentMonth = currentMonth.plusMonths(1); } @@ -102,10 +107,11 @@ public List> extractData(ResultSet resultSet) throws SQLExce ledgerReport.setPayment(new ArrayList<>()); } - if (code.equals("10102")) { - ledgerReport.getDemand().setArrears(taxamount != null ? taxamount : BigDecimal.ZERO); - ledgerReport.getDemand().setMonthAndYear(monthAndYear); - } else if (code.equals("WS_TIME_PENALTY") || code.equals("10201")) { +// if (code.equals("10102")) { +// ledgerReport.getDemand().setArrears(taxamount != null ? taxamount : BigDecimal.ZERO); +// ledgerReport.getDemand().setMonthAndYear(monthAndYear); +// } else + if (code.equals("WS_TIME_PENALTY") || code.equals("10201")) { ledgerReport.getDemand().setPenalty(taxamount != null ? taxamount : BigDecimal.ZERO); BigDecimal amount = ledgerReport.getDemand().getTaxamount() != null ? ledgerReport.getDemand().getTaxamount() : BigDecimal.ZERO; ledgerReport.getDemand().setTotalForCurrentMonth((taxamount != null ? taxamount : BigDecimal.ZERO).add(amount)); @@ -119,11 +125,6 @@ public List> extractData(ResultSet resultSet) throws SQLExce long penaltyAppliedDateMillis = demandGenerationDateLocal.plus(11, ChronoUnit.DAYS).atStartOfDay(ZoneId.systemDefault()).toInstant().toEpochMilli(); ledgerReport.getDemand().setDueDate(dueDateMillis); ledgerReport.getDemand().setPenaltyAppliedDate(penaltyAppliedDateMillis); - Long startDate = resultSet.getLong("startdate"); - String connectionno = resultSet.getString("connectionno"); - BigDecimal taxAmountResult = getMonthlyTaxAmount(startDate, connectionno); - BigDecimal totalAmountPaidResult = getMonthlyTotalAmountPaid(startDate, connectionno); - ledgerReport.getDemand().setArrears(taxAmountResult.subtract(totalAmountPaidResult)); ledgerReport.getDemand().setTotal_due_amount(ledgerReport.getDemand().getTotalForCurrentMonth().add(ledgerReport.getDemand().getArrears())); } ledgerReport.getDemand().setConnectionNo(resultSet.getString("connectionno")); From c036ce6f341e0529dc14f1d381b6da693da71295 Mon Sep 17 00:00:00 2001 From: Saloni-eGov Date: Fri, 9 Aug 2024 11:46:39 +0530 Subject: [PATCH 02/10] ISTE-229 --- .../repository/rowmapper/LedgerReportRowMapper.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/municipal-services/ws-services/src/main/java/org/egov/waterconnection/repository/rowmapper/LedgerReportRowMapper.java b/municipal-services/ws-services/src/main/java/org/egov/waterconnection/repository/rowmapper/LedgerReportRowMapper.java index 9696d7008..60da239e1 100644 --- a/municipal-services/ws-services/src/main/java/org/egov/waterconnection/repository/rowmapper/LedgerReportRowMapper.java +++ b/municipal-services/ws-services/src/main/java/org/egov/waterconnection/repository/rowmapper/LedgerReportRowMapper.java @@ -85,6 +85,7 @@ public List> extractData(ResultSet resultSet) throws SQLExce BigDecimal taxAmountResult = getMonthlyTaxAmount(epochTime, consumerCode); BigDecimal totalAmountPaidResult = getMonthlyTotalAmountPaid(epochTime, consumerCode); ledgerReport.getDemand().setArrears(taxAmountResult.subtract(totalAmountPaidResult)); + log.info("Arrers are "+ledgerReport.getDemand().getArrears()+" and monthandYear"+ ledgerReport.getDemand().getMonthAndYear()); ledgerReports.put(monthAndYear, ledgerReport); currentMonth = currentMonth.plusMonths(1); } @@ -115,7 +116,6 @@ public List> extractData(ResultSet resultSet) throws SQLExce ledgerReport.getDemand().setPenalty(taxamount != null ? taxamount : BigDecimal.ZERO); BigDecimal amount = ledgerReport.getDemand().getTaxamount() != null ? ledgerReport.getDemand().getTaxamount() : BigDecimal.ZERO; ledgerReport.getDemand().setTotalForCurrentMonth((taxamount != null ? taxamount : BigDecimal.ZERO).add(amount)); - ledgerReport.getDemand().setTotal_due_amount(ledgerReport.getDemand().getTotalForCurrentMonth().add(ledgerReport.getDemand().getArrears() != null ? ledgerReport.getDemand().getArrears() : BigDecimal.ZERO)); } else if (code.equals("10101")) { ledgerReport.getDemand().setMonthAndYear(monthAndYear); ledgerReport.getDemand().setDemandGenerationDate(demandGenerationDateLong); @@ -125,8 +125,9 @@ public List> extractData(ResultSet resultSet) throws SQLExce long penaltyAppliedDateMillis = demandGenerationDateLocal.plus(11, ChronoUnit.DAYS).atStartOfDay(ZoneId.systemDefault()).toInstant().toEpochMilli(); ledgerReport.getDemand().setDueDate(dueDateMillis); ledgerReport.getDemand().setPenaltyAppliedDate(penaltyAppliedDateMillis); - ledgerReport.getDemand().setTotal_due_amount(ledgerReport.getDemand().getTotalForCurrentMonth().add(ledgerReport.getDemand().getArrears())); +// ledgerReport.getDemand().setTotal_due_amount(ledgerReport.getDemand().getTotalForCurrentMonth().add(ledgerReport.getDemand().getArrears())); } + ledgerReport.getDemand().setTotal_due_amount(ledgerReport.getDemand().getTotalForCurrentMonth().add(ledgerReport.getDemand().getArrears() != null ? ledgerReport.getDemand().getArrears() : BigDecimal.ZERO)); ledgerReport.getDemand().setConnectionNo(resultSet.getString("connectionno")); ledgerReport.getDemand().setOldConnectionNo(resultSet.getString("oldconnectionno")); ledgerReport.getDemand().setUserId(resultSet.getString("uuid")); From 0695131dd5458642f24cbed6db9013a7093f285b Mon Sep 17 00:00:00 2001 From: Saloni-eGov Date: Fri, 9 Aug 2024 12:53:29 +0530 Subject: [PATCH 03/10] ISTE-229 --- .../rowmapper/LedgerReportRowMapper.java | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/municipal-services/ws-services/src/main/java/org/egov/waterconnection/repository/rowmapper/LedgerReportRowMapper.java b/municipal-services/ws-services/src/main/java/org/egov/waterconnection/repository/rowmapper/LedgerReportRowMapper.java index 60da239e1..498ae96ec 100644 --- a/municipal-services/ws-services/src/main/java/org/egov/waterconnection/repository/rowmapper/LedgerReportRowMapper.java +++ b/municipal-services/ws-services/src/main/java/org/egov/waterconnection/repository/rowmapper/LedgerReportRowMapper.java @@ -112,14 +112,24 @@ public List> extractData(ResultSet resultSet) throws SQLExce // ledgerReport.getDemand().setArrears(taxamount != null ? taxamount : BigDecimal.ZERO); // ledgerReport.getDemand().setMonthAndYear(monthAndYear); // } else - if (code.equals("WS_TIME_PENALTY") || code.equals("10201")) { + BigDecimal arrers_Penalty=BigDecimal.ZERO; + if(code.equalsIgnoreCase("10201")) + { + arrers_Penalty=taxamount; + } + BigDecimal ws_round_off=BigDecimal.ZERO; + if(code.equalsIgnoreCase("WS_Round_Off")) + { + ws_round_off=taxamount; + } + if (code.equalsIgnoreCase("WS_TIME_PENALTY")) { ledgerReport.getDemand().setPenalty(taxamount != null ? taxamount : BigDecimal.ZERO); BigDecimal amount = ledgerReport.getDemand().getTaxamount() != null ? ledgerReport.getDemand().getTaxamount() : BigDecimal.ZERO; ledgerReport.getDemand().setTotalForCurrentMonth((taxamount != null ? taxamount : BigDecimal.ZERO).add(amount)); - } else if (code.equals("10101")) { + } else if (code.equalsIgnoreCase("10101")) { ledgerReport.getDemand().setMonthAndYear(monthAndYear); ledgerReport.getDemand().setDemandGenerationDate(demandGenerationDateLong); - ledgerReport.getDemand().setTaxamount(taxamount); + ledgerReport.getDemand().setTaxamount(taxamount.add(ws_round_off)); ledgerReport.getDemand().setTotalForCurrentMonth(ledgerReport.getDemand().getTaxamount().add(ledgerReport.getDemand().getPenalty() != null ? ledgerReport.getDemand().getPenalty() : BigDecimal.ZERO)); long dueDateMillis = demandGenerationDateLocal.plus(10, ChronoUnit.DAYS).atStartOfDay(ZoneId.systemDefault()).toInstant().toEpochMilli(); long penaltyAppliedDateMillis = demandGenerationDateLocal.plus(11, ChronoUnit.DAYS).atStartOfDay(ZoneId.systemDefault()).toInstant().toEpochMilli(); From 00216590cc5ecfd9d2abb7711fe4ab56aeb971f0 Mon Sep 17 00:00:00 2001 From: Saloni-eGov Date: Fri, 9 Aug 2024 14:17:02 +0530 Subject: [PATCH 04/10] ISTE-229 --- .../repository/builder/FuzzySearchQueryBuilder.java | 1 + 1 file changed, 1 insertion(+) diff --git a/municipal-services/ws-services/src/main/java/org/egov/waterconnection/repository/builder/FuzzySearchQueryBuilder.java b/municipal-services/ws-services/src/main/java/org/egov/waterconnection/repository/builder/FuzzySearchQueryBuilder.java index db159acd0..3d60fb1f4 100644 --- a/municipal-services/ws-services/src/main/java/org/egov/waterconnection/repository/builder/FuzzySearchQueryBuilder.java +++ b/municipal-services/ws-services/src/main/java/org/egov/waterconnection/repository/builder/FuzzySearchQueryBuilder.java @@ -110,6 +110,7 @@ public String getFuzzySearchQuery(SearchCriteria criteria, List ids){ } finalQuery = mapper.writeValueAsString(node); + log.info("final query is"+finalQuery); } catch (Exception e){ From 73cc5d07dac713cfb111c916006db0c900c599af Mon Sep 17 00:00:00 2001 From: Saloni-eGov Date: Fri, 9 Aug 2024 15:13:09 +0530 Subject: [PATCH 05/10] ISTE-229 --- .../repository/rowmapper/LedgerReportRowMapper.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/municipal-services/ws-services/src/main/java/org/egov/waterconnection/repository/rowmapper/LedgerReportRowMapper.java b/municipal-services/ws-services/src/main/java/org/egov/waterconnection/repository/rowmapper/LedgerReportRowMapper.java index 498ae96ec..636f09ec1 100644 --- a/municipal-services/ws-services/src/main/java/org/egov/waterconnection/repository/rowmapper/LedgerReportRowMapper.java +++ b/municipal-services/ws-services/src/main/java/org/egov/waterconnection/repository/rowmapper/LedgerReportRowMapper.java @@ -89,7 +89,6 @@ public List> extractData(ResultSet resultSet) throws SQLExce ledgerReports.put(monthAndYear, ledgerReport); currentMonth = currentMonth.plusMonths(1); } - while (resultSet.next()) { Long dateLong = resultSet.getLong("enddate"); LocalDate date = Instant.ofEpochMilli(dateLong).atZone(ZoneId.systemDefault()).toLocalDate(); @@ -117,10 +116,9 @@ public List> extractData(ResultSet resultSet) throws SQLExce { arrers_Penalty=taxamount; } - BigDecimal ws_round_off=BigDecimal.ZERO; if(code.equalsIgnoreCase("WS_Round_Off")) { - ws_round_off=taxamount; + ledgerReport.getDemand().setTaxamount(ledgerReport.getDemand().getTaxamount().add(taxamount)); } if (code.equalsIgnoreCase("WS_TIME_PENALTY")) { ledgerReport.getDemand().setPenalty(taxamount != null ? taxamount : BigDecimal.ZERO); @@ -129,7 +127,7 @@ public List> extractData(ResultSet resultSet) throws SQLExce } else if (code.equalsIgnoreCase("10101")) { ledgerReport.getDemand().setMonthAndYear(monthAndYear); ledgerReport.getDemand().setDemandGenerationDate(demandGenerationDateLong); - ledgerReport.getDemand().setTaxamount(taxamount.add(ws_round_off)); + ledgerReport.getDemand().setTaxamount(ledgerReport.getDemand().getTaxamount().add(taxamount)); ledgerReport.getDemand().setTotalForCurrentMonth(ledgerReport.getDemand().getTaxamount().add(ledgerReport.getDemand().getPenalty() != null ? ledgerReport.getDemand().getPenalty() : BigDecimal.ZERO)); long dueDateMillis = demandGenerationDateLocal.plus(10, ChronoUnit.DAYS).atStartOfDay(ZoneId.systemDefault()).toInstant().toEpochMilli(); long penaltyAppliedDateMillis = demandGenerationDateLocal.plus(11, ChronoUnit.DAYS).atStartOfDay(ZoneId.systemDefault()).toInstant().toEpochMilli(); From cd25f8ec545ebebdb9bf30b3a3e99d860e536dbe Mon Sep 17 00:00:00 2001 From: Saloni-eGov Date: Fri, 9 Aug 2024 16:07:45 +0530 Subject: [PATCH 06/10] ISTE-229 --- .../repository/builder/WsQueryBuilder.java | 2 +- .../waterconnection/web/models/DemandLedgerReport.java | 8 -------- 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/municipal-services/ws-services/src/main/java/org/egov/waterconnection/repository/builder/WsQueryBuilder.java b/municipal-services/ws-services/src/main/java/org/egov/waterconnection/repository/builder/WsQueryBuilder.java index acf84c687..3127f7d85 100644 --- a/municipal-services/ws-services/src/main/java/org/egov/waterconnection/repository/builder/WsQueryBuilder.java +++ b/municipal-services/ws-services/src/main/java/org/egov/waterconnection/repository/builder/WsQueryBuilder.java @@ -207,7 +207,7 @@ public class WsQueryBuilder { "ORDER BY startdate"; public static final String TAX_AMOUNT_QUERY="SELECT SUM(taxamount) FROM egbs_demanddetail_v1 WHERE " + - "demandid IN (SELECT id FROM egbs_demand_v1 WHERE consumercode = ? AND taxperiodfrom < ? AND status='ACTIVE');"; + "demandid IN (SELECT id FROM egbs_demand_v1 WHERE consumercode = ? AND taxperiodto < ? AND status='ACTIVE');"; public static final String TOTAL_AMOUNT_PAID_QUERY="SELECT SUM(totalamountpaid) FROM egcl_payment WHERE " + "id IN (SELECT paymentid FROM egcl_paymentdetail WHERE billid IN " + diff --git a/municipal-services/ws-services/src/main/java/org/egov/waterconnection/web/models/DemandLedgerReport.java b/municipal-services/ws-services/src/main/java/org/egov/waterconnection/web/models/DemandLedgerReport.java index c7cad175e..b84da9289 100644 --- a/municipal-services/ws-services/src/main/java/org/egov/waterconnection/web/models/DemandLedgerReport.java +++ b/municipal-services/ws-services/src/main/java/org/egov/waterconnection/web/models/DemandLedgerReport.java @@ -56,12 +56,4 @@ public class DemandLedgerReport { @JsonProperty("penaltyAppliedOnDate") private Long penaltyAppliedDate=0L; -// public DemandLedgerReport(String monthAndYear) { -// this.monthAndYear = monthAndYear; -// this.taxamount = BigDecimal.ZERO; -// this.penalty = BigDecimal.ZERO; -// this.totalForCurrentMonth = BigDecimal.ZERO; -// this.arrears = BigDecimal.ZERO; -// this.total_due_amount = BigDecimal.ZERO; -// } } From b57214cccf6ec7c3fcb512c9d77e7c71038d943f Mon Sep 17 00:00:00 2001 From: Saloni-eGov Date: Fri, 9 Aug 2024 16:39:31 +0530 Subject: [PATCH 07/10] ISTE-229 --- .../repository/rowmapper/LedgerReportRowMapper.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/municipal-services/ws-services/src/main/java/org/egov/waterconnection/repository/rowmapper/LedgerReportRowMapper.java b/municipal-services/ws-services/src/main/java/org/egov/waterconnection/repository/rowmapper/LedgerReportRowMapper.java index 636f09ec1..27b57e6cb 100644 --- a/municipal-services/ws-services/src/main/java/org/egov/waterconnection/repository/rowmapper/LedgerReportRowMapper.java +++ b/municipal-services/ws-services/src/main/java/org/egov/waterconnection/repository/rowmapper/LedgerReportRowMapper.java @@ -201,7 +201,7 @@ private void addPaymentToLedger(List> monthlyRecordList) { paymentLedgerReport.setCollectionDate(transactionDateLong); paymentLedgerReport.setReceiptNo(payment.getPaymentDetails().get(0).getReceiptNumber()); paymentLedgerReport.setPaid(payment.getTotalAmountPaid()); - BigDecimal totalDueAmount=ledgerReport.getDemand().getTotal_due_amount(); + BigDecimal totalDueAmount=payment.getTotalDue(); if(totalDueAmount.equals(BigDecimal.ZERO)) { paymentLedgerReport.setBalanceLeft(payment.getTotalDue().subtract(paymentLedgerReport.getPaid())); From 9f9cf752f9e2c1ecba4b0a08da1409b1aea10ebc Mon Sep 17 00:00:00 2001 From: Saloni-eGov Date: Fri, 9 Aug 2024 16:48:12 +0530 Subject: [PATCH 08/10] ISTE-229 --- .../rowmapper/LedgerReportRowMapper.java | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/municipal-services/ws-services/src/main/java/org/egov/waterconnection/repository/rowmapper/LedgerReportRowMapper.java b/municipal-services/ws-services/src/main/java/org/egov/waterconnection/repository/rowmapper/LedgerReportRowMapper.java index 27b57e6cb..35127960f 100644 --- a/municipal-services/ws-services/src/main/java/org/egov/waterconnection/repository/rowmapper/LedgerReportRowMapper.java +++ b/municipal-services/ws-services/src/main/java/org/egov/waterconnection/repository/rowmapper/LedgerReportRowMapper.java @@ -201,15 +201,15 @@ private void addPaymentToLedger(List> monthlyRecordList) { paymentLedgerReport.setCollectionDate(transactionDateLong); paymentLedgerReport.setReceiptNo(payment.getPaymentDetails().get(0).getReceiptNumber()); paymentLedgerReport.setPaid(payment.getTotalAmountPaid()); - BigDecimal totalDueAmount=payment.getTotalDue(); - if(totalDueAmount.equals(BigDecimal.ZERO)) - { +// BigDecimal totalDueAmount=payment.getTotalDue(); +// if(totalDueAmount.equals(BigDecimal.ZERO)) +// { paymentLedgerReport.setBalanceLeft(payment.getTotalDue().subtract(paymentLedgerReport.getPaid())); - } - else - { - paymentLedgerReport.setBalanceLeft(totalDueAmount.subtract(paymentLedgerReport.getPaid())); - } +// } +// else +// { +// paymentLedgerReport.setBalanceLeft(totalDueAmount.subtract(paymentLedgerReport.getPaid())); +// } if (ledgerReport.getPayment() == null) { ledgerReport.setPayment(new ArrayList<>()); } From 587b4764d55e2b2edb474211d3ba23e701666803 Mon Sep 17 00:00:00 2001 From: Saloni-eGov Date: Fri, 9 Aug 2024 17:27:36 +0530 Subject: [PATCH 09/10] ISTE-229 --- .../rowmapper/LedgerReportRowMapper.java | 16 +++++++--------- .../waterconnection/web/models/LedgerReport.java | 7 +++++++ 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/municipal-services/ws-services/src/main/java/org/egov/waterconnection/repository/rowmapper/LedgerReportRowMapper.java b/municipal-services/ws-services/src/main/java/org/egov/waterconnection/repository/rowmapper/LedgerReportRowMapper.java index 35127960f..caceb65cd 100644 --- a/municipal-services/ws-services/src/main/java/org/egov/waterconnection/repository/rowmapper/LedgerReportRowMapper.java +++ b/municipal-services/ws-services/src/main/java/org/egov/waterconnection/repository/rowmapper/LedgerReportRowMapper.java @@ -192,6 +192,8 @@ private void addPaymentToLedger(List> monthlyRecordList) { boolean paymentMatched = false; if(payments!=null) { + BigDecimal totalPaymentInMonth=BigDecimal.ZERO; + BigDecimal totalBalanceLeftInMonth=BigDecimal.ZERO; for (Payment payment : payments) { Long transactionDateLong = payment.getTransactionDate(); LocalDate transactionDate = Instant.ofEpochMilli(transactionDateLong).atZone(ZoneId.systemDefault()).toLocalDate(); @@ -201,15 +203,9 @@ private void addPaymentToLedger(List> monthlyRecordList) { paymentLedgerReport.setCollectionDate(transactionDateLong); paymentLedgerReport.setReceiptNo(payment.getPaymentDetails().get(0).getReceiptNumber()); paymentLedgerReport.setPaid(payment.getTotalAmountPaid()); -// BigDecimal totalDueAmount=payment.getTotalDue(); -// if(totalDueAmount.equals(BigDecimal.ZERO)) -// { - paymentLedgerReport.setBalanceLeft(payment.getTotalDue().subtract(paymentLedgerReport.getPaid())); -// } -// else -// { -// paymentLedgerReport.setBalanceLeft(totalDueAmount.subtract(paymentLedgerReport.getPaid())); -// } + paymentLedgerReport.setBalanceLeft(payment.getTotalDue().subtract(paymentLedgerReport.getPaid())); + totalPaymentInMonth=totalPaymentInMonth.add(payment.getTotalAmountPaid()); + totalBalanceLeftInMonth=totalBalanceLeftInMonth.add(payment.getTotalDue()); if (ledgerReport.getPayment() == null) { ledgerReport.setPayment(new ArrayList<>()); } @@ -217,6 +213,8 @@ private void addPaymentToLedger(List> monthlyRecordList) { paymentMatched = true; } } + ledgerReport.setTotalBalanceLeftInMonth(totalPaymentInMonth); + ledgerReport.setTotalPaymentInMonth(totalPaymentInMonth); } if (!paymentMatched) { PaymentLedgerReport defaultPaymentLedgerReport = new PaymentLedgerReport(); diff --git a/municipal-services/ws-services/src/main/java/org/egov/waterconnection/web/models/LedgerReport.java b/municipal-services/ws-services/src/main/java/org/egov/waterconnection/web/models/LedgerReport.java index 3dac0232e..720e7f2cb 100644 --- a/municipal-services/ws-services/src/main/java/org/egov/waterconnection/web/models/LedgerReport.java +++ b/municipal-services/ws-services/src/main/java/org/egov/waterconnection/web/models/LedgerReport.java @@ -3,6 +3,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import lombok.*; +import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; @@ -17,4 +18,10 @@ public class LedgerReport @JsonProperty("payment") private List payment=new ArrayList<>(); + + @JsonProperty("totalPaymentInMonth") + private BigDecimal totalPaymentInMonth=BigDecimal.ZERO; + + @JsonProperty("totalBalanceLeftInMonth") + private BigDecimal totalBalanceLeftInMonth=BigDecimal.ZERO; } From f1f9d8673d0250c0f952842e8e1b45883535c76d Mon Sep 17 00:00:00 2001 From: Saloni-eGov Date: Fri, 9 Aug 2024 17:40:35 +0530 Subject: [PATCH 10/10] ISTE-229 --- .../repository/rowmapper/LedgerReportRowMapper.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/municipal-services/ws-services/src/main/java/org/egov/waterconnection/repository/rowmapper/LedgerReportRowMapper.java b/municipal-services/ws-services/src/main/java/org/egov/waterconnection/repository/rowmapper/LedgerReportRowMapper.java index caceb65cd..a95dd13b8 100644 --- a/municipal-services/ws-services/src/main/java/org/egov/waterconnection/repository/rowmapper/LedgerReportRowMapper.java +++ b/municipal-services/ws-services/src/main/java/org/egov/waterconnection/repository/rowmapper/LedgerReportRowMapper.java @@ -213,7 +213,7 @@ private void addPaymentToLedger(List> monthlyRecordList) { paymentMatched = true; } } - ledgerReport.setTotalBalanceLeftInMonth(totalPaymentInMonth); + ledgerReport.setTotalBalanceLeftInMonth(totalBalanceLeftInMonth); ledgerReport.setTotalPaymentInMonth(totalPaymentInMonth); } if (!paymentMatched) {