From 30ca1894db02914905638e4ad3fbb72209c825ed Mon Sep 17 00:00:00 2001 From: Fatimah Alshammari Date: Sun, 24 Jul 2022 15:15:44 +0300 Subject: [PATCH] fix issues. --- assets/langs/ar-SA.json | 14 +++ assets/langs/en-US.json | 14 +++ lib/api/payslip/payslip_api_client.dart | 94 +++++++++++++++++++ lib/generated/codegen_loader.g.dart | 28 ++++++ lib/generated/locale_keys.g.dart | 14 +++ lib/models/generic_response_model.dart | 76 ++++++++++++--- lib/models/payslip/get_deductions_list.dart | 36 +++++++ lib/models/payslip/get_earnings_list.dart | 37 ++++++++ .../payslip/get_payment_information.dart | 33 +++++++ lib/models/payslip/get_payslip.dart | 38 ++++++++ .../payslip/get_summary_of_payment.dart | 38 ++++++++ lib/ui/landing/widget/app_drawer.dart | 42 ++++++--- lib/ui/misc/request_submit_screen.dart | 10 +- .../my_attendance/my_attendance_screen.dart | 16 ++-- lib/ui/profile/add_update_family_member.dart | 11 --- lib/ui/profile/basic_details.dart | 12 +-- lib/ui/profile/delete_family_member.dart | 2 +- .../dynamic_input_familyMembers_screen.dart | 17 +--- lib/ui/profile/family_members.dart | 8 +- lib/ui/profile/phone_numbers.dart | 6 +- lib/ui/screens/profile/profile_screen.dart | 6 +- 21 files changed, 467 insertions(+), 85 deletions(-) create mode 100644 lib/api/payslip/payslip_api_client.dart create mode 100644 lib/models/payslip/get_deductions_list.dart create mode 100644 lib/models/payslip/get_earnings_list.dart create mode 100644 lib/models/payslip/get_payment_information.dart create mode 100644 lib/models/payslip/get_payslip.dart create mode 100644 lib/models/payslip/get_summary_of_payment.dart diff --git a/assets/langs/ar-SA.json b/assets/langs/ar-SA.json index 7f22931..89f2ef6 100644 --- a/assets/langs/ar-SA.json +++ b/assets/langs/ar-SA.json @@ -251,6 +251,20 @@ "writeComment": "أكتب تعليقا", "approversList": "قائمة الموافقين", "yourRequestHasBeenSubmittedForApprovals": "تم تقديم طلبك للموافقات", + "correctCurrentDatails": "تعديل او اكمال التفاصيل الحالية", + "selectType": " حدد نوع التغيير الذي تريد القيام به", + "enterNewInfo": " أدخل معلومات جديدة بسبب تغيير حقيقي في التفاصيل الحالية (على سبيل المثال بسبب تغيير في الحالة الاجتماعية", + "endDate": "تاريخ الانتهاء", + "removeThisMember": "هل انت متأكد تريد ازالة هذا العضو؟", + "updateThisMember ": "هل انت متأكد تريد تحديث بيانات هذا العضو؟", + "addNewFamilyMember": "اضافة عضو جديد", + "addRow": "اضافة صف جديد", + "pleaseSelect": "الرجاء اختيار", + "delete" : "حذف", + "edit" : "تعديل", + "add" : "اضافه", + "myProfile": "معلوماتي", + "mowadhafhi": "موظفي", "profile": { "reset_password": { "label": "Reset Password", diff --git a/assets/langs/en-US.json b/assets/langs/en-US.json index 5934ab3..272e621 100644 --- a/assets/langs/en-US.json +++ b/assets/langs/en-US.json @@ -252,6 +252,20 @@ "writeComment": "Write a comment", "approversList": "Approvers List", "yourRequestHasBeenSubmittedForApprovals": "Your request has been submitted for approvals", + "correctCurrentDatails": "correct or complete the current details", + "selectType": "Select the type of change you want to make", + "enterNewInfo": "Enter new Information because of a real change to the current details (e.g because of a change in marital status)", + "endDate": "*End Date", + "removeThisMember": "Are You Sure You Want to Remove this Member?", + "updateThisMember": "Are You Sure You Want to Update this Member?", + "addNewFamilyMember": "Add New Family Member", + "addRow": "Add new row", + "pleaseSelect": "Please Select *", + "delete" : "delete", + "add" : "Add", + "edit" : "Edit", + "myProfile": "My Profile", + "mowadhafhi": "Mowadhafhi", "profile": { "reset_password": { "label": "Reset Password", diff --git a/lib/api/payslip/payslip_api_client.dart b/lib/api/payslip/payslip_api_client.dart new file mode 100644 index 0000000..eff8608 --- /dev/null +++ b/lib/api/payslip/payslip_api_client.dart @@ -0,0 +1,94 @@ + + +import 'dart:async'; + +import 'package:mohem_flutter_app/api/api_client.dart'; +import 'package:mohem_flutter_app/app_state/app_state.dart'; +import 'package:mohem_flutter_app/classes/consts.dart'; +import 'package:mohem_flutter_app/models/generic_response_model.dart'; +import 'package:mohem_flutter_app/models/get_employee_contacts.model.dart'; +import 'package:mohem_flutter_app/models/payslip/get_deductions_list.dart'; +import 'package:mohem_flutter_app/models/payslip/get_earnings_list.dart'; +import 'package:mohem_flutter_app/models/payslip/get_payment_information.dart'; +import 'package:mohem_flutter_app/models/payslip/get_payslip.dart'; +import 'package:mohem_flutter_app/models/payslip/get_summary_of_payment.dart'; + + +class PayslipApiClient { + static final PayslipApiClient _instance = PayslipApiClient._internal(); + + PayslipApiClient._internal(); + + factory PayslipApiClient() => _instance; + + Future> getPayslip() async { + String url = "${ApiConsts.erpRest}GET_PAYSLIP"; + Map postParams = { + "P_MENU_TYPE": "E", + "P_SELECTED_RESP_ID": -999, + }; + postParams.addAll(AppState().postParamsJson); + return await ApiClient().postJsonForObject((json) { + GenericResponseModel? responseData = GenericResponseModel.fromJson(json); + print(responseData); + return responseData.getPayslipList ?? []; + }, url, postParams); + } + + Future> getSummaryOfPayment() async { + String url = "${ApiConsts.erpRest}GET_SUMMARY_OF_PAYMENT"; + Map postParams = { + "P_ACTION_CONTEXT_ID": 188844253, + }; + postParams.addAll(AppState().postParamsJson); + return await ApiClient().postJsonForObject((json) { + GenericResponseModel? responseData = GenericResponseModel.fromJson(json); + print(responseData); + return responseData.getSummaryOfPaymentList ?? []; + }, url, postParams); + } + + Future> getPaymentInfo() async { + String url = "${ApiConsts.erpRest}GET_PAYMENT_INFORMATION"; + Map postParams = { + "P_ACTION_CONTEXT_ID": 188844253, + }; + postParams.addAll(AppState().postParamsJson); + return await ApiClient().postJsonForObject((json) { + GenericResponseModel? responseData = GenericResponseModel.fromJson(json); + print(responseData); + return responseData.getPaymentInformationList ?? []; + }, url, postParams); + } + + Future> getDeductionsList() async { + String url = "${ApiConsts.erpRest}GET_DEDUCTIONS"; + Map postParams = { + "P_ACTION_CONTEXT_ID": 188844253, + "P_PAGE_LIMIT": 100, + "P_PAGE_NUM": 1 + }; + postParams.addAll(AppState().postParamsJson); + return await ApiClient().postJsonForObject((json) { + GenericResponseModel? responseData = GenericResponseModel.fromJson(json); + print(responseData); + return responseData.getDeductionsList ?? []; + }, url, postParams); + } + + + Future> getEarningsList() async { + String url = "${ApiConsts.erpRest}GET_EARNINGS"; + Map postParams = { + "P_ACTION_CONTEXT_ID": 188844253, + "P_PAGE_LIMIT": 100, + "P_PAGE_NUM": 1 + }; + postParams.addAll(AppState().postParamsJson); + return await ApiClient().postJsonForObject((json) { + GenericResponseModel? responseData = GenericResponseModel.fromJson(json); + print(responseData); + return responseData.getEarningsList ?? []; + }, url, postParams); + } +} \ No newline at end of file diff --git a/lib/generated/codegen_loader.g.dart b/lib/generated/codegen_loader.g.dart index ad3a70e..a45063a 100644 --- a/lib/generated/codegen_loader.g.dart +++ b/lib/generated/codegen_loader.g.dart @@ -267,6 +267,20 @@ class CodegenLoader extends AssetLoader{ "writeComment": "أكتب تعليقا", "approversList": "قائمة الموافقين", "yourRequestHasBeenSubmittedForApprovals": "تم تقديم طلبك للموافقات", + "correctCurrentDatails": "تعديل او اكمال التفاصيل الحالية", + "selectType": " حدد نوع التغيير الذي تريد القيام به", + "enterNewInfo": " أدخل معلومات جديدة بسبب تغيير حقيقي في التفاصيل الحالية (على سبيل المثال بسبب تغيير في الحالة الاجتماعية", + "endDate": "تاريخ الانتهاء", + "removeThisMember": "هل انت متأكد تريد ازالة هذا العضو؟", + "updateThisMember ": "هل انت متأكد تريد تحديث بيانات هذا العضو؟", + "addNewFamilyMember": "اضافة عضو جديد", + "addRow": "اضافة صف جديد", + "pleaseSelect": "الرجاء اختيار", + "delete": "حذف", + "edit": "تعديل", + "add": "اضافه", + "myProfile": "معلوماتي", + "mowadhafhi": "موظفي", "profile": { "reset_password": { "label": "Reset Password", @@ -560,6 +574,20 @@ static const Map en_US = { "writeComment": "Write a comment", "approversList": "Approvers List", "yourRequestHasBeenSubmittedForApprovals": "Your request has been submitted for approvals", + "correctCurrentDatails": "correct or complete the current details", + "selectType": "Select the type of change you want to make", + "enterNewInfo": "Enter new Information because of a real change to the current details (e.g because of a change in marital status)", + "endDate": "*End Date", + "removeThisMember": "Are You Sure You Want to Remove this Member?", + "updateThisMember": "Are You Sure You Want to Update this Member?", + "addNewFamilyMember": "Add New Family Member", + "addRow": "Add new row", + "pleaseSelect": "Please Select *", + "delete": "delete", + "add": "Add", + "edit": "Edit", + "myProfile": "My Profile", + "mowadhafhi": "Mowadhafhi", "profile": { "reset_password": { "label": "Reset Password", diff --git a/lib/generated/locale_keys.g.dart b/lib/generated/locale_keys.g.dart index 21d18f5..26dca5b 100644 --- a/lib/generated/locale_keys.g.dart +++ b/lib/generated/locale_keys.g.dart @@ -252,6 +252,20 @@ abstract class LocaleKeys { static const writeComment = 'writeComment'; static const approversList = 'approversList'; static const yourRequestHasBeenSubmittedForApprovals = 'yourRequestHasBeenSubmittedForApprovals'; + static const correctCurrentDatails = 'correctCurrentDatails'; + static const selectType = 'selectType'; + static const enterNewInfo = 'enterNewInfo'; + static const endDate = 'endDate'; + static const removeThisMember = 'removeThisMember'; + static const updateThisMember = 'updateThisMember '; + static const addNewFamilyMember = 'addNewFamilyMember'; + static const addRow = 'addRow'; + static const pleaseSelect = 'pleaseSelect'; + static const delete = 'delete'; + static const edit = 'edit'; + static const add = 'add'; + static const myProfile = 'myProfile'; + static const mowadhafhi = 'mowadhafhi'; static const profile_reset_password_label = 'profile.reset_password.label'; static const profile_reset_password_username = 'profile.reset_password.username'; static const profile_reset_password_password = 'profile.reset_password.password'; diff --git a/lib/models/generic_response_model.dart b/lib/models/generic_response_model.dart index 687c514..b72fd53 100644 --- a/lib/models/generic_response_model.dart +++ b/lib/models/generic_response_model.dart @@ -35,6 +35,11 @@ import 'package:mohem_flutter_app/models/mowadhafhi/get_ticket_types.dart'; import 'package:mohem_flutter_app/models/mowadhafhi/get_tickets_list.dart'; import 'package:mohem_flutter_app/models/notification_action_model.dart'; import 'package:mohem_flutter_app/models/notification_get_respond_attributes_list_model.dart'; +import 'package:mohem_flutter_app/models/payslip/get_deductions_list.dart'; +import 'package:mohem_flutter_app/models/payslip/get_earnings_list.dart'; +import 'package:mohem_flutter_app/models/payslip/get_payment_information.dart'; +import 'package:mohem_flutter_app/models/payslip/get_payslip.dart'; +import 'package:mohem_flutter_app/models/payslip/get_summary_of_payment.dart'; import 'package:mohem_flutter_app/models/profile/basic_details_cols_structions.dart'; import 'package:mohem_flutter_app/models/profile/basic_details_dff_structure.dart'; import 'package:mohem_flutter_app/models/profile/get_contact_clos_structure_list.dart'; @@ -142,12 +147,12 @@ class GenericResponseModel { GetContactNotificationBodyList? getContactNotificationBodyList; List? getCountriesList; List? getDayHoursTypeDetailsList; - List? getDeductionsList; + List? getDeductionsList; GetDefaultValueList? getDefaultValueList; List? getEITCollectionNotificationBodyList; List? getEITDFFStructureList; List? getEITTransactionList; - List? getEarningsList; + List? getEarningsList; List? getEmployeeAddressList; List? getEmployeeBasicDetailsList; List? getEmployeeContactsList; @@ -171,8 +176,8 @@ class GenericResponseModel { List? getOpenNotificationsNumList; List? getOpenPeriodDatesList; List? getOrganizationsSalariesList; - List? getPaymentInformationList; - List? getPayslipList; + List? getPaymentInformationList; + List? getPayslipList; List? getPendingReqDetailsList; List? getPendingReqFunctionsList; List? getPerformanceAppraisalList; @@ -193,7 +198,7 @@ class GenericResponseModel { List? getSubordinatesAttdStatusList; List? getSubordinatesLeavesList; List? getSubordinatesLeavesTotalVacationsList; - List? getSummaryOfPaymentList; + List? getSummaryOfPaymentList; List? getSwipesList; List? getTermColsStructureList; List? getTermDffStructureList; @@ -734,7 +739,12 @@ class GenericResponseModel { getDayHoursTypeDetailsList!.add(new GetDayHoursTypeDetailsList.fromJson(v)); }); } - getDeductionsList = json['GetDeductionsList']; + if (json['GetDeductionsList'] != null) { + getDeductionsList = []; + json['GetDeductionsList'].forEach((v) { + getDeductionsList!.add(new GetDeductionsList.fromJson(v)); + }); + } getDefaultValueList = json['GetDefaultValueList'] != null ? GetDefaultValueList.fromJson(json['GetDefaultValueList']) : null; getEITCollectionNotificationBodyList = json["GetEITCollectionNotificationBodyList"] == null ? null @@ -751,7 +761,12 @@ class GenericResponseModel { getEITTransactionList!.add(new GetEITTransactionList.fromJson(v)); }); } - getEarningsList = json['GetEarningsList']; + if (json['GetEarningsList'] != null) { + getEarningsList = []; + json['GetEarningsList'].forEach((v) { + getEarningsList!.add(new GetEarningsList.fromJson(v)); + }); + } if (json['GetEmployeeAddressList'] != null) { getEmployeeAddressList = []; json['GetEmployeeAddressList'].forEach((v) { @@ -820,8 +835,19 @@ class GenericResponseModel { getOpenNotificationsNumList = json['GetOpenNotificationsNumList']; getOpenPeriodDatesList = json['GetOpenPeriodDatesList']; getOrganizationsSalariesList = json['GetOrganizationsSalariesList']; - getPaymentInformationList = json['GetPaymentInformationList']; - getPayslipList = json['GetPayslipList']; + if (json['GetPaymentInformationList'] != null) { + getPaymentInformationList = []; + json['GetPaymentInformationList'].forEach((v) { + getPaymentInformationList! + .add(new GetPaymentInformationList.fromJson(v)); + }); + } + if (json['GetPayslipList'] != null) { + getPayslipList = []; + json['GetPayslipList'].forEach((v) { + getPayslipList!.add(new GetPayslipList.fromJson(v)); + }); + } getPendingReqDetailsList = json['GetPendingReqDetailsList']; getPendingReqFunctionsList = json['GetPendingReqFunctionsList']; getPerformanceAppraisalList = json['GetPerformanceAppraisalList']; @@ -877,7 +903,12 @@ class GenericResponseModel { } getSubordinatesLeavesTotalVacationsList = json['GetSubordinatesLeavesTotalVacationsList']; - getSummaryOfPaymentList = json['GetSummaryOfPaymentList']; + if (json['GetSummaryOfPaymentList'] != null) { + getSummaryOfPaymentList = []; + json['GetSummaryOfPaymentList'].forEach((v) { + getSummaryOfPaymentList!.add(new GetSummaryOfPaymentList.fromJson(v)); + }); + } getSwipesList = json['GetSwipesList']; getTermColsStructureList = json['GetTermColsStructureList']; getTermDffStructureList = json['GetTermDffStructureList']; @@ -1241,7 +1272,10 @@ class GenericResponseModel { if (this.getDayHoursTypeDetailsList != null) { data['GetDayHoursTypeDetailsList'] = this.getDayHoursTypeDetailsList!.map((v) => v.toJson()).toList(); } - data['GetDeductionsList'] = this.getDeductionsList; + if (this.getDeductionsList != null) { + data['GetDeductionsList'] = + this.getDeductionsList!.map((v) => v.toJson()).toList(); + } if (this.getDefaultValueList != null) { data['GetDefaultValueList'] = this.getDefaultValueList!.toJson(); } @@ -1252,7 +1286,10 @@ class GenericResponseModel { if (this.getEITTransactionList != null) { data['GetEITTransactionList'] = this.getEITTransactionList!.map((v) => v.toJson()).toList(); } - data['GetEarningsList'] = this.getEarningsList; + if (this.getEarningsList != null) { + data['GetEarningsList'] = + this.getEarningsList!.map((v) => v.toJson()).toList(); + } if (this.getEmployeeAddressList != null) { data['GetEmployeeAddressList'] = this.getEmployeeAddressList!.map((v) => v.toJson()).toList(); } @@ -1297,8 +1334,14 @@ class GenericResponseModel { data['GetOpenNotificationsNumList'] = this.getOpenNotificationsNumList; data['GetOpenPeriodDatesList'] = this.getOpenPeriodDatesList; data['GetOrganizationsSalariesList'] = this.getOrganizationsSalariesList; - data['GetPaymentInformationList'] = this.getPaymentInformationList; - data['GetPayslipList'] = this.getPayslipList; + if (this.getPaymentInformationList != null) { + data['GetPaymentInformationList'] = + this.getPaymentInformationList!.map((v) => v.toJson()).toList(); + } + if (this.getPayslipList != null) { + data['GetPayslipList'] = + this.getPayslipList!.map((v) => v.toJson()).toList(); + } data['GetPendingReqDetailsList'] = this.getPendingReqDetailsList; data['GetPendingReqFunctionsList'] = this.getPendingReqFunctionsList; data['GetPerformanceAppraisalList'] = this.getPerformanceAppraisalList; @@ -1341,7 +1384,10 @@ class GenericResponseModel { } data['GetSubordinatesLeavesTotalVacationsList'] = this.getSubordinatesLeavesTotalVacationsList; - data['GetSummaryOfPaymentList'] = this.getSummaryOfPaymentList; + if (this.getSummaryOfPaymentList != null) { + data['GetSummaryOfPaymentList'] = + this.getSummaryOfPaymentList!.map((v) => v.toJson()).toList(); + } data['GetSwipesList'] = this.getSwipesList; data['GetTermColsStructureList'] = this.getTermColsStructureList; data['GetTermDffStructureList'] = this.getTermDffStructureList; diff --git a/lib/models/payslip/get_deductions_list.dart b/lib/models/payslip/get_deductions_list.dart new file mode 100644 index 0000000..7a99447 --- /dev/null +++ b/lib/models/payslip/get_deductions_list.dart @@ -0,0 +1,36 @@ +class GetDeductionsList { + int? aMOUNT; + String? eLEMENTNAME; + int? fROMROWNUM; + int? nOOFROWS; + int? rOWNUM; + int? tOROWNUM; + + GetDeductionsList( + {this.aMOUNT, + this.eLEMENTNAME, + this.fROMROWNUM, + this.nOOFROWS, + this.rOWNUM, + this.tOROWNUM}); + + GetDeductionsList.fromJson(Map json) { + aMOUNT = json['AMOUNT']; + eLEMENTNAME = json['ELEMENT_NAME']; + fROMROWNUM = json['FROM_ROW_NUM']; + nOOFROWS = json['NO_OF_ROWS']; + rOWNUM = json['ROW_NUM']; + tOROWNUM = json['TO_ROW_NUM']; + } + + Map toJson() { + final Map data = new Map(); + data['AMOUNT'] = this.aMOUNT; + data['ELEMENT_NAME'] = this.eLEMENTNAME; + data['FROM_ROW_NUM'] = this.fROMROWNUM; + data['NO_OF_ROWS'] = this.nOOFROWS; + data['ROW_NUM'] = this.rOWNUM; + data['TO_ROW_NUM'] = this.tOROWNUM; + return data; + } +} \ No newline at end of file diff --git a/lib/models/payslip/get_earnings_list.dart b/lib/models/payslip/get_earnings_list.dart new file mode 100644 index 0000000..272dab3 --- /dev/null +++ b/lib/models/payslip/get_earnings_list.dart @@ -0,0 +1,37 @@ + +class GetEarningsList { + int? aMOUNT; + String? eLEMENTNAME; + int? fROMROWNUM; + int? nOOFROWS; + int? rOWNUM; + int? tOROWNUM; + + GetEarningsList( + {this.aMOUNT, + this.eLEMENTNAME, + this.fROMROWNUM, + this.nOOFROWS, + this.rOWNUM, + this.tOROWNUM}); + + GetEarningsList.fromJson(Map json) { + aMOUNT = json['AMOUNT']; + eLEMENTNAME = json['ELEMENT_NAME']; + fROMROWNUM = json['FROM_ROW_NUM']; + nOOFROWS = json['NO_OF_ROWS']; + rOWNUM = json['ROW_NUM']; + tOROWNUM = json['TO_ROW_NUM']; + } + + Map toJson() { + final Map data = new Map(); + data['AMOUNT'] = this.aMOUNT; + data['ELEMENT_NAME'] = this.eLEMENTNAME; + data['FROM_ROW_NUM'] = this.fROMROWNUM; + data['NO_OF_ROWS'] = this.nOOFROWS; + data['ROW_NUM'] = this.rOWNUM; + data['TO_ROW_NUM'] = this.tOROWNUM; + return data; + } +} \ No newline at end of file diff --git a/lib/models/payslip/get_payment_information.dart b/lib/models/payslip/get_payment_information.dart new file mode 100644 index 0000000..277b409 --- /dev/null +++ b/lib/models/payslip/get_payment_information.dart @@ -0,0 +1,33 @@ + +class GetPaymentInformationList { + String? aCCOUNTNUMBER; + String? aMOUNT; + String? bANKNAME; + String? bRANCHNAME; + String? pAYMENTMETHODNAME; + + GetPaymentInformationList( + {this.aCCOUNTNUMBER, + this.aMOUNT, + this.bANKNAME, + this.bRANCHNAME, + this.pAYMENTMETHODNAME}); + + GetPaymentInformationList.fromJson(Map json) { + aCCOUNTNUMBER = json['ACCOUNT_NUMBER']; + aMOUNT = json['AMOUNT']; + bANKNAME = json['BANK_NAME']; + bRANCHNAME = json['BRANCH_NAME']; + pAYMENTMETHODNAME = json['PAYMENT_METHOD_NAME']; + } + + Map toJson() { + final Map data = new Map(); + data['ACCOUNT_NUMBER'] = this.aCCOUNTNUMBER; + data['AMOUNT'] = this.aMOUNT; + data['BANK_NAME'] = this.bANKNAME; + data['BRANCH_NAME'] = this.bRANCHNAME; + data['PAYMENT_METHOD_NAME'] = this.pAYMENTMETHODNAME; + return data; + } +} \ No newline at end of file diff --git a/lib/models/payslip/get_payslip.dart b/lib/models/payslip/get_payslip.dart new file mode 100644 index 0000000..2bb8280 --- /dev/null +++ b/lib/models/payslip/get_payslip.dart @@ -0,0 +1,38 @@ + + +class GetPayslipList { + int? aCTIONCONTEXTID; + String? pAYMENTDATE; + String? pAYSLIPCHOICE; + String? pERIODENDDATE; + String? pERIODNAME; + String? pERIODSTARTDATE; + + GetPayslipList( + {this.aCTIONCONTEXTID, + this.pAYMENTDATE, + this.pAYSLIPCHOICE, + this.pERIODENDDATE, + this.pERIODNAME, + this.pERIODSTARTDATE}); + + GetPayslipList.fromJson(Map json) { + aCTIONCONTEXTID = json['ACTION_CONTEXT_ID']; + pAYMENTDATE = json['PAYMENT_DATE']; + pAYSLIPCHOICE = json['PAYSLIP_CHOICE']; + pERIODENDDATE = json['PERIOD_END_DATE']; + pERIODNAME = json['PERIOD_NAME']; + pERIODSTARTDATE = json['PERIOD_START_DATE']; + } + + Map toJson() { + final Map data = new Map(); + data['ACTION_CONTEXT_ID'] = this.aCTIONCONTEXTID; + data['PAYMENT_DATE'] = this.pAYMENTDATE; + data['PAYSLIP_CHOICE'] = this.pAYSLIPCHOICE; + data['PERIOD_END_DATE'] = this.pERIODENDDATE; + data['PERIOD_NAME'] = this.pERIODNAME; + data['PERIOD_START_DATE'] = this.pERIODSTARTDATE; + return data; + } +} \ No newline at end of file diff --git a/lib/models/payslip/get_summary_of_payment.dart b/lib/models/payslip/get_summary_of_payment.dart new file mode 100644 index 0000000..abf3dc4 --- /dev/null +++ b/lib/models/payslip/get_summary_of_payment.dart @@ -0,0 +1,38 @@ + + +class GetSummaryOfPaymentList { + int? tOTALDEDUCTIONSAMOUNT; + int? tOTALDEDUCTIONSPERCENTAGE; + int? tOTALEARNINGSAMOUNT; + int? tOTALEARNINGSPERCENTAGE; + int? tOTALPAYAMOUNT; + int? tOTALPAYPERCENTAGE; + + GetSummaryOfPaymentList( + {this.tOTALDEDUCTIONSAMOUNT, + this.tOTALDEDUCTIONSPERCENTAGE, + this.tOTALEARNINGSAMOUNT, + this.tOTALEARNINGSPERCENTAGE, + this.tOTALPAYAMOUNT, + this.tOTALPAYPERCENTAGE}); + + GetSummaryOfPaymentList.fromJson(Map json) { + tOTALDEDUCTIONSAMOUNT = json['TOTAL_DEDUCTIONS_AMOUNT']; + tOTALDEDUCTIONSPERCENTAGE = json['TOTAL_DEDUCTIONS_PERCENTAGE']; + tOTALEARNINGSAMOUNT = json['TOTAL_EARNINGS_AMOUNT']; + tOTALEARNINGSPERCENTAGE = json['TOTAL_EARNINGS_PERCENTAGE']; + tOTALPAYAMOUNT = json['TOTAL_PAY_AMOUNT']; + tOTALPAYPERCENTAGE = json['TOTAL_PAY_PERCENTAGE']; + } + + Map toJson() { + final Map data = new Map(); + data['TOTAL_DEDUCTIONS_AMOUNT'] = this.tOTALDEDUCTIONSAMOUNT; + data['TOTAL_DEDUCTIONS_PERCENTAGE'] = this.tOTALDEDUCTIONSPERCENTAGE; + data['TOTAL_EARNINGS_AMOUNT'] = this.tOTALEARNINGSAMOUNT; + data['TOTAL_EARNINGS_PERCENTAGE'] = this.tOTALEARNINGSPERCENTAGE; + data['TOTAL_PAY_AMOUNT'] = this.tOTALPAYAMOUNT; + data['TOTAL_PAY_PERCENTAGE'] = this.tOTALPAYPERCENTAGE; + return data; + } +} \ No newline at end of file diff --git a/lib/ui/landing/widget/app_drawer.dart b/lib/ui/landing/widget/app_drawer.dart index 4732d36..d1de8d7 100644 --- a/lib/ui/landing/widget/app_drawer.dart +++ b/lib/ui/landing/widget/app_drawer.dart @@ -1,6 +1,8 @@ +import 'package:easy_localization/easy_localization.dart'; import 'package:flutter/material.dart'; import 'package:flutter/widgets.dart'; import 'package:mohem_flutter_app/config/routes.dart'; +import 'package:mohem_flutter_app/generated/locale_keys.g.dart'; import 'package:mohem_flutter_app/ui/landing/widget/drawer_item.dart'; class AppDrawer extends StatefulWidget { @@ -20,26 +22,38 @@ class _AppDrawerState extends State { ), Expanded( child: ListView(padding: const EdgeInsets.all(21), physics: const BouncingScrollPhysics(), children: [ - const Divider(), - InkWell( - child: const DrawerItem( - 'My Profile', - icon: Icons.person, - color: Colors.grey, - ), - onTap: () { - drawerNavigator(context, AppRoutes.profile); - }), + // const Divider(), + // InkWell( + // child: const DrawerItem( + // 'My Profile', + // icon: Icons.person, + // color: Colors.grey, + // ), + // onTap: () { + // drawerNavigator(context, AppRoutes.profile); + // }), const Divider(), InkWell( - child: const DrawerItem( - 'Mowadhafhi', + child: new DrawerItem( + // 'Mowadhafhi', + LocaleKeys.myProfile.tr(), icon: Icons.person, color: Colors.grey, ), onTap: () { - drawerNavigator(context, AppRoutes.mowadhafhi); - }) + drawerNavigator(context, AppRoutes.profile); + }), + const Divider(), + InkWell( + child: new DrawerItem( + // 'Mowadhafhi', + LocaleKeys.mowadhafhi.tr(), + icon: Icons.person, + color: Colors.grey, + ), + onTap: () { + drawerNavigator(context, AppRoutes.mowadhafhi); + }) ])) ]))); } diff --git a/lib/ui/misc/request_submit_screen.dart b/lib/ui/misc/request_submit_screen.dart index 915118f..4a72756 100644 --- a/lib/ui/misc/request_submit_screen.dart +++ b/lib/ui/misc/request_submit_screen.dart @@ -87,21 +87,21 @@ class _RequestSubmitScreenState extends State { if (params!.approvalFlag == 'phone_numbers') { await ProfileApiClient().startPhoneApprovalProcess( - "SUBMIT", + LocaleKeys.submit.tr(), comments.text, params!.pItemId, params!.transactionId, ); } else if(params!.approvalFlag == 'family_member') { await ProfileApiClient().getApproves( - "SUBMIT", + LocaleKeys.submit.tr(), comments.text, params!.transactionId!.toInt(), params!.pItemId.toString(), ); } else { await MyAttendanceApiClient().startEitApprovalProcess( - "SUBMIT", + LocaleKeys.submit.tr(), comments.text, params!.pItemId, params!.transactionId, @@ -143,7 +143,7 @@ class _RequestSubmitScreenState extends State { padding: const EdgeInsets.all(21).copyWith(top: 14), physics: const BouncingScrollPhysics(), children: [ - attachmentView("Attachments"), + attachmentView(LocaleKeys.attachments.tr(),), 14.height, InputWidget( LocaleKeys.comments.tr(), @@ -233,7 +233,7 @@ class _RequestSubmitScreenState extends State { children: [ title.toText16().expanded, 6.width, - SimpleButton("Add", () async { + SimpleButton(LocaleKeys.add.tr(), () async { FilePickerResult? result = await FilePicker.platform.pickFiles(allowMultiple: true); if (result != null) { attachmentFiles = attachmentFiles + result.paths.map((path) => File(path!)).toList(); diff --git a/lib/ui/my_attendance/my_attendance_screen.dart b/lib/ui/my_attendance/my_attendance_screen.dart index e1db55c..48a3aa0 100644 --- a/lib/ui/my_attendance/my_attendance_screen.dart +++ b/lib/ui/my_attendance/my_attendance_screen.dart @@ -32,14 +32,14 @@ class MyAttendanceScreen extends StatelessWidget { ? LocaleKeys.noDataAvailable.tr().toText16().center : Column( children: [ - //commenting this because missing wipe coming as duplicate in the screen - // itemView( - // "assets/images/pdf.svg", - // LocaleKeys.missingSwipes.tr(), - // ).onPress(() { - // Navigator.pushNamed(context, AppRoutes.dynamicScreen, arguments: DynamicListViewParams(LocaleKeys.missingSwipes.tr(), "HMG_OTL_MISSING_SWIPE_EIT_SS")); - // }), - // 12.height, + // commenting this because missing wipe coming as duplicate in the screen + itemView( + "assets/images/pdf.svg", + LocaleKeys.myAttendance.tr(), + ).onPress(() { + Navigator.pushNamed(context, AppRoutes.dynamicScreen, arguments: DynamicListViewParams(LocaleKeys.missingSwipes.tr(), "HMG_OTL_MISSING_SWIPE_EIT_SS")); + }), + 12.height, ListView.separated( padding: const EdgeInsets.all(21), itemBuilder: (cxt, index) => itemView( diff --git a/lib/ui/profile/add_update_family_member.dart b/lib/ui/profile/add_update_family_member.dart index 30e6d3f..cd84051 100644 --- a/lib/ui/profile/add_update_family_member.dart +++ b/lib/ui/profile/add_update_family_member.dart @@ -47,17 +47,6 @@ class _AddUpdateFamilyMemberState extends State { super.initState(); } - // void callFamilyMemberData() async { - // try { - // Utils.showLoading(context); - // callAddAndUpdateFamilyMember(); - // Utils.hideLoading(context); - // setState(() {}); - // } catch (ex) { - // Utils.hideLoading(context); - // Utils.handleException(ex, context, null); - // } - // } void callAddAndUpdateFamilyMember() async { try { diff --git a/lib/ui/profile/basic_details.dart b/lib/ui/profile/basic_details.dart index 795563e..42e165f 100644 --- a/lib/ui/profile/basic_details.dart +++ b/lib/ui/profile/basic_details.dart @@ -137,13 +137,13 @@ class _BasicDetailsState extends State { showAlertDialog(BuildContext context) { dynamic changeOrNew = 1; Widget cancelButton = TextButton( - child: Text("Cancel"), + child: Text(LocaleKeys.cancel.tr()), onPressed: () { Navigator.pop(context); }, ); Widget continueButton = TextButton( - child: Text("Next"), + child: Text(LocaleKeys.next.tr()), onPressed: () { continueDynamicForms(); }, @@ -151,7 +151,7 @@ class _BasicDetailsState extends State { StatefulBuilder alert = StatefulBuilder(builder: (context, setState) { return AlertDialog( shape: RoundedRectangleBorder(borderRadius: BorderRadius.all(Radius.circular(10.0))), - title: Text("Confirm"), + title: Text(LocaleKeys.confirm.tr()), content: Builder(builder: (context) { // Get available height and width of the build area of this widget. Make a choice depending on the size. var height = MediaQuery.of(context).size.height * .5; @@ -159,14 +159,14 @@ class _BasicDetailsState extends State { height: height, child: Column(children: [ Text( - "Select the type of change you want to make.", + LocaleKeys.selectType.tr(), style: TextStyle(fontSize: 16, fontWeight: FontWeight.bold), ), Divider(), Column( children: [ ListTile( - title: Text("correct or complete the current details"), + title: Text(LocaleKeys.correctCurrentDatails.tr()), leading: Radio( value: 1, groupValue: changeOrNew, @@ -179,7 +179,7 @@ class _BasicDetailsState extends State { ), ), ListTile( - title: Text("Enter new Information because of a real change to the current details (e.g because of a change in marital status)"), + title: Text(LocaleKeys.enterNewInfo.tr()), leading: Radio( value: 2, groupValue: changeOrNew, diff --git a/lib/ui/profile/delete_family_member.dart b/lib/ui/profile/delete_family_member.dart index 9e12252..e9c252c 100644 --- a/lib/ui/profile/delete_family_member.dart +++ b/lib/ui/profile/delete_family_member.dart @@ -69,7 +69,7 @@ class _DeleteFamilyMemberState extends State { body: Column( children: [ DynamicTextFieldWidget( - "*End Date", date.toString(), + LocaleKeys.endDate.tr(), date.toString(), // suffixIconData: Icons.calendar_today, isEnable: false, onTap: () async { diff --git a/lib/ui/profile/dynamic_screens/dynamic_input_familyMembers_screen.dart b/lib/ui/profile/dynamic_screens/dynamic_input_familyMembers_screen.dart index 0fa6845..7278318 100644 --- a/lib/ui/profile/dynamic_screens/dynamic_input_familyMembers_screen.dart +++ b/lib/ui/profile/dynamic_screens/dynamic_input_familyMembers_screen.dart @@ -5,24 +5,9 @@ import 'dart:io'; import 'package:easy_localization/easy_localization.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; -import 'package:mohem_flutter_app/api/my_attendance_api_client.dart'; -import 'package:mohem_flutter_app/api/profile_api_client.dart'; -import 'package:mohem_flutter_app/classes/utils.dart'; -import 'package:mohem_flutter_app/extensions/int_extensions.dart'; -import 'package:mohem_flutter_app/extensions/string_extensions.dart'; -import 'package:mohem_flutter_app/extensions/widget_extensions.dart'; -import 'package:mohem_flutter_app/generated/locale_keys.g.dart'; -import 'package:mohem_flutter_app/models/dyanmic_forms/get_set_values_request_model.dart'; -import 'package:mohem_flutter_app/models/generic_response_model.dart'; -import 'package:mohem_flutter_app/models/get_eit_dff_structure_list_model.dart'; -import 'package:mohem_flutter_app/models/get_employee_basic_details.model.dart'; import 'package:mohem_flutter_app/models/get_employee_contacts.model.dart'; -import 'package:mohem_flutter_app/models/profile/basic_details_cols_structions.dart'; -import 'package:mohem_flutter_app/models/profile/basic_details_dff_structure.dart'; -import 'package:mohem_flutter_app/ui/my_attendance/dynamic_screens/dynamic_listview_screen.dart'; import 'package:mohem_flutter_app/widgets/app_bar_widget.dart'; -import 'package:mohem_flutter_app/widgets/button/default_button.dart'; -import 'package:mohem_flutter_app/widgets/dynamic_forms/dynamic_textfield_widget.dart'; + class DynamicFamilyMembersParams { String title; diff --git a/lib/ui/profile/family_members.dart b/lib/ui/profile/family_members.dart index d0e04f3..055c54c 100644 --- a/lib/ui/profile/family_members.dart +++ b/lib/ui/profile/family_members.dart @@ -116,7 +116,7 @@ class _FamilyMembersState extends State { child: InkWell( onTap: () { relationId = getEmployeeContactsList[index]!.cONTACTRELATIONSHIPID!.toInt(); - showUpdateAlertDialog(context, relationId!.toInt(), 2, "UPDATE"); + showUpdateAlertDialog(context, relationId!.toInt(), 2, LocaleKeys.update.tr()); }, child: RichText( text: TextSpan( @@ -201,7 +201,7 @@ class _FamilyMembersState extends State { BoxShadow(color: MyColors.lightGreyEFColor, spreadRadius: 3), ], ), - child: DefaultButton("Add New Family Member", () async { + child: DefaultButton(LocaleKeys.addNewFamilyMember.tr(), () async { Navigator.pushNamed(context, AppRoutes.addUpdateFamilyMember, arguments: {"relationID":relationId, "flag":1, "actionType":"ADD"}); // context.setLocale(const Locale("en", "US")); // to change Loacle // Profile(); @@ -231,7 +231,7 @@ class _FamilyMembersState extends State { title: Text( LocaleKeys.confirm.tr(), ), - content: Text("Are You Sure You Want to Update this Member?"), + content: Text(LocaleKeys.updateThisMember.tr()), actions: [ cancelButton, continueButton, @@ -268,7 +268,7 @@ class _FamilyMembersState extends State { title: Text( LocaleKeys.confirm.tr(), ), - content: Text("Are You Sure You Want to Remove this Member?"), + content: Text(LocaleKeys.removeThisMember.tr()), actions: [ cancelButton, continueButton, diff --git a/lib/ui/profile/phone_numbers.dart b/lib/ui/profile/phone_numbers.dart index 14ce3ff..294a0b7 100644 --- a/lib/ui/profile/phone_numbers.dart +++ b/lib/ui/profile/phone_numbers.dart @@ -69,7 +69,7 @@ class _PhoneNumbersState extends State { color: Color(0xff259CB8), ), Text( - 'Add new row', + LocaleKeys.addRow.tr(), style: TextStyle(color: Color(0xff259CB8), fontWeight: FontWeight.bold), ) ]), @@ -106,7 +106,7 @@ class _PhoneNumbersState extends State { child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [ PopupMenuButton( child: DynamicTextFieldWidget( - "Please Select *", + LocaleKeys.pleaseSelect.tr(), e.pHONETYPEMEANING ?? "", isEnable: false, isPopup: true, @@ -135,7 +135,7 @@ class _PhoneNumbersState extends State { size: 18, ), Text( - 'Delete', + LocaleKeys.delete.tr(), style: TextStyle(color: Colors.red, fontWeight: FontWeight.bold), ) ]), diff --git a/lib/ui/screens/profile/profile_screen.dart b/lib/ui/screens/profile/profile_screen.dart index 8b015b0..44a0afe 100644 --- a/lib/ui/screens/profile/profile_screen.dart +++ b/lib/ui/screens/profile/profile_screen.dart @@ -1,11 +1,13 @@ import 'dart:ui'; import 'dart:convert'; +import 'package:easy_localization/easy_localization.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:image_picker/image_picker.dart'; import 'package:mohem_flutter_app/api/profile_api_client.dart'; import 'package:mohem_flutter_app/app_state/app_state.dart'; import 'package:mohem_flutter_app/classes/utils.dart'; +import 'package:mohem_flutter_app/generated/locale_keys.g.dart'; import 'package:mohem_flutter_app/models/get_employee_basic_details.model.dart'; import 'package:mohem_flutter_app/models/member_information_list_model.dart'; import 'package:mohem_flutter_app/ui/screens/profile/widgets/header.dart'; @@ -79,7 +81,7 @@ class _ProfileScreenState extends State { child: Row(children: [ Icon(Icons.photo, color: Colors.white), Text( - 'Edit', + LocaleKeys.edit.tr(), style: TextStyle(color: Colors.white, fontSize: 12), ) ]))), @@ -100,7 +102,7 @@ class _ProfileScreenState extends State { padding: EdgeInsets.only(left: 20, right: 20), child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [Text('OK'), Text('CANCEL')], + children: [Text(LocaleKeys.ok.tr()), Text(LocaleKeys.cancel.tr())], )), BottomSheetItem( onTap: () {