From adee4f3a62ce281f72939e5451a83fe9b1c43f9c Mon Sep 17 00:00:00 2001 From: Hari-egov Date: Wed, 29 May 2024 15:19:25 +0530 Subject: [PATCH 01/17] ISTE-159 - progress - changes --- .../lib/model/connection/property.dart | 7 ++++ .../providers/consumer_details_provider.dart | 2 + .../consumer_details/consumer_details.dart | 27 ++++++++++++ .../walk_through.dart | 28 +++++++------ .../utils/constants/i18_key_constants.dart | 21 +++++++--- .../lib/utils/testing_keys/testing_keys.dart | 42 +++++++++++-------- .../lib/utils/validators/validators.dart | 12 +++++- 7 files changed, 101 insertions(+), 38 deletions(-) diff --git a/frontend/mgramseva/lib/model/connection/property.dart b/frontend/mgramseva/lib/model/connection/property.dart index 234351a4d..867331df1 100644 --- a/frontend/mgramseva/lib/model/connection/property.dart +++ b/frontend/mgramseva/lib/model/connection/property.dart @@ -188,6 +188,8 @@ class Owners { String? fatherOrHusbandName; @JsonKey(name: "name") String? name; + @JsonKey(name: "remarks") + String? remarks; @JsonKey(name: "status") String? status; @JsonKey(name: "gender") @@ -204,6 +206,9 @@ class Owners { @JsonKey(ignore: true) var consumerNameCtrl = TextEditingController(); + @JsonKey(ignore: true) + var consumerRemarksCtrl = TextEditingController(); + @JsonKey(ignore: true) var fatherOrSpouseCtrl = TextEditingController(); @@ -214,6 +219,7 @@ class Owners { setText() { name = consumerNameCtrl.text.trim(); + remarks = consumerRemarksCtrl.text; mobileNumber = phoneNumberCtrl.text; fatherOrHusbandName = fatherOrSpouseCtrl.text.trim(); } @@ -222,6 +228,7 @@ class Owners { consumerNameCtrl.text = name ?? ''; phoneNumberCtrl.text = mobileNumber ?? ''; fatherOrSpouseCtrl.text = fatherOrHusbandName ?? ''; + consumerRemarksCtrl.text = remarks ?? ''; } factory Owners.fromJson(Map json) => _$OwnersFromJson(json); diff --git a/frontend/mgramseva/lib/providers/consumer_details_provider.dart b/frontend/mgramseva/lib/providers/consumer_details_provider.dart index aabae950a..5fce3a807 100644 --- a/frontend/mgramseva/lib/providers/consumer_details_provider.dart +++ b/frontend/mgramseva/lib/providers/consumer_details_provider.dart @@ -1,4 +1,6 @@ import 'dart:async'; +import 'dart:convert'; +import 'dart:developer'; import 'package:flutter/material.dart'; import 'package:mgramseva/model/common/demand.dart'; diff --git a/frontend/mgramseva/lib/screeens/consumer_details/consumer_details.dart b/frontend/mgramseva/lib/screeens/consumer_details/consumer_details.dart index 9575cd86d..637fffee4 100644 --- a/frontend/mgramseva/lib/screeens/consumer_details/consumer_details.dart +++ b/frontend/mgramseva/lib/screeens/consumer_details/consumer_details.dart @@ -638,6 +638,33 @@ class _ConsumerDetailsState extends State { ], ), ), + + // REMARKS + // Show Remarks TextField when check box is clicked + if (consumerProvider.isEdit && + consumerProvider.waterconnection.status == + "Inactive") + Consumer( + builder: (_, consumerProvider, child) => + BuildTextField( + i18.consumer.CONSUMER_REMARKS, + property.owners!.first.consumerRemarksCtrl, + validator: (val) => + Validators.consumerRemarksValidator( + val, 20, i18.consumer.CONSUMER_REMARKS), + isRequired: true, + contextKey: consumerProvider + .consmerWalkthrougList[9].key, + key: Keys.createConsumer.CONSUMER_REMARKS_KEY, + inputFormatter: [ + FilteringTextInputFormatter.allow( + RegExp("[a-zA-Z0-9/\\-]")) + ], + isDisabled: false, + ), + ), + + // REMARKS SizedBox( height: 20, ), diff --git a/frontend/mgramseva/lib/screeens/consumer_details/consumer_details_walk_through/walk_through.dart b/frontend/mgramseva/lib/screeens/consumer_details/consumer_details_walk_through/walk_through.dart index f5ed41bd0..429c35ee2 100644 --- a/frontend/mgramseva/lib/screeens/consumer_details/consumer_details_walk_through/walk_through.dart +++ b/frontend/mgramseva/lib/screeens/consumer_details/consumer_details_walk_through/walk_through.dart @@ -63,7 +63,7 @@ var json = [ (val) => {}, [], true, - itemAsString: (i) =>i.toString(), + itemAsString: (i) => i.toString(), ) }, { @@ -76,7 +76,7 @@ var json = [ (val) => {}, [], true, - itemAsString: (i) =>i.toString(), + itemAsString: (i) => i.toString(), ) }, { @@ -89,22 +89,24 @@ var json = [ (val) => {}, [], true, - itemAsString: (i) =>i.toString(), + itemAsString: (i) => i.toString(), ) }, { - "name": (i18.consumerWalkThroughMsg.CONSUMER_WALKTHROUGH_AMOUNT_TYPE_MESSAGE), - "widget": RadioButtonFieldBuilder( - navigatorKey.currentContext!, - "", - null, - '', - '', - false, - Constants.CONSUMER_PAYMENT_TYPE, - (val)=>{}, + "name": + (i18.consumerWalkThroughMsg.CONSUMER_WALKTHROUGH_AMOUNT_TYPE_MESSAGE), + "widget": RadioButtonFieldBuilder(navigatorKey.currentContext!, "", null, + '', '', false, Constants.CONSUMER_PAYMENT_TYPE, (val) => {}, isEnabled: true), }, + { + "name": (i18.consumerWalkThroughMsg.CONSUMER_REMARKS_MSG), + "widget": BuildTextField( + i18.consumer.CONSUMER_REMARKS, + TextEditingController(), + isRequired: true, + ), + }, ]; class ConsumerWalkThrough { diff --git a/frontend/mgramseva/lib/utils/constants/i18_key_constants.dart b/frontend/mgramseva/lib/utils/constants/i18_key_constants.dart index 6fd9a90e6..85f3cd1e0 100644 --- a/frontend/mgramseva/lib/utils/constants/i18_key_constants.dart +++ b/frontend/mgramseva/lib/utils/constants/i18_key_constants.dart @@ -41,9 +41,12 @@ class Common { String get S_NO => 'S_NO'; String get LAST_BILL_CYCLE_MONTH => 'LAST_BILL_CYCLE_MONTH'; String get CONSUMER_COUNT => 'CONSUMER_COUNT'; - String get LAST_BILL_CYCLE_DEMAND_NOT_GENERATED => 'LAST_BILL_CYCLE_DEMAND_NOT_GENERATED'; - String get LAST_BILL_CYCLE_DEMAND_GENERATED => 'LAST_BILL_CYCLE_DEMAND_GENERATED'; - String get WS_REPORTS_WATER_CONNECTION_COUNT => 'WS_REPORTS_WATER_CONNECTION_COUNT'; + String get LAST_BILL_CYCLE_DEMAND_NOT_GENERATED => + 'LAST_BILL_CYCLE_DEMAND_NOT_GENERATED'; + String get LAST_BILL_CYCLE_DEMAND_GENERATED => + 'LAST_BILL_CYCLE_DEMAND_GENERATED'; + String get WS_REPORTS_WATER_CONNECTION_COUNT => + 'WS_REPORTS_WATER_CONNECTION_COUNT'; String get COLLAPSE => 'COLLAPSE'; String get NAME => 'CORE_COMMON_NAME'; String get CONTINUE_TO_LOGIN => 'CONTINUE_TO_LOGIN'; @@ -129,6 +132,7 @@ class Common { String get CONNECTION_ID => 'CONNECTION_ID'; //Connection ID String get CONSUMER_NAME => 'CONSUMER_NAME'; //Consumer Name + String get CONSUMER_REMARKS => 'CONSUMER_REMARKS'; //Consumer Name String get TOTAL_DUE_AMOUNT => 'TOTAL_DUE_AMOUNT'; //Total Amount Due String get PAYMENT_AMOUNT => 'PAYMENT_AMOUNT'; //Payment Amount String get PAYMENT_METHOD => 'PAYMENT_METHOD'; //Payment Method @@ -279,7 +283,6 @@ class Password { String get NEW_PASSWORD_ENTER => 'NEW_PASSWORD_ENTER'; String get CONFIRM_PASSWORD_ENTER => 'CONFIRM_PASSWORD_ENTER'; String get INVITED_TO_SINGLE_GP => 'INVITED_TO_SINGLE_GP'; - } class Expense { @@ -412,6 +415,8 @@ class CreateConsumer { String get ALL_DEMANDS_REVERSED => 'ALL_DEMANDS_REVERSED'; String get CONSUMER_OLD_CONNECTION_ID_REQUIRED => 'CONSUMER_OLD_CONNECTION_ID_REQUIRED'; + String get CONSUMER_REMARKS_REQUIRED => 'CONSUMER_REMARKS_REQUIRED'; + String get CONSUMER_REMARKS => 'CREATE_CONSUMER_REMARKS'; } class SearchWaterConnection { @@ -476,6 +481,7 @@ class _Validators { String get PENALTY_VALIDATION => 'PENALTY_VALIDATION'; String get ADVANCE_VALIDATION => 'ADVANCE_VALIDATION'; String get OLD_CONNECTION_VALIDATION => 'OLD_CONNECTION_VALIDATION'; + String get REMARKS_VALIDATION => 'OLD_CONNECTION_VALIDATION'; String get STREET_VALIDATION => 'STREET_VALIDATION'; String get HOUSE_NUMBER_VALIDATION => 'HOUSE_NUMBER_VALIDATION'; String get CONSUMER_NAME_VALIDATION => 'CONSUMER_NAME_VALIDATION'; @@ -492,8 +498,10 @@ class DemandGenerate { String get BILLING_YEAR_LABEL => 'GENERATE_DEMAND_BILLING_YEAR_LABEL'; String get BILLING_CYCLE_LABEL => 'GENERATE_DEMAND_BILLING_CYCLE_LABEL'; String get NO_DEMAND_GEN_WITH_RATE_0 => 'NO_DEMAND_GEN_WITH_RATE_0'; - String get NO_SERVICE_PRESENT_WITH_RATE_MORE_THAN_0 => 'NO_SERVICE_PRESENT_WITH_RATE_MORE_THAN_0'; - String get ARE_YOU_SURE_TO_GENERATE_DEMAND_FOR => 'ARE_YOU_SURE_TO_GENERATE_DEMAND_FOR'; + String get NO_SERVICE_PRESENT_WITH_RATE_MORE_THAN_0 => + 'NO_SERVICE_PRESENT_WITH_RATE_MORE_THAN_0'; + String get ARE_YOU_SURE_TO_GENERATE_DEMAND_FOR => + 'ARE_YOU_SURE_TO_GENERATE_DEMAND_FOR'; String get WITH_MINIMUM_CHARGE_OF => 'WITH_MINIMUM_CHARGE_OF'; String get PREV_METER_READING_LABEL => 'GENERATE_DEMAND_PREV_METER_READING_LABEL'; @@ -643,6 +651,7 @@ class _ConsumerWalkThroughMsg { String get CONSUMER_ARREARS_MSG => 'CONSUMER_ARREARS_MSG'; String get CONSUMER_WALKTHROUGH_AMOUNT_TYPE_MESSAGE => 'CONSUMER_WALKTHROUGH_AMOUNT_TYPE_MESSAGE'; + String get CONSUMER_REMARKS_MSG => 'CONSUMER_REMARKS_MSG'; } class _DashBoard { diff --git a/frontend/mgramseva/lib/utils/testing_keys/testing_keys.dart b/frontend/mgramseva/lib/utils/testing_keys/testing_keys.dart index 4da92c398..1d46ec94c 100644 --- a/frontend/mgramseva/lib/utils/testing_keys/testing_keys.dart +++ b/frontend/mgramseva/lib/utils/testing_keys/testing_keys.dart @@ -1,6 +1,6 @@ import 'package:flutter/material.dart'; -class Keys{ +class Keys { static LanguagePageKeys language = const LanguagePageKeys(); static ForgotPasswordKeys forgotPassword = const ForgotPasswordKeys(); static LoginKeys login = const LoginKeys(); @@ -16,19 +16,20 @@ class Keys{ static BillReportKeys billReport = const BillReportKeys(); } -class LanguagePageKeys{ +class LanguagePageKeys { const LanguagePageKeys(); - Key get LANGUAGE_PAGE_CONTINUE_BTN => Key("language selected continue button"); + Key get LANGUAGE_PAGE_CONTINUE_BTN => + Key("language selected continue button"); } -class ForgotPasswordKeys{ +class ForgotPasswordKeys { const ForgotPasswordKeys(); Key get FORGOT_PASSWORD_BUTTON => Key("forgot Password Button"); Key get FORGOT_PASSWORD_MOBILE_NO => Key("forgot Password Mobile"); - Key get FORGOT_PASSWORD_CONTINUE_BTN => Key("forgot Password Continue button"); + Key get FORGOT_PASSWORD_CONTINUE_BTN => + Key("forgot Password Continue button"); } - class LoginKeys { const LoginKeys(); Key get LOGIN_PHONE_NUMBER_KEY => Key("PhoneNum"); @@ -53,7 +54,7 @@ class ChangePasswordKeys { Key get CHANGE_PASSWORD_BTN_KEY => Key("Change Password Button Key"); } -class CreateConsumerKeys{ +class CreateConsumerKeys { const CreateConsumerKeys(); Key get CONSUMER_NAME_KEY => Key("consumerName"); Key get CONSUMER_SPOUSE_PARENT_KEY => Key("spouse parentName"); @@ -64,10 +65,12 @@ class CreateConsumerKeys{ Key get CONSUMER_PROPERTY_KEY => Key("consumerProperty"); Key get CONSUMER_SERVICE_KEY => Key("consumerService"); Key get CONSUMER_LAST_BILLED_CYCLE => Key("consumerLastBilledCycle"); - Key get CONSUMER_PREVIOUS_READING_DATE_KEY => Key("consumerPreviousReadingDatePicker"); + Key get CONSUMER_PREVIOUS_READING_DATE_KEY => + Key("consumerPreviousReadingDatePicker"); Key get CONSUMER_METER_NUMBER_KEY => Key("consumerMeterNumber"); Key get CONSUMER_ARREARS_KEY => Key("consumerArrears"); Key get CREATE_CONSUMER_BTN_KEY => Key("createConsumerBtn"); + Key get CONSUMER_REMARKS_KEY => Key("consumerRemarks"); } class SearchConnectionKeys { @@ -80,20 +83,21 @@ class SearchConnectionKeys { Key get SEARCH_BTN_KEY => Key("Search Connection Btn"); } -class GenerateBulkDemandKeys{ +class GenerateBulkDemandKeys { const GenerateBulkDemandKeys(); Key get BULK_DEMAND_BILLING_YEAR => Key('Bulk Demand billingYear'); Key get BULK_DEMAND_BILLING_CYCLE => Key('Bulk Demand billingCycle'); Key get GENERATE_BILL_BTN => Key('Generate Bill button'); } -class CommonKeys{ +class CommonKeys { const CommonKeys(); Key get LOGOUT_TILE_KEY => Key('Log out Side Bar'); - Key get CONSUMER_PREVIOUS_READING_DATE_KEY => Key("consumerPreviousReadingDatePicker"); + Key get CONSUMER_PREVIOUS_READING_DATE_KEY => + Key("consumerPreviousReadingDatePicker"); Key get PAGINATION_DROPDOWN => Key("drop_down"); - Key get PAGINATION_COUNT=> Key("20"); - Key get SHARE=> Key("Share Whatsapp"); + Key get PAGINATION_COUNT => Key("20"); + Key get SHARE => Key("Share Whatsapp"); } class ExpenseKeys { @@ -121,7 +125,6 @@ class DashboardKeys { Key get DASHBOARD_DATE_PICKER => Key("dashboard_date_picker"); Key get SECOND_TAB => Key("1"); Key get THIRD_TAB => Key("2"); - } class HouseholdKeys { @@ -134,10 +137,13 @@ class BillReportKeys { Key get BILL_REPORT_VIEW_BUTTON => Key("bill_report_view_button"); Key get BILL_REPORT_DOWNLOAD_BUTTON => Key("bill_report_download_button"); Key get COLLECTION_REPORT_VIEW_BUTTON => Key("collection_report_view_button"); - Key get INACTIVE_CONSUMER_REPORT_VIEW_BUTTON => Key("inactive_consumer_report_view_button"); - Key get COLLECTION_REPORT_DOWNLOAD_BUTTON => Key("collection_report_download_button"); + Key get INACTIVE_CONSUMER_REPORT_VIEW_BUTTON => + Key("inactive_consumer_report_view_button"); + Key get COLLECTION_REPORT_DOWNLOAD_BUTTON => + Key("collection_report_download_button"); Key get BILL_REPORT_BILLING_YEAR => Key("bill_report_billing_year"); Key get BILL_REPORT_BILLING_CYCLE => Key("bill_report_billing_cycle"); - Key get EXPENSE_BILL_REPORT_VIEW_BUTTON => Key("expense_bill_report_view_button"); + Key get EXPENSE_BILL_REPORT_VIEW_BUTTON => + Key("expense_bill_report_view_button"); Key get VENDOR_REPORT_VIEW_BUTTON => Key("vendor_report_view_button"); -} \ No newline at end of file +} diff --git a/frontend/mgramseva/lib/utils/validators/validators.dart b/frontend/mgramseva/lib/utils/validators/validators.dart index dffa31df9..7e5dc451e 100644 --- a/frontend/mgramseva/lib/utils/validators/validators.dart +++ b/frontend/mgramseva/lib/utils/validators/validators.dart @@ -55,7 +55,17 @@ class Validators { return '${ApplicationLocalizations.of(navigatorKey.currentContext!).translate(i18.consumer.CONSUMER_OLD_CONNECTION_ID_REQUIRED)}'; } else if (v.toString().trim().isNotEmpty && v.toString().trim().length > input) { - return '${ApplicationLocalizations.of(navigatorKey.currentContext!).translate(key == i18.consumer.DOOR_NO ? i18.validators.HOUSE_NUMBER_VALIDATION : key == i18.consumer.OLD_CONNECTION_ID ? i18.validators.OLD_CONNECTION_VALIDATION : key == i18.consumer.STREET_NUM_NAME?i18.validators.STREET_VALIDATION: key == i18.consumer.CONSUMER_NAME?i18.validators.CONSUMER_NAME_VALIDATION: key == i18.consumer.FATHER_SPOUSE_NAME?i18.validators.FATHER_SPOUSE_NAME_VALIDATION:i18.validators.INVALID_FORMAT)}'; + return '${ApplicationLocalizations.of(navigatorKey.currentContext!).translate(key == i18.consumer.DOOR_NO ? i18.validators.HOUSE_NUMBER_VALIDATION : key == i18.consumer.OLD_CONNECTION_ID ? i18.validators.OLD_CONNECTION_VALIDATION : key == i18.consumer.STREET_NUM_NAME ? i18.validators.STREET_VALIDATION : key == i18.consumer.CONSUMER_NAME ? i18.validators.CONSUMER_NAME_VALIDATION : key == i18.consumer.FATHER_SPOUSE_NAME ? i18.validators.FATHER_SPOUSE_NAME_VALIDATION : i18.validators.INVALID_FORMAT)}'; + } + return null; + } + + static String? consumerRemarksValidator(String? v, int input, String? key) { + if (key == i18.consumer.CONSUMER_REMARKS && v.toString().isEmpty) { + return '${ApplicationLocalizations.of(navigatorKey.currentContext!).translate(i18.consumer.CONSUMER_REMARKS_REQUIRED)}'; + } else if (v.toString().trim().isNotEmpty && + v.toString().trim().length > input) { + return '${ApplicationLocalizations.of(navigatorKey.currentContext!).translate(key == i18.consumer.CONSUMER_REMARKS ? i18.validators.REMARKS_VALIDATION : i18.validators.INVALID_FORMAT)}'; } return null; } From 645cd99fd2af5f0365097a0b93ee98ec255113e5 Mon Sep 17 00:00:00 2001 From: Hari-egov Date: Wed, 29 May 2024 15:44:56 +0530 Subject: [PATCH 02/17] Owners --- .../lib/screeens/consumer_details/consumer_details.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/mgramseva/lib/screeens/consumer_details/consumer_details.dart b/frontend/mgramseva/lib/screeens/consumer_details/consumer_details.dart index 637fffee4..77c73576b 100644 --- a/frontend/mgramseva/lib/screeens/consumer_details/consumer_details.dart +++ b/frontend/mgramseva/lib/screeens/consumer_details/consumer_details.dart @@ -640,7 +640,7 @@ class _ConsumerDetailsState extends State { ), // REMARKS - // Show Remarks TextField when check box is clicked + // Show Remarks TextField when check box is true if (consumerProvider.isEdit && consumerProvider.waterconnection.status == "Inactive") From 26f566528cd6e7c017614235f617794cdbca59a6 Mon Sep 17 00:00:00 2001 From: Taniya-eGov <103186387+Taniya-eGov@users.noreply.github.com> Date: Wed, 29 May 2024 17:12:57 +0530 Subject: [PATCH 03/17] Duplicate bill changes --- .../java/org/egov/demand/model/BillV2.java | 3 ++ .../demand/repository/BillRepositoryV2.java | 18 ++++---- .../querybuilder/BillQueryBuilder.java | 15 ++++--- .../repository/rowmapper/BillRowMapperV2.java | 1 + .../egov/demand/service/BillServicev2.java | 41 ++++++++++++++++++- .../java/org/egov/demand/util/Constants.java | 14 +++++++ .../demand/web/validator/BillValidator.java | 32 +++++++++++++++ ...1130141020__egbs_bill_alter_add_userid.sql | 1 + ...4420__egbs_bill_alter_add_consumercode.sql | 7 ++++ 9 files changed, 115 insertions(+), 17 deletions(-) create mode 100644 business-services/billing-service/src/main/resources/db/migration/main/V20221130141020__egbs_bill_alter_add_userid.sql create mode 100644 business-services/billing-service/src/main/resources/db/migration/main/V20221206104420__egbs_bill_alter_add_consumercode.sql diff --git a/business-services/billing-service/src/main/java/org/egov/demand/model/BillV2.java b/business-services/billing-service/src/main/java/org/egov/demand/model/BillV2.java index ca69ebbad..c4c281313 100644 --- a/business-services/billing-service/src/main/java/org/egov/demand/model/BillV2.java +++ b/business-services/billing-service/src/main/java/org/egov/demand/model/BillV2.java @@ -28,6 +28,9 @@ public class BillV2 { @Size(max = 256) private String id; + @JsonProperty("userId") + private String userId; + @JsonProperty("mobileNumber") @Pattern(regexp = "^[0-9]{10}$", message = "MobileNumber should be 10 digit number") private String mobileNumber; diff --git a/business-services/billing-service/src/main/java/org/egov/demand/repository/BillRepositoryV2.java b/business-services/billing-service/src/main/java/org/egov/demand/repository/BillRepositoryV2.java index c650f4985..cdf43681b 100644 --- a/business-services/billing-service/src/main/java/org/egov/demand/repository/BillRepositoryV2.java +++ b/business-services/billing-service/src/main/java/org/egov/demand/repository/BillRepositoryV2.java @@ -69,6 +69,8 @@ public void setValues(PreparedStatement ps, int index) throws SQLException { AuditDetails auditDetails = bill.getAuditDetails(); ps.setString(1, bill.getId()); + ps.setString(15, bill.getUserId()); + ps.setString(16, bill.getConsumerCode()); ps.setString(2, bill.getTenantId()); ps.setString(3, bill.getPayerName()); ps.setString(4, bill.getPayerAddress()); @@ -82,8 +84,8 @@ public void setValues(PreparedStatement ps, int index) throws SQLException { ps.setString(12, bill.getMobileNumber()); ps.setString(13, bill.getStatus().toString()); ps.setObject(14, util.getPGObject(bill.getAdditionalDetails())); - ps.setString(15, bill.getConsumerCode()); - ps.setString(16, bill.getTenantId()); + // ps.setString(15, bill.getConsumerCode()); + // ps.setString(16, bill.getTenantId()); } @@ -93,12 +95,12 @@ public int getBatchSize() { } }); - for (int i = 0; i < saveBill.length; i++) { - if(0 == saveBill[i]) - throw new CustomException("EG_BS_DUPLICATE_ACTIVE_BILL_INSERTION_ERROR", - "Insertion failed due to presence of ACTIVE bill in DB for consumer-code : " - + bills.get(i).getConsumerCode()); - } + // for (int i = 0; i < saveBill.length; i++) { + // if(0 == saveBill[i]) + // throw new CustomException("EG_BS_DUPLICATE_ACTIVE_BILL_INSERTION_ERROR", + // "Insertion failed due to presence of ACTIVE bill in DB for consumer-code : " + // + bills.get(i).getConsumerCode()); + // } saveBillDetails(billRequest); } diff --git a/business-services/billing-service/src/main/java/org/egov/demand/repository/querybuilder/BillQueryBuilder.java b/business-services/billing-service/src/main/java/org/egov/demand/repository/querybuilder/BillQueryBuilder.java index b17622f6e..df7ae022e 100644 --- a/business-services/billing-service/src/main/java/org/egov/demand/repository/querybuilder/BillQueryBuilder.java +++ b/business-services/billing-service/src/main/java/org/egov/demand/repository/querybuilder/BillQueryBuilder.java @@ -22,10 +22,9 @@ public class BillQueryBuilder { public static final String BILL_STATUS_UPDATE_BASE_QUERY = "UPDATE egbs_bill_v1 SET status=?, lastmodifieddate=? {replace} WHERE status='ACTIVE' AND tenantId = ? "; public static final String INSERT_BILL_QUERY = "INSERT into egbs_bill_v1 " - + " (id, tenantid, payername, payeraddress, payeremail, isactive, iscancelled, createdby, createddate, lastmodifiedby, lastmodifieddate, mobilenumber, status, additionaldetails)" - + " SELECT ?,?,?,?,?,?,?,?,?,?,?,?,?,? " - + " WHERE NOT EXISTS (SELECT distinct(consumercode) FROM egbs_bill_v1 bill INNER JOIN egbs_billdetail_v1 billd ON bill.id=billd.billid " - + " WHERE status = 'ACTIVE' AND consumerCode = ? AND bill.tenantid = ?)"; + +"(id, tenantid, payername, payeraddress, payeremail, isactive, iscancelled, createdby, createddate, lastmodifiedby, lastmodifieddate," + +" mobilenumber, status, additionaldetails, payerid, consumercode)" + +"values(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)"; public static final String INSERT_BILLDETAILS_QUERY = "INSERT into egbs_billdetail_v1 " @@ -49,7 +48,7 @@ public class BillQueryBuilder { + " INNER JOIN (SELECT bd_consumercode, min(b_createddate) as mindate FROM billresult GROUP BY bd_consumercode) as uniqbill" + " ON uniqbill.bd_consumercode=billresult.bd_consumercode AND uniqbill.mindate=billresult.b_createddate "; - public static final String BILL_BASE_QUERY = "SELECT b.id AS b_id,b.mobilenumber, b.tenantid AS b_tenantid," + public static final String BILL_BASE_QUERY = "SELECT b.id AS b_id,b.mobilenumber, b.tenantid AS b_tenantid,b.payerid AS b_payerid," + " b.payername AS b_payername, b.payeraddress AS b_payeraddress, b.payeremail AS b_payeremail,b.filestoreid AS b_fileStoreId," + " b.isactive AS b_isactive, b.iscancelled AS b_iscancelled, b.createdby AS b_createdby, b.status as b_status," + " b.createddate AS b_createddate, b.lastmodifiedby AS b_lastmodifiedby, b.lastmodifieddate AS b_lastmodifieddate," @@ -82,9 +81,9 @@ public String getBillQuery(BillSearchCriteria billSearchCriteria, List p } addWhereClause(billQuery, preparedStatementValues, billSearchCriteria); - if(billSearchCriteria!=null && billSearchCriteria.getReturnAllBills()) { - return billQuery.toString(); - } + // if(billSearchCriteria!=null && billSearchCriteria.getReturnAllBills()) { + // return billQuery.toString(); + // } StringBuilder maxQuery = addPagingClause(billQuery, preparedStatementValues, billSearchCriteria); return maxQuery.toString(); diff --git a/business-services/billing-service/src/main/java/org/egov/demand/repository/rowmapper/BillRowMapperV2.java b/business-services/billing-service/src/main/java/org/egov/demand/repository/rowmapper/BillRowMapperV2.java index caa8e6e8b..ade4777fc 100644 --- a/business-services/billing-service/src/main/java/org/egov/demand/repository/rowmapper/BillRowMapperV2.java +++ b/business-services/billing-service/src/main/java/org/egov/demand/repository/rowmapper/BillRowMapperV2.java @@ -50,6 +50,7 @@ public List extractData(ResultSet rs) throws SQLException { .id(billId) .totalAmount(BigDecimal.ZERO) .tenantId(rs.getString("b_tenantid")) + .userId(rs.getString("b_payerid")) .payerName(rs.getString("b_payername")) .payerAddress(rs.getString("b_payeraddress")) .payerEmail(rs.getString("b_payeremail")) diff --git a/business-services/billing-service/src/main/java/org/egov/demand/service/BillServicev2.java b/business-services/billing-service/src/main/java/org/egov/demand/service/BillServicev2.java index d485ac915..3f53c587a 100644 --- a/business-services/billing-service/src/main/java/org/egov/demand/service/BillServicev2.java +++ b/business-services/billing-service/src/main/java/org/egov/demand/service/BillServicev2.java @@ -62,6 +62,7 @@ import java.util.UUID; import java.util.function.Function; import java.util.stream.Collectors; +import java.util.stream.Stream; import org.egov.common.contract.request.RequestInfo; import org.egov.demand.config.ApplicationProperties; @@ -99,6 +100,10 @@ import org.springframework.util.CollectionUtils; import org.springframework.util.ObjectUtils; import org.springframework.util.StringUtils; +import org.egov.demand.producer.Producer; +import org.egov.demand.web.contract.UserResponse; +import org.egov.demand.web.contract.UserSearchRequest; +import com.fasterxml.jackson.databind.ObjectMapper; import lombok.extern.slf4j.Slf4j; @@ -138,9 +143,20 @@ public class BillServicev2 { @Autowired private BillValidator billValidator; + + @Autowired + private Producer producer; + + @Autowired + private ObjectMapper mapper; + + @Value("${kafka.topics.cancel.bill.topic.name}") + private String billCancelTopic; @Value("${kafka.topics.billgen.topic.name}") private String notifTopicName; + + private static List ownerPlainRequestFieldsList; /** * Cancell bill operation can be carried by this method, based on consumerCodes @@ -154,6 +170,7 @@ public class BillServicev2 { public Integer cancelBill(UpdateBillRequest updateBillRequest) { UpdateBillCriteria cancelBillCriteria = updateBillRequest.getUpdateBillCriteria(); + billValidator.validateBillSearchRequest(cancelBillCriteria); Set consumerCodes = cancelBillCriteria.getConsumerCodes(); cancelBillCriteria.setStatusToBeUpdated(BillStatus.CANCELLED); @@ -162,10 +179,31 @@ public Integer cancelBill(UpdateBillRequest updateBillRequest) { throw new CustomException("EG_BS_CANCEL_BILL_ERROR", "Only one consumer code can be provided in the Cancel request"); } else { - return billRepository.updateBillStatus(cancelBillCriteria); + int result = billRepository.updateBillStatus(cancelBillCriteria); + sendNotificationForBillCancellation(updateBillRequest.getRequestInfo(), cancelBillCriteria); + return result; } } + private void sendNotificationForBillCancellation(RequestInfo requestInfo, UpdateBillCriteria cancelBillCriteria) { + Set consumerCodes = cancelBillCriteria.getConsumerCodes(); + if(CollectionUtils.isEmpty(consumerCodes)) + return; + + List bills = billRepository.findBill(BillSearchCriteria.builder() + .service(cancelBillCriteria.getBusinessService()) + .tenantId(cancelBillCriteria.getTenantId()) + .consumerCode(consumerCodes) + .build()); + + if (CollectionUtils.isEmpty(bills)) + return; + + BillRequestV2 req = BillRequestV2.builder().bills(bills).requestInfo(requestInfo).build(); + producer.push(billCancelTopic, req); + + } + /** * Fetches the bill for given parameters * @@ -428,6 +466,7 @@ private List prepareBill(List demands, RequestInfo requestInfo) .status(BillStatus.ACTIVE) .billDetails(billDetails) .totalAmount(billAmount) + .userId(payer.getUuid()) .billNumber(billNumber) .tenantId(tenantId) .id(billId) diff --git a/business-services/billing-service/src/main/java/org/egov/demand/util/Constants.java b/business-services/billing-service/src/main/java/org/egov/demand/util/Constants.java index 7ddff20a9..d516bedfd 100644 --- a/business-services/billing-service/src/main/java/org/egov/demand/util/Constants.java +++ b/business-services/billing-service/src/main/java/org/egov/demand/util/Constants.java @@ -171,4 +171,18 @@ private Constants() {} public static final String PAID_CANCEL_BILL_MSG = "You cannot cancel the bill in the workflow"; public static final String COUNT_REPLACE_CANCEL_BILL_MSG = "{count}"; + + // Bill cancel + + public static final String CANCELLATION_REASON_MSG= "reasonMessage"; + + public static final String CANCELLATION_REASON_CODE= "reason"; + + public static final String CANCELL_REASON_MSG_NOT_FOUND = "EG_BS_CANCELL_REASON_MSG_NOT"; + public static final String CANCELL_REASON_MSG_NOT_FOUND_MSG = "Cancell Reason message with key " + "'" + CANCELLATION_REASON_MSG + "'" + " is madnatory Text field in additionalDetails of Bill cancell Request"; + public static final String CANCELL_REASON_MSG_EMPTY_MSG = "Cancell Reason message cannot be empty"; + + public static final String CANCELL_REASON_CODE_NOT_FOUND = "EG_BS_CANCELL_REASON_CODE_NOT"; + public static final String CANCELL_REASON_CODE_NOT_FOUND_MSG = "Cancellation Reason with key " + "'" + CANCELLATION_REASON_CODE + "'" + " is a madnatory Text field in additionalDetails of Bill cancell Request"; + public static final String CANCELL_REASON_CODE_EMPTY_MSG = "Cancell Reason code cannot be empty"; } \ No newline at end of file diff --git a/business-services/billing-service/src/main/java/org/egov/demand/web/validator/BillValidator.java b/business-services/billing-service/src/main/java/org/egov/demand/web/validator/BillValidator.java index d44b7ac3d..709d5a33d 100644 --- a/business-services/billing-service/src/main/java/org/egov/demand/web/validator/BillValidator.java +++ b/business-services/billing-service/src/main/java/org/egov/demand/web/validator/BillValidator.java @@ -1,10 +1,13 @@ package org.egov.demand.web.validator; +import java.util.HashMap; +import java.util.Map; import static org.egov.demand.util.Constants.BILL_GEN_MANDATORY_FIELDS_MISSING_KEY; import static org.egov.demand.util.Constants.BILL_GEN_MANDATORY_FIELDS_MISSING_MSG; import org.egov.common.contract.request.RequestInfo; import org.egov.demand.model.BillSearchCriteria; +import org.egov.demand.model.BillV2.BillStatus; import org.egov.demand.model.GenerateBillCriteria; import org.egov.demand.util.Util; import org.egov.tracer.model.CustomException; @@ -12,6 +15,11 @@ import org.springframework.stereotype.Component; import org.springframework.util.CollectionUtils; import org.springframework.validation.Errors; +import org.egov.demand.model.UpdateBillCriteria; +import org.egov.demand.util.Constants; +import org.springframework.util.StringUtils; + +import com.fasterxml.jackson.databind.JsonNode; @Component public class BillValidator { @@ -57,4 +65,28 @@ public void validateBillSearchCriteria(BillSearchCriteria billCriteria, RequestI } } + public void validateBillSearchRequest(UpdateBillCriteria cancelBillCriteria) { + cancelBillCriteria.setStatusToBeUpdated(BillStatus.CANCELLED); + JsonNode additionalDetails = cancelBillCriteria.getAdditionalDetails(); + Map errorMap = new HashMap<>(); + JsonNode reasonMsg = additionalDetails.get(Constants.CANCELLATION_REASON_MSG); + JsonNode reasonCode = additionalDetails.get(Constants.CANCELLATION_REASON_CODE); + if (null != reasonCode && reasonCode.isTextual()) { + if (StringUtils.isEmpty(reasonCode.textValue())) + errorMap.put(Constants.CANCELL_REASON_CODE_NOT_FOUND, Constants.CANCELL_REASON_CODE_EMPTY_MSG); + } else { + errorMap.put(Constants.CANCELL_REASON_CODE_NOT_FOUND, Constants.CANCELL_REASON_CODE_NOT_FOUND_MSG); + } + + if (null != reasonMsg && reasonMsg.isTextual()) { + if (StringUtils.isEmpty(reasonMsg.textValue())) + errorMap.put(Constants.CANCELL_REASON_MSG_NOT_FOUND, Constants.CANCELL_REASON_MSG_EMPTY_MSG); + } else { + errorMap.put(Constants.CANCELL_REASON_MSG_NOT_FOUND, Constants.CANCELL_REASON_MSG_NOT_FOUND_MSG); + } + if (!CollectionUtils.isEmpty(errorMap)) { + throw new CustomException(errorMap); + } + } + } diff --git a/business-services/billing-service/src/main/resources/db/migration/main/V20221130141020__egbs_bill_alter_add_userid.sql b/business-services/billing-service/src/main/resources/db/migration/main/V20221130141020__egbs_bill_alter_add_userid.sql new file mode 100644 index 000000000..e37239ab9 --- /dev/null +++ b/business-services/billing-service/src/main/resources/db/migration/main/V20221130141020__egbs_bill_alter_add_userid.sql @@ -0,0 +1 @@ +ALTER TABLE egbs_bill_v1 add column payerid character varying (128); \ No newline at end of file diff --git a/business-services/billing-service/src/main/resources/db/migration/main/V20221206104420__egbs_bill_alter_add_consumercode.sql b/business-services/billing-service/src/main/resources/db/migration/main/V20221206104420__egbs_bill_alter_add_consumercode.sql new file mode 100644 index 000000000..a8ed241df --- /dev/null +++ b/business-services/billing-service/src/main/resources/db/migration/main/V20221206104420__egbs_bill_alter_add_consumercode.sql @@ -0,0 +1,7 @@ +ALTER TABLE egbs_bill_v1 ADD COLUMN IF NOT EXISTS consumercode CHARACTER VARYING(256); + +UPDATE egbs_bill_v1 b SET consumerCode = bd.consumercode FROM egbs_billdetail_v1 bd WHERE bd.billid = b.id; + +ALTER TABLE egbs_bill_v1 ALTER COLUMN consumercode SET NOT NULL; + +CREATE UNIQUE INDEX IF NOT EXISTS index_egbs_UNIQUE_ACTIVE_BILL ON egbs_bill_v1 (consumercode, tenantid, status) where status='ACTIVE'; \ No newline at end of file From 3c9743437502acfc6bef812a563ebff334351e28 Mon Sep 17 00:00:00 2001 From: Taniya-eGov <103186387+Taniya-eGov@users.noreply.github.com> Date: Thu, 30 May 2024 16:02:16 +0530 Subject: [PATCH 04/17] updated BillRepositoryV2 --- .../org/egov/demand/repository/BillRepositoryV2.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/business-services/billing-service/src/main/java/org/egov/demand/repository/BillRepositoryV2.java b/business-services/billing-service/src/main/java/org/egov/demand/repository/BillRepositoryV2.java index cdf43681b..dfb0514de 100644 --- a/business-services/billing-service/src/main/java/org/egov/demand/repository/BillRepositoryV2.java +++ b/business-services/billing-service/src/main/java/org/egov/demand/repository/BillRepositoryV2.java @@ -95,12 +95,12 @@ public int getBatchSize() { } }); - // for (int i = 0; i < saveBill.length; i++) { - // if(0 == saveBill[i]) - // throw new CustomException("EG_BS_DUPLICATE_ACTIVE_BILL_INSERTION_ERROR", - // "Insertion failed due to presence of ACTIVE bill in DB for consumer-code : " - // + bills.get(i).getConsumerCode()); - // } + for (int i = 0; i < saveBill.length; i++) { + if(0 == saveBill[i]) + throw new CustomException("EG_BS_DUPLICATE_ACTIVE_BILL_INSERTION_ERROR", + "Insertion failed due to presence of ACTIVE bill in DB for consumer-code : " + + bills.get(i).getConsumerCode()); + } saveBillDetails(billRequest); } From 5a5a22bcb32d3fe275e3361166d0cf3153a010e9 Mon Sep 17 00:00:00 2001 From: Hari-egov Date: Fri, 31 May 2024 11:33:21 +0530 Subject: [PATCH 05/17] ISTE - 159 changes --- .../lib/components/dashboard/bills_table.dart | 81 +++++--- .../lib/model/connection/property.g.dart | 2 + .../providers/consumer_details_provider.dart | 1 + .../household_register_provider.dart | 185 +++++++++++------- .../lib/repository/billing_service_repo.dart | 6 - .../consumer_details/consumer_details.dart | 39 ++-- .../household_register/household_list.dart | 4 + 7 files changed, 189 insertions(+), 129 deletions(-) diff --git a/frontend/mgramseva/lib/components/dashboard/bills_table.dart b/frontend/mgramseva/lib/components/dashboard/bills_table.dart index 7eb43c4c2..c0836879c 100644 --- a/frontend/mgramseva/lib/components/dashboard/bills_table.dart +++ b/frontend/mgramseva/lib/components/dashboard/bills_table.dart @@ -1,3 +1,6 @@ +import 'dart:convert'; +import 'dart:developer'; + import 'package:flutter/material.dart'; import 'package:horizontal_data_table/horizontal_data_table.dart'; import 'package:mgramseva/utils/localization/application_localizations.dart'; @@ -14,17 +17,22 @@ class BillsTable extends StatefulWidget { ScrollController scrollController = ScrollController(); BillsTable( {Key? key, - required this.headerList, - required this.tableData, - required this.leftColumnWidth, - required this.rightColumnWidth, this.height, this.scrollPhysics}) + required this.headerList, + required this.tableData, + required this.leftColumnWidth, + required this.rightColumnWidth, + this.height, + this.scrollPhysics}) : super(key: key); BillsTable.withScrollController( {Key? key, - required this.headerList, - required this.tableData, - required this.leftColumnWidth, - required this.rightColumnWidth, this.height, this.scrollPhysics, required this.scrollController}) + required this.headerList, + required this.tableData, + required this.leftColumnWidth, + required this.rightColumnWidth, + this.height, + this.scrollPhysics, + required this.scrollController}) : super(key: key); @override @@ -106,22 +114,22 @@ class _BillsTable extends State { return Container( decoration: isBorderRequired ? BoxDecoration( - border: Border( - left: tableCellBorder, - bottom: tableCellBorder, - right: tableCellBorder)) + border: Border( + left: tableCellBorder, + bottom: tableCellBorder, + right: tableCellBorder)) : null, child: isAscending != null ? Wrap( - crossAxisAlignment: WrapCrossAlignment.center, - spacing: 5, - children: [ - textWidget, - Icon(isAscending - ? Icons.arrow_upward - : Icons.arrow_downward_sharp) - ], - ) + crossAxisAlignment: WrapCrossAlignment.center, + spacing: 5, + children: [ + textWidget, + Icon(isAscending + ? Icons.arrow_upward + : Icons.arrow_downward_sharp) + ], + ) : textWidget, width: widget.leftColumnWidth, height: 56, @@ -129,9 +137,13 @@ class _BillsTable extends State { alignment: Alignment.centerLeft, ); } + double columnRowIncreasedHeight(int index) { - return - (50 + widget.tableData[index].tableRow.first.label.substring(28).length.toDouble()); + return (50 + + widget.tableData[index].tableRow.first.label + .substring(28) + .length + .toDouble()); //if greater than 28 characters } @@ -149,17 +161,20 @@ class _BillsTable extends State { child: Container( decoration: BoxDecoration( border: Border( - left: tableCellBorder, - bottom: tableCellBorder, - right: tableCellBorder, - )), + left: tableCellBorder, + bottom: tableCellBorder, + right: tableCellBorder, + )), child: Text( ApplicationLocalizations.of(context) .translate(widget.tableData[index].tableRow.first.label), - style: widget.tableData[index].tableRow.first.style ?? TextStyle(color: Theme.of(context).primaryColor), + style: widget.tableData[index].tableRow.first.style ?? + TextStyle(color: Theme.of(context).primaryColor), ), width: widget.leftColumnWidth, - height: widget.tableData[index].tableRow.first.label.length > 28 ? columnRowIncreasedHeight(index) : columnRowFixedHeight, + height: widget.tableData[index].tableRow.first.label.length > 28 + ? columnRowIncreasedHeight(index) + : columnRowFixedHeight, padding: EdgeInsets.only(left: 17, right: 5, top: 6, bottom: 6), alignment: Alignment.centerLeft, ), @@ -174,7 +189,8 @@ class _BillsTable extends State { child: Row( children: [ Expanded( - child: Text(ApplicationLocalizations.of(context).translate(input), + child: Text( + ApplicationLocalizations.of(context).translate(input), style: style, maxLines: 2, overflow: TextOverflow.ellipsis, @@ -183,7 +199,9 @@ class _BillsTable extends State { ], ), width: widget.leftColumnWidth, - height: widget.tableData[index].tableRow.first.label.length > 28 ? columnRowIncreasedHeight(index) : columnRowFixedHeight, + height: widget.tableData[index].tableRow.first.label.length > 28 + ? columnRowIncreasedHeight(index) + : columnRowFixedHeight, padding: EdgeInsets.only(left: 17, right: 5, top: 6, bottom: 6), alignment: Alignment.centerLeft, ); @@ -191,6 +209,7 @@ class _BillsTable extends State { Widget _generateRightHandSideColumnRow(BuildContext context, int index) { var data = widget.tableData[index]; + return LayoutBuilder(builder: (context, constraints) { var list = []; for (int i = 1; i < data.tableRow.length; i++) { diff --git a/frontend/mgramseva/lib/model/connection/property.g.dart b/frontend/mgramseva/lib/model/connection/property.g.dart index b99f0dfdb..c7cbf2436 100644 --- a/frontend/mgramseva/lib/model/connection/property.g.dart +++ b/frontend/mgramseva/lib/model/connection/property.g.dart @@ -141,6 +141,7 @@ Owners _$OwnersFromJson(Map json) { ..mobileNumber = json['mobileNumber'] as String? ..fatherOrHusbandName = json['fatherOrHusbandName'] as String? ..name = json['name'] as String? + ..remarks = json['remarks'] as String? ..status = json['status'] as String? ..gender = json['gender'] as String? ..ownerType = json['ownerType'] as String? @@ -180,6 +181,7 @@ Map _$OwnersToJson(Owners instance) => { 'mobileNumber': instance.mobileNumber, 'fatherOrHusbandName': instance.fatherOrHusbandName, 'name': instance.name, + 'remarks': instance.remarks, 'status': instance.status, 'gender': instance.gender, 'ownerType': instance.ownerType, diff --git a/frontend/mgramseva/lib/providers/consumer_details_provider.dart b/frontend/mgramseva/lib/providers/consumer_details_provider.dart index 5fce3a807..5c1fc04fe 100644 --- a/frontend/mgramseva/lib/providers/consumer_details_provider.dart +++ b/frontend/mgramseva/lib/providers/consumer_details_provider.dart @@ -365,6 +365,7 @@ class ConsumerProvider with ChangeNotifier { waterconnection.arrears = null; waterconnection.advance = null; } + var result1 = await ConsumerRepository().updateProperty(property.toJson()); var result2 = await ConsumerRepository() diff --git a/frontend/mgramseva/lib/providers/household_register_provider.dart b/frontend/mgramseva/lib/providers/household_register_provider.dart index abdc982d1..eb3fa2fd7 100644 --- a/frontend/mgramseva/lib/providers/household_register_provider.dart +++ b/frontend/mgramseva/lib/providers/household_register_provider.dart @@ -159,7 +159,7 @@ class HouseholdRegisterProvider with ChangeNotifier { (waterConnectionsDetails?.totalCount ?? 0)) ? (waterConnectionsDetails!.totalCount!) : (offset + limit) - 1)); - } catch (e, s) { + } catch (e, s) { isLoaderEnabled = false; notifyListeners(); streamController.addError('error'); @@ -183,34 +183,66 @@ class HouseholdRegisterProvider with ChangeNotifier { } List get collectionHeaderList => [ - TableHeader(i18.common.CONNECTION_ID, isSortingRequired: true, isAscendingOrder: sortBy != null && sortBy!.key == 'connectionNumber' ? sortBy!.isAscending : null, apiKey: 'connectionNumber', callBack: onSort), - // TableHeader(i18.common.VILLAGE_CODE, isSortingRequired: false), - // TableHeader(i18.common.VILLAGE_NAME, isSortingRequired: false), - // TableHeader(i18.common.TENANT_ID, isSortingRequired: false), - TableHeader(i18.common.NAME, isSortingRequired: false), - TableHeader(i18.common.GENDER, isSortingRequired: false), - TableHeader(i18.consumer.FATHER_SPOUSE_NAME, isSortingRequired: false), - TableHeader(i18.common.MOBILE_NUMBER, isSortingRequired: false), - TableHeader(i18.consumer.OLD_CONNECTION_ID, isSortingRequired: false), - TableHeader(i18.consumer.CONSUMER_CATEGORY, isSortingRequired: false), - TableHeader(i18.consumer.CONSUMER_SUBCATEGORY, isSortingRequired: false), - TableHeader(i18.searchWaterConnection.PROPERTY_TYPE, isSortingRequired: false), - TableHeader(i18.searchWaterConnection.CONNECTION_TYPE, isSortingRequired: false), - TableHeader(i18.demandGenerate.METER_READING_DATE, isSortingRequired: false), - TableHeader(i18.searchWaterConnection.METER_NUMBER, isSortingRequired: false), - TableHeader(i18.demandGenerate.PREV_METER_READING_LABEL, isSortingRequired: false), - TableHeader(i18.consumer.ARREARS_ON_CREATION, isSortingRequired: false), - TableHeader(i18.consumer.CORE_PENALTY_ON_CREATION, isSortingRequired: false), - TableHeader(i18.consumer.CORE_ADVANCE_ON_CREATION, isSortingRequired: false), - TableHeader(i18.common.CORE_TOTAL_BILL_AMOUNT, isSortingRequired: false), - TableHeader(i18.billDetails.TOTAL_AMOUNT_COLLECTED, isSortingRequired: false), - TableHeader(i18.common.CORE_ADVANCE_AS_ON_TODAY, isSortingRequired: false), - TableHeader(i18.householdRegister.PENDING_COLLECTIONS, isSortingRequired: true, isAscendingOrder: sortBy != null && sortBy!.key == 'collectionPendingAmount' ? sortBy!.isAscending : null, apiKey: 'collectionPendingAmount', callBack: onSort), - TableHeader(i18.common.CREATED_ON_DATE, isSortingRequired: false), - TableHeader(i18.householdRegister.LAST_BILL_GEN_DATE, isSortingRequired: true, apiKey: 'lastDemandGeneratedDate', isAscendingOrder: sortBy != null && sortBy!.key == 'lastDemandGeneratedDate' ? sortBy!.isAscending : null, callBack: onSort), - TableHeader(i18.householdRegister.ACTIVE_INACTIVE, isSortingRequired: false, apiKey: 'status'), - ] - ; + TableHeader(i18.common.CONNECTION_ID, + isSortingRequired: true, + isAscendingOrder: + sortBy != null && sortBy!.key == 'connectionNumber' + ? sortBy!.isAscending + : null, + apiKey: 'connectionNumber', + callBack: onSort), + // TableHeader(i18.common.VILLAGE_CODE, isSortingRequired: false), + // TableHeader(i18.common.VILLAGE_NAME, isSortingRequired: false), + // TableHeader(i18.common.TENANT_ID, isSortingRequired: false), + TableHeader(i18.common.NAME, isSortingRequired: false), + TableHeader(i18.common.GENDER, isSortingRequired: false), + TableHeader(i18.consumer.FATHER_SPOUSE_NAME, isSortingRequired: false), + TableHeader(i18.common.MOBILE_NUMBER, isSortingRequired: false), + TableHeader(i18.consumer.OLD_CONNECTION_ID, isSortingRequired: false), + TableHeader(i18.consumer.CONSUMER_CATEGORY, isSortingRequired: false), + TableHeader(i18.consumer.CONSUMER_SUBCATEGORY, + isSortingRequired: false), + TableHeader(i18.searchWaterConnection.PROPERTY_TYPE, + isSortingRequired: false), + TableHeader(i18.searchWaterConnection.CONNECTION_TYPE, + isSortingRequired: false), + TableHeader(i18.demandGenerate.METER_READING_DATE, + isSortingRequired: false), + TableHeader(i18.searchWaterConnection.METER_NUMBER, + isSortingRequired: false), + TableHeader(i18.demandGenerate.PREV_METER_READING_LABEL, + isSortingRequired: false), + TableHeader(i18.consumer.ARREARS_ON_CREATION, isSortingRequired: false), + TableHeader(i18.consumer.CORE_PENALTY_ON_CREATION, + isSortingRequired: false), + TableHeader(i18.consumer.CORE_ADVANCE_ON_CREATION, + isSortingRequired: false), + TableHeader(i18.common.CORE_TOTAL_BILL_AMOUNT, + isSortingRequired: false), + TableHeader(i18.billDetails.TOTAL_AMOUNT_COLLECTED, + isSortingRequired: false), + TableHeader(i18.common.CORE_ADVANCE_AS_ON_TODAY, + isSortingRequired: false), + TableHeader(i18.householdRegister.PENDING_COLLECTIONS, + isSortingRequired: true, + isAscendingOrder: + sortBy != null && sortBy!.key == 'collectionPendingAmount' + ? sortBy!.isAscending + : null, + apiKey: 'collectionPendingAmount', + callBack: onSort), + TableHeader(i18.common.CREATED_ON_DATE, isSortingRequired: false), + TableHeader(i18.householdRegister.LAST_BILL_GEN_DATE, + isSortingRequired: true, + apiKey: 'lastDemandGeneratedDate', + isAscendingOrder: + sortBy != null && sortBy!.key == 'lastDemandGeneratedDate' + ? sortBy!.isAscending + : null, + callBack: onSort), + TableHeader(i18.householdRegister.ACTIVE_INACTIVE, + isSortingRequired: false, apiKey: 'status'), + ]; List get collectionHeaderListOLd => [ TableHeader(i18.common.CONNECTION_ID, isSortingRequired: true, @@ -220,8 +252,10 @@ class HouseholdRegisterProvider with ChangeNotifier { : null, apiKey: 'connectionNumber', callBack: onSort), - TableHeader(i18.consumer.OLD_CONNECTION_ID, - isSortingRequired: false,), + TableHeader( + i18.consumer.OLD_CONNECTION_ID, + isSortingRequired: false, + ), TableHeader(i18.common.NAME, isSortingRequired: true, isAscendingOrder: sortBy != null && sortBy!.key == 'name' @@ -296,7 +330,7 @@ class HouseholdRegisterProvider with ChangeNotifier { navigatorKey.currentContext!, listen: false); String? name = - truncateWithEllipsis(connection.connectionHolders?.first.name??'NA'); + truncateWithEllipsis(connection.connectionHolders?.first.name ?? 'NA'); String? fatherName = truncateWithEllipsis( connection.connectionHolders?.first.fatherOrHusbandName); return TableDataRow([ @@ -323,7 +357,8 @@ class HouseholdRegisterProvider with ChangeNotifier { '${fatherName ?? 'NA'}', ), TableData( - maskMobileNumber('${connection.connectionHolders?.first.mobileNumber ?? 'NA'}'), + maskMobileNumber( + '${connection.connectionHolders?.first.mobileNumber ?? 'NA'}'), ), TableData( '${connection.oldConnectionNo ?? 'NA'}', @@ -341,13 +376,13 @@ class HouseholdRegisterProvider with ChangeNotifier { '${ApplicationLocalizations.of(navigatorKey.currentContext!).translate(connection.connectionType ?? 'NA')}', ), TableData( - '${connection.connectionType == 'Metered' ?connection.additionalDetails?.lastDemandGeneratedDate != null && connection.additionalDetails?.lastDemandGeneratedDate != '' ? DateFormats.timeStampToDate(int.parse(connection.additionalDetails?.lastDemandGeneratedDate ?? 'NA')) :'NA' :'NA' }', + '${connection.connectionType == 'Metered' ? connection.additionalDetails?.lastDemandGeneratedDate != null && connection.additionalDetails?.lastDemandGeneratedDate != '' ? DateFormats.timeStampToDate(int.parse(connection.additionalDetails?.lastDemandGeneratedDate ?? 'NA')) : 'NA' : 'NA'}', ), TableData( - '${connection.connectionType == 'Metered' ? connection.meterId :'NA' }', + '${connection.connectionType == 'Metered' ? connection.meterId : 'NA'}', ), TableData( - '${connection.connectionType == 'Metered' ? connection.additionalDetails?.meterReading :'NA' }', + '${connection.connectionType == 'Metered' ? connection.additionalDetails?.meterReading : 'NA'}', ), TableData( '${connection.arrears != null ? '₹ ${connection.arrears}' : '-'}', @@ -377,13 +412,12 @@ class HouseholdRegisterProvider with ChangeNotifier { '${connection.additionalDetails?.lastDemandGeneratedDate != null && connection.additionalDetails?.lastDemandGeneratedDate != '' ? DateFormats.timeStampToDate(int.parse(connection.additionalDetails?.lastDemandGeneratedDate ?? '')) : '-'}', ), TableData( - '${connection.status.toString() == Constants.CONNECTION_STATUS.last ? 'Y' : 'N'}', + '${connection.status.toString().toLowerCase() == Constants.CONNECTION_STATUS.last.toLowerCase() ? 'Y' : 'N'}', style: TextStyle( color: connection.status.toString() == Constants.CONNECTION_STATUS.last ? ColorCodes.ACTIVE_COL : ColorCodes.INACTIVE_COL)), - ]); } @@ -430,6 +464,7 @@ class HouseholdRegisterProvider with ChangeNotifier { fetchHouseholdDetails( context, localLimit ?? limit, localOffSet ?? 1, isSearch); } + String maskMobileNumber(String mobileNumber) { if (mobileNumber.length != 10) { // Check if the mobile number has the expected length @@ -529,7 +564,6 @@ class HouseholdRegisterProvider with ChangeNotifier { i18.common.CREATED_ON_DATE, i18.householdRegister.LAST_BILL_GEN_DATE, i18.householdRegister.ACTIVE_INACTIVE - ]; var downloadHeaderList = [ i18.common.VILLAGE_CODE, @@ -558,63 +592,64 @@ class HouseholdRegisterProvider with ChangeNotifier { i18.common.CREATED_ON_DATE, i18.householdRegister.LAST_BILL_GEN_DATE, i18.householdRegister.ACTIVE_INACTIVE - ]; var pdfTableData = waterConnectionsDetails.waterConnection ?.map>((connection) => [ - '${connection.connectionNo ?? ''} ${connection.connectionType == 'Metered' ? '- M' : ''}', - '${connection.connectionHolders?.first.name ?? ''}', - '${connection.connectionHolders?.first.fatherOrHusbandName ?? ''}', - '${connection.additionalDetails?.collectionPendingAmount != null ? double.parse(connection.additionalDetails?.collectionPendingAmount ?? '') < 0.0 ? '-' : '₹ ${double.parse(connection.additionalDetails?.collectionPendingAmount ?? '0').abs()}' : '-'}', - '${connection.additionalDetails?.collectionPendingAmount != null ? double.parse(connection.additionalDetails?.collectionPendingAmount ?? '') < 0.0 ? '₹ ${double.parse(connection.additionalDetails?.collectionPendingAmount ?? '0').abs()}' : '₹ 0' : '₹ 0'}', - '${connection.status.toString() == Constants.CONNECTION_STATUS.last ? 'Y' : 'N'}', - '${connection.additionalDetails?.lastDemandGeneratedDate != null && connection.additionalDetails?.lastDemandGeneratedDate != '' ? DateFormats.timeStampToDate(int.parse(connection.additionalDetails?.lastDemandGeneratedDate ?? '')) : '-'}' + '${connection.connectionNo ?? ''} ${connection.connectionType == 'Metered' ? '- M' : ''}', + '${connection.connectionHolders?.first.name ?? ''}', + '${connection.connectionHolders?.first.fatherOrHusbandName ?? ''}', + '${connection.additionalDetails?.collectionPendingAmount != null ? double.parse(connection.additionalDetails?.collectionPendingAmount ?? '') < 0.0 ? '-' : '₹ ${double.parse(connection.additionalDetails?.collectionPendingAmount ?? '0').abs()}' : '-'}', + '${connection.additionalDetails?.collectionPendingAmount != null ? double.parse(connection.additionalDetails?.collectionPendingAmount ?? '') < 0.0 ? '₹ ${double.parse(connection.additionalDetails?.collectionPendingAmount ?? '0').abs()}' : '₹ 0' : '₹ 0'}', + '${connection.status.toString() == Constants.CONNECTION_STATUS.last ? 'Y' : 'N'}', + '${connection.additionalDetails?.lastDemandGeneratedDate != null && connection.additionalDetails?.lastDemandGeneratedDate != '' ? DateFormats.timeStampToDate(int.parse(connection.additionalDetails?.lastDemandGeneratedDate ?? '')) : '-'}' ]) .toList() ?? []; var excelTableData = waterConnectionsDetails.waterConnection ?.map>((connection) => [ - '${commonProvider.userDetails?.selectedtenant?.city?.code ?? 'NA'}', - '${ApplicationLocalizations.of(context).translate(connection.tenantId ?? 'NA')}', - '${connection.tenantId ?? 'NA'}', - '${connection.connectionHolders?.first.name ?? 'NA'}', - '${ApplicationLocalizations.of(context).translate(connection.connectionHolders?.first.gender ?? 'NA')}', - '${connection.connectionHolders?.first.fatherOrHusbandName ?? 'NA'}', - maskMobileNumber('${connection.connectionHolders?.first.mobileNumber ?? 'NA'}'), - '${connection.oldConnectionNo ?? 'NA'}', - '${connection.connectionNo ?? 'NA'}', - '${ApplicationLocalizations.of(context).translate(connection.additionalDetails?.category ?? 'NA')}', - '${ApplicationLocalizations.of(context).translate(connection.additionalDetails?.subCategory ?? 'NA')}', - '${ApplicationLocalizations.of(context).translate(connection.additionalDetails?.propertyType ?? 'NA')}', - '${ApplicationLocalizations.of(context).translate(connection.connectionType ?? 'NA')}', - '${connection.connectionType == 'Metered' ?connection.additionalDetails?.lastDemandGeneratedDate != null && connection.additionalDetails?.lastDemandGeneratedDate != '' ? DateFormats.timeStampToDate(int.parse(connection.additionalDetails?.lastDemandGeneratedDate ?? 'NA')) :'NA' :'NA' }', - '${connection.connectionType == 'Metered' ? connection.meterId :'NA' }', - '${connection.connectionType == 'Metered' ? connection.additionalDetails?.meterReading :'NA' }', - '${connection.arrears != null ? '₹ ${connection.arrears}' : '-'}', - '${connection.penalty != null ? '₹ ${connection.penalty}' : '-'}', - '${connection.advance != null ? '₹ ${connection.advance}' : '-'}', - '${connection.additionalDetails?.totalAmount != null ? '₹ ${connection.additionalDetails?.totalAmount}' : '-'}', - '${connection.additionalDetails?.collectionAmount != null ? '₹ ${connection.additionalDetails?.collectionAmount}' : '-'}', - '${connection.additionalDetails?.collectionPendingAmount != null ? double.parse(connection.additionalDetails?.collectionPendingAmount ?? '') < 0.0 ? '₹ ${double.parse(connection.additionalDetails?.collectionPendingAmount ?? '0').abs()}' : '-' : '-'}', - '${connection.additionalDetails?.collectionPendingAmount != null ? double.parse(connection.additionalDetails?.collectionPendingAmount ?? '') < 0.0 ? '-' : '₹ ${double.parse(connection.additionalDetails?.collectionPendingAmount ?? '0').abs()}' : '-'}', - '${connection.additionalDetails?.appCreatedDate != null ? DateFormats.timeStampToDate(connection.additionalDetails?.appCreatedDate?.toInt()) : '-'}', - '${connection.additionalDetails?.lastDemandGeneratedDate != null && connection.additionalDetails?.lastDemandGeneratedDate != '' ? DateFormats.timeStampToDate(int.parse(connection.additionalDetails?.lastDemandGeneratedDate ?? '')) : '-'}', - '${connection.status.toString() == Constants.CONNECTION_STATUS.last ? 'Y' : 'N'}', + '${commonProvider.userDetails?.selectedtenant?.city?.code ?? 'NA'}', + '${ApplicationLocalizations.of(context).translate(connection.tenantId ?? 'NA')}', + '${connection.tenantId ?? 'NA'}', + '${connection.connectionHolders?.first.name ?? 'NA'}', + '${ApplicationLocalizations.of(context).translate(connection.connectionHolders?.first.gender ?? 'NA')}', + '${connection.connectionHolders?.first.fatherOrHusbandName ?? 'NA'}', + maskMobileNumber( + '${connection.connectionHolders?.first.mobileNumber ?? 'NA'}'), + '${connection.oldConnectionNo ?? 'NA'}', + '${connection.connectionNo ?? 'NA'}', + '${ApplicationLocalizations.of(context).translate(connection.additionalDetails?.category ?? 'NA')}', + '${ApplicationLocalizations.of(context).translate(connection.additionalDetails?.subCategory ?? 'NA')}', + '${ApplicationLocalizations.of(context).translate(connection.additionalDetails?.propertyType ?? 'NA')}', + '${ApplicationLocalizations.of(context).translate(connection.connectionType ?? 'NA')}', + '${connection.connectionType == 'Metered' ? connection.additionalDetails?.lastDemandGeneratedDate != null && connection.additionalDetails?.lastDemandGeneratedDate != '' ? DateFormats.timeStampToDate(int.parse(connection.additionalDetails?.lastDemandGeneratedDate ?? 'NA')) : 'NA' : 'NA'}', + '${connection.connectionType == 'Metered' ? connection.meterId : 'NA'}', + '${connection.connectionType == 'Metered' ? connection.additionalDetails?.meterReading : 'NA'}', + '${connection.arrears != null ? '₹ ${connection.arrears}' : '-'}', + '${connection.penalty != null ? '₹ ${connection.penalty}' : '-'}', + '${connection.advance != null ? '₹ ${connection.advance}' : '-'}', + '${connection.additionalDetails?.totalAmount != null ? '₹ ${connection.additionalDetails?.totalAmount}' : '-'}', + '${connection.additionalDetails?.collectionAmount != null ? '₹ ${connection.additionalDetails?.collectionAmount}' : '-'}', + '${connection.additionalDetails?.collectionPendingAmount != null ? double.parse(connection.additionalDetails?.collectionPendingAmount ?? '') < 0.0 ? '₹ ${double.parse(connection.additionalDetails?.collectionPendingAmount ?? '0').abs()}' : '-' : '-'}', + '${connection.additionalDetails?.collectionPendingAmount != null ? double.parse(connection.additionalDetails?.collectionPendingAmount ?? '') < 0.0 ? '-' : '₹ ${double.parse(connection.additionalDetails?.collectionPendingAmount ?? '0').abs()}' : '-'}', + '${connection.additionalDetails?.appCreatedDate != null ? DateFormats.timeStampToDate(connection.additionalDetails?.appCreatedDate?.toInt()) : '-'}', + '${connection.additionalDetails?.lastDemandGeneratedDate != null && connection.additionalDetails?.lastDemandGeneratedDate != '' ? DateFormats.timeStampToDate(int.parse(connection.additionalDetails?.lastDemandGeneratedDate ?? '')) : '-'}', + '${connection.status.toString() == Constants.CONNECTION_STATUS.last ? 'Y' : 'N'}', ]) .toList() ?? []; isExcelDownload ? generateExcel( - downloadHeaderList + downloadHeaderList .map((e) => '${ApplicationLocalizations.of(navigatorKey.currentContext!).translate(e)}') .toList(), excelTableData) : await HouseholdPdfCreator( context, - headerList.where((e) => e!=i18.consumer.OLD_CONNECTION_ID) + headerList + .where((e) => e != i18.consumer.OLD_CONNECTION_ID) .map((e) => '${ApplicationLocalizations.of(navigatorKey.currentContext!).translate(e)}') .toList(), diff --git a/frontend/mgramseva/lib/repository/billing_service_repo.dart b/frontend/mgramseva/lib/repository/billing_service_repo.dart index 0e892c4ce..3c819d747 100644 --- a/frontend/mgramseva/lib/repository/billing_service_repo.dart +++ b/frontend/mgramseva/lib/repository/billing_service_repo.dart @@ -55,12 +55,6 @@ class BillingServiceRepository extends BaseService { Future fetchAggregateDemand( Map queryparams) async { - // log(jsonEncode(queryparams)); - // log(jsonEncode( - // { - // 'RequestInfo': getRequestInfo('_search'), - // }, - // )); late AggragateDemandDetails aggItems; var res = await makeRequest( url: Url.FETCH_AGGREGATE_DEMAND, diff --git a/frontend/mgramseva/lib/screeens/consumer_details/consumer_details.dart b/frontend/mgramseva/lib/screeens/consumer_details/consumer_details.dart index 77c73576b..839317be6 100644 --- a/frontend/mgramseva/lib/screeens/consumer_details/consumer_details.dart +++ b/frontend/mgramseva/lib/screeens/consumer_details/consumer_details.dart @@ -644,23 +644,28 @@ class _ConsumerDetailsState extends State { if (consumerProvider.isEdit && consumerProvider.waterconnection.status == "Inactive") - Consumer( - builder: (_, consumerProvider, child) => - BuildTextField( - i18.consumer.CONSUMER_REMARKS, - property.owners!.first.consumerRemarksCtrl, - validator: (val) => - Validators.consumerRemarksValidator( - val, 20, i18.consumer.CONSUMER_REMARKS), - isRequired: true, - contextKey: consumerProvider - .consmerWalkthrougList[9].key, - key: Keys.createConsumer.CONSUMER_REMARKS_KEY, - inputFormatter: [ - FilteringTextInputFormatter.allow( - RegExp("[a-zA-Z0-9/\\-]")) - ], - isDisabled: false, + Visibility( + visible: + (consumerProvider.waterconnection.status == + "Inactive"), + child: Consumer( + builder: (_, consumerProvider, child) => + BuildTextField( + i18.consumer.CONSUMER_REMARKS, + property.owners!.first.consumerRemarksCtrl, + validator: (val) => + Validators.consumerRemarksValidator(val, + 20, i18.consumer.CONSUMER_REMARKS), + isRequired: true, + contextKey: consumerProvider + .consmerWalkthrougList[9].key, + key: Keys.createConsumer.CONSUMER_REMARKS_KEY, + inputFormatter: [ + FilteringTextInputFormatter.allow( + RegExp("[A-Za-z ]")) + ], + isDisabled: false, + ), ), ), diff --git a/frontend/mgramseva/lib/screeens/household_register/household_list.dart b/frontend/mgramseva/lib/screeens/household_register/household_list.dart index 148583319..cbe32cebb 100644 --- a/frontend/mgramseva/lib/screeens/household_register/household_list.dart +++ b/frontend/mgramseva/lib/screeens/household_register/household_list.dart @@ -1,3 +1,6 @@ +import 'dart:convert'; +import 'dart:developer'; + import 'package:flutter/material.dart'; import 'package:mgramseva/components/dashboard/bills_table.dart'; import 'package:mgramseva/model/connection/water_connection.dart'; @@ -58,6 +61,7 @@ class _HouseholdListState extends State { constraints.maxWidth < 760 ? 115.0 : (constraints.maxWidth / 6); var tableData = householdProvider .getCollectionsData(expenseList as List); + return tableData.isEmpty ? CommonWidgets.buildEmptyMessage( ApplicationLocalizations.of(context) From 59288451c44d0e3d1e4b426bc7a600d06b7aa268 Mon Sep 17 00:00:00 2001 From: Hari-egov Date: Fri, 7 Jun 2024 10:34:08 +0530 Subject: [PATCH 06/17] ISTE-39 and ISTE 159 --- .../generate_new_bill.dart | 13 +++++++------ .../new_consumer_bill.dart | 15 +-------------- .../lib/model/connection/property.dart | 2 +- .../lib/model/connection/water_connection.dart | 3 +++ .../model/connection/water_connection.g.dart | 16 +++++++++------- .../expenses_details/expenses_details.g.dart | 18 +++++++++--------- .../providers/consumer_details_provider.dart | 18 ++++++++++++++++-- .../consumer_details/consumer_details.dart | 1 + .../household_detail/household_detail.dart | 4 ++-- 9 files changed, 49 insertions(+), 41 deletions(-) diff --git a/frontend/mgramseva/lib/components/house_connection_and_bill/generate_new_bill.dart b/frontend/mgramseva/lib/components/house_connection_and_bill/generate_new_bill.dart index 779c5ff78..cb2b1c14a 100644 --- a/frontend/mgramseva/lib/components/house_connection_and_bill/generate_new_bill.dart +++ b/frontend/mgramseva/lib/components/house_connection_and_bill/generate_new_bill.dart @@ -120,14 +120,15 @@ class _GenerateNewBillState extends State { .meterReading == null ? "NA".toString() + : "${widget.waterConnection?.additionalDetails!.meterReading.toString()}" + : demandList.demands!.first.meterReadings! + .isNotEmpty + ? demandList.demands?.first.meterReadings! + .first.currentReading + .toString() : widget.waterConnection?.additionalDetails! .meterReading - .toString() - :demandList.demands!.first.meterReadings!.isNotEmpty? demandList.demands?.first.meterReadings!.first - .currentReading - .toString():widget.waterConnection?.additionalDetails! - .meterReading - .toString(), + .toString(), context), if (CommonProvider.getPenaltyOrAdvanceStatus( widget.waterConnection?.mdmsData, false) && diff --git a/frontend/mgramseva/lib/components/house_connection_and_bill/new_consumer_bill.dart b/frontend/mgramseva/lib/components/house_connection_and_bill/new_consumer_bill.dart index 71b4f3a55..eb14be5da 100644 --- a/frontend/mgramseva/lib/components/house_connection_and_bill/new_consumer_bill.dart +++ b/frontend/mgramseva/lib/components/house_connection_and_bill/new_consumer_bill.dart @@ -38,16 +38,6 @@ class NewConsumerBillState extends State { @override void initState() { super.initState(); - - WidgetsBinding.instance.addPostFrameCallback((timeStamp) { - // var houseHoldProvider = - // Provider.of(context, listen: false); - - // if (houseHoldProvider.isfirstdemand && - // widget.waterConnection?.connectionType != 'Metered') { - // createPDFInitCall(); - // } - }); } static getLabelText(label, value, context, {subLabel = ''}) { @@ -108,9 +98,6 @@ class NewConsumerBillState extends State { var penalty = billList.bill!.isEmpty ? Penalty(0.0, '0', false) : CommonProvider.getPenalty(widget.waterConnection?.demands); - // var penaltyApplicable = billList.bill!.isEmpty - // ? PenaltyApplicable(0.0) - // : CommonProvider.getPenaltyApplicable(widget.demandList); return LayoutBuilder(builder: (context, constraints) { // Handler Status @@ -594,7 +581,7 @@ class NewConsumerBillState extends State { (!(e.isPaymentCompleted ?? false) && e.status != 'CANCELLED')) .toList(); - demandList = demandList.map((e) => Demands.fromJson(e.toJson())).toList(); + // demandList = demandList.map((e) => Demands.fromJson(e.toJson())).toList(); demandList.forEach((e) { e.demandDetails?.sort((a, b) => diff --git a/frontend/mgramseva/lib/model/connection/property.dart b/frontend/mgramseva/lib/model/connection/property.dart index 867331df1..dbec36743 100644 --- a/frontend/mgramseva/lib/model/connection/property.dart +++ b/frontend/mgramseva/lib/model/connection/property.dart @@ -219,7 +219,7 @@ class Owners { setText() { name = consumerNameCtrl.text.trim(); - remarks = consumerRemarksCtrl.text; + remarks = consumerRemarksCtrl.text.trim(); mobileNumber = phoneNumberCtrl.text; fatherOrHusbandName = fatherOrSpouseCtrl.text.trim(); } diff --git a/frontend/mgramseva/lib/model/connection/water_connection.dart b/frontend/mgramseva/lib/model/connection/water_connection.dart index 62fc87b72..9e239ed20 100644 --- a/frontend/mgramseva/lib/model/connection/water_connection.dart +++ b/frontend/mgramseva/lib/model/connection/water_connection.dart @@ -330,6 +330,9 @@ class AdditionalDetails { @JsonKey(name: "totalamount") String? totalAmount; + @JsonKey(name: "remarks") + String? remarks; + @JsonKey(name: "appCreatedDate") num? appCreatedDate; diff --git a/frontend/mgramseva/lib/model/connection/water_connection.g.dart b/frontend/mgramseva/lib/model/connection/water_connection.g.dart index c4e271ea1..33f521a2d 100644 --- a/frontend/mgramseva/lib/model/connection/water_connection.g.dart +++ b/frontend/mgramseva/lib/model/connection/water_connection.g.dart @@ -15,19 +15,19 @@ WaterConnection _$WaterConnectionFromJson(Map json) => ..tenantId = json['tenantId'] as String? ..action = json['action'] as String? ..status = json['status'] as String? - ..meterInstallationDate = json['meterInstallationDate'] as int? + ..meterInstallationDate = (json['meterInstallationDate'] as num?)?.toInt() ..documents = json['documents'] == null ? null : Documents.fromJson(json['documents'] as Map) - ..proposedTaps = json['proposedTaps'] as int? - ..noOfTaps = json['noOfTaps'] as int? + ..proposedTaps = (json['proposedTaps'] as num?)?.toInt() + ..noOfTaps = (json['noOfTaps'] as num?)?.toInt() ..arrears = (json['arrears'] as num?)?.toDouble() ..connectionType = json['connectionType'] as String? ..oldConnectionNo = json['oldConnectionNo'] as String? ..meterId = json['meterId'] as String? ..propertyType = json['propertyType'] as String? - ..previousReadingDate = json['previousReadingDate'] as int? - ..previousReading = json['previousReading'] as int? + ..previousReadingDate = (json['previousReadingDate'] as num?)?.toInt() + ..previousReading = (json['previousReading'] as num?)?.toInt() ..proposedPipeSize = (json['proposedPipeSize'] as num?)?.toDouble() ..connectionHolders = (json['connectionHolders'] as List?) ?.map((e) => Owners.fromJson(e as Map)) @@ -83,8 +83,8 @@ Map _$ProcessInstanceToJson(ProcessInstance instance) => AdditionalDetails _$AdditionalDetailsFromJson(Map json) => AdditionalDetails() - ..initialMeterReading = json['initialMeterReading'] as int? - ..meterReading = json['meterReading'] as int? + ..initialMeterReading = (json['initialMeterReading'] as num?)?.toInt() + ..meterReading = (json['meterReading'] as num?)?.toInt() ..locality = json['locality'] as String? ..category = json['category'] as String? ..subCategory = json['subCategory'] as String? @@ -96,6 +96,7 @@ AdditionalDetails _$AdditionalDetailsFromJson(Map json) => ..collectionAmount = json['collectionAmount'] as String? ..collectionPendingAmount = json['collectionPendingAmount'] as String? ..totalAmount = json['totalamount'] as String? + ..remarks = json['remarks'] as String? ..appCreatedDate = json['appCreatedDate'] as num? ..action = json['action'] as String?; @@ -114,6 +115,7 @@ Map _$AdditionalDetailsToJson(AdditionalDetails instance) => 'collectionAmount': instance.collectionAmount, 'collectionPendingAmount': instance.collectionPendingAmount, 'totalamount': instance.totalAmount, + 'remarks': instance.remarks, 'appCreatedDate': instance.appCreatedDate, 'action': instance.action, }; diff --git a/frontend/mgramseva/lib/model/expenses_details/expenses_details.g.dart b/frontend/mgramseva/lib/model/expenses_details/expenses_details.g.dart index 4565dd482..2ced20fc9 100644 --- a/frontend/mgramseva/lib/model/expenses_details/expenses_details.g.dart +++ b/frontend/mgramseva/lib/model/expenses_details/expenses_details.g.dart @@ -9,7 +9,7 @@ part of 'expenses_details.dart'; ExpensesDetailsWithPagination _$ExpensesDetailsWithPaginationFromJson( Map json) => ExpensesDetailsWithPagination() - ..totalCount = json['totalCount'] as int? + ..totalCount = (json['totalCount'] as num?)?.toInt() ..billDataCount = json['billData'] == null ? null : BillDataCount.fromJson(json['billData'] as Map) @@ -55,17 +55,17 @@ ExpensesDetailsModel _$ExpensesDetailsModelFromJson( ..expensesAmount = (json['amount'] as List?) ?.map((e) => ExpensesAmount.fromJson(e as Map)) .toList() - ..billDate = json['billDate'] as int? - ..paidDate = json['paidDate'] as int? - ..billIssuedDate = json['billIssuedDate'] as int? + ..billDate = (json['billDate'] as num?)?.toInt() + ..paidDate = (json['paidDate'] as num?)?.toInt() + ..billIssuedDate = (json['billIssuedDate'] as num?)?.toInt() ..challanNo = json['challanNo'] as String? ..accountId = json['accountId'] as String? ..applicationStatus = json['applicationStatus'] as String? ..totalAmount = (json['totalAmount'] as num?)?.toDouble() ..isBillPaid = json['isBillPaid'] as bool? ?? false ..fileStoreId = json['filestoreid'] as String? - ..taxPeriodFrom = json['taxPeriodFrom'] as int? - ..taxPeriodTo = json['taxPeriodTo'] as int?; + ..taxPeriodFrom = (json['taxPeriodFrom'] as num?)?.toInt() + ..taxPeriodTo = (json['taxPeriodTo'] as num?)?.toInt(); Map _$ExpensesDetailsModelToJson( ExpensesDetailsModel instance) => @@ -105,7 +105,7 @@ Map _$ExpensesAmountToJson(ExpensesAmount instance) => }; Citizen _$CitizenFromJson(Map json) => Citizen() - ..id = json['id'] as int? + ..id = (json['id'] as num?)?.toInt() ..uuid = json['uuid'] as String? ..userName = json['userName'] as String? ..name = json['name'] as String? @@ -122,8 +122,8 @@ Map _$CitizenToJson(Citizen instance) => { AuditDetails _$AuditDetailsFromJson(Map json) => AuditDetails() ..createdBy = json['createdBy'] as String? ..lastModifiedBy = json['lastModifiedBy'] as String? - ..createdTime = json['createdTime'] as int? - ..lastModifiedTime = json['lastModifiedTime'] as int?; + ..createdTime = (json['createdTime'] as num?)?.toInt() + ..lastModifiedTime = (json['lastModifiedTime'] as num?)?.toInt(); Map _$AuditDetailsToJson(AuditDetails instance) => { diff --git a/frontend/mgramseva/lib/providers/consumer_details_provider.dart b/frontend/mgramseva/lib/providers/consumer_details_provider.dart index 5c1fc04fe..037144199 100644 --- a/frontend/mgramseva/lib/providers/consumer_details_provider.dart +++ b/frontend/mgramseva/lib/providers/consumer_details_provider.dart @@ -80,7 +80,9 @@ class ConsumerProvider with ChangeNotifier { "channel": "CITIZEN", "ownershipCategory": "INDIVIDUAL", "owners": [ - Owners.fromJson({"ownerType": "NONE"}).toJson() + Owners.fromJson({ + "ownerType": "NONE", + }).toJson() ], "address": Address().toJson() }); @@ -135,6 +137,7 @@ class ConsumerProvider with ChangeNotifier { "tenantId": commonProvider.userDetails!.selectedtenant!.code, "connectionNumber": id.split('_').join('/') }); + if (waterconnections.waterConnection != null && waterconnections.waterConnection!.isNotEmpty) { setWaterConnection(waterconnections.waterConnection?.first); @@ -231,6 +234,7 @@ class ConsumerProvider with ChangeNotifier { paymentDetails.payments!.isNotEmpty) { isFirstDemand = true; } + notifyListeners(); } catch (e, s) { ErrorHandler().allExceptionsHandler(navigatorKey.currentContext!, e, s); @@ -306,7 +310,8 @@ class ConsumerProvider with ChangeNotifier { : waterconnection.additionalDetails?.subCategory, "aadharNumber": waterconnection.addharCtrl.text.trim().isEmpty ? null - : waterconnection.addharCtrl.text.trim() + : waterconnection.addharCtrl.text.trim(), + "remarks": property.owners?.first.remarks }); } else { waterconnection.additionalDetails!.locality = @@ -330,6 +335,9 @@ class ConsumerProvider with ChangeNotifier { waterconnection.additionalDetails!.meterReading = waterconnection.previousReading; waterconnection.additionalDetails!.propertyType = property.propertyType; + + waterconnection.additionalDetails!.remarks = + property.owners?.first.remarks; } try { @@ -448,6 +456,11 @@ class ConsumerProvider with ChangeNotifier { var res = await ConsumerRepository().getProperty(query); if (res != null) property = new Property.fromJson(res['Properties'].first); + + property.owners!.first.remarks = + waterconnection.additionalDetails?.remarks ?? "-"; + // property.owners!.first.remarks = + // waterconnection.additionalDetails?.remarks ?? ""; property.owners!.first.getText(); property.address.getText(); @@ -459,6 +472,7 @@ class ConsumerProvider with ChangeNotifier { commonProvider.userDetails!.selectedtenant!.code!; property.address.gpNameCityCodeCtrl.text = commonProvider.userDetails!.selectedtenant!.city!.code!; + streamController.add(property); notifyListeners(); } catch (e) { diff --git a/frontend/mgramseva/lib/screeens/consumer_details/consumer_details.dart b/frontend/mgramseva/lib/screeens/consumer_details/consumer_details.dart index 839317be6..a66d73f44 100644 --- a/frontend/mgramseva/lib/screeens/consumer_details/consumer_details.dart +++ b/frontend/mgramseva/lib/screeens/consumer_details/consumer_details.dart @@ -501,6 +501,7 @@ class _ConsumerDetailsState extends State { .waterconnection .om_5Ctrl, isRequired: false, + isDisabled: true, ) : Text(""), ], diff --git a/frontend/mgramseva/lib/screeens/household_detail/household_detail.dart b/frontend/mgramseva/lib/screeens/household_detail/household_detail.dart index 2ac460db1..92192c34d 100644 --- a/frontend/mgramseva/lib/screeens/household_detail/household_detail.dart +++ b/frontend/mgramseva/lib/screeens/household_detail/household_detail.dart @@ -1,3 +1,4 @@ +import 'dart:convert'; import 'dart:developer'; import 'package:flutter/material.dart'; @@ -52,8 +53,7 @@ class _HouseholdDetailState extends State { buildDemandView(DemandList data) { var houseHoldProvider = Provider.of(context, listen: false); - log("${houseHoldProvider.waterConnection?.connectionType}"); - log("${houseHoldProvider.isfirstdemand}"); + return Column( children: [ data.demands!.isEmpty From cdc5b77df17e35eefa657eb78e878ea729ca919c Mon Sep 17 00:00:00 2001 From: Hari-egov Date: Fri, 7 Jun 2024 14:43:00 +0530 Subject: [PATCH 07/17] ISTE 159 & ISTE 39 FIX --- .../providers/consumer_details_provider.dart | 11 +++---- .../providers/search_connection_provider.dart | 30 +++++++++++-------- .../connection_details_card.dart | 2 -- .../consumer_details/consumer_details.dart | 28 +++++++++++------ 4 files changed, 43 insertions(+), 28 deletions(-) diff --git a/frontend/mgramseva/lib/providers/consumer_details_provider.dart b/frontend/mgramseva/lib/providers/consumer_details_provider.dart index 037144199..27667409d 100644 --- a/frontend/mgramseva/lib/providers/consumer_details_provider.dart +++ b/frontend/mgramseva/lib/providers/consumer_details_provider.dart @@ -17,6 +17,7 @@ import 'package:mgramseva/model/mdms/property_type.dart'; import 'package:mgramseva/model/mdms/sub_category_type.dart'; import 'package:mgramseva/model/mdms/tax_period.dart'; import 'package:mgramseva/providers/common_provider.dart'; +import 'package:mgramseva/providers/search_connection_provider.dart'; import 'package:mgramseva/repository/billing_service_repo.dart'; import 'package:mgramseva/repository/consumer_details_repo.dart'; import 'package:mgramseva/repository/core_repo.dart'; @@ -86,6 +87,7 @@ class ConsumerProvider with ChangeNotifier { ], "address": Address().toJson() }); + if (boundaryList.length == 1) { property.address.localityCtrl = boundaryList.first; onChangeOfLocality(property.address.localityCtrl); @@ -354,6 +356,7 @@ class ConsumerProvider with ChangeNotifier { if (result2 != null) { setModel(); phoneNumberAutoValidation = false; + streamController.add(property); Notifiers.getToastMessage( context, i18.consumer.REGISTER_SUCCESS, 'SUCCESS'); @@ -448,7 +451,9 @@ class ConsumerProvider with ChangeNotifier { } } - Future getProperty(Map query) async { + Future getProperty( + Map query, + ) async { try { var commonProvider = Provider.of( navigatorKey.currentContext!, @@ -457,10 +462,6 @@ class ConsumerProvider with ChangeNotifier { if (res != null) property = new Property.fromJson(res['Properties'].first); - property.owners!.first.remarks = - waterconnection.additionalDetails?.remarks ?? "-"; - // property.owners!.first.remarks = - // waterconnection.additionalDetails?.remarks ?? ""; property.owners!.first.getText(); property.address.getText(); diff --git a/frontend/mgramseva/lib/providers/search_connection_provider.dart b/frontend/mgramseva/lib/providers/search_connection_provider.dart index e5ea0342b..5c2e1529a 100644 --- a/frontend/mgramseva/lib/providers/search_connection_provider.dart +++ b/frontend/mgramseva/lib/providers/search_connection_provider.dart @@ -1,4 +1,5 @@ import 'dart:async'; +import 'dart:developer'; import 'package:flutter/material.dart'; import 'package:mgramseva/model/connection/search_connection.dart'; import 'package:mgramseva/model/connection/water_connections.dart'; @@ -60,25 +61,30 @@ class SearchConnectionProvider with ChangeNotifier { Loaders.showLoadingDialog(context); var inputJson = searchconnection.toJson(); inputJson.removeWhere((key, value) => value == ""); - var connectionresults = isNameSearch == true ? SearchConnectionRepository().getConnectionName({ - "tenantId": commonProvider.userDetails!.selectedtenant!.code, - ...inputJson - }) : SearchConnectionRepository().getconnection({ - "tenantId": commonProvider.userDetails!.selectedtenant!.code, - ...inputJson - }); + var connectionresults = isNameSearch == true + ? SearchConnectionRepository().getConnectionName({ + "tenantId": commonProvider.userDetails!.selectedtenant!.code, + ...inputJson + }) + : SearchConnectionRepository().getconnection({ + "tenantId": commonProvider.userDetails!.selectedtenant!.code, + ...inputJson + }); /// popping the loader - connectionresults.then( (value) => { Navigator.pop(context), - if (value.waterConnectionData!.length > 0 || value.waterConnection!.length > 0) + if (value.waterConnectionData!.length > 0 || + value.waterConnection!.length > 0) { waterConnections = value, Navigator.pushNamed( - context, Routes.SEARCH_CONSUMER_RESULT, - arguments: {...inputJson, ...arguments, "isNameSearch" : isNameSearch }) + context, Routes.SEARCH_CONSUMER_RESULT, arguments: { + ...inputJson, + ...arguments, + "isNameSearch": isNameSearch + }) } else { @@ -91,7 +97,7 @@ class SearchConnectionProvider with ChangeNotifier { Navigator.pop(context); ErrorHandler().allExceptionsHandler(context, e, s); }); - } catch (e, s) { + } catch (e, s) { Navigator.pop(context); ErrorHandler().allExceptionsHandler(context, e, s); } diff --git a/frontend/mgramseva/lib/screeens/connection_results/connection_details_card.dart b/frontend/mgramseva/lib/screeens/connection_results/connection_details_card.dart index 8b6b1fee3..bf9ea007d 100644 --- a/frontend/mgramseva/lib/screeens/connection_results/connection_details_card.dart +++ b/frontend/mgramseva/lib/screeens/connection_results/connection_details_card.dart @@ -285,8 +285,6 @@ class SearchConnectionDetailCard extends StatelessWidget { .HOUSE_DETAILS_VIEW : i18.searchWaterConnection .HOUSE_DETAILS_EDIT, () { - log("${isNameSearch}"); - log("${jsonEncode(waterconnections.waterConnection![index])}"); Navigator.pushNamed( context, (arguments['Mode'] == 'collect' diff --git a/frontend/mgramseva/lib/screeens/consumer_details/consumer_details.dart b/frontend/mgramseva/lib/screeens/consumer_details/consumer_details.dart index a66d73f44..eabcaa487 100644 --- a/frontend/mgramseva/lib/screeens/consumer_details/consumer_details.dart +++ b/frontend/mgramseva/lib/screeens/consumer_details/consumer_details.dart @@ -7,6 +7,7 @@ import 'package:mgramseva/model/connection/property.dart'; import 'package:mgramseva/model/connection/water_connection.dart'; import 'package:mgramseva/providers/common_provider.dart'; import 'package:mgramseva/providers/consumer_details_provider.dart'; +import 'package:mgramseva/providers/search_connection_provider.dart'; import 'package:mgramseva/screeens/consumer_details/consumer_details_walk_through/walk_flow_container.dart'; import 'package:mgramseva/screeens/consumer_details/consumer_details_walk_through/walk_through.dart'; import 'package:mgramseva/screeens/generate_bill/widgets/meter_reading.dart'; @@ -69,15 +70,18 @@ class _ConsumerDetailsState extends State { var commonProvider = Provider.of( navigatorKey.currentContext!, listen: false); + consumerProvider ..setModel() ..setWaterConnection(widget.waterConnection) ..fetchBoundary() ..getPaymentType() - ..getProperty({ - "tenantId": commonProvider.userDetails!.selectedtenant!.code, - "propertyIds": widget.waterConnection!.propertyId - }) + ..getProperty( + { + "tenantId": commonProvider.userDetails!.selectedtenant!.code, + "propertyIds": widget.waterConnection!.propertyId + }, + ) ..autoValidation = false ..formKey = GlobalKey() ..setWalkThrough(ConsumerWalkThrough().consumerWalkThrough.map((e) { @@ -89,6 +93,7 @@ class _ConsumerDetailsState extends State { WidgetsBinding.instance.addPostFrameCallback((_) { Provider.of(navigatorKey.currentContext!, listen: false); + consumerProvider ..setModel() ..getWaterConnection(widget.id) @@ -650,9 +655,14 @@ class _ConsumerDetailsState extends State { (consumerProvider.waterconnection.status == "Inactive"), child: Consumer( - builder: (_, consumerProvider, child) => - BuildTextField( - i18.consumer.CONSUMER_REMARKS, + builder: (_, consumerProvider, child) { + property.owners!.first.consumerRemarksCtrl + .text = consumerProvider.waterconnection + .additionalDetails!.remarks ?? + ""; + return BuildTextField( + "Remarks", + // i18.consumer.CONSUMER_REMARKS, property.owners!.first.consumerRemarksCtrl, validator: (val) => Validators.consumerRemarksValidator(val, @@ -666,8 +676,8 @@ class _ConsumerDetailsState extends State { RegExp("[A-Za-z ]")) ], isDisabled: false, - ), - ), + ); + }), ), // REMARKS From 27a36d1ae5fe53570fdb68b8c158146600650e79 Mon Sep 17 00:00:00 2001 From: Hari-egov Date: Fri, 7 Jun 2024 14:47:49 +0530 Subject: [PATCH 08/17] ISTE 159,39 UAT Build --- frontend/mgramseva/lib/env/app_config.dart | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/frontend/mgramseva/lib/env/app_config.dart b/frontend/mgramseva/lib/env/app_config.dart index 94253b5b1..d94f65699 100644 --- a/frontend/mgramseva/lib/env/app_config.dart +++ b/frontend/mgramseva/lib/env/app_config.dart @@ -27,9 +27,13 @@ dynamic get apiBaseUrl { } Map devConstants = { - _baseUrl: kIsWeb - ? (window.location.origin) + "/" - : const String.fromEnvironment('BASE_URL'), + // PROD + // _baseUrl: "https://mgramseva-dwss.punjab.gov.in/", + // UAT + _baseUrl: "https://mgramseva-uat.psegs.in/", + // _baseUrl: kIsWeb + // ? (window.location.origin) + "/" + // : const String.fromEnvironment('BASE_URL'), }; Map stageConstants = { From 29427219737bb0b0d9bd8a15335912906e8d280e Mon Sep 17 00:00:00 2001 From: Hari-egov Date: Fri, 7 Jun 2024 16:25:27 +0530 Subject: [PATCH 09/17] Meter Connection disable removed --- .../lib/screeens/consumer_details/consumer_details.dart | 1 - 1 file changed, 1 deletion(-) diff --git a/frontend/mgramseva/lib/screeens/consumer_details/consumer_details.dart b/frontend/mgramseva/lib/screeens/consumer_details/consumer_details.dart index eabcaa487..6cbc7a2e5 100644 --- a/frontend/mgramseva/lib/screeens/consumer_details/consumer_details.dart +++ b/frontend/mgramseva/lib/screeens/consumer_details/consumer_details.dart @@ -506,7 +506,6 @@ class _ConsumerDetailsState extends State { .waterconnection .om_5Ctrl, isRequired: false, - isDisabled: true, ) : Text(""), ], From 0d997a6f61e671eee65d54784ec3da1f1bfda0f1 Mon Sep 17 00:00:00 2001 From: debasishchakraborty-egovt Date: Tue, 11 Jun 2024 18:13:34 +0530 Subject: [PATCH 10/17] ISTE-44-pending issue: added chnages asked by anniket for bill genration fix --- .../wscalculation/consumer/DemandGenerationConsumer.java | 5 ++--- .../org/egov/wscalculation/service/DemandService.java | 8 ++++---- .../wscalculation/service/WSCalculationServiceImpl.java | 6 +++--- 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/municipal-services/ws-calculator/src/main/java/org/egov/wscalculation/consumer/DemandGenerationConsumer.java b/municipal-services/ws-calculator/src/main/java/org/egov/wscalculation/consumer/DemandGenerationConsumer.java index 94995c078..78a7d4f26 100644 --- a/municipal-services/ws-calculator/src/main/java/org/egov/wscalculation/consumer/DemandGenerationConsumer.java +++ b/municipal-services/ws-calculator/src/main/java/org/egov/wscalculation/consumer/DemandGenerationConsumer.java @@ -187,11 +187,11 @@ public void listenDeadLetterTopic(final List> records) { */ private void generateDemandInBatch(CalculationReq request, Map masterMap, String errorTopic, boolean isSendMessage) throws Exception { - for (CalculationCriteria criteria : request.getCalculationCriteria()) { + /*for (CalculationCriteria criteria : request.getCalculationCriteria()) { Boolean genratedemand = true; wsCalulationWorkflowValidator.applicationValidation(request.getRequestInfo(), criteria.getTenantId(), criteria.getConnectionNo(), genratedemand); - } + }*/ System.out.println("Calling Bulk Demand generation connection Number" + request.getCalculationCriteria().get(0).getConnectionNo()); wSCalculationServiceImpl.bulkDemandGeneration(request, masterMap); /*String connectionNoStrings = request.getCalculationCriteria().stream() @@ -517,7 +517,6 @@ private void generateDemandAndSendnotification(RequestInfo requestInfo, String t public void generateDemandInBulk(CalculationReq calculationReq, String billingCycle, Map masterMap, boolean isSendMessage,String tenantId) { - log.info("masterMap:"+masterMap); try { if(!tenantId.equals(config.getSmsExcludeTenant())) { generateDemandInBatch(calculationReq, masterMap, billingCycle, isSendMessage); 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 11104a17f..c768cc8c2 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 @@ -937,12 +937,12 @@ private List updateDemandForCalculation(RequestInfo requestInfo, List demandDetails = new LinkedList<>(); calculation.getTaxHeadEstimates().forEach(taxHeadEstimate -> { @@ -1028,7 +1028,7 @@ private List updateDemandForCalculation(RequestInfo requestInfo, List waterConnectionList = calculatorUtils.getWaterConnection(requestInfo, @@ -1050,7 +1050,7 @@ private List updateDemandForCalculation(RequestInfo requestInfo, List billingSlabIds = estimatesAndBillingSlabs.get("billingSlabIds"); WaterConnection waterConnection = criteria.getWaterConnection(); - Property property = wSCalculationUtil.getProperty( - WaterConnectionRequest.builder().waterConnection(waterConnection).requestInfo(requestInfo).build()); + /*Property property = wSCalculationUtil.getProperty( + WaterConnectionRequest.builder().waterConnection(waterConnection).requestInfo(requestInfo).build());*/ - String tenantId = null != property.getTenantId() ? property.getTenantId() : criteria.getTenantId(); + String tenantId = criteria.getTenantId(); /*Map taxHeadCategoryMap = ((List) masterMap From b4e6559de6e8003ae539589743386af9d6678658 Mon Sep 17 00:00:00 2001 From: Taniya-eGov <103186387+Taniya-eGov@users.noreply.github.com> Date: Wed, 12 Jun 2024 12:49:07 +0530 Subject: [PATCH 11/17] updated application.properties --- .../billing-service/src/main/resources/application.properties | 1 + 1 file changed, 1 insertion(+) diff --git a/business-services/billing-service/src/main/resources/application.properties b/business-services/billing-service/src/main/resources/application.properties index b38493e0d..d5c30b522 100644 --- a/business-services/billing-service/src/main/resources/application.properties +++ b/business-services/billing-service/src/main/resources/application.properties @@ -113,6 +113,7 @@ egov.apportion.endpoint=/apportion-service/v2/demand/_apportion # billgen notif topic kafka.topics.billgen.topic.name=billing-billgen-topic-name bill.notification.fallback.locale=en_IN +kafka.topics.cancel.bill.topic.name=bill-cancel-topic-name # notif topic kafka.topics.notification.sms=egov.core.notification.sms From 2c9ef9d9225c05289e14212b603df847f39c3d8a Mon Sep 17 00:00:00 2001 From: Hari-egov Date: Wed, 12 Jun 2024 16:26:35 +0530 Subject: [PATCH 12/17] ISTE-173-FIX --- .../modules/hrms/src/components/hrmscard.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/modules/hrms/src/components/hrmscard.js b/frontend/micro-ui/web/micro-ui-internals/packages/modules/hrms/src/components/hrmscard.js index d2548841f..2a7a1893c 100644 --- a/frontend/micro-ui/web/micro-ui-internals/packages/modules/hrms/src/components/hrmscard.js +++ b/frontend/micro-ui/web/micro-ui-internals/packages/modules/hrms/src/components/hrmscard.js @@ -4,6 +4,7 @@ import { useTranslation } from "react-i18next"; import EmployeeModuleCard from "./EmployeeModuleCard"; const HRMSCard = () => { + const ADMIN = Digit.Utils.hrmsAccess(); const STATE_ADMIN = Digit.UserService.hasAccess(["STATE_ADMIN"]); const DIV_ADMIN = Digit.UserService.hasAccess(["DIV_ADMIN"]); @@ -11,6 +12,7 @@ const HRMSCard = () => { if (!ADMIN) { return null; } + const { t } = useTranslation(); const tenantId = Digit.ULBService.getCurrentTenantId(); let roles = STATE_ADMIN @@ -45,6 +47,16 @@ const HRMSCard = () => { ] : []; + const moduleForDivisionUser = + DIV_ADMIN && MDMS_ADMIN? + [ + { + label: t("WORK_BENCH_URL_PENALTY_MASTER_DATA"), + link: `${window?.location?.origin}/workbench-ui/employee/mdms-search-v2?moduleName=ws-services-calculation&masterName=Penalty`, + }, + ] : []; + + const propsForModuleCard = { Icon: , moduleName: t("ACTION_TEST_HRMS"), @@ -75,10 +87,12 @@ const HRMSCard = () => { }, ...moduleForSomeDIVAdmin, ...moduleForSomeSTATEUser, + ...moduleForDivisionUser, ], }; return ; }; + export default HRMSCard; From c6b30bc72fbff94e8692f52b0b6e2396eec870b8 Mon Sep 17 00:00:00 2001 From: Hari-egov Date: Wed, 12 Jun 2024 18:13:07 +0530 Subject: [PATCH 13/17] ISTE-173 FIX -2 --- .../packages/modules/hrms/src/components/hrmscard.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/modules/hrms/src/components/hrmscard.js b/frontend/micro-ui/web/micro-ui-internals/packages/modules/hrms/src/components/hrmscard.js index 2a7a1893c..bff488035 100644 --- a/frontend/micro-ui/web/micro-ui-internals/packages/modules/hrms/src/components/hrmscard.js +++ b/frontend/micro-ui/web/micro-ui-internals/packages/modules/hrms/src/components/hrmscard.js @@ -52,7 +52,8 @@ const HRMSCard = () => { [ { label: t("WORK_BENCH_URL_PENALTY_MASTER_DATA"), - link: `${window?.location?.origin}/workbench-ui/employee/mdms-search-v2?moduleName=ws-services-calculation&masterName=Penalty`, + link: `${window?.location?.origin}/workbench-ui/employee/workbench/mdms-search-v2?moduleName=ws-services-calculation&masterName=Penalty`, + }, ] : []; From fd4ca00afa3b15849079250a701225bb4b3b8619 Mon Sep 17 00:00:00 2001 From: Hari-egov Date: Wed, 12 Jun 2024 18:31:05 +0530 Subject: [PATCH 14/17] ISTE -159,39 Changes requested by Naveen --- .../house_connection_and_bill/new_consumer_bill.dart | 2 -- frontend/mgramseva/lib/env/app_config.dart | 10 +++------- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/frontend/mgramseva/lib/components/house_connection_and_bill/new_consumer_bill.dart b/frontend/mgramseva/lib/components/house_connection_and_bill/new_consumer_bill.dart index eb14be5da..f7e65b94d 100644 --- a/frontend/mgramseva/lib/components/house_connection_and_bill/new_consumer_bill.dart +++ b/frontend/mgramseva/lib/components/house_connection_and_bill/new_consumer_bill.dart @@ -581,8 +581,6 @@ class NewConsumerBillState extends State { (!(e.isPaymentCompleted ?? false) && e.status != 'CANCELLED')) .toList(); - // demandList = demandList.map((e) => Demands.fromJson(e.toJson())).toList(); - demandList.forEach((e) { e.demandDetails?.sort((a, b) => a.auditDetails!.createdTime!.compareTo(b.auditDetails!.createdTime!)); diff --git a/frontend/mgramseva/lib/env/app_config.dart b/frontend/mgramseva/lib/env/app_config.dart index d94f65699..94253b5b1 100644 --- a/frontend/mgramseva/lib/env/app_config.dart +++ b/frontend/mgramseva/lib/env/app_config.dart @@ -27,13 +27,9 @@ dynamic get apiBaseUrl { } Map devConstants = { - // PROD - // _baseUrl: "https://mgramseva-dwss.punjab.gov.in/", - // UAT - _baseUrl: "https://mgramseva-uat.psegs.in/", - // _baseUrl: kIsWeb - // ? (window.location.origin) + "/" - // : const String.fromEnvironment('BASE_URL'), + _baseUrl: kIsWeb + ? (window.location.origin) + "/" + : const String.fromEnvironment('BASE_URL'), }; Map stageConstants = { From 230f1370e8e0943167936a1aae25ae4304e7d6c5 Mon Sep 17 00:00:00 2001 From: Hari-egov Date: Thu, 13 Jun 2024 11:53:05 +0530 Subject: [PATCH 15/17] CHANGES ISTE-173 - Commented Changes Done --- .../new_consumer_bill.dart | 73 +--- .../providers/collect_payment_provider.dart | 356 +++++++++--------- .../lib/providers/common_provider.dart | 4 +- .../household_register_provider.dart | 3 - 4 files changed, 187 insertions(+), 249 deletions(-) diff --git a/frontend/mgramseva/lib/components/house_connection_and_bill/new_consumer_bill.dart b/frontend/mgramseva/lib/components/house_connection_and_bill/new_consumer_bill.dart index f7e65b94d..80fb993a6 100644 --- a/frontend/mgramseva/lib/components/house_connection_and_bill/new_consumer_bill.dart +++ b/frontend/mgramseva/lib/components/house_connection_and_bill/new_consumer_bill.dart @@ -262,34 +262,7 @@ class NewConsumerBillState extends State { i18.common.CORE_NET_DUE_AMOUNT, "${netDueAmount(houseHoldProvider)}", context), - // if (CommonProvider - // .getPenaltyOrAdvanceStatus( - // widget.waterConnection - // ?.mdmsData, - // false, - // true) && - // houseHoldProvider.isfirstdemand && - // penalty.isDueDateCrossed) - // getLabelText( - // i18.billDetails.CORE_PENALTY, - // ('₹' + - // penaltyApplicable - // .penaltyApplicable - // .toString()), - // context), - // if (CommonProvider - // .getPenaltyOrAdvanceStatus( - // widget.waterConnection - // ?.mdmsData, - // true) && - // houseHoldProvider.isfirstdemand) - //Net due Amount - // getLabelText( - // i18.common.CORE_NET_DUE_AMOUNT, - // ('₹' + - // "${houseHoldProvider.aggDemandItems?.netDueWithPenalty ?? 0.0}" - // .toString()), - // context), + if (CommonProvider .getPenaltyOrAdvanceStatus( widget.waterConnection @@ -311,62 +284,18 @@ class NewConsumerBillState extends State { .CORE_NET_DUE_AMOUNT_WITH_PENALTY, ('₹' + "${(houseHoldProvider.aggDemandItems?.netDueWithPenalty ?? 0.0) + (houseHoldProvider.aggDemandItems?.totalApplicablePenalty ?? 0.0)}"), - // OLD - // CommonProvider - // .getNetDueAmountWithWithOutPenalty( - // billList - // .bill - // ?.first - // .totalAmount ?? - // 0, - // penalty, - // true) - // .toString()), - // OLD context, subLabel: getDueDatePenalty( penalty.date, context)) ], )), - // Total Amount Due - - // if (houseHoldProvider.isfirstdemand) - // getLabelText( - // i18.common.TOTAL_DUE_AMOUNT, - // ('₹' + - // (widget - // .demandList - // .first - // .demandDetails! - // .first - // .taxHeadMasterCode == - // 'WS_TIME_PENALTY' - // ? CommonProvider - // .getCurrentBill( - // widget - // .demandList) + - // CommonProvider - // .getArrearsAmountOncePenaltyExpires( - // widget - // .demandList) - // : CommonProvider - // .getTotalBillAmount( - // widget - // .demandList)) - // .toString()), - // context), - widget.mode == 'collect' ? Align( alignment: Alignment.centerLeft, child: houseHoldProvider .isfirstdemand == true - /*&& - houseHoldProvider.waterConnection! - .connectionType != - 'Metered'*/ ? ButtonGroup( i18.billDetails .COLLECT_PAYMENT, diff --git a/frontend/mgramseva/lib/providers/collect_payment_provider.dart b/frontend/mgramseva/lib/providers/collect_payment_provider.dart index bb740a01d..7d42b9e0c 100644 --- a/frontend/mgramseva/lib/providers/collect_payment_provider.dart +++ b/frontend/mgramseva/lib/providers/collect_payment_provider.dart @@ -258,174 +258,188 @@ class CollectPaymentProvider with ChangeNotifier { screenshotController .captureFromWidget( - Container( - width: kIsWeb ? 375 : 195, - margin: EdgeInsets.zero, - padding: EdgeInsets.zero, - child: Row( - children: [ - Column( - mainAxisSize: MainAxisSize.min, - children: [ - Row( - mainAxisAlignment: MainAxisAlignment.spaceAround, - children: [ - kIsWeb - ? SizedBox( - width: 70, - height: 70, - ) - : Image( - width: 40, - height: 40, - color: Colors.black, - image: NetworkImage(stateProvider - .stateInfo!.stateLogoURL - .toString())), - Container( - width: kIsWeb ? 290 : 90, + Container( + width: kIsWeb ? 375 : 195, + margin: EdgeInsets.zero, + padding: EdgeInsets.zero, + child: Row( + children: [ + Column( + mainAxisSize: MainAxisSize.min, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.spaceAround, + children: [ + kIsWeb + ? SizedBox( + width: 70, + height: 70, + ) + : Image( + width: 40, + height: 40, + color: Colors.black, + image: NetworkImage(stateProvider + .stateInfo!.stateLogoURL + .toString())), + Container( + width: kIsWeb ? 290 : 90, + margin: EdgeInsets.all(5), + child: Text( + ApplicationLocalizations.of( + navigatorKey.currentContext!) + .translate(i18.consumerReciepts + .GRAM_PANCHAYAT_WATER_SUPPLY_AND_SANITATION), + textScaleFactor: kIsWeb ? 3 : 1, + maxLines: 3, + style: TextStyle( + color: Colors.black, + fontSize: 10, + height: 1, + fontWeight: FontWeight.bold, + fontStyle: FontStyle.italic), + textAlign: TextAlign.left, + ), + ) + ], + ), + SizedBox( + height: 8, + ), + Container( + width: kIsWeb ? 375 : 90, margin: EdgeInsets.all(5), child: Text( - ApplicationLocalizations.of( - navigatorKey.currentContext!) - .translate(i18.consumerReciepts - .GRAM_PANCHAYAT_WATER_SUPPLY_AND_SANITATION), - textScaleFactor: kIsWeb ? 3 : 1, - maxLines: 3, - style: TextStyle( + ApplicationLocalizations.of( + navigatorKey.currentContext!) + .translate( + i18.consumerReciepts.WATER_RECEIPT), + textScaleFactor: kIsWeb ? 3 : 1, + style: TextStyle( color: Colors.black, fontSize: 10, height: 1, fontWeight: FontWeight.bold, - fontStyle: FontStyle.italic), - textAlign: TextAlign.left, - ), - ) - ], - ), - SizedBox( - height: 8, - ), - Container( - width: kIsWeb ? 375 : 90, - margin: EdgeInsets.all(5), - child: Text( - ApplicationLocalizations.of( - navigatorKey.currentContext!) - .translate(i18.consumerReciepts.WATER_RECEIPT), - textScaleFactor: kIsWeb ? 3 : 1, - style: TextStyle( + ))), + SizedBox( + height: 8, + ), + getPrinterLabel( + i18.consumerReciepts.RECEIPT_GPWSC_NAME, + ApplicationLocalizations.of( + navigatorKey.currentContext!) + .translate(commonProvider + .userDetails!.selectedtenant!.code!)), + getPrinterLabel( + i18.consumerReciepts.RECEIPT_CONSUMER_NO, + '${fetchBill.consumerCode}'), + getPrinterLabel( + i18.consumerReciepts.RECEIPT_CONSUMER_NAME, + '${item.paidBy}', + ), + getPrinterLabel( + i18.consumerReciepts.RECEIPT_CONSUMER_MOBILE_NO, + item.mobileNumber), + getPrinterLabel( + i18.consumerReciepts.RECEIPT_CONSUMER_ADDRESS, + ApplicationLocalizations.of( + navigatorKey.currentContext!) + .translate(houseHoldProvider + .waterConnection! + .additionalDetails! + .doorNo + .toString()) + + " " + + ApplicationLocalizations.of( + navigatorKey.currentContext!) + .translate( + '${houseHoldProvider.waterConnection?.additionalDetails?.street.toString()}') + + " " + + ApplicationLocalizations.of( + navigatorKey.currentContext!) + .translate( + '${houseHoldProvider.waterConnection?.additionalDetails?.locality.toString()}') + + " " + + ApplicationLocalizations.of( + navigatorKey.currentContext!) + .translate(commonProvider + .userDetails!.selectedtenant!.code!)), + SizedBox( + height: 10, + ), + getPrinterLabel(i18.consumer.SERVICE_TYPE, + '${houseHoldProvider.waterConnection!.connectionType.toString()}'), + getPrinterLabel( + i18.consumerReciepts.CONSUMER_RECEIPT_NO, + item.paymentDetails!.first.receiptNumber), + getPrinterLabel( + i18.consumerReciepts.RECEIPT_ISSUE_DATE, + DateFormats.timeStampToDate(item.transactionDate, + format: "dd/MM/yyyy") + .toString()), + getPrinterLabel( + i18.consumerReciepts.RECEIPT_BILL_PERIOD, + DateFormats.timeStampToDate( + item.paymentDetails?.last.bill!.billDetails! + .first.fromPeriod, + format: "dd/MM/yyyy") + + '-' + + DateFormats.timeStampToDate( + item.paymentDetails?.last.bill + ?.billDetails!.first.toPeriod, + format: "dd/MM/yyyy") + .toString()), + SizedBox( + height: 8, + ), + getPrinterLabel( + i18.consumerReciepts.CONSUMER_ACTUAL_DUE_AMOUNT, + ('₹' + (item.totalDue).toString())), + getPrinterLabel( + i18.consumerReciepts.RECEIPT_AMOUNT_PAID, + ('₹' + (item.totalAmountPaid).toString())), + getPrinterLabel( + i18.consumerReciepts.RECEIPT_AMOUNT_IN_WORDS, + ('Rupees ' + + (NumberToWord() + .convert( + 'en-in', item.totalAmountPaid!.toInt()) + .toString()) + + ' only')), + getPrinterLabel( + (item.totalDue ?? 0) - + (item.totalAmountPaid ?? 0) >= + 0 + ? i18.consumerReciepts.CONSUMER_PENDING_AMOUNT + : i18.common.CORE_ADVANCE, + ('₹' + + ((item.totalDue ?? 0) - + (item.totalAmountPaid ?? 0)) + .abs() + .toString())), + SizedBox( + height: 8, + ), + Text('- - *** - -', + textScaleFactor: kIsWeb ? 3 : 1, + textAlign: TextAlign.start, + style: TextStyle( + color: Colors.black, + fontSize: kIsWeb ? 5 : 6, + fontWeight: FontWeight.bold)), + Text( + "${ApplicationLocalizations.of(navigatorKey.currentContext!).translate(i18.common.RECEIPT_FOOTER)}", + textScaleFactor: kIsWeb ? 3 : 1, + textAlign: TextAlign.start, + style: TextStyle( color: Colors.black, - fontSize: 10, - height: 1, - fontWeight: FontWeight.bold, - ))), - SizedBox( - height: 8, - ), - getPrinterLabel( - i18.consumerReciepts.RECEIPT_GPWSC_NAME, - ApplicationLocalizations.of(navigatorKey.currentContext!) - .translate(commonProvider - .userDetails!.selectedtenant!.code!)), - getPrinterLabel(i18.consumerReciepts.RECEIPT_CONSUMER_NO, - '${fetchBill.consumerCode}'), - getPrinterLabel( - i18.consumerReciepts.RECEIPT_CONSUMER_NAME, - '${item.paidBy}', - ), - getPrinterLabel( - i18.consumerReciepts.RECEIPT_CONSUMER_MOBILE_NO, - item.mobileNumber), - getPrinterLabel( - i18.consumerReciepts.RECEIPT_CONSUMER_ADDRESS, - ApplicationLocalizations.of(navigatorKey.currentContext!) - .translate(houseHoldProvider - .waterConnection!.additionalDetails!.doorNo - .toString()) + - " " + - ApplicationLocalizations.of( - navigatorKey.currentContext!) - .translate( - '${houseHoldProvider.waterConnection?.additionalDetails?.street.toString()}') + - " " + - ApplicationLocalizations.of( - navigatorKey.currentContext!) - .translate( - '${houseHoldProvider.waterConnection?.additionalDetails?.locality.toString()}') + - " " + - ApplicationLocalizations.of( - navigatorKey.currentContext!) - .translate(commonProvider - .userDetails!.selectedtenant!.code!)), - SizedBox( - height: 10, - ), - getPrinterLabel(i18.consumer.SERVICE_TYPE, - '${houseHoldProvider.waterConnection!.connectionType.toString()}'), - getPrinterLabel(i18.consumerReciepts.CONSUMER_RECEIPT_NO, - item.paymentDetails!.first.receiptNumber), - getPrinterLabel( - i18.consumerReciepts.RECEIPT_ISSUE_DATE, - DateFormats.timeStampToDate(item.transactionDate, - format: "dd/MM/yyyy") - .toString()), - getPrinterLabel( - i18.consumerReciepts.RECEIPT_BILL_PERIOD, - DateFormats.timeStampToDate( - item.paymentDetails?.last.bill!.billDetails!.first - .fromPeriod, - format: "dd/MM/yyyy") + - '-' + - DateFormats.timeStampToDate( - item.paymentDetails?.last.bill?.billDetails! - .first.toPeriod, - format: "dd/MM/yyyy") - .toString()), - SizedBox( - height: 8, - ), - getPrinterLabel( - i18.consumerReciepts.CONSUMER_ACTUAL_DUE_AMOUNT, - ('₹' + (item.totalDue).toString())), - getPrinterLabel(i18.consumerReciepts.RECEIPT_AMOUNT_PAID, - ('₹' + (item.totalAmountPaid).toString())), - getPrinterLabel( - i18.consumerReciepts.RECEIPT_AMOUNT_IN_WORDS, - ('Rupees ' + - (NumberToWord() - .convert('en-in', item.totalAmountPaid!.toInt()) - .toString()) + - ' only')), - getPrinterLabel( - (item.totalDue ?? 0) - (item.totalAmountPaid ?? 0)>=0?i18.consumerReciepts.CONSUMER_PENDING_AMOUNT:i18.common.CORE_ADVANCE, - ('₹' + - ((item.totalDue ?? 0) - (item.totalAmountPaid ?? 0)).abs() - .toString())), - SizedBox( - height: 8, - ), - Text('- - *** - -', - textScaleFactor: kIsWeb ? 3 : 1, - textAlign: TextAlign.start, - style: TextStyle( - color: Colors.black, - fontSize: kIsWeb ? 5 : 6, - fontWeight: FontWeight.bold)), - Text( - "${ApplicationLocalizations.of(navigatorKey.currentContext!).translate(i18.common.RECEIPT_FOOTER)}", - textScaleFactor: kIsWeb ? 3 : 1, - textAlign: TextAlign.start, - style: TextStyle( - color: Colors.black, - fontSize: kIsWeb ? 5 : 6, - fontWeight: FontWeight.bold)), - ], - ), - ], - )), - pixelRatio: 16/9 - ) + fontSize: kIsWeb ? 5 : 6, + fontWeight: FontWeight.bold)), + ], + ), + ], + )), + pixelRatio: 16 / 9) .then((value) => { kIsWeb ? js.onButtonClick( @@ -518,7 +532,7 @@ class CollectPaymentProvider with ChangeNotifier { } Future updatePaymentInformation( - FetchBill fetchBill, Map query,BuildContext context) async { + FetchBill fetchBill, Map query, BuildContext context) async { var commonProvider = Provider.of(context, listen: false); var amount = fetchBill.customAmountCtrl.text; @@ -568,8 +582,7 @@ class CollectPaymentProvider with ChangeNotifier { "Payments": [paymentDetails.payments!.first] }, { - "key": query['connectionType'] == - 'Metered' + "key": query['connectionType'] == 'Metered' ? "ws-receipt" : "ws-receipt-nm", "tenantId": commonProvider.userDetails!.selectedtenant!.code, @@ -584,8 +597,7 @@ class CollectPaymentProvider with ChangeNotifier { "Payments": [paymentDetails.payments!.first] }, { - "key": query['connectionType'] == - 'Metered' + "key": query['connectionType'] == 'Metered' ? "ws-receipt" : "ws-receipt-nm", "tenantId": commonProvider.userDetails!.selectedtenant!.code, @@ -610,8 +622,8 @@ class CollectPaymentProvider with ChangeNotifier { } } - Future createTransaction( - FetchBill fetchBill, String tenantId, BuildContext context,Map query) async { + Future createTransaction(FetchBill fetchBill, String tenantId, + BuildContext context, Map query) async { var amount = fetchBill.customAmountCtrl.value.text; var transaction = { "Transaction": { @@ -630,9 +642,11 @@ class CollectPaymentProvider with ChangeNotifier { "mobileNumber": fetchBill.mobileNumber, "tenantId": tenantId }, - "callbackUrl": - "${apiBaseUrl}mgramseva/paymentSuccess", - "additionalDetails": {"isWhatsapp": false,"connectionType":query["connectionType"]} + "callbackUrl": "${apiBaseUrl}mgramseva/paymentSuccess", + "additionalDetails": { + "isWhatsapp": false, + "connectionType": query["connectionType"] + } } }; try { diff --git a/frontend/mgramseva/lib/providers/common_provider.dart b/frontend/mgramseva/lib/providers/common_provider.dart index 8eb71078e..cc7342ebe 100644 --- a/frontend/mgramseva/lib/providers/common_provider.dart +++ b/frontend/mgramseva/lib/providers/common_provider.dart @@ -81,9 +81,7 @@ class CommonProvider with ChangeNotifier { var response = await CoreRepository().getLocilisation(query); labels = localizedStrings = response; setLocalizationLabels(response); - } catch (e) { - print(e); - } + } catch (e) {} return labels; } diff --git a/frontend/mgramseva/lib/providers/household_register_provider.dart b/frontend/mgramseva/lib/providers/household_register_provider.dart index eb3fa2fd7..a9008d0c7 100644 --- a/frontend/mgramseva/lib/providers/household_register_provider.dart +++ b/frontend/mgramseva/lib/providers/household_register_provider.dart @@ -191,9 +191,6 @@ class HouseholdRegisterProvider with ChangeNotifier { : null, apiKey: 'connectionNumber', callBack: onSort), - // TableHeader(i18.common.VILLAGE_CODE, isSortingRequired: false), - // TableHeader(i18.common.VILLAGE_NAME, isSortingRequired: false), - // TableHeader(i18.common.TENANT_ID, isSortingRequired: false), TableHeader(i18.common.NAME, isSortingRequired: false), TableHeader(i18.common.GENDER, isSortingRequired: false), TableHeader(i18.consumer.FATHER_SPOUSE_NAME, isSortingRequired: false), From 2e6945ad29533a5f838a60f7659194d181939da1 Mon Sep 17 00:00:00 2001 From: Hari-egov Date: Fri, 14 Jun 2024 14:20:05 +0530 Subject: [PATCH 16/17] Remarks Localization Changes --- .../lib/screeens/consumer_details/consumer_details.dart | 6 +++--- .../mgramseva/lib/utils/constants/i18_key_constants.dart | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/frontend/mgramseva/lib/screeens/consumer_details/consumer_details.dart b/frontend/mgramseva/lib/screeens/consumer_details/consumer_details.dart index 6cbc7a2e5..4db67c9d2 100644 --- a/frontend/mgramseva/lib/screeens/consumer_details/consumer_details.dart +++ b/frontend/mgramseva/lib/screeens/consumer_details/consumer_details.dart @@ -660,12 +660,12 @@ class _ConsumerDetailsState extends State { .additionalDetails!.remarks ?? ""; return BuildTextField( - "Remarks", - // i18.consumer.CONSUMER_REMARKS, + + i18.consumer.CONSUMER_REMARKS, property.owners!.first.consumerRemarksCtrl, validator: (val) => Validators.consumerRemarksValidator(val, - 20, i18.consumer.CONSUMER_REMARKS), + 40, i18.consumer.CONSUMER_REMARKS), isRequired: true, contextKey: consumerProvider .consmerWalkthrougList[9].key, diff --git a/frontend/mgramseva/lib/utils/constants/i18_key_constants.dart b/frontend/mgramseva/lib/utils/constants/i18_key_constants.dart index 85f3cd1e0..5f6445386 100644 --- a/frontend/mgramseva/lib/utils/constants/i18_key_constants.dart +++ b/frontend/mgramseva/lib/utils/constants/i18_key_constants.dart @@ -481,7 +481,7 @@ class _Validators { String get PENALTY_VALIDATION => 'PENALTY_VALIDATION'; String get ADVANCE_VALIDATION => 'ADVANCE_VALIDATION'; String get OLD_CONNECTION_VALIDATION => 'OLD_CONNECTION_VALIDATION'; - String get REMARKS_VALIDATION => 'OLD_CONNECTION_VALIDATION'; + String get REMARKS_VALIDATION => 'REMARKS_VALIDATION'; String get STREET_VALIDATION => 'STREET_VALIDATION'; String get HOUSE_NUMBER_VALIDATION => 'HOUSE_NUMBER_VALIDATION'; String get CONSUMER_NAME_VALIDATION => 'CONSUMER_NAME_VALIDATION'; From e8c6b0f37e70c047e3602ea727a3dd5180920f2b Mon Sep 17 00:00:00 2001 From: debasishchakraborty-egovt Date: Fri, 14 Jun 2024 20:00:46 +0530 Subject: [PATCH 17/17] Added chnages for penalty --- .../src/main/java/org/egov/demand/service/DemandService.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 db0fa4fad..49b795ca4 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 @@ -684,7 +684,7 @@ public AggregatedDemandDetailResponse getAllDemands(DemandCriteria demandCriteri Integer rate = (Integer) paymentMasterData.get("rate"); String penaltyType = String.valueOf(paymentMasterData.get("type")); totalApplicablePenalty = currentmonthBill.multiply(new BigDecimal(rate).divide(new BigDecimal(100))); - totalApplicablePenalty = totalApplicablePenalty.setScale(0, RoundingMode.CEILING); + totalApplicablePenalty = totalApplicablePenalty.setScale(0, RoundingMode.HALF_UP); } else { log.info("MDMS data is Null Penalty not connfigured"); }