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)}',