From 1d52a6aea964acb54a9173b5e60f6bf221fff8e9 Mon Sep 17 00:00:00 2001 From: Rahul Dev Garg <34365102+rahuldevgarg@users.noreply.github.com> Date: Thu, 19 Oct 2023 10:42:51 +0530 Subject: [PATCH] PFM-4136 --- .../lib/providers/expenses_details_provider.dart | 10 +++++++--- .../mgramseva/lib/screeens/expense/search_expense.dart | 2 +- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/frontend/mgramseva/lib/providers/expenses_details_provider.dart b/frontend/mgramseva/lib/providers/expenses_details_provider.dart index da8e728d6..646ca3211 100644 --- a/frontend/mgramseva/lib/providers/expenses_details_provider.dart +++ b/frontend/mgramseva/lib/providers/expenses_details_provider.dart @@ -58,6 +58,9 @@ class ExpensesDetailsProvider with ChangeNotifier { else fetchVendors(); if (expensesDetails != null) { expenditureDetails = expensesDetails; + if(expenditureDetails.expenseType=='ELECTRICITY_BILL'){ + expenditureDetails.allowEdit = false; + } getStoreFileDetails(); } else if (id != null) { var commonProvider = @@ -524,16 +527,17 @@ class ExpensesDetailsProvider with ChangeNotifier { notifyListeners(); } - List> getExpenseTypeList() { + List> getExpenseTypeList({bool isSearch=false}) { var commonProvider = Provider.of( navigatorKey.currentContext!, listen: false); if (languageList?.mdmsRes?.expense?.expenseList != null) { var res = languageList?.mdmsRes?.pspclIntegration?.accountNumberGpMapping?.where((element) => element.departmentEntityCode==commonProvider.userDetails?.selectedtenant?.city?.code).toList(); + var temp_list = languageList?.mdmsRes?.expense?.expenseList?.toList(); if(res!.isNotEmpty){ - languageList?.mdmsRes?.expense?.expenseList!.removeWhere((element) => element.code=="20101"); + isSearch?{}:temp_list!.removeWhere((element) => element.code=="ELECTRICITY_BILL"); } - return (languageList?.mdmsRes?.expense?.expenseList ?? []) + return (temp_list ?? []) .map((value) { return DropdownMenuItem( value: value.code, diff --git a/frontend/mgramseva/lib/screeens/expense/search_expense.dart b/frontend/mgramseva/lib/screeens/expense/search_expense.dart index 298d46d4a..7b0d1acd3 100644 --- a/frontend/mgramseva/lib/screeens/expense/search_expense.dart +++ b/frontend/mgramseva/lib/screeens/expense/search_expense.dart @@ -80,7 +80,7 @@ class _SearchExpenseState extends State { '', '', onChangeOfExpense, - expensesDetailsProvider.getExpenseTypeList(), + expensesDetailsProvider.getExpenseTypeList(isSearch: true), false, hint: '${ApplicationLocalizations.of(context).translate(i18.common.ELECTRICITY_HINT)}',