diff --git a/lib/api/worklist/worklist_api_client.dart b/lib/api/worklist/worklist_api_client.dart index 91cd04f..e08d30b 100644 --- a/lib/api/worklist/worklist_api_client.dart +++ b/lib/api/worklist/worklist_api_client.dart @@ -36,6 +36,7 @@ import 'package:mohem_flutter_app/models/worklist/hr/get_contact_notification_bo import 'package:mohem_flutter_app/models/worklist/hr/get_phones_notification_body_list_model.dart'; import 'package:mohem_flutter_app/models/worklist/replacement_list_model.dart'; import 'package:mohem_flutter_app/models/worklist_response_model.dart'; +import 'package:mohem_flutter_app/models/worklist/payment_details_list.dart'; class WorkListApiClient { static final WorkListApiClient _instance = WorkListApiClient._internal(); @@ -290,6 +291,22 @@ class WorkListApiClient { return responseData.getPrNotificationBodyList; }, url, postParams); } + Future getPaymentNotificationBody(int pNotificationID, int pTransactionID) async { + String url = "${ApiConsts.erpRest}GET_PAY_REQ_NOTIFICATION_BODY"; + Map postParams = { + "P_NOTIFICATION_ID": pNotificationID, + "P_TRANSACTION_ID": pTransactionID, + "P_PAGE_LIMIT": 100, + "P_PAGE_NUM": 1, + }; + postParams.addAll(AppState().postParamsJson); + return await ApiClient().postJsonForObject((json) { + GenericResponseModel responseData = GenericResponseModel.fromJson(json); + return responseData.getPaymentNotificationBodyList; + }, url, postParams); + } + + Future> getMoItemHistory(int pItemID, int pOrgID) async { String url = "${ApiConsts.erpRest}GET_MO_ITEM_HISTORY"; @@ -718,4 +735,18 @@ class WorkListApiClient { return responseData.getPRInformationList; }, url, postParams); } + + Future?> getPaymentDetailsNotification(int? notificationId) async { + String url = "${ApiConsts.erpRest}GET_PAY_REQ_NOTIFICATION_BODY"; + Map postParams = { + "P_NOTIFICATION_ID": notificationId, + "P_PAGE_LIMIT": 100, + "P_PAGE_NUM": 1, + }; + postParams.addAll(AppState().postParamsJson); + return await ApiClient().postJsonForObject((json) { + GenericResponseModel responseData = GenericResponseModel.fromJson(json); + return responseData.getAbsenceCollectionNotificationBodyList; + }, url, postParams); + } } diff --git a/lib/app_state/app_state.dart b/lib/app_state/app_state.dart index 8f81951..2e8e2ad 100644 --- a/lib/app_state/app_state.dart +++ b/lib/app_state/app_state.dart @@ -90,7 +90,7 @@ class AppState { String get getHuaweiPushToken => _huaweiPushToken; - final PostParamsModel _postParamsInitConfig = PostParamsModel(channel: 31, versionID: 8.2, mobileType: Platform.isAndroid ? "android" : "ios"); + final PostParamsModel _postParamsInitConfig = PostParamsModel(channel: 31, versionID: 6.0, mobileType: Platform.isAndroid ? "android" : "ios"); void setPostParamsInitConfig() { isAuthenticated = false; diff --git a/lib/classes/consts.dart b/lib/classes/consts.dart index a6fb4d5..bee7a99 100644 --- a/lib/classes/consts.dart +++ b/lib/classes/consts.dart @@ -3,13 +3,12 @@ import 'package:mohem_flutter_app/ui/marathon/widgets/question_card.dart'; class ApiConsts { // static String baseUrl = "http://10.200.204.11"; // Local server // static String baseUrl = "https://erptstapp.srca.org.sa"; // SRCA server - // static String baseUrl = "https://uat.hmgwebservices.com"; // UAT ser343622ver - // static String baseUrl = "http://10.201.204.101:2024"; - // static String baseUrl = "https://webservices.hmg.com"; // PreProd - // static String baseUrl = "https://hmgwebservices.com"; // Live server - - static String baseUrl = "https://mohemm.hmg.com"; // New Live server + static String baseUrl = "https://uat.hmgwebservices.com"; // UAT ser343622ver + // static String baseUrl = "http://10.20.200.111:1010/"; + // static String baseUrl = "https://webservices.hmg.com"; // PreProd + // static String baseUrl = "https://mohemm.hmg.com"; + // static String baseUrl = "https://hmgwebservices.com"; // Live server static String baseUrlServices = baseUrl + "/Services/"; // server // static String baseUrlServices = "https://api.cssynapses.com/tangheem/"; // Live server static String utilitiesRest = baseUrlServices + "Utilities.svc/REST/"; diff --git a/lib/classes/date_uitl.dart b/lib/classes/date_uitl.dart index 89e237d..e27843c 100644 --- a/lib/classes/date_uitl.dart +++ b/lib/classes/date_uitl.dart @@ -524,4 +524,14 @@ class DateUtil { // } // return ""; // } + static String replaceArabicNumber(String input) { + const english = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9']; + const arabic = ['٠', '١', '٢', '٣', '٤', '٥', '٦', '٧', '٨', '٩']; + + for (int i = 0; i < english.length; i++) { + input = input.replaceAll(arabic[i], english[i]); + } + + return input; + } } diff --git a/lib/generated/codegen_loader.g.dart b/lib/generated/codegen_loader.g.dart index 1251dd6..15cdb5b 100644 --- a/lib/generated/codegen_loader.g.dart +++ b/lib/generated/codegen_loader.g.dart @@ -551,6 +551,31 @@ class CodegenLoader extends AssetLoader { "uploadedDocuments": "المستندات التي تم تحميلها", "youCannotJoinTheMarathon": "لا يمكنك الانضمام إلى الماراثون لأنك تجاوزت الحد الزمني", "pleaseClickButtonToJoinMarathon": "الرجاء الضغط على الزر أدناه للانضمام إلى الماراثون", + "paymentRequest":"طلب الدفع", + + "paymentDetails":"تفاصيل الدفع", + "requestNo":"رقم الطلب", + "requesterEmpNum":"رقم الموظف الذي قدم الطلب", + "requesterEmpName":"اسم الموظف مقدم الطلب", + "prepareEmpName":"إعداد اسم الموظف", + "requesterPositionName":"اسم الوظيفة لمقدم الطلب", + "preparePositionName":"إعداد اسم الوظيفة", + "requesterPayrollName":"اسم مقدم الطلب", + "payingORGName":"اسم المنظمة الدافعة", + "requestAmount":"مبلغ الطلب", + "typeofPayment":"نوع الدفع", + "beneficiaryDetails":"تفاصيل المستفيد", + "beneficiaryName":"اسم المستفيد", + "idIqama":"الهوية السعودية / الإقامة", + "beneficiaryBankName":"اسم البنك المستفيد", + "sadadNumber":"رقم سداد", + "beneficiaryIBAN":"رقم IBAN للمستفيد", + "purchaseOrders":"طلبات الشراء", + "approvalDate":"تاريخ الموافقة", + "pOAmount":"مبلغ الطلب", + "versionStatus":"حالة الإصدار", + "supplierNo":"رقم المورد", + "general":"عام", "generate": "يولد", }; static const Map en_US = { @@ -1109,7 +1134,31 @@ class CodegenLoader extends AssetLoader { "userId": "UserID", "pleaseClickButtonToJoinMarathon": "Press the button below to join the Marathon.", "youCannotJoinTheMarathon": "You cannot join the Marathon because you have exceeded the time limit.", - "generate": "Generate" + "generate": "Generate", + "paymentRequest":"Pay Request", + "paymentDetails":"Payment Details", + "requestNo":"Request No", + "requesterEmpNum":"Requester Employee Num", + "requesterEmpName":"Requester Employee Name", + "prepareEmpName":"Prepare Employee Name", + "requesterPositionName":"Requester Position Name", + "preparePositionName":"Prepare Position Name", + "requesterPayrollName":"Requester Payroll Name", + "payingORGName":"Paying Organization Name", + "requestAmount":"Request Amount", + "typeofPayment":"Type of Payment", + "beneficiaryDetails":"Beneficiary Details", + "beneficiaryName":"Beneficiary Name", + "idIqama":"Saudi ID / Iqama", + "beneficiaryBankName":"Beneficiary Bank Name", + "sadadNumber":"Sadad Number", + "beneficiaryIBAN":"Beneficiary IBAN", + "purchaseOrders":"Purchase Orders", + "approvalDate":"Approval Date", + "pOAmount":"PO Amount", + "versionStatus":"Version Status", + "supplierNo":"Supplier No", + "general":"General" }; static const Map> mapLocales = {"ar_SA": ar_SA, "en_US": en_US}; } diff --git a/lib/generated/locale_keys.g.dart b/lib/generated/locale_keys.g.dart index cc7f2b4..0ec89e4 100644 --- a/lib/generated/locale_keys.g.dart +++ b/lib/generated/locale_keys.g.dart @@ -403,6 +403,7 @@ abstract class LocaleKeys { static const purchaseOrder = 'purchaseOrder'; static const ITGForms = 'ITGForms'; static const itemCreation = 'itemCreation'; + static const paymentRequest = 'paymentRequest'; static const stamp = 'stamp'; static const addFavoriteList = 'addFavoriteList'; static const feedbackUserExperience = 'feedbackUserExperience'; @@ -551,4 +552,28 @@ abstract class LocaleKeys { static const youCannotJoinTheMarathon ='youCannotJoinTheMarathon'; static const open ='open'; static const generate = 'generate'; + static const paymentDetails ='paymentDetails'; + static const requestNo ='requestNo'; + static const requesterEmpNum ='requesterEmpNum'; + static const requesterEmpName ='requesterEmpName'; + static const prepareEmpName ='prepareEmpName'; + static const requesterPositionName ='requesterPositionName'; + static const preparePositionName ='preparePositionName'; + static const requesterPayrollName ='requesterPayrollName'; + static const payingORGName ='payingORGName'; + static const requestAmount ='requestAmount'; + static const typeofPayment ='typeofPayment'; + static const beneficiaryDetails ='beneficiaryDetails'; + static const beneficiaryName ='beneficiaryName'; + static const idIqama ='idIqama'; + static const beneficiaryBankName ='beneficiaryBankName'; + static const sadadNumber ='sadadNumber'; + static const beneficiaryIBAN ='beneficiaryIBAN'; + static const purchaseOrders ='purchaseOrders'; + static const pOAmount ='pOAmount'; + static const approvalDate ='approvalDate'; + static const versionStatus ='versionStatus'; + static const supplierNo ='supplierNo'; + static const general ="general"; + } diff --git a/lib/models/generic_response_model.dart b/lib/models/generic_response_model.dart index 893b5b9..e9daeb4 100644 --- a/lib/models/generic_response_model.dart +++ b/lib/models/generic_response_model.dart @@ -110,6 +110,7 @@ import 'package:mohem_flutter_app/models/worklist/hr/get_address_notification_bo import 'package:mohem_flutter_app/models/worklist/hr/get_basic_det_ntf_body_list_model.dart'; import 'package:mohem_flutter_app/models/worklist/hr/get_contact_notification_body_list_model.dart'; import 'package:mohem_flutter_app/models/worklist/hr/get_phones_notification_body_list_model.dart'; +import 'package:mohem_flutter_app/models/worklist/payment_details_list.dart'; import 'package:mohem_flutter_app/models/worklist/replacement_list_model.dart'; import 'package:mohem_flutter_app/models/worklist/resubmit_eit_response_model.dart'; import 'package:mohem_flutter_app/models/worklist_response_model.dart'; @@ -187,6 +188,7 @@ class GenericResponseModel { List? getCEIDFFStructureList; List? getCEITransactionList; List? getCcpTransactionsList; + List? getContactColsStructureList; List? getContactDetailsList; List? getContactDffStructureList; @@ -232,6 +234,7 @@ class GenericResponseModel { List? getPoItemHistoryList; GetPoNotificationBodyList? getPoNotificationBodyList; GetPrNotificationBodyList? getPrNotificationBodyList; + GetPaymentNotificationBodyList? getPaymentNotificationBodyList; GetPRInformationList? getPRInformationList; List? getQuotationAnalysisList; List? getRFCEmployeeListList; @@ -500,6 +503,7 @@ class GenericResponseModel { this.getPoItemHistoryList, this.getPoNotificationBodyList, this.getPrNotificationBodyList, + this.getPaymentNotificationBodyList, this.getPRInformationList, this.getQuotationAnalysisList, this.getRFCEmployeeListList, @@ -1022,6 +1026,9 @@ class GenericResponseModel { } getPoNotificationBodyList = json['GetPoNotificationBodyList'] != null ? GetPoNotificationBodyList.fromJson(json['GetPoNotificationBodyList']) : null; getPrNotificationBodyList = json['GetPrNotificationBodyList'] != null ? GetPrNotificationBodyList.fromJson(json['GetPrNotificationBodyList']) : null; + getPaymentNotificationBodyList = json['Pay_ReqNotificationBody'] != null ? GetPaymentNotificationBodyList.fromJson(json['Pay_ReqNotificationBody']) : null; + + getPRInformationList = json['PR_Information_List'] != null ? GetPRInformationList.fromJson(json['PR_Information_List']) : null; if (json['GetQuotationAnalysisList'] != null) { getQuotationAnalysisList = []; @@ -1650,6 +1657,9 @@ class GenericResponseModel { if (this.getPrNotificationBodyList != null) { data['GetPrNotificationBodyList'] = this.getPrNotificationBodyList!.toJson(); } + if (this.getPaymentNotificationBodyList != null) { + data['Pay_ReqNotificationBody'] = this.getPaymentNotificationBodyList!.toJson(); + } if (this.getPRInformationList != null) { data['PR_Information_List'] = this.getPRInformationList!.toJson(); diff --git a/lib/models/worklist/payment_details_list.dart b/lib/models/worklist/payment_details_list.dart new file mode 100644 index 0000000..be7bada --- /dev/null +++ b/lib/models/worklist/payment_details_list.dart @@ -0,0 +1,285 @@ +import 'dart:convert'; + +class GetPaymentNotificationBodyList { + List? beneficieryList; + dynamic pInformation; + dynamic pQuestion; + List? paymentDetailsList; + List? purchaseOrdersList; + List? refundInvoiceList; + List? supplierInformationList; + + GetPaymentNotificationBodyList({ + this.beneficieryList, + this.pInformation, + this.pQuestion, + this.paymentDetailsList, + this.purchaseOrdersList, + this.refundInvoiceList, + this.supplierInformationList, + }); + + factory GetPaymentNotificationBodyList.fromRawJson(String str) => GetPaymentNotificationBodyList.fromJson(json.decode(str)); + + String toRawJson() => json.encode(toJson()); + + factory GetPaymentNotificationBodyList.fromJson(Map json) => GetPaymentNotificationBodyList( + beneficieryList: json["Beneficiery_List"] == null ? [] : List.from(json["Beneficiery_List"]!.map((x) => BeneficieryList.fromJson(x))), + pInformation: json["P_INFORMATION"], + pQuestion: json["P_QUESTION"], + paymentDetailsList: json["PaymentDetails_List"] == null ? [] : List.from(json["PaymentDetails_List"]!.map((x) => PaymentDetailsList.fromJson(x))), + purchaseOrdersList: json["PurchaseOrders_List"] == null ? [] : List.from(json["PurchaseOrders_List"]!.map((x) => PurchaseOrdersList.fromJson(x))), + refundInvoiceList: json["RefundInvoice_List"] == null ? [] : List.from(json["RefundInvoice_List"]!.map((x) => RefundInvoiceList.fromJson(x))), + supplierInformationList: json["SupplierInformation_List"] == null ? [] : List.from(json["SupplierInformation_List"]!.map((x) => SupplierInformationList.fromJson(x))), + ); + + Map toJson() => { + "Beneficiery_List": beneficieryList == null ? [] : List.from(beneficieryList!.map((x) => x.toJson())), + "P_INFORMATION": pInformation, + "P_QUESTION": pQuestion, + "PaymentDetails_List": paymentDetailsList == null ? [] : List.from(paymentDetailsList!.map((x) => x.toJson())), + "PurchaseOrders_List": purchaseOrdersList == null ? [] : List.from(purchaseOrdersList!.map((x) => x.toJson())), + "RefundInvoice_List": refundInvoiceList == null ? [] : List.from(refundInvoiceList!.map((x) => x.toJson())), + "SupplierInformation_List": supplierInformationList == null ? [] : List.from(supplierInformationList!.map((x) => x.toJson())), + }; +} + +class BeneficieryList { + String? beneficiaryBankName; + String? beneficiaryIban; + String? beneficiaryName; + String? iqamaNumber; + String? saddadNumber; + + BeneficieryList({ + this.beneficiaryBankName, + this.beneficiaryIban, + this.beneficiaryName, + this.iqamaNumber, + this.saddadNumber, + }); + + factory BeneficieryList.fromRawJson(String str) => BeneficieryList.fromJson(json.decode(str)); + + String toRawJson() => json.encode(toJson()); + + factory BeneficieryList.fromJson(Map json) => BeneficieryList( + beneficiaryBankName: json["BENEFICIARY_BANK_NAME"], + beneficiaryIban: json["BENEFICIARY_IBAN"], + beneficiaryName: json["BENEFICIARY_NAME"], + iqamaNumber: json["IQAMA_NUMBER"], + saddadNumber: json["SADDAD_NUMBER"], + ); + + Map toJson() => { + "BENEFICIARY_BANK_NAME": beneficiaryBankName, + "BENEFICIARY_IBAN": beneficiaryIban, + "BENEFICIARY_NAME": beneficiaryName, + "IQAMA_NUMBER": iqamaNumber, + "SADDAD_NUMBER": saddadNumber, + }; +} + +class PaymentDetailsList { + String? currency; + String? payingOrganizationName; + String? paymentDetails; + String? paymentMethodName; + String? prepareEmployeeName; + String? prepareEmployeeNumber; + String? preparePositionName; + String? requesterEmployeeName; + String? requesterEmployeeNumber; + String? requesterOperatingUnits; + String? requesterPayrollName; + String? requesterPositionName; + String? requestAmount; + String? requestDate; + String? requestNumber; + String? typeOfPayment; + + PaymentDetailsList({ + this.currency, + this.payingOrganizationName, + this.paymentDetails, + this.paymentMethodName, + this.prepareEmployeeName, + this.prepareEmployeeNumber, + this.preparePositionName, + this.requesterEmployeeName, + this.requesterEmployeeNumber, + this.requesterOperatingUnits, + this.requesterPayrollName, + this.requesterPositionName, + this.requestAmount, + this.requestDate, + this.requestNumber, + this.typeOfPayment, + }); + + factory PaymentDetailsList.fromRawJson(String str) => PaymentDetailsList.fromJson(json.decode(str)); + + String toRawJson() => json.encode(toJson()); + + factory PaymentDetailsList.fromJson(Map json) => PaymentDetailsList( + currency: json["CURRENCY"], + payingOrganizationName: json["PAYING_ORGANIZATION_NAME"], + paymentDetails: json["PAYMENT_DETAILS"], + paymentMethodName: json["PAYMENT_METHOD_NAME"], + prepareEmployeeName: json["PREPARE_EMPLOYEE_NAME"], + prepareEmployeeNumber: json["PREPARE_EMPLOYEE_NUMBER"], + preparePositionName: json["PREPARE_POSITION_NAME"], + requesterEmployeeName: json["REQUESTER_EMPLOYEE_NAME"], + requesterEmployeeNumber: json["REQUESTER_EMPLOYEE_NUMBER"], + requesterOperatingUnits: json["REQUESTER_OPERATING_UNITS"], + requesterPayrollName: json["REQUESTER_PAYROLL_NAME"], + requesterPositionName: json["REQUESTER_POSITION_NAME"], + requestAmount: json["REQUEST_AMOUNT"], + requestDate: json["REQUEST_DATE"], + requestNumber: json["REQUEST_NUMBER"], + typeOfPayment: json["TYPE_OF_PAYMENT"], + ); + + Map toJson() => { + "CURRENCY": currency, + "PAYING_ORGANIZATION_NAME": payingOrganizationName, + "PAYMENT_DETAILS": paymentDetails, + "PAYMENT_METHOD_NAME": paymentMethodName, + "PREPARE_EMPLOYEE_NAME": prepareEmployeeName, + "PREPARE_EMPLOYEE_NUMBER": prepareEmployeeNumber, + "PREPARE_POSITION_NAME": preparePositionName, + "REQUESTER_EMPLOYEE_NAME": requesterEmployeeName, + "REQUESTER_EMPLOYEE_NUMBER": requesterEmployeeNumber, + "REQUESTER_OPERATING_UNITS": requesterOperatingUnits, + "REQUESTER_PAYROLL_NAME": requesterPayrollName, + "REQUESTER_POSITION_NAME": requesterPositionName, + "REQUEST_AMOUNT": requestAmount, + "REQUEST_DATE": requestDate, + "REQUEST_NUMBER": requestNumber, + "TYPE_OF_PAYMENT": typeOfPayment, + }; +} + +class PurchaseOrdersList { + dynamic poAmount; + dynamic poApprovalDate; + String? poNumber; + String? prNumber; + String? supplierName; + String? supplierNumber; + String? versionStatus; + + PurchaseOrdersList({ + this.poAmount, + this.poApprovalDate, + this.poNumber, + this.prNumber, + this.supplierName, + this.supplierNumber, + this.versionStatus, + }); + + factory PurchaseOrdersList.fromRawJson(String str) => PurchaseOrdersList.fromJson(json.decode(str)); + + String toRawJson() => json.encode(toJson()); + + factory PurchaseOrdersList.fromJson(Map json) => PurchaseOrdersList( + poAmount: json["PO_AMOUNT"], + poApprovalDate: json["PO_APPROVAL_DATE"], + poNumber: json["PO_NUMBER"], + prNumber: json["PR_NUMBER"], + supplierName: json["SUPPLIER_NAME"], + supplierNumber: json["SUPPLIER_NUMBER"], + versionStatus: json["VERSION_STATUS"], + ); + + Map toJson() => { + "PO_AMOUNT": poAmount, + "PO_APPROVAL_DATE": poApprovalDate, + "PO_NUMBER": poNumber, + "PR_NUMBER": prNumber, + "SUPPLIER_NAME": supplierName, + "SUPPLIER_NUMBER": supplierNumber, + "VERSION_STATUS": versionStatus, + }; +} + +class RefundInvoiceList { + dynamic amount; + String? hospitalClinic; + dynamic invoicedDate; + String? invoiceNumber; + String? patientName; + String? patientNumber; + + RefundInvoiceList({ + this.amount, + this.hospitalClinic, + this.invoicedDate, + this.invoiceNumber, + this.patientName, + this.patientNumber, + }); + + factory RefundInvoiceList.fromRawJson(String str) => RefundInvoiceList.fromJson(json.decode(str)); + + String toRawJson() => json.encode(toJson()); + + factory RefundInvoiceList.fromJson(Map json) => RefundInvoiceList( + amount: json["AMOUNT"], + hospitalClinic: json["HOSPITAL_CLINIC"], + invoicedDate: json["INVOICED_DATE"], + invoiceNumber: json["INVOICE_NUMBER"], + patientName: json["PATIENT_NAME"], + patientNumber: json["PATIENT_NUMBER"], + ); + + Map toJson() => { + "AMOUNT": amount, + "HOSPITAL_CLINIC": hospitalClinic, + "INVOICED_DATE": invoicedDate, + "INVOICE_NUMBER": invoiceNumber, + "PATIENT_NAME": patientName, + "PATIENT_NUMBER": patientNumber, + }; +} + +class SupplierInformationList { + String? crNumber; + String? supplierBankAccountName; + String? supplierBankAccountNumber; + String? supplierBankIban; + String? supplierName; + String? supplierNumber; + + SupplierInformationList({ + this.crNumber, + this.supplierBankAccountName, + this.supplierBankAccountNumber, + this.supplierBankIban, + this.supplierName, + this.supplierNumber, + }); + + factory SupplierInformationList.fromRawJson(String str) => SupplierInformationList.fromJson(json.decode(str)); + + String toRawJson() => json.encode(toJson()); + + factory SupplierInformationList.fromJson(Map json) => SupplierInformationList( + crNumber: json["CR_NUMBER"], + supplierBankAccountName: json["SUPPLIER_BANK_ACCOUNT_NAME"], + supplierBankAccountNumber: json["SUPPLIER_BANK_ACCOUNT_NUMBER"], + supplierBankIban: json["SUPPLIER_BANK_IBAN"], + supplierName: json["SUPPLIER_NAME"], + supplierNumber: json["SUPPLIER_NUMBER"], + ); + + Map toJson() => { + "CR_NUMBER": crNumber, + "SUPPLIER_BANK_ACCOUNT_NAME": supplierBankAccountName, + "SUPPLIER_BANK_ACCOUNT_NUMBER": supplierBankAccountNumber, + "SUPPLIER_BANK_IBAN": supplierBankIban, + "SUPPLIER_NAME": supplierName, + "SUPPLIER_NUMBER": supplierNumber, + }; +} diff --git a/lib/ui/login/verify_last_login_screen.dart b/lib/ui/login/verify_last_login_screen.dart index 8f6751c..b0ef955 100644 --- a/lib/ui/login/verify_last_login_screen.dart +++ b/lib/ui/login/verify_last_login_screen.dart @@ -58,9 +58,15 @@ class _VerifyLastLoginScreenState extends State { @override Widget build(BuildContext context) { - mobileLoginInfoListModel ??= ModalRoute.of(context)!.settings.arguments as GetMobileLoginInfoListModel; - // String empName = AppState().isArabic(context) ? AppState().memberInformationList!.eMPLOYEEDISPLAYNAMEAr! : AppState().memberInformationList!.eMPLOYEEDISPLAYNAMEEn!; - String empName = mobileLoginInfoListModel!.employeeName!; + if(ModalRoute.of(context)!.settings.arguments != null) { + mobileLoginInfoListModel ??= ModalRoute + .of(context)! + .settings + .arguments as GetMobileLoginInfoListModel; + // String empName = AppState().isArabic(context) ? AppState().memberInformationList!.eMPLOYEEDISPLAYNAMEAr! : AppState().memberInformationList!.eMPLOYEEDISPLAYNAMEEn!; + String empName = mobileLoginInfoListModel!.employeeName!; + + } return Scaffold( appBar: AppBar( diff --git a/lib/ui/my_attendance/dynamic_screens/dynamic_input_screen.dart b/lib/ui/my_attendance/dynamic_screens/dynamic_input_screen.dart index 20da2c8..4f67c62 100644 --- a/lib/ui/my_attendance/dynamic_screens/dynamic_input_screen.dart +++ b/lib/ui/my_attendance/dynamic_screens/dynamic_input_screen.dart @@ -6,6 +6,7 @@ import 'package:flutter/material.dart'; import 'package:mohem_flutter_app/api/leave_balance_api_client.dart'; import 'package:mohem_flutter_app/api/my_attendance_api_client.dart'; import 'package:mohem_flutter_app/app_state/app_state.dart'; +import 'package:mohem_flutter_app/classes/date_uitl.dart'; import 'package:mohem_flutter_app/classes/utils.dart'; import 'package:mohem_flutter_app/config/routes.dart'; import 'package:mohem_flutter_app/extensions/int_extensions.dart'; @@ -85,7 +86,7 @@ class _DynamicInputScreenState extends State { // } // } // } - return ValidateEitTransactionModel(dATEVALUE: null, nAME: e.aPPLICATIONCOLUMNNAME, nUMBERVALUE: null, tRANSACTIONNUMBER: 1, vARCHAR2VALUE: tempVar.toString()).toJson(); + return ValidateEitTransactionModel(dATEVALUE: null, nAME: e.aPPLICATIONCOLUMNNAME, nUMBERVALUE: null, tRANSACTIONNUMBER: 1, vARCHAR2VALUE: DateUtil.replaceArabicNumber(tempVar)).toJson(); }).toList(); values.add(ValidateEitTransactionModel(dATEVALUE: null, nAME: "PEI_ACTION", nUMBERVALUE: null, tRANSACTIONNUMBER: 1, vARCHAR2VALUE: "NEW_ROW").toJson()); @@ -773,7 +774,7 @@ class _DynamicInputScreenState extends State { onTap: () async { if ((getEitDffStructureList![index].eSERVICESDV?.pVALUECOLUMNNAME != null)) { var timeString = getEitDffStructureList![index].eSERVICESDV!.pVALUECOLUMNNAME!.split(":"); - selectedDate = DateTime(0, 0, 0, int.parse(timeString[0]), int.parse(timeString[1])); + selectedDate = DateTime(0, 0, 0, int.parse(timeString[0]), int.parse((timeString[1]))); //DateTime.parse(getEitDffStructureList![index].eSERVICESDV!.pVALUECOLUMNNAME!); } @@ -861,7 +862,9 @@ class _DynamicInputScreenState extends State { context: context, initialTime: time, builder: (cxt, child) { - return MediaQuery(data: MediaQuery.of(context).copyWith(alwaysUse24HourFormat: true), child: child ?? Container()); + return MediaQuery(data: MediaQuery.of(context).copyWith(alwaysUse24HourFormat: true), child: Localizations.override( + context: context, + locale: const Locale('en', 'US'),child: child ?? Container())); }); if (picked != null && picked != time) { diff --git a/lib/ui/work_list/sheets/update_continue_sheet.dart b/lib/ui/work_list/sheets/update_continue_sheet.dart index 1240de2..42632a8 100644 --- a/lib/ui/work_list/sheets/update_continue_sheet.dart +++ b/lib/ui/work_list/sheets/update_continue_sheet.dart @@ -38,7 +38,7 @@ class _UpdateContinueSheetState extends State { var size = MediaQuery.of(context).size; itemHeight = (size.height - kToolbarHeight - 24) / 9; itemWidth = size.width / 2; - return Column( + return Column( children: [ if ((widget.workListData?.sUBJECT ?? "").isNotEmpty) widget.workListData!.sUBJECT!.toText14().paddingOnly(top: 10, right: 21, left: 21, bottom: 21), ListView.separated( diff --git a/lib/ui/work_list/work_list_screen.dart b/lib/ui/work_list/work_list_screen.dart index 9dea0a1..6f93909 100644 --- a/lib/ui/work_list/work_list_screen.dart +++ b/lib/ui/work_list/work_list_screen.dart @@ -78,7 +78,10 @@ class _WorkListScreenState extends State { WorkListItemTypeModelData( value: 0, name: 'STAMP', fullName: LocaleKeys.stamp.tr(), active: false, color: [Color(0xff32D892), Color(0xff1AB170)], icon: "assets/images/miss_swipe.svg", key: 'STAMP', disable: false), WorkListItemTypeModelData( - value: 0, name: 'COC', fullName: LocaleKeys.itemCreation.tr(), active: false, color: [Color(0xff787299), Color(0xff1AB170)], icon: "assets/images/miss_swipe.svg", key: 'COC', disable: true) + value: 0, name: 'COC', fullName: LocaleKeys.itemCreation.tr(), active: false, color: [Color(0xff787299), Color(0xff1AB170)], icon: "assets/images/miss_swipe.svg", key: 'COC', disable: true), + WorkListItemTypeModelData( + value: 0, name: 'Payment Req', fullName: LocaleKeys.paymentRequest.tr(), active: false, color: [Color(0xff42d7bf), Color(0xff42d7bf)], icon: "assets/images/PR.svg", key: 'PAY_REQ', disable: false) + ]; int? workListItemIndex; diff --git a/lib/ui/work_list/worklist_detail_screen.dart b/lib/ui/work_list/worklist_detail_screen.dart index 146bd44..bd0a8b3 100644 --- a/lib/ui/work_list/worklist_detail_screen.dart +++ b/lib/ui/work_list/worklist_detail_screen.dart @@ -29,6 +29,7 @@ import 'package:mohem_flutter_app/models/worklist/hr/get_address_notification_bo import 'package:mohem_flutter_app/models/worklist/hr/get_basic_det_ntf_body_list_model.dart'; import 'package:mohem_flutter_app/models/worklist/hr/get_contact_notification_body_list_model.dart'; import 'package:mohem_flutter_app/models/worklist/hr/get_phones_notification_body_list_model.dart'; +import 'package:mohem_flutter_app/models/worklist/payment_details_list.dart'; import 'package:mohem_flutter_app/models/worklist_response_model.dart'; import 'package:mohem_flutter_app/ui/my_attendance/dynamic_screens/dynamic_listview_screen.dart'; import 'package:mohem_flutter_app/ui/work_list/sheets/delegate_sheet.dart'; @@ -46,7 +47,6 @@ import 'package:mohem_flutter_app/widgets/dialogs/accept_reject_input_dialog.dar import 'package:mohem_flutter_app/widgets/dialogs/confirm_dialog.dart'; import 'package:mohem_flutter_app/models/termination/termination_notification_body.dart'; - class WorkListDetailScreen extends StatefulWidget { WorkListDetailScreen({Key? key}) : super(key: key); @@ -70,27 +70,30 @@ class _WorkListDetailScreenState extends State { List getStampMsNotifications = []; List getStampNsNotifications = []; List getMoNotificationBodyList = []; - List getNotificationRespondAttributes = []; + List getNotificationRespondAttributes = + []; NotificationGetRespondAttributesList? notificationNoteInput; List getRFCEmployeeList = []; //HR Details Screen Requests - List? getEitCollectionNotificationBodyList = []; + List? + getEitCollectionNotificationBodyList = []; List? getPhonesNotificationBodyList = []; List? getBasicDetNtfBodyList = []; - List? getAbsenceCollectionNotificationBodyList = []; + List? + getAbsenceCollectionNotificationBodyList = []; GetContactNotificationBodyList? getContactNotificationBodyList; List? getAddressNotificationBodyList = []; List? getTerminationNotificationBodyList = []; - GenericResponseModel? getBasicNTFBody; GenericResponseModel? getICBody; GenericResponseModel? subordinatesLeavesModel; GetPoNotificationBodyList? getPoNotificationBody; GetPrNotificationBodyList? getPrNotificationBody; GetItemCreationNtfBodyList? getItemCreationNtfBody; + GetPaymentNotificationBodyList? getPaymentNotificationBodyList; bool isCloseAvailable = false; bool isApproveAvailable = false; @@ -129,8 +132,9 @@ class _WorkListDetailScreenState extends State { getAbsenceCollectionNotificationBodyList!.clear(); getContactNotificationBodyList = null; getAddressNotificationBodyList!.clear(); - - if (workListData!.iTEMTYPE == "HRSSA" || workListData!.iTEMTYPE == "STAMP") { + getPaymentNotificationBodyList = null; + if (workListData!.iTEMTYPE == "HRSSA" || + workListData!.iTEMTYPE == "STAMP") { getUserInformation(); } @@ -152,7 +156,7 @@ class _WorkListDetailScreenState extends State { getContactNotificationBody(); } else if (workListData!.rEQUESTTYPE == "ADDRESS") { getAddressNotificationBody(); - } else if(workListData!.rEQUESTTYPE =='TERMINATION'){ + } else if (workListData!.rEQUESTTYPE == 'TERMINATION') { getTerminationNotificationBody(); } } @@ -171,6 +175,9 @@ class _WorkListDetailScreenState extends State { if (workListData!.iTEMTYPE == "REQAPPRV") { getPRNotification(); } + if (workListData!.iTEMTYPE == "PAY_REQ") { + getPaymentNotification(); + } if (controller.hasClients) { controller.jumpToPage(0); @@ -184,7 +191,8 @@ class _WorkListDetailScreenState extends State { void getDataFromState() { if (workListData == null) { - workListData = AppState().workList![AppState().workListIndex!]; // ModalRoute.of(context)!.settings.arguments as WorkListResponseModel; + workListData = AppState().workList![AppState() + .workListIndex!]; // ModalRoute.of(context)!.settings.arguments as WorkListResponseModel; getData(); } } @@ -217,7 +225,8 @@ class _WorkListDetailScreenState extends State { Column( children: [ Container( - padding: const EdgeInsets.only(left: 21, right: 21, top: 16, bottom: 16), + padding: const EdgeInsets.only( + left: 21, right: 21, top: 16, bottom: 16), decoration: const BoxDecoration( borderRadius: BorderRadius.only( bottomLeft: Radius.circular(25), @@ -236,13 +245,19 @@ class _WorkListDetailScreenState extends State { child: Row( children: [ myTab(LocaleKeys.info.tr(), 0), - (workListData!.iTEMTYPE == "HRSSA" || workListData!.iTEMTYPE == "STAMP") ? myTab(LocaleKeys.details.tr(), 1) : myTab(LocaleKeys.request.tr(), 1), + (workListData!.iTEMTYPE == "HRSSA" || + workListData!.iTEMTYPE == "STAMP") + ? myTab(LocaleKeys.details.tr(), 1) + : myTab(LocaleKeys.request.tr(), 1), myTab(LocaleKeys.actions.tr(), 2), myTab(LocaleKeys.attachments.tr(), 3), ], ), ), - if ((workListData?.sUBJECT ?? "").isNotEmpty) workListData!.sUBJECT!.toText14().paddingOnly(top: 20, right: 21, left: 21), + if ((workListData?.sUBJECT ?? "").isNotEmpty) + workListData!.sUBJECT! + .toText14() + .paddingOnly(top: 20, right: 21, left: 21), PageView( controller: controller, onPageChanged: (int pageIndex) { @@ -254,25 +269,38 @@ class _WorkListDetailScreenState extends State { InfoFragment( poHeaderList: getPoNotificationBody?.pOHeader ?? [], workListData: workListData, - itemCreationHeader: getItemCreationNtfBody?.itemCreationHeader ?? [], + itemCreationHeader: + getItemCreationNtfBody?.itemCreationHeader ?? [], getStampMsNotifications: getStampMsNotifications, getStampNsNotifications: getStampNsNotifications, - getEitCollectionNotificationBodyList: getEitCollectionNotificationBodyList, - getPhonesNotificationBodyList: getPhonesNotificationBodyList, + getEitCollectionNotificationBodyList: + getEitCollectionNotificationBodyList, + getPhonesNotificationBodyList: + getPhonesNotificationBodyList, getBasicDetNtfBodyList: getBasicDetNtfBodyList, - getAddressNotificationBodyList: getAddressNotificationBodyList, - getAbsenceCollectionNotificationBodyList: getAbsenceCollectionNotificationBodyList, - getContactNotificationBodyList: getContactNotificationBodyList, + getAddressNotificationBodyList: + getAddressNotificationBodyList, + getAbsenceCollectionNotificationBodyList: + getAbsenceCollectionNotificationBodyList, + getContactNotificationBodyList: + getContactNotificationBodyList, getPrNotificationBodyList: getPrNotificationBody, - getTerminationNotificationBodyList:getTerminationNotificationBodyList + getTerminationNotificationBodyList: + getTerminationNotificationBodyList, + getPaymentNotificationBodyList: + getPaymentNotificationBodyList, ), - (workListData!.iTEMTYPE == "HRSSA" || workListData!.iTEMTYPE == "STAMP") - ? DetailFragment(workListData, memberInformationListModel) + (workListData!.iTEMTYPE == "HRSSA" || + workListData!.iTEMTYPE == "STAMP" || workListData!.iTEMTYPE == "PAY_REQ") + ? DetailFragment( + workListData, memberInformationListModel) : RequestFragment( moNotificationBodyList: getMoNotificationBodyList, poLinesList: getPoNotificationBody?.pOLines ?? [], - itemCreationLines: getItemCreationNtfBody?.itemCreationLines ?? [], + itemCreationLines: + getItemCreationNtfBody?.itemCreationLines ?? [], prLinesList: getPrNotificationBody?.pRLines ?? [], + ), isActionHistoryLoaded ? actionHistoryList.isEmpty @@ -292,11 +320,13 @@ class _WorkListDetailScreenState extends State { ).expanded, if (isApproveAvailable || isRejectAvailable || isCloseAvailable) Container( - padding: const EdgeInsets.only(top: 14, bottom: 14, left: 21, right: 21), + padding: const EdgeInsets.only( + top: 14, bottom: 14, left: 21, right: 21), decoration: const BoxDecoration( color: Colors.white, border: Border( - top: BorderSide(color: MyColors.lightGreyEFColor, width: 1.0), + top: BorderSide( + color: MyColors.lightGreyEFColor, width: 1.0), ), ), child: Row( @@ -305,20 +335,29 @@ class _WorkListDetailScreenState extends State { DefaultButton( LocaleKeys.reject.tr(), () => performAction(rejectAction), - colors: const [Color(0xffE47A7E), Color(0xffDE6D71)], + colors: const [ + Color(0xffE47A7E), + Color(0xffDE6D71) + ], ).expanded, if (isApproveAvailable && isRejectAvailable) 8.width, if (isApproveAvailable) DefaultButton( LocaleKeys.approve.tr(), () => performAction(approveAction), - colors: const [Color(0xff28C884), Color(0xff1BB271)], + colors: const [ + Color(0xff28C884), + Color(0xff1BB271) + ], ).expanded, if (isCloseAvailable) DefaultButton( LocaleKeys.ok.tr(), () => performAction("CLOSE"), - colors: const [Color(0xff32D892), Color(0xff1AB170)], + colors: const [ + Color(0xff32D892), + Color(0xff1AB170) + ], ).expanded, 8.width, Container( @@ -328,7 +367,11 @@ class _WorkListDetailScreenState extends State { shape: BoxShape.circle, color: MyColors.lightGreyE6Color, ), - child: Icon(showFabOptions ? Icons.more_vert_rounded : Icons.more_horiz_rounded, color: MyColors.darkIconColor), + child: Icon( + showFabOptions + ? Icons.more_vert_rounded + : Icons.more_horiz_rounded, + color: MyColors.darkIconColor), ).onPress(() { setState(() { showFabOptions = true; @@ -345,7 +388,8 @@ class _WorkListDetailScreenState extends State { opacity: showFabOptions ? 1 : 0, duration: const Duration(milliseconds: 250), child: Container( - padding: const EdgeInsets.only(left: 21, right: 21, bottom: 75 - 12), + padding: const EdgeInsets.only( + left: 21, right: 21, bottom: 75 - 12), width: double.infinity, height: double.infinity, color: Colors.white.withOpacity(.67), @@ -354,15 +398,19 @@ class _WorkListDetailScreenState extends State { mainAxisSize: MainAxisSize.min, crossAxisAlignment: CrossAxisAlignment.end, children: [ - myFab(LocaleKeys.skip.tr(), "assets/images/skip.svg").onPress(() { - if (AppState().workList!.length - 1 > AppState().workListIndex!) { + myFab(LocaleKeys.skip.tr(), "assets/images/skip.svg") + .onPress(() { + if (AppState().workList!.length - 1 > + AppState().workListIndex!) { animationIndex = animationIndex + 1; - AppState().setWorkListIndex = AppState().workListIndex! + 1; + AppState().setWorkListIndex = + AppState().workListIndex! + 1; workListData = null; showFabOptions = false; tabIndex = 0; getDataFromState(); - } else if (AppState().workList!.length - 1 == AppState().workListIndex!) { + } else if (AppState().workList!.length - 1 == + AppState().workListIndex!) { Navigator.pop(context); } }), @@ -380,25 +428,31 @@ class _WorkListDetailScreenState extends State { ], ), ), - floatingActionButton: (!isApproveAvailable && !isRejectAvailable && !isCloseAvailable) - ? Container( - height: 43, - width: 43, - decoration: const BoxDecoration( - shape: BoxShape.circle, - color: MyColors.lightGreyE6Color, - ), - child: Icon(showFabOptions ? Icons.more_vert_rounded : Icons.more_horiz_rounded, color: MyColors.darkIconColor), - ).onPress(() { - setState(() { - showFabOptions = true; - }); - }) - : null, + floatingActionButton: + (!isApproveAvailable && !isRejectAvailable && !isCloseAvailable) + ? Container( + height: 43, + width: 43, + decoration: const BoxDecoration( + shape: BoxShape.circle, + color: MyColors.lightGreyE6Color, + ), + child: Icon( + showFabOptions + ? Icons.more_vert_rounded + : Icons.more_horiz_rounded, + color: MyColors.darkIconColor), + ).onPress(() { + setState(() { + showFabOptions = true; + }); + }) + : null, ); } - List viewApiButtonsList(List notificationButtonsList) { + List viewApiButtonsList( + List notificationButtonsList) { List fabs = []; for (int i = 0; i < notificationButtonsList.length; i++) { if (notificationButtonsList[i].bUTTONACTION! == "REJECTED" || @@ -412,7 +466,9 @@ class _WorkListDetailScreenState extends State { notificationButtonsList[i].bUTTONLABEL!, getActionImage(notificationButtonsList[i].bUTTONACTION!), isIconAsset: true, - ).paddingOnly(bottom: 12).onPress(() => handleFabAction(notificationButtonsList[i]))); + ) + .paddingOnly(bottom: 12) + .onPress(() => handleFabAction(notificationButtonsList[i]))); } return fabs; } @@ -491,7 +547,8 @@ class _WorkListDetailScreenState extends State { )); break; case "ANSWER_INFO": - performAction(notificationButton.bUTTONACTION!, title: notificationButton.bUTTONLABEL); + performAction(notificationButton.bUTTONACTION!, + title: notificationButton.bUTTONLABEL); break; case "RFC": getRFCEmployeeListFunc(); @@ -511,20 +568,31 @@ class _WorkListDetailScreenState extends State { callBackFunc: reloadWorkList, child: UpdateContinueSheet( workListData: workListData, - getEitCollectionNotificationBodyList: getEitCollectionNotificationBodyList, - dynamicParams: DynamicListViewParams(workListData!.sUBJECT!, workListData!.fUNCTIONNAME!, - isUpdate: true, collectionNotificationList: getEitCollectionNotificationBodyList![0].collectionNotification)), + getEitCollectionNotificationBodyList: + getEitCollectionNotificationBodyList, + dynamicParams: DynamicListViewParams( + workListData!.sUBJECT!, workListData!.fUNCTIONNAME!, + isUpdate: true, + collectionNotificationList: + getEitCollectionNotificationBodyList![0] + .collectionNotification)), ); break; case "CONTINUE_ACTION": showMyBottomSheet( context, + type:"CONTINUE_ACTION", callBackFunc: reloadWorkList, child: UpdateContinueSheet( workListData: workListData, - getEitCollectionNotificationBodyList: getEitCollectionNotificationBodyList, - dynamicParams: DynamicListViewParams(workListData!.sUBJECT!, workListData!.fUNCTIONNAME!, - isUpdate: true, collectionNotificationList: getEitCollectionNotificationBodyList![0].collectionNotification)), + getEitCollectionNotificationBodyList: + getEitCollectionNotificationBodyList, + dynamicParams: DynamicListViewParams( + workListData!.sUBJECT!, workListData!.fUNCTIONNAME!, + isUpdate: true, + collectionNotificationList: + getEitCollectionNotificationBodyList![0] + .collectionNotification)), ); break; case "APPROVE_AND_FORWARD": @@ -536,7 +604,8 @@ class _WorkListDetailScreenState extends State { notificationID: workListData!.nOTIFICATIONID, actionHistoryList: actionHistoryList, callBackFunc: reloadWorkList, - getNotificationRespondAttributes: getNotificationRespondAttributes, + getNotificationRespondAttributes: + getNotificationRespondAttributes, )); break; case "FORWARD": @@ -548,7 +617,8 @@ class _WorkListDetailScreenState extends State { notificationID: workListData!.nOTIFICATIONID, actionHistoryList: actionHistoryList, callBackFunc: reloadWorkList, - getNotificationRespondAttributes: getNotificationRespondAttributes, + getNotificationRespondAttributes: + getNotificationRespondAttributes, )); break; case "DEL": @@ -569,7 +639,8 @@ class _WorkListDetailScreenState extends State { void getRFCEmployeeListFunc() async { try { Utils.showLoading(context); - getRFCEmployeeList = await WorkListApiClient().getRFCEmployeeeList(workListData!.nOTIFICATIONID!); + getRFCEmployeeList = await WorkListApiClient() + .getRFCEmployeeeList(workListData!.nOTIFICATIONID!); Utils.hideLoading(context); actionHistoryList.last.sEQUENCE = getRFCEmployeeList[0].sEQ; showMyBottomSheet(context, @@ -589,7 +660,8 @@ class _WorkListDetailScreenState extends State { } } - Future performNetworkCall(BuildContext context, {String? email, String? userId}) async { + Future performNetworkCall(BuildContext context, + {String? email, String? userId}) async { showDialog( context: context, builder: (BuildContext cxt) => ConfirmDialog( @@ -599,7 +671,12 @@ class _WorkListDetailScreenState extends State { Navigator.pop(cxt); Utils.showLoading(context); try { - await WorkListApiClient().submitComment(comment: "", email: email, userId: userId, notificationId: workListData!.nOTIFICATIONID, apiMode: "REJECT"); + await WorkListApiClient().submitComment( + comment: "", + email: email, + userId: userId, + notificationId: workListData!.nOTIFICATIONID, + apiMode: "REJECT"); Utils.hideLoading(context); Navigator.pop(context, "delegate_reload"); } catch (ex) { @@ -617,7 +694,9 @@ class _WorkListDetailScreenState extends State { mainAxisSize: MainAxisSize.min, crossAxisAlignment: CrossAxisAlignment.center, children: [ - title.toText12(color: isSelected ? Colors.white : Colors.white.withOpacity(.74), isCenter: true), + title.toText12( + color: isSelected ? Colors.white : Colors.white.withOpacity(.74), + isCenter: true), 4.height, Container( height: 8, @@ -680,14 +759,17 @@ class _WorkListDetailScreenState extends State { notificationGetRespond: notificationNoteInput, actionMode: actionMode, onTap: (String note) { - List> responseAttribute = []; + List> responseAttribute = []; - for (var element in getNotificationRespondAttributes!) { - responseAttribute.add({ - "ATTRIBUTE_NAME": element!.attributeName, - if (element!.attributeType == "number") "ATTRIBUTE_NUMBER_VALUE": note else if (element!.attributeType == "VARCHAR2") "ATTRIBUTE_TEXT_VALUE": note - }); - } + for (var element in getNotificationRespondAttributes!) { + responseAttribute.add({ + "ATTRIBUTE_NAME": element!.attributeName, + if (element!.attributeType == "number") + "ATTRIBUTE_NUMBER_VALUE": note + else if (element!.attributeType == "VARCHAR2") + "ATTRIBUTE_TEXT_VALUE": note + }); + } Map payload = { "P_ACTION_MODE": actionMode, @@ -695,11 +777,16 @@ class _WorkListDetailScreenState extends State { "P_COMMENTS": note, "P_FORWARD_TO_USER_NAME": "", "P_NOTIFICATION_ID": workListData!.nOTIFICATIONID, - "RespondAttributeList":responseAttribute, + "RespondAttributeList": responseAttribute, }; - if (actionMode == "APPROVED" || actionMode == "APPROVE" || actionMode == "CLOSE" || actionMode == "ANSWER_INFO" || actionMode == "RFC" || actionMode == "TRY_APPROVE_AGAIN" || actionMode == "SEND_BACK_TO_PREPARER") { + if (actionMode == "APPROVED" || + actionMode == "APPROVE" || + actionMode == "CLOSE" || + actionMode == "ANSWER_INFO" || + actionMode == "RFC") { performNotificationAction(payload); - } else if (note.isNotEmpty && (actionMode != "APPROVED" || actionMode != "APPROVE")) { + } else if (note.isNotEmpty && + (actionMode != "APPROVED" || actionMode != "APPROVE")) { performNotificationAction(payload); } else { Utils.showToast(LocaleKeys.pleaseEnterComments.tr()); @@ -712,7 +799,8 @@ class _WorkListDetailScreenState extends State { void performNotificationAction(Map payload) async { try { Utils.showLoading(context); - GenericResponseModel model = await WorkListApiClient().postNotificationActions(payload); + GenericResponseModel model = + await WorkListApiClient().postNotificationActions(payload); Utils.hideLoading(context); Utils.showToast(LocaleKeys.yourChangeHasBeenSavedSuccessfully.tr()); animationIndex = animationIndex + 1; @@ -753,7 +841,8 @@ class _WorkListDetailScreenState extends State { if (apiCallCount == 0) Utils.showLoading(context); apiCallCount++; getEitCollectionNotificationBodyList!.clear(); - getEitCollectionNotificationBodyList = await WorkListApiClient().GetEitNotificationBody(workListData!.nOTIFICATIONID); + getEitCollectionNotificationBodyList = await WorkListApiClient() + .GetEitNotificationBody(workListData!.nOTIFICATIONID); apiCallCount--; if (apiCallCount == 0) { Utils.hideLoading(context); @@ -771,7 +860,8 @@ class _WorkListDetailScreenState extends State { if (apiCallCount == 0) Utils.showLoading(context); apiCallCount++; memberInformationListModel = null; - memberInformationListModel = await WorkListApiClient().getUserInformation(-999, workListData!.sELECTEDEMPLOYEENUMBER!); + memberInformationListModel = await WorkListApiClient() + .getUserInformation(-999, workListData!.sELECTEDEMPLOYEENUMBER!); apiCallCount--; if (apiCallCount == 0) { Utils.hideLoading(context); @@ -789,7 +879,8 @@ class _WorkListDetailScreenState extends State { if (apiCallCount == 0) Utils.showLoading(context); apiCallCount++; getPhonesNotificationBodyList!.clear(); - getPhonesNotificationBodyList = await WorkListApiClient().getPhonesNotificationBodyList(workListData!.nOTIFICATIONID); + getPhonesNotificationBodyList = await WorkListApiClient() + .getPhonesNotificationBodyList(workListData!.nOTIFICATIONID); apiCallCount--; if (apiCallCount == 0) { Utils.hideLoading(context); @@ -807,7 +898,8 @@ class _WorkListDetailScreenState extends State { if (apiCallCount == 0) Utils.showLoading(context); apiCallCount++; getBasicDetNtfBodyList!.clear(); - getBasicDetNtfBodyList = await WorkListApiClient().getBasicDetNtfBodyList(workListData!.nOTIFICATIONID); + getBasicDetNtfBodyList = await WorkListApiClient() + .getBasicDetNtfBodyList(workListData!.nOTIFICATIONID); apiCallCount--; if (apiCallCount == 0) { Utils.hideLoading(context); @@ -825,7 +917,8 @@ class _WorkListDetailScreenState extends State { if (apiCallCount == 0) Utils.showLoading(context); apiCallCount++; getAbsenceCollectionNotificationBodyList!.clear(); - getAbsenceCollectionNotificationBodyList = await WorkListApiClient().getAbsenceNotificationBody(workListData!.nOTIFICATIONID); + getAbsenceCollectionNotificationBodyList = await WorkListApiClient() + .getAbsenceNotificationBody(workListData!.nOTIFICATIONID); apiCallCount--; if (apiCallCount == 0) { Utils.hideLoading(context); @@ -842,7 +935,8 @@ class _WorkListDetailScreenState extends State { try { if (apiCallCount == 0) Utils.showLoading(context); apiCallCount++; - getContactNotificationBodyList = await WorkListApiClient().getContactNotificationBodyList(workListData!.nOTIFICATIONID); + getContactNotificationBodyList = await WorkListApiClient() + .getContactNotificationBodyList(workListData!.nOTIFICATIONID); apiCallCount--; if (apiCallCount == 0) { Utils.hideLoading(context); @@ -859,7 +953,8 @@ class _WorkListDetailScreenState extends State { try { if (apiCallCount == 0) Utils.showLoading(context); apiCallCount++; - getAddressNotificationBodyList = await WorkListApiClient().getAddressNotificationBodyList(workListData!.nOTIFICATIONID); + getAddressNotificationBodyList = await WorkListApiClient() + .getAddressNotificationBodyList(workListData!.nOTIFICATIONID); apiCallCount--; if (apiCallCount == 0) { Utils.hideLoading(context); @@ -871,15 +966,15 @@ class _WorkListDetailScreenState extends State { Utils.handleException(ex, context, null); } } + void getTerminationNotificationBody() async { try { - if (apiCallCount == 0) - apiCallCount++; - getTerminationNotificationBodyList = await WorkListApiClient().getTerminationNotificationBodyList(workListData!.nOTIFICATIONID); + if (apiCallCount == 0) apiCallCount++; + getTerminationNotificationBodyList = await WorkListApiClient() + .getTerminationNotificationBodyList(workListData!.nOTIFICATIONID); Utils.hideLoading(context); apiCallCount--; if (apiCallCount == 0) { - setState(() {}); } } catch (ex) { @@ -889,16 +984,16 @@ class _WorkListDetailScreenState extends State { } } - - void getStampNotificationBody() async { try { if (apiCallCount == 0) Utils.showLoading(context); apiCallCount++; if (workListData!.rEQUESTTYPE == "STAMP_MS") { - getStampMsNotifications = await WorkListApiClient().getStampMsNotificationBody(workListData!.nOTIFICATIONID!, -999); + getStampMsNotifications = await WorkListApiClient() + .getStampMsNotificationBody(workListData!.nOTIFICATIONID!, -999); } else { - getStampNsNotifications = await WorkListApiClient().getStampNsNotificationBody(workListData!.nOTIFICATIONID!, -999); + getStampNsNotifications = await WorkListApiClient() + .getStampNsNotificationBody(workListData!.nOTIFICATIONID!, -999); } apiCallCount--; if (apiCallCount == 0) { @@ -916,7 +1011,8 @@ class _WorkListDetailScreenState extends State { try { if (apiCallCount == 0) Utils.showLoading(context); apiCallCount++; - getMoNotificationBodyList = await WorkListApiClient().getMoNotificationBody(workListData!.nOTIFICATIONID!, -999); + getMoNotificationBodyList = await WorkListApiClient() + .getMoNotificationBody(workListData!.nOTIFICATIONID!, -999); apiCallCount--; if (apiCallCount == 0) { Utils.hideLoading(context); @@ -933,7 +1029,8 @@ class _WorkListDetailScreenState extends State { try { if (apiCallCount == 0) Utils.showLoading(context); apiCallCount++; - getItemCreationNtfBody = await WorkListApiClient().getItemCreationNtfBody(workListData!.nOTIFICATIONID!, -999); + getItemCreationNtfBody = await WorkListApiClient() + .getItemCreationNtfBody(workListData!.nOTIFICATIONID!, -999); apiCallCount--; if (apiCallCount == 0) { Utils.hideLoading(context); @@ -950,7 +1047,8 @@ class _WorkListDetailScreenState extends State { try { if (apiCallCount == 0) Utils.showLoading(context); apiCallCount++; - getPoNotificationBody = await WorkListApiClient().getPoNotificationBody(workListData!.nOTIFICATIONID!, -999); + getPoNotificationBody = await WorkListApiClient() + .getPoNotificationBody(workListData!.nOTIFICATIONID!, -999); apiCallCount--; if (apiCallCount == 0) { Utils.hideLoading(context); @@ -967,7 +1065,26 @@ class _WorkListDetailScreenState extends State { try { if (apiCallCount == 0) Utils.showLoading(context); apiCallCount++; - getPrNotificationBody = await WorkListApiClient().getPRNotificationBody(workListData!.nOTIFICATIONID!, -999); + getPrNotificationBody = await WorkListApiClient() + .getPRNotificationBody(workListData!.nOTIFICATIONID!, -999); + apiCallCount--; + if (apiCallCount == 0) { + Utils.hideLoading(context); + setState(() {}); + } + } catch (ex) { + apiCallCount--; + Utils.hideLoading(context); + Utils.handleException(ex, context, null); + } + } + + void getPaymentNotification() async { + try { + if (apiCallCount == 0) Utils.showLoading(context); + apiCallCount++; + getPaymentNotificationBodyList = await WorkListApiClient() + .getPaymentNotificationBody(workListData!.nOTIFICATIONID!, -999); apiCallCount--; if (apiCallCount == 0) { Utils.hideLoading(context); @@ -985,7 +1102,8 @@ class _WorkListDetailScreenState extends State { if (apiCallCount == 0) Utils.showLoading(context); apiCallCount++; getNotificationRespondAttributes.clear(); - getNotificationRespondAttributes = await WorkListApiClient().notificationGetRespondAttributes(workListData!.nOTIFICATIONID!); + getNotificationRespondAttributes = await WorkListApiClient() + .notificationGetRespondAttributes(workListData!.nOTIFICATIONID!); if (getNotificationRespondAttributes.isNotEmpty) { notificationNoteInput = getNotificationRespondAttributes.first; } @@ -1006,18 +1124,25 @@ class _WorkListDetailScreenState extends State { if (apiCallCount == 0) Utils.showLoading(context); apiCallCount++; notificationButtonsList.clear(); - notificationButtonsList = await WorkListApiClient().getNotificationButtons(workListData!.nOTIFICATIONID!); + notificationButtonsList = await WorkListApiClient() + .getNotificationButtons(workListData!.nOTIFICATIONID!); if (notificationButtonsList.isNotEmpty) { - isCloseAvailable = notificationButtonsList.any((GetNotificationButtonsList element) => element.bUTTONACTION == "CLOSE"); - isApproveAvailable = notificationButtonsList.any((GetNotificationButtonsList element) { - if (element.bUTTONACTION == "APPROVED" || element.bUTTONACTION == "APPROVE") { + isCloseAvailable = notificationButtonsList.any( + (GetNotificationButtonsList element) => + element.bUTTONACTION == "CLOSE"); + isApproveAvailable = + notificationButtonsList.any((GetNotificationButtonsList element) { + if (element.bUTTONACTION == "APPROVED" || + element.bUTTONACTION == "APPROVE") { approveAction = element.bUTTONACTION!; return true; } return false; }); - isRejectAvailable = notificationButtonsList.any((GetNotificationButtonsList element) { - if (element.bUTTONACTION == "REJECTED" || element.bUTTONACTION == "REJECT") { + isRejectAvailable = + notificationButtonsList.any((GetNotificationButtonsList element) { + if (element.bUTTONACTION == "REJECTED" || + element.bUTTONACTION == "REJECT") { rejectAction = element.bUTTONACTION!; return true; } @@ -1040,7 +1165,8 @@ class _WorkListDetailScreenState extends State { try { isActionHistoryLoaded = false; actionHistoryList.clear(); - actionHistoryList = await WorkListApiClient().getActionHistory(workListData!.nOTIFICATIONID!); + actionHistoryList = await WorkListApiClient() + .getActionHistory(workListData!.nOTIFICATIONID!); setState(() { isActionHistoryLoaded = true; }); @@ -1053,7 +1179,8 @@ class _WorkListDetailScreenState extends State { try { isAttachmentLoaded = false; getAttachmentList.clear(); - getAttachmentList = await WorkListApiClient().getAttachments(workListData!.nOTIFICATIONID!); + getAttachmentList = await WorkListApiClient() + .getAttachments(workListData!.nOTIFICATIONID!); setState(() { isAttachmentLoaded = true; }); diff --git a/lib/ui/work_list/worklist_fragments/actions_fragment.dart b/lib/ui/work_list/worklist_fragments/actions_fragment.dart index 10d027a..41de635 100644 --- a/lib/ui/work_list/worklist_fragments/actions_fragment.dart +++ b/lib/ui/work_list/worklist_fragments/actions_fragment.dart @@ -167,7 +167,7 @@ class ActionsFragment extends StatelessWidget { Duration duration = DateTime.now().difference(dateTimeFrom); return "Action duration: " + DateUtil.formatDuration(duration); } else { - if (actionHistoryList[index + 1].nOTIFICATIONDATE!.isEmpty) { + if (actionHistoryList[index].nOTIFICATIONDATE!.isEmpty) { return ""; } else { DateTime dateTimeTo = DateUtil.convertSimpleStringDateToDate(actionHistoryList[index].nOTIFICATIONDATE!); diff --git a/lib/ui/work_list/worklist_fragments/info_fragments.dart b/lib/ui/work_list/worklist_fragments/info_fragments.dart index 7e1cd1c..1351126 100644 --- a/lib/ui/work_list/worklist_fragments/info_fragments.dart +++ b/lib/ui/work_list/worklist_fragments/info_fragments.dart @@ -19,8 +19,8 @@ import 'package:mohem_flutter_app/models/worklist/hr/get_contact_notification_bo import 'package:mohem_flutter_app/models/worklist/hr/get_phones_notification_body_list_model.dart'; import 'package:mohem_flutter_app/models/worklist_response_model.dart'; import 'package:mohem_flutter_app/widgets/item_detail_view_widget.dart'; - import 'package:mohem_flutter_app/models/termination/termination_notification_body.dart'; +import 'package:mohem_flutter_app/models/worklist/payment_details_list.dart'; class InfoFragment extends StatelessWidget { WorkListResponseModel? workListData; @@ -28,14 +28,18 @@ class InfoFragment extends StatelessWidget { List? getStampMsNotifications; List? getStampNsNotifications; List itemCreationHeader; - List? getEitCollectionNotificationBodyList; + List? + getEitCollectionNotificationBodyList; List? getPhonesNotificationBodyList; List? getBasicDetNtfBodyList; - List? getAbsenceCollectionNotificationBodyList; + List? + getAbsenceCollectionNotificationBodyList; GetContactNotificationBodyList? getContactNotificationBodyList; GetPrNotificationBodyList? getPrNotificationBodyList; List? getAddressNotificationBodyList = []; - List? getTerminationNotificationBodyList =[]; + List? getTerminationNotificationBodyList = []; + GetPaymentNotificationBodyList? getPaymentNotificationBodyList; + InfoFragment( {this.workListData, this.poHeaderList = const [], @@ -49,15 +53,18 @@ class InfoFragment extends StatelessWidget { this.getContactNotificationBodyList, this.getPrNotificationBodyList, this.getAddressNotificationBodyList, - this.getTerminationNotificationBodyList - }); + this.getTerminationNotificationBodyList, + this.getPaymentNotificationBodyList}); double itemHeight = 0; double itemWidth = 0; + + + @override Widget build(BuildContext context) { - var size = MediaQuery.of(context).size; + Size size = MediaQuery.of(context).size; itemHeight = (size.height - kToolbarHeight - 24) / 9; itemWidth = size.width / 2; @@ -68,36 +75,62 @@ class InfoFragment extends StatelessWidget { mainAxisSize: MainAxisSize.min, children: [ ItemDetailGrid( - ItemDetailViewCol(LocaleKeys.from.tr(), workListData!.fROMUSER ?? ""), + ItemDetailViewCol( + LocaleKeys.from.tr(), workListData!.fROMUSER ?? ""), ItemDetailViewCol(LocaleKeys.to.tr(), workListData!.tOUSER ?? ""), ), ItemDetailGrid( - ItemDetailViewCol(LocaleKeys.sent.tr(), workListData!.bEGINDATE ?? ""), - ItemDetailViewCol(LocaleKeys.closed.tr(), workListData!.eNDDATE ?? ""), + ItemDetailViewCol( + LocaleKeys.sent.tr(), workListData!.bEGINDATE ?? ""), + ItemDetailViewCol( + LocaleKeys.closed.tr(), workListData!.eNDDATE ?? ""), ), ItemDetailGrid( - ItemDetailViewCol(LocaleKeys.id.tr(), workListData!.nOTIFICATIONID?.toString() ?? ""), - ItemDetailViewCol(LocaleKeys.responder.tr(), workListData!.rESPONDER ?? ""), + ItemDetailViewCol(LocaleKeys.id.tr(), + workListData!.nOTIFICATIONID?.toString() ?? ""), + ItemDetailViewCol( + LocaleKeys.responder.tr(), workListData!.rESPONDER ?? ""), ), ItemDetailGrid( - ItemDetailViewCol(LocaleKeys.subject.tr(), workListData!.sUBJECT ?? ""), + ItemDetailViewCol( + LocaleKeys.subject.tr(), workListData!.sUBJECT ?? ""), Container(), isItLast: true, ), ], ).objectContainerView(), - if (getPrNotificationBodyList != null) getPRNotificationBodyListWidget(getPrNotificationBodyList!), - if (getStampMsNotifications?.isNotEmpty ?? false) getStampMsNotificationsListView(getStampMsNotifications ?? []), - if (getStampNsNotifications?.isNotEmpty ?? false) getStampNsNotificationsListView(getStampNsNotifications ?? []), + if (getPrNotificationBodyList != null) + getPRNotificationBodyListWidget(getPrNotificationBodyList!), + if (getStampMsNotifications?.isNotEmpty ?? false) + getStampMsNotificationsListView(getStampMsNotifications ?? []), + if (getStampNsNotifications?.isNotEmpty ?? false) + getStampNsNotificationsListView(getStampNsNotifications ?? []), if (poHeaderList.isNotEmpty) getPoNotificationsListView(), if (itemCreationHeader.isNotEmpty) getItemCreationHeaderView(), - if (getEitCollectionNotificationBodyList?.isNotEmpty ?? false) getEitNotificationsListView(getEitCollectionNotificationBodyList ?? []), - if (getPhonesNotificationBodyList?.isNotEmpty ?? false) getPhonesNotificationBodyListWidget(getPhonesNotificationBodyList ?? []).objectContainerView(title: "Mobile Numbers"), - if (getBasicDetNtfBodyList?.isNotEmpty ?? false) getBasicDetNtfBodyListWidget(getBasicDetNtfBodyList ?? []).objectContainerView(title: "Basic Information"), - if (getAbsenceCollectionNotificationBodyList?.isNotEmpty ?? false) getAbsenceCollectionNotificationBodyListWidget(getAbsenceCollectionNotificationBodyList ?? []), - if (getContactNotificationBodyList != null) getContactNotificationBodyListWidget(getContactNotificationBodyList ?? GetContactNotificationBodyList()).objectContainerView(), - if (getAddressNotificationBodyList?.isNotEmpty ?? false) getAddressNotificationBodyListWidget(getAddressNotificationBodyList!), - if (getTerminationNotificationBodyList?.isNotEmpty ?? false) getTerminationNotificationBodyListWidget(getTerminationNotificationBodyList!), + if (getEitCollectionNotificationBodyList?.isNotEmpty ?? false) + getEitNotificationsListView(getEitCollectionNotificationBodyList ?? []), + if (getPhonesNotificationBodyList?.isNotEmpty ?? false) + getPhonesNotificationBodyListWidget(getPhonesNotificationBodyList ?? []) + .objectContainerView(title: "Mobile Numbers"), + if (getBasicDetNtfBodyList?.isNotEmpty ?? false) + getBasicDetNtfBodyListWidget(getBasicDetNtfBodyList ?? []) + .objectContainerView(title: "Basic Information"), + if (getAbsenceCollectionNotificationBodyList?.isNotEmpty ?? false) + getAbsenceCollectionNotificationBodyListWidget( + getAbsenceCollectionNotificationBodyList ?? []), + if (getContactNotificationBodyList != null) + getContactNotificationBodyListWidget(getContactNotificationBodyList ?? + GetContactNotificationBodyList()) + .objectContainerView(), + if (getAddressNotificationBodyList?.isNotEmpty ?? false) + getAddressNotificationBodyListWidget(getAddressNotificationBodyList!), + if (getTerminationNotificationBodyList?.isNotEmpty ?? false) + getTerminationNotificationBodyListWidget( + getTerminationNotificationBodyList!), + if (getPaymentNotificationBodyList != null) + getPaymentNotificationBodyListWidget(getPaymentNotificationBodyList ?? + GetPaymentNotificationBodyList()) + .objectContainerView(), ]; return Container( width: double.infinity, @@ -115,43 +148,59 @@ class InfoFragment extends StatelessWidget { return ListView.separated( shrinkWrap: true, physics: const NeverScrollableScrollPhysics(), - itemBuilder: (cxt, index) => Column( + itemBuilder: (BuildContext cxt, int index) => Column( crossAxisAlignment: CrossAxisAlignment.start, mainAxisSize: MainAxisSize.min, children: [ Column( children: [ ItemDetailGrid( - ItemDetailViewCol(LocaleKeys.description.tr(), workListData!.fROMUSER ?? ""), - ItemDetailViewCol(LocaleKeys.from.tr(), workListData!.fROMUSER ?? ""), + ItemDetailViewCol(LocaleKeys.description.tr(), + workListData!.fROMUSER ?? ""), + ItemDetailViewCol( + LocaleKeys.from.tr(), workListData!.fROMUSER ?? ""), ), ItemDetailGrid( - ItemDetailViewCol(LocaleKeys.to.tr(), workListData!.tOUSER ?? ""), - ItemDetailViewCol(LocaleKeys.sent.tr(), workListData!.bEGINDATE ?? ""), + ItemDetailViewCol( + LocaleKeys.to.tr(), workListData!.tOUSER ?? ""), + ItemDetailViewCol( + LocaleKeys.sent.tr(), workListData!.bEGINDATE ?? ""), ), ItemDetailGrid( - ItemDetailViewCol(LocaleKeys.closed.tr(), workListData!.eNDDATE ?? ""), - ItemDetailViewCol(LocaleKeys.id.tr(), workListData!.nOTIFICATIONID?.toString() ?? ""), + ItemDetailViewCol( + LocaleKeys.closed.tr(), workListData!.eNDDATE ?? ""), + ItemDetailViewCol(LocaleKeys.id.tr(), + workListData!.nOTIFICATIONID?.toString() ?? ""), ), ItemDetailGrid( - ItemDetailViewCol(LocaleKeys.supplier.tr(), poHeaderList[index].vENDORNAME ?? ""), - ItemDetailViewCol(LocaleKeys.site.tr(), poHeaderList[index].vENDORSITECODE ?? ""), + ItemDetailViewCol(LocaleKeys.supplier.tr(), + poHeaderList[index].vENDORNAME ?? ""), + ItemDetailViewCol(LocaleKeys.site.tr(), + poHeaderList[index].vENDORSITECODE ?? ""), ), ItemDetailGrid( - ItemDetailViewCol(LocaleKeys.buyer.tr(), poHeaderList[index].bUYER ?? ""), - ItemDetailViewCol(LocaleKeys.preparer.tr(), poHeaderList[index].pREPARER ?? ""), + ItemDetailViewCol(LocaleKeys.buyer.tr(), + poHeaderList[index].bUYER ?? ""), + ItemDetailViewCol(LocaleKeys.preparer.tr(), + poHeaderList[index].pREPARER ?? ""), ), ItemDetailGrid( - ItemDetailViewCol(LocaleKeys.creationDate.tr(), poHeaderList[index].cREATIONDATE ?? ""), - ItemDetailViewCol(LocaleKeys.shipToLocation.tr(), poHeaderList[index].sHIPTOLOCATIONNAME ?? ""), + ItemDetailViewCol(LocaleKeys.creationDate.tr(), + poHeaderList[index].cREATIONDATE ?? ""), + ItemDetailViewCol(LocaleKeys.shipToLocation.tr(), + poHeaderList[index].sHIPTOLOCATIONNAME ?? ""), ), ItemDetailGrid( - ItemDetailViewCol(LocaleKeys.quotationNumber.tr(), poHeaderList[index].qUOTATIONNUMBER ?? ""), - ItemDetailViewCol(LocaleKeys.quotationDate.tr(), poHeaderList[index].qUOTATIONDATE ?? ""), + ItemDetailViewCol(LocaleKeys.quotationNumber.tr(), + poHeaderList[index].qUOTATIONNUMBER ?? ""), + ItemDetailViewCol(LocaleKeys.quotationDate.tr(), + poHeaderList[index].qUOTATIONDATE ?? ""), ), ItemDetailGrid( - ItemDetailViewCol(LocaleKeys.paymentTerms.tr(), poHeaderList[index].pAYMENTTERMS ?? ""), - ItemDetailViewCol(LocaleKeys.currency.tr(), poHeaderList[index].cURRENCYNAME ?? ""), + ItemDetailViewCol(LocaleKeys.paymentTerms.tr(), + poHeaderList[index].pAYMENTTERMS ?? ""), + ItemDetailViewCol(LocaleKeys.currency.tr(), + poHeaderList[index].cURRENCYNAME ?? ""), isItLast: true, ), ], @@ -160,19 +209,26 @@ class InfoFragment extends StatelessWidget { Column( children: [ ItemDetailGrid( - ItemDetailViewCol(LocaleKeys.grossAmount.tr(), poHeaderList[index].gROSSAMOUNT?.toString() ?? ""), - ItemDetailViewCol(LocaleKeys.discountAmount.tr(), poHeaderList[index].dISCOUNTAMOUNT?.toString() ?? ""), + ItemDetailViewCol(LocaleKeys.grossAmount.tr(), + poHeaderList[index].gROSSAMOUNT?.toString() ?? ""), + ItemDetailViewCol(LocaleKeys.discountAmount.tr(), + poHeaderList[index].dISCOUNTAMOUNT?.toString() ?? ""), ), ItemDetailGrid( - ItemDetailViewCol(LocaleKeys.customDuty.tr(), poHeaderList[index].cUSTOMDUTY?.toString() ?? ""), - ItemDetailViewCol(LocaleKeys.shipHandle.tr(), poHeaderList[index].sHIPHANDLE?.toString() ?? ""), + ItemDetailViewCol(LocaleKeys.customDuty.tr(), + poHeaderList[index].cUSTOMDUTY?.toString() ?? ""), + ItemDetailViewCol(LocaleKeys.shipHandle.tr(), + poHeaderList[index].sHIPHANDLE?.toString() ?? ""), ), ItemDetailGrid( - ItemDetailViewCol(LocaleKeys.otherCharges.tr(), poHeaderList[index].oTHERCHARGES?.toString() ?? ""), - ItemDetailViewCol(LocaleKeys.totalPOAmountWithVAT.tr(), poHeaderList[index].lOCCURTOTPOAMT.toString() ?? ""), + ItemDetailViewCol(LocaleKeys.otherCharges.tr(), + poHeaderList[index].oTHERCHARGES?.toString() ?? ""), + ItemDetailViewCol(LocaleKeys.totalPOAmountWithVAT.tr(), + poHeaderList[index].lOCCURTOTPOAMT.toString() ?? ""), ), ItemDetailGrid( - ItemDetailViewCol(LocaleKeys.totalPOAmountInWords.tr(), poHeaderList[index].tOTPOAMTWORD ?? ""), + ItemDetailViewCol(LocaleKeys.totalPOAmountInWords.tr(), + poHeaderList[index].tOTPOAMTWORD ?? ""), Container(), isItLast: true, ), @@ -180,7 +236,7 @@ class InfoFragment extends StatelessWidget { ).objectContainerView(title: LocaleKeys.amount_detail.tr()), ], ), - separatorBuilder: (cxt, index) => 4.height, + separatorBuilder: (BuildContext cxt, int index) => 4.height, itemCount: poHeaderList.length); } @@ -194,67 +250,95 @@ class InfoFragment extends StatelessWidget { // itemCount: dataList.length); // } - Widget getStampMsNotificationsListView(List list) { + Widget getStampMsNotificationsListView( + List list) { return ListView.separated( shrinkWrap: true, physics: const NeverScrollableScrollPhysics(), - itemBuilder: (cxt, index) => Column( + itemBuilder: (BuildContext cxt, int index) => Column( mainAxisSize: MainAxisSize.min, children: [ ItemDetailGrid( - ItemDetailViewCol(LocaleKeys.employeeNumber.tr(), list[index].eMPLOYEENUMBER.toString()), - ItemDetailViewCol(LocaleKeys.assignmentNumber.tr(), list[index].aSSIGNMENTNUMBER.toString()), + ItemDetailViewCol(LocaleKeys.employeeNumber.tr(), + list[index].eMPLOYEENUMBER.toString()), + ItemDetailViewCol(LocaleKeys.assignmentNumber.tr(), + list[index].aSSIGNMENTNUMBER.toString()), ), ItemDetailGrid( - ItemDetailViewCol(LocaleKeys.employeeName.tr(), list[index].eMPLOYEENAME.toString()), - ItemDetailViewCol(LocaleKeys.scheduleDate.tr(), DateUtil.formatDateToDate(DateUtil.convertStringToDate(list[index].sCHEDULEDATE.toString()), false)), + ItemDetailViewCol(LocaleKeys.employeeName.tr(), + list[index].eMPLOYEENAME.toString()), + ItemDetailViewCol( + LocaleKeys.scheduleDate.tr(), + DateUtil.formatDateToDate( + DateUtil.convertStringToDate( + list[index].sCHEDULEDATE.toString()), + false)), ), ItemDetailGrid( - ItemDetailViewCol(LocaleKeys.shiftType.tr(), list[index].sHTTYPEDESC.toString()), - ItemDetailViewCol(LocaleKeys.shift.tr(), list[index].sHTNAME.toString()), + ItemDetailViewCol(LocaleKeys.shiftType.tr(), + list[index].sHTTYPEDESC.toString()), + ItemDetailViewCol( + LocaleKeys.shift.tr(), list[index].sHTNAME.toString()), ), ItemDetailGrid( - ItemDetailViewCol(LocaleKeys.breakText.tr(), list[index].bREAKNAME.toString()), - ItemDetailViewCol(LocaleKeys.actualSwipeStart.tr(), list[index].sHTACTUALSTARTTIME.toString()), + ItemDetailViewCol(LocaleKeys.breakText.tr(), + list[index].bREAKNAME.toString()), + ItemDetailViewCol(LocaleKeys.actualSwipeStart.tr(), + list[index].sHTACTUALSTARTTIME.toString()), ), ItemDetailGrid( - ItemDetailViewCol(LocaleKeys.actualSwipeEnd.tr(), list[index].sHTACTUALENDTIME.toString()), - ItemDetailViewCol(LocaleKeys.approvedSwipeStart.tr(), list[index].aPPROVEDSTARTTIME.toString()), + ItemDetailViewCol(LocaleKeys.actualSwipeEnd.tr(), + list[index].sHTACTUALENDTIME.toString()), + ItemDetailViewCol(LocaleKeys.approvedSwipeStart.tr(), + list[index].aPPROVEDSTARTTIME.toString()), ), ItemDetailGrid( - ItemDetailViewCol(LocaleKeys.approvedSwipeStartReason.tr(), list[index].aPPROVEDSTARTREASON.toString()), + ItemDetailViewCol(LocaleKeys.approvedSwipeStartReason.tr(), + list[index].aPPROVEDSTARTREASON.toString()), ItemDetailViewCol(LocaleKeys.approvedSwipeEnd.tr(), ""), ), ItemDetailGrid( - ItemDetailViewCol(LocaleKeys.approvedSwipeEndReason.tr(), list[index].aPPROVEDENDREASONDESC.toString()), + ItemDetailViewCol(LocaleKeys.approvedSwipeEndReason.tr(), + list[index].aPPROVEDENDREASONDESC.toString()), Container(), isItLast: true, ), ], ).objectContainerView(), - separatorBuilder: (cxt, index) => 1.height.paddingOnly(top: 8, bottom: 8), + separatorBuilder: (BuildContext cxt, int index) => + 1.height.paddingOnly(top: 8, bottom: 8), itemCount: list.length); } - Widget getStampNsNotificationsListView(List list) { + Widget getStampNsNotificationsListView( + List list) { return ListView.separated( shrinkWrap: true, physics: const NeverScrollableScrollPhysics(), - itemBuilder: (cxt, index) => Column( + itemBuilder: (BuildContext cxt, int index) => Column( mainAxisSize: MainAxisSize.min, children: [ ItemDetailGrid( - ItemDetailViewCol(LocaleKeys.employeeNumber.tr(), list[index].eMPLOYEENUMBER.toString()), - ItemDetailViewCol(LocaleKeys.assignmentNumber.tr(), list[index].aSSIGNMENTNUMBER.toString()), + ItemDetailViewCol(LocaleKeys.employeeNumber.tr(), + list[index].eMPLOYEENUMBER.toString()), + ItemDetailViewCol(LocaleKeys.assignmentNumber.tr(), + list[index].aSSIGNMENTNUMBER.toString()), ), ItemDetailGrid( - ItemDetailViewCol(LocaleKeys.employeeName.tr(), list[index].eMPLOYEENAME.toString()), - ItemDetailViewCol(LocaleKeys.scheduleDate.tr(), DateUtil.formatDateToDate(DateUtil.convertStringToDate(list[index].sCHEDULEDATE.toString()), false)), + ItemDetailViewCol(LocaleKeys.employeeName.tr(), + list[index].eMPLOYEENAME.toString()), + ItemDetailViewCol( + LocaleKeys.scheduleDate.tr(), + DateUtil.formatDateToDate( + DateUtil.convertStringToDate( + list[index].sCHEDULEDATE.toString()), + false)), isItLast: true, ), ], ).objectContainerView(), - separatorBuilder: (cxt, index) => 1.height.paddingOnly(top: 8, bottom: 8), + separatorBuilder: (BuildContext cxt, int index) => + 1.height.paddingOnly(top: 8, bottom: 8), itemCount: list.length); } @@ -262,43 +346,65 @@ class InfoFragment extends StatelessWidget { return ListView.separated( shrinkWrap: true, physics: const NeverScrollableScrollPhysics(), - itemBuilder: (cxt, index) => Column( + itemBuilder: (BuildContext cxt, int index) => Column( mainAxisSize: MainAxisSize.min, children: [ ItemDetailGrid( - ItemDetailViewCol(LocaleKeys.operatingUnit.tr(), itemCreationHeader[index].oPERATINGUNIT?.toString() ?? ""), - ItemDetailViewCol(LocaleKeys.category.tr(), itemCreationHeader[index].cATEGORY?.toString() ?? ""), + ItemDetailViewCol( + LocaleKeys.operatingUnit.tr(), + itemCreationHeader[index].oPERATINGUNIT?.toString() ?? + ""), + ItemDetailViewCol(LocaleKeys.category.tr(), + itemCreationHeader[index].cATEGORY?.toString() ?? ""), ), ItemDetailGrid( - ItemDetailViewCol(LocaleKeys.requester.tr(), itemCreationHeader[index].rEQUESTER?.toString() ?? ""), - ItemDetailViewCol(LocaleKeys.analyzedBy.tr(), itemCreationHeader[index].aNALYZEDBY?.toString() ?? ""), + ItemDetailViewCol(LocaleKeys.requester.tr(), + itemCreationHeader[index].rEQUESTER?.toString() ?? ""), + ItemDetailViewCol(LocaleKeys.analyzedBy.tr(), + itemCreationHeader[index].aNALYZEDBY?.toString() ?? ""), ), ItemDetailGrid( - ItemDetailViewCol(LocaleKeys.approvedDate.tr(), itemCreationHeader[index].aPPROVEDDATE?.toString() ?? ""), - ItemDetailViewCol(LocaleKeys.itemType.tr(), itemCreationHeader[index].iTEMTYPE?.toString() ?? ""), + ItemDetailViewCol(LocaleKeys.approvedDate.tr(), + itemCreationHeader[index].aPPROVEDDATE?.toString() ?? ""), + ItemDetailViewCol(LocaleKeys.itemType.tr(), + itemCreationHeader[index].iTEMTYPE?.toString() ?? ""), ), ItemDetailGrid( - ItemDetailViewCol(LocaleKeys.relatedTo.tr(), itemCreationHeader[index].rELATEDTO?.toString() ?? ""), - ItemDetailViewCol(LocaleKeys.requestDate.tr(), DateUtil.formatDateToDate(DateUtil.convertStringToDate(itemCreationHeader[index].rEQUESTDATE.toString()), false)), + ItemDetailViewCol(LocaleKeys.relatedTo.tr(), + itemCreationHeader[index].rELATEDTO?.toString() ?? ""), + ItemDetailViewCol( + LocaleKeys.requestDate.tr(), + DateUtil.formatDateToDate( + DateUtil.convertStringToDate( + itemCreationHeader[index].rEQUESTDATE.toString()), + false)), ), ItemDetailGrid( - ItemDetailViewCol(LocaleKeys.analyzedDate.tr(), itemCreationHeader[index].aNALYZEDDATE?.toString() ?? ""), - ItemDetailViewCol(LocaleKeys.urgent.tr(), itemCreationHeader[index].uRGENTFLAGDISP?.toString() ?? ""), + ItemDetailViewCol(LocaleKeys.analyzedDate.tr(), + itemCreationHeader[index].aNALYZEDDATE?.toString() ?? ""), + ItemDetailViewCol( + LocaleKeys.urgent.tr(), + itemCreationHeader[index].uRGENTFLAGDISP?.toString() ?? + ""), ), ], ).objectContainerView(), - separatorBuilder: (cxt, index) => 18.height, + separatorBuilder: (BuildContext cxt, int index) => 18.height, itemCount: itemCreationHeader.length); } //HR multiple type requests - Widget getEitNotificationsListView(List list) { + Widget getEitNotificationsListView( + List list) { return ListView.separated( shrinkWrap: true, physics: const NeverScrollableScrollPhysics(), - itemBuilder: (cxt, index) { - List dataList = list.isEmpty ? [] : (list[index].collectionNotification ?? []); - dataList = dataList.where((o) => o.displayFlag == "Y").toList(); + itemBuilder: (BuildContext cxt, int index) { + List dataList = + list.isEmpty ? [] : (list[index].collectionNotification ?? []); + dataList = dataList + .where((CollectionNotificationEit o) => o.displayFlag == "Y") + .toList(); bool isOdd = false; if (dataList.length % 2 != 0) { isOdd = true; @@ -308,7 +414,8 @@ class InfoFragment extends StatelessWidget { itemCount: dataList.length, shrinkWrap: true, physics: const NeverScrollableScrollPhysics(), - itemBuilder: (context, index) => ItemDetailViewGridItem( + itemBuilder: (BuildContext context, int index) => + ItemDetailViewGridItem( index, dataList[index].segmentPrompt, dataList[index].segmentValueDsp, @@ -324,12 +431,13 @@ class InfoFragment extends StatelessWidget { ), ).objectContainerView(); }, - separatorBuilder: (cxt, index) => 12.height, + separatorBuilder: (BuildContext cxt, int index) => 12.height, itemCount: list.length, ); } - Widget getPhonesNotificationBodyListWidget(List list) { + Widget getPhonesNotificationBodyListWidget( + List list) { bool isOdd = false; if (list.length % 2 != 0) { isOdd = true; @@ -339,7 +447,7 @@ class InfoFragment extends StatelessWidget { itemCount: list.length, shrinkWrap: true, physics: const NeverScrollableScrollPhysics(), - itemBuilder: (context, index) => ItemDetailViewGridItem( + itemBuilder: (BuildContext context, int index) => ItemDetailViewGridItem( index, LocaleKeys.subject.tr(), list[index].proposedPhoneNumber ?? "", @@ -359,8 +467,9 @@ class InfoFragment extends StatelessWidget { child: ListView.separated( shrinkWrap: true, physics: const NeverScrollableScrollPhysics(), - itemBuilder: (cxt, index) => ItemDetailViewCol(LocaleKeys.subject.tr(), list[index].proposedPhoneNumber ?? ""), - separatorBuilder: (cxt, index) => 4.height, + itemBuilder: (BuildContext cxt, int index) => ItemDetailViewCol( + LocaleKeys.subject.tr(), list[index].proposedPhoneNumber ?? ""), + separatorBuilder: (BuildContext cxt, int index) => 4.height, itemCount: list.length), ); } @@ -375,7 +484,7 @@ class InfoFragment extends StatelessWidget { itemCount: list.length, shrinkWrap: true, physics: const NeverScrollableScrollPhysics(), - itemBuilder: (context, index) => ItemDetailViewGridItem( + itemBuilder: (BuildContext context, int index) => ItemDetailViewGridItem( index, list[index].segmentPrompt, list[index].segmentValueDsp, @@ -395,19 +504,24 @@ class InfoFragment extends StatelessWidget { child: ListView.separated( shrinkWrap: true, physics: const NeverScrollableScrollPhysics(), - itemBuilder: (cxt, index) => ItemDetailViewCol(list[index].segmentPrompt!, list[index].segmentValueDsp!), - separatorBuilder: (cxt, index) => 4.height, + itemBuilder: (BuildContext cxt, int index) => ItemDetailViewCol( + list[index].segmentPrompt!, list[index].segmentValueDsp!), + separatorBuilder: (BuildContext cxt, int index) => 4.height, itemCount: list.length), ); } - Widget getAbsenceCollectionNotificationBodyListWidget(List list) { + Widget getAbsenceCollectionNotificationBodyListWidget( + List list) { return ListView.separated( shrinkWrap: true, physics: const NeverScrollableScrollPhysics(), - itemBuilder: (cxt, index) { - List dataList = list.isEmpty ? [] : (list[index].collectionNotification ?? []); - dataList = dataList.where((o) => o.dISPLAYFLAG == "Y").toList(); + itemBuilder: (BuildContext cxt, int index) { + List dataList = + list.isEmpty ? [] : (list[index].collectionNotification ?? []); + dataList = dataList + .where((CollectionNotificationAbsence o) => o.dISPLAYFLAG == "Y") + .toList(); bool isOdd = false; if (dataList.length % 2 != 0) { isOdd = true; @@ -418,7 +532,8 @@ class InfoFragment extends StatelessWidget { itemCount: dataList.length, shrinkWrap: true, physics: const NeverScrollableScrollPhysics(), - itemBuilder: (context, index) => ItemDetailViewGridItem( + itemBuilder: (BuildContext context, int index) => + ItemDetailViewGridItem( index, dataList[index].sEGMENTPROMPT, dataList[index].sEGMENTVALUEDSP, @@ -436,34 +551,50 @@ class InfoFragment extends StatelessWidget { return ListView.separated( shrinkWrap: true, physics: const NeverScrollableScrollPhysics(), - itemBuilder: (cxt, index) => dataList[index].dISPLAYFLAG == "Y" ? ItemDetailViewCol(dataList[index].sEGMENTPROMPT!, dataList[index].sEGMENTVALUEDSP!) : Container(), - separatorBuilder: (cxt, index) => dataList[index].dISPLAYFLAG == "Y" ? 4.height : 0.height, + itemBuilder: (BuildContext cxt, int index) => + dataList[index].dISPLAYFLAG == "Y" + ? ItemDetailViewCol(dataList[index].sEGMENTPROMPT!, + dataList[index].sEGMENTVALUEDSP!) + : Container(), + separatorBuilder: (BuildContext cxt, int index) => + dataList[index].dISPLAYFLAG == "Y" ? 4.height : 0.height, itemCount: dataList.length) .objectContainerView(); }, - separatorBuilder: (cxt, index) => 12.height, + separatorBuilder: (BuildContext cxt, int index) => 12.height, itemCount: list.length, ); } - Widget getPRNotificationBodyListWidget(GetPrNotificationBodyList getPrNotificationBodyList) { + Widget getPRNotificationBodyListWidget( + GetPrNotificationBodyList getPrNotificationBodyList) { return Column( children: [ - getPrNotificationBodyList.pINFORMATION != null ? getPrNotificationBodyList.pINFORMATION.toString().toText14(color: MyColors.textMixColor).objectContainerView() : Container(), + getPrNotificationBodyList.pINFORMATION != null + ? getPrNotificationBodyList.pINFORMATION + .toString() + .toText14(color: MyColors.textMixColor) + .objectContainerView() + : Container(), 12.height, Column( children: [ ItemDetailGrid( - ItemDetailViewCol(LocaleKeys.from.tr(), workListData!.fROMUSER ?? ""), + ItemDetailViewCol( + LocaleKeys.from.tr(), workListData!.fROMUSER ?? ""), ItemDetailViewCol(LocaleKeys.to.tr(), workListData!.tOUSER ?? ""), ), ItemDetailGrid( - ItemDetailViewCol(LocaleKeys.sent.tr(), workListData!.bEGINDATE ?? ""), - ItemDetailViewCol(LocaleKeys.closed.tr(), workListData!.eNDDATE ?? ""), + ItemDetailViewCol( + LocaleKeys.sent.tr(), workListData!.bEGINDATE ?? ""), + ItemDetailViewCol( + LocaleKeys.closed.tr(), workListData!.eNDDATE ?? ""), ), ItemDetailGrid( - ItemDetailViewCol(LocaleKeys.id.tr(), workListData!.nOTIFICATIONID?.toString() ?? ""), - ItemDetailViewCol(LocaleKeys.responder.tr(), workListData!.rESPONDER ?? ""), + ItemDetailViewCol(LocaleKeys.id.tr(), + workListData!.nOTIFICATIONID?.toString() ?? ""), + ItemDetailViewCol( + LocaleKeys.responder.tr(), workListData!.rESPONDER ?? ""), ), Column( children: getPRHeaderValues(), @@ -474,12 +605,14 @@ class InfoFragment extends StatelessWidget { ); } - Widget getAddressNotificationBodyListWidget(List getAddressNotificationBodyList) { + Widget getAddressNotificationBodyListWidget( + List getAddressNotificationBodyList) { bool isOdd = false; try { if (getAddressNotificationBodyList.length % 2 != 0) { isOdd = true; - getAddressNotificationBodyList.add(GetAddressNotificationBodyList(sEGMENTPROMPT: "--", sEGMENTVALUEDSP: "--")); + getAddressNotificationBodyList.add(GetAddressNotificationBodyList( + sEGMENTPROMPT: "--", sEGMENTVALUEDSP: "--")); } } catch (e) {} @@ -487,15 +620,16 @@ class InfoFragment extends StatelessWidget { itemCount: getAddressNotificationBodyList!.length, shrinkWrap: true, physics: const NeverScrollableScrollPhysics(), - itemBuilder: (context, index) => ItemDetailViewGridItem( + itemBuilder: (BuildContext context, int index) => ItemDetailViewGridItem( index, getAddressNotificationBodyList[index].sEGMENTPROMPT, getAddressNotificationBodyList[index].sEGMENTVALUEDSP, - isNeedToShowEmptyDivider: (getAddressNotificationBodyList.length == index + 1) - ? isOdd - ? true - : false - : false, + isNeedToShowEmptyDivider: + (getAddressNotificationBodyList.length == index + 1) + ? isOdd + ? true + : false + : false, ), gridDelegate: SliverGridDelegateWithFixedCrossAxisCount( crossAxisCount: 2, @@ -504,13 +638,14 @@ class InfoFragment extends StatelessWidget { ).objectContainerView(); } - - Widget getTerminationNotificationBodyListWidget(List getterminationNotificationBodyList) { + Widget getTerminationNotificationBodyListWidget( + List getterminationNotificationBodyList) { bool isOdd = false; try { if (getterminationNotificationBodyList.length % 2 != 0) { isOdd = true; - getterminationNotificationBodyList.add(TerminationNotificationBody(sEGMENTPROMPT: "--", sEGMENTVALUEDSP: "--")); + getterminationNotificationBodyList.add(TerminationNotificationBody( + sEGMENTPROMPT: "--", sEGMENTVALUEDSP: "--")); } } catch (e) {} @@ -518,15 +653,16 @@ class InfoFragment extends StatelessWidget { itemCount: getterminationNotificationBodyList!.length, shrinkWrap: true, physics: const NeverScrollableScrollPhysics(), - itemBuilder: (context, index) => ItemDetailViewGridItem( + itemBuilder: (BuildContext context, int index) => ItemDetailViewGridItem( index, getterminationNotificationBodyList[index].sEGMENTPROMPT, getterminationNotificationBodyList[index].sEGMENTVALUEDSP, - isNeedToShowEmptyDivider: (getterminationNotificationBodyList.length == index + 1) - ? isOdd - ? true - : false - : false, + isNeedToShowEmptyDivider: + (getterminationNotificationBodyList.length == index + 1) + ? isOdd + ? true + : false + : false, ), gridDelegate: SliverGridDelegateWithFixedCrossAxisCount( crossAxisCount: 2, @@ -535,22 +671,25 @@ class InfoFragment extends StatelessWidget { ).objectContainerView(); } - - List getPRHeaderValues() { List pRHeaders = []; - getPrNotificationBodyList!.pRHeader!.forEach((element) { - pRHeaders.add(ItemDetailGrid(ItemDetailViewCol(element.hDRATTRIBUTENAME!, element.hDRATTRIBUTEVALUE!), Container())); + getPrNotificationBodyList!.pRHeader!.forEach((PRHeader element) { + pRHeaders.add(ItemDetailGrid( + ItemDetailViewCol( + element.hDRATTRIBUTENAME!, element.hDRATTRIBUTEVALUE!), + Container())); }); return pRHeaders; } - Widget getContactNotificationBodyListWidget(GetContactNotificationBodyList data) { + Widget getContactNotificationBodyListWidget( + GetContactNotificationBodyList data) { bool isOdd = false; try { if (data.contactNotificationBody!.length % 2 != 0) { isOdd = true; - data.contactNotificationBody!.add(ContactNotificationBody(segmentPrompt: "--", segmentValueDsp: "--")); + data.contactNotificationBody!.add(ContactNotificationBody( + segmentPrompt: "--", segmentValueDsp: "--")); } } catch (e) {} @@ -558,15 +697,16 @@ class InfoFragment extends StatelessWidget { itemCount: data.contactNotificationBody!.length, shrinkWrap: true, physics: const NeverScrollableScrollPhysics(), - itemBuilder: (context, index) => ItemDetailViewGridItem( + itemBuilder: (BuildContext context, int index) => ItemDetailViewGridItem( index, data.contactNotificationBody![index].segmentPrompt, data.contactNotificationBody![index].segmentValueDsp, - isNeedToShowEmptyDivider: (data.contactNotificationBody!.length == index + 1) - ? isOdd - ? true - : false - : false, + isNeedToShowEmptyDivider: + (data.contactNotificationBody!.length == index + 1) + ? isOdd + ? true + : false + : false, ), gridDelegate: SliverGridDelegateWithFixedCrossAxisCount( crossAxisCount: 2, @@ -578,9 +718,132 @@ class InfoFragment extends StatelessWidget { child: ListView.separated( shrinkWrap: true, physics: const NeverScrollableScrollPhysics(), - itemBuilder: (cxt, index) => ItemDetailViewCol(data.contactNotificationBody![index].segmentPrompt!, data.contactNotificationBody![index].segmentValueDsp!), - separatorBuilder: (cxt, index) => 4.height, + itemBuilder: (BuildContext cxt, int index) => ItemDetailViewCol( + data.contactNotificationBody![index].segmentPrompt!, + data.contactNotificationBody![index].segmentValueDsp!), + separatorBuilder: (BuildContext cxt, int index) => 4.height, itemCount: data.contactNotificationBody!.length), ); } + + Widget getPaymentNotificationBodyListWidget( + GetPaymentNotificationBodyList? data) { + return Column( + children: [ + 12.height, + if (data!.paymentDetailsList!.isNotEmpty) + Column( + children: [ + LocaleKeys.paymentDetails.tr().toText14(color: MyColors.textMixColor), + ItemDetailGrid( + ItemDetailViewCol( + LocaleKeys.requestNumber.tr(), data.paymentDetailsList![0].requestNumber ?? ""), + ItemDetailViewCol( LocaleKeys.requesterEmpNum.tr(), + data.paymentDetailsList![0].requesterEmployeeName ?? ""), + ), + ItemDetailGrid( + ItemDetailViewCol( LocaleKeys.requestDate.tr(), + DateUtil.formatDateToDate( + DateUtil.convertStringToDate(data.paymentDetailsList![0].requestDate!), false) ?? ""), + ItemDetailViewCol( + LocaleKeys.requesterEmpName.tr(), data.paymentDetailsList![0].requesterEmployeeName ?? ""), + ), + ItemDetailGrid( + ItemDetailViewCol( LocaleKeys.prepareEmpName.tr(), + data.paymentDetailsList![0].prepareEmployeeName ?? ""), + ItemDetailViewCol( + LocaleKeys.requesterPositionName.tr(), data.paymentDetailsList![0].requesterPositionName ?? ""), + ), + ItemDetailGrid( + ItemDetailViewCol( LocaleKeys.preparePositionName.tr(), + data.paymentDetailsList![0].preparePositionName ?? ""), + ItemDetailViewCol( + LocaleKeys.requesterPayrollName.tr(), data.paymentDetailsList![0].requesterPayrollName ?? ""), + ), + ], + ).objectContainerView(), + if (data!.paymentDetailsList!.isNotEmpty) + Column( + children: [ + LocaleKeys.general.tr().toText14(color: MyColors.textMixColor), + ItemDetailGrid( + ItemDetailViewCol( + LocaleKeys.payingORGName.tr(), data.paymentDetailsList![0].payingOrganizationName ?? ""), + ItemDetailViewCol(LocaleKeys.requestAmount.tr(), + data.paymentDetailsList![0].requestAmount ?? ""), + ), + ItemDetailGrid( + ItemDetailViewCol(LocaleKeys.paymentMethodName.tr(), + data.paymentDetailsList![0].paymentMethodName ?? ""), + ItemDetailViewCol( + LocaleKeys.currency.tr(), data.paymentDetailsList![0].currency ?? ""), + ), + ItemDetailGrid( + ItemDetailViewCol(LocaleKeys.typeofPayment.tr(), + data.paymentDetailsList![0].typeOfPayment ?? ""), + ItemDetailViewCol( + LocaleKeys.paymentDetails.tr(), data.paymentDetailsList![0].paymentDetails ?? ""), + ), + + ], + ).objectContainerView(), + + if (data!.beneficieryList!.isNotEmpty) + Column( + children: [ + LocaleKeys.beneficiaryDetails.tr().toText14(color: MyColors.textMixColor), + ItemDetailGrid( + ItemDetailViewCol( + LocaleKeys.beneficiaryName.tr(), data.beneficieryList![0].beneficiaryName ?? ""), + ItemDetailViewCol(LocaleKeys.idIqama.tr(), + data.beneficieryList![0].iqamaNumber ?? ""), + ), + ItemDetailGrid( + ItemDetailViewCol(LocaleKeys.beneficiaryBankName.tr(), + data.beneficieryList![0] .beneficiaryBankName ?? ""), + ItemDetailViewCol( + LocaleKeys.sadadNumber.tr(), data.beneficieryList![0].saddadNumber ?? ""), + ), + ItemDetailGrid( + ItemDetailViewCol(LocaleKeys.beneficiaryIBAN.tr(), + data.beneficieryList![0].beneficiaryIban ?? ""), + Container(), + ), + + ], + ).objectContainerView(), + + if (data!.purchaseOrdersList!.isNotEmpty && data.purchaseOrdersList![0].poAmount !=null) + Column( + children: [ + LocaleKeys.purchaseOrders.tr().toText14(color: MyColors.textMixColor), + ItemDetailGrid( + ItemDetailViewCol( + LocaleKeys.poNumber.tr(), data.purchaseOrdersList![0].poNumber ?? ""), + ItemDetailViewCol(LocaleKeys.pOAmount.tr(), + data.purchaseOrdersList![0].poAmount.toString() ?? ""), + ), + ItemDetailGrid( + ItemDetailViewCol(LocaleKeys.supplierName.tr(), + data.purchaseOrdersList![0].supplierName ?? ""), + ItemDetailViewCol( + LocaleKeys.approvalDate.tr(), data.purchaseOrdersList![0].poApprovalDate!=null ? DateUtil.formatDateToDate( + DateUtil.convertStringToDate(data.purchaseOrdersList![0].poApprovalDate), false) :"" ), + ), + ItemDetailGrid( + ItemDetailViewCol(LocaleKeys.requestNumber.tr(), + data.purchaseOrdersList![0].prNumber?? ""), + ItemDetailViewCol(LocaleKeys.versionStatus.tr(), + data.purchaseOrdersList![0].versionStatus?? ""), + ), + ItemDetailGrid( + ItemDetailViewCol(LocaleKeys.supplierNo.tr(), + data.purchaseOrdersList![0].supplierNumber?? ""), + Container(), + ), + ], + ).objectContainerView(), + ], + ); + } } diff --git a/lib/widgets/bottom_sheet.dart b/lib/widgets/bottom_sheet.dart index 5eab25a..4101746 100644 --- a/lib/widgets/bottom_sheet.dart +++ b/lib/widgets/bottom_sheet.dart @@ -1,13 +1,15 @@ import 'package:flutter/material.dart'; import 'package:mohem_flutter_app/extensions/int_extensions.dart'; -void showMyBottomSheet(BuildContext context, {required Widget child, required VoidCallback callBackFunc}) { +void showMyBottomSheet(BuildContext context, {required Widget child, required VoidCallback callBackFunc, String? type}) { showModalBottomSheet( context: context, isScrollControlled: true, backgroundColor: Colors.transparent, builder: (BuildContext context) { return Container( + constraints: BoxConstraints( + maxHeight: type =='CONTINUE_ACTION' ? MediaQuery.of(context).size.height *.75 : double.infinity,), decoration: const BoxDecoration( color: Colors.white, borderRadius: BorderRadius.only( @@ -17,7 +19,7 @@ void showMyBottomSheet(BuildContext context, {required Widget child, required Vo ), padding: MediaQuery.of(context).viewInsets, clipBehavior: Clip.antiAlias, - child: Column( + child:SingleChildScrollView(child: Column( mainAxisAlignment: MainAxisAlignment.center, mainAxisSize: MainAxisSize.min, children: [ @@ -35,7 +37,7 @@ void showMyBottomSheet(BuildContext context, {required Widget child, required Vo 8.height, child, ], - ), + )), ); }, ).then((value) {