From a6454776ddaf51474076d26783c9065f8b69fb45 Mon Sep 17 00:00:00 2001 From: Sultan khan Date: Thu, 23 Apr 2026 15:59:13 +0300 Subject: [PATCH 1/3] fixes for monthly calendar color coding .. and ticket screen --- .../attendance/monthly_attendance_screen.dart | 59 +++++++++++++++++-- .../ticket/ticket_detailed_screen.dart | 48 +++++++-------- 2 files changed, 78 insertions(+), 29 deletions(-) diff --git a/lib/ui/attendance/monthly_attendance_screen.dart b/lib/ui/attendance/monthly_attendance_screen.dart index 5e33708..7b5776e 100644 --- a/lib/ui/attendance/monthly_attendance_screen.dart +++ b/lib/ui/attendance/monthly_attendance_screen.dart @@ -57,6 +57,15 @@ class _MonthlyAttendanceScreenState extends State { Utils.showLoading(context); getTimeCardSummaryList = await MonthlyAttendanceApiClient().getTimeCardSummary(searchMonth, searchYear); getDayHoursTypeDetailsList = await MonthlyAttendanceApiClient().getDayHoursTypeDetails(searchMonth, searchYear); + + // Debug logging to check the data + print('Total days received: ${getDayHoursTypeDetailsList.length}'); + for (var day in getDayHoursTypeDetailsList) { + if (day.lEAVETYPECODE != null && day.lEAVETYPECODE!.isNotEmpty) { + print('Date: ${day.sCHEDULEDATE}, LEAVE_TYPE_CODE: ${day.lEAVETYPECODE}'); + } + } + Utils.hideLoading(context); _calendarController.displayDate = formattedDate; setState(() {}); @@ -307,10 +316,19 @@ class _MonthlyAttendanceScreenState extends State { // bool isDayIsPresent = getDayHoursTypeDetailsList[val - 1].aTTENDEDFLAG == 'Y'; // bool isDayIsAbsent = getDayHoursTypeDetailsList[val - 1].aTTENDEDFLAG == 'N' && getDayHoursTypeDetailsList[val - 1].aBSENTFLAG == 'Y'; List getDayHours = - getDayHoursTypeDetailsList.where((GetDayHoursTypeDetailsList element) => DateFormat("MM/dd/yyyy", "en_US").parse(element.sCHEDULEDATE!).day == details.date.day).toList(); + getDayHoursTypeDetailsList.where((GetDayHoursTypeDetailsList element) { + DateTime scheduleDate = DateFormat("MM/dd/yyyy", "en_US").parse(element.sCHEDULEDATE!); + return scheduleDate.day == details.date.day && + scheduleDate.month == details.date.month && + scheduleDate.year == details.date.year; + }).toList(); if (getDayHours.isNotEmpty) { GetDayHoursTypeDetailsList dayData = getDayHours.first; + + // Debug logging + print('Day: ${details.date.day}, LEAVE_TYPE_CODE: ${dayData.lEAVETYPECODE}, ATTENDED_FLAG: ${dayData.aTTENDEDFLAG}, DAY_TYPE: ${dayData.dAYTYPE}'); + bool isDayIsOff = dayData.aTTENDEDFLAG == 'N' && dayData.dAYTYPE == 'OFF'; bool isDayIsPresent = dayData.aTTENDEDFLAG == 'Y'; bool isDayIsAbsent = dayData.aTTENDEDFLAG == 'N' && dayData.aBSENTFLAG == 'Y'; @@ -321,8 +339,9 @@ class _MonthlyAttendanceScreenState extends State { bool useGradient = false; // Determine color based on leave type code - if (leaveTypeCode != null && leaveTypeCode.isNotEmpty) { + if (leaveTypeCode != null && leaveTypeCode.isNotEmpty && leaveTypeCode.trim().isNotEmpty) { leaveTypeColor = leaveTypeColors[leaveTypeCode]; + print('Matched color for $leaveTypeCode: $leaveTypeColor'); } // If no leave type color found, use default colors based on attendance status @@ -396,6 +415,28 @@ class _MonthlyAttendanceScreenState extends State { ), ); } + // Handle days with leave type codes (HOLIDAY, WFH, etc.) that are not present/absent/off + else if (leaveTypeColor != null) { + return Container( + margin: const EdgeInsets.all(4), + decoration: BoxDecoration( + color: leaveTypeColor, + shape: BoxShape.circle, + boxShadow: [ + BoxShadow( + offset: const Offset(0, 2), + blurRadius: 26, + color: MyColors.blackColor.withOpacity(0.100), + ), + ], + ), + alignment: Alignment.center, + child: Text( + "$val", + style: const TextStyle(fontSize: 13, fontWeight: FontWeight.w500, color: MyColors.white), + ), + ); + } } return Container( margin: const EdgeInsets.all(4), @@ -430,14 +471,22 @@ class _MonthlyAttendanceScreenState extends State { void calendarTapped(CalendarTapDetails details) async { if (details.date == null) return; - // Filter to find the matching day data + // Filter to find the matching day data with full date comparison List getDayHours = - getDayHoursTypeDetailsList.where((GetDayHoursTypeDetailsList element) => - DateFormat("MM/dd/yyyy", "en_US").parse(element.sCHEDULEDATE!).day == details.date!.day).toList(); + getDayHoursTypeDetailsList.where((GetDayHoursTypeDetailsList element) { + DateTime scheduleDate = DateFormat("MM/dd/yyyy", "en_US").parse(element.sCHEDULEDATE!); + return scheduleDate.day == details.date!.day && + scheduleDate.month == details.date!.month && + scheduleDate.year == details.date!.year; + }).toList(); if (getDayHours.isEmpty) return; GetDayHoursTypeDetailsList dayData = getDayHours.first; + + // Debug logging + print('Tapped Day: ${details.date!.day}, LEAVE_TYPE_CODE: ${dayData.lEAVETYPECODE}'); + pRTPID = dayData.rTPID; await getScheduleShiftsDetails(details.date!.day, pRTPID); dynamic value = getScheduleShiftsDetailsList!.pERCENTAGE; diff --git a/lib/ui/screens/ticket/ticket_detailed_screen.dart b/lib/ui/screens/ticket/ticket_detailed_screen.dart index 7959f39..5a412cf 100644 --- a/lib/ui/screens/ticket/ticket_detailed_screen.dart +++ b/lib/ui/screens/ticket/ticket_detailed_screen.dart @@ -1,4 +1,3 @@ -import 'dart:convert'; import 'package:easy_localization/easy_localization.dart'; import 'package:flutter/material.dart'; @@ -61,23 +60,24 @@ class _TicketDetailedScreenState extends State { appBar: AppBarWidget(context, title:LocaleKeys.ticketDetails.tr()), body: Column( children: [ - ListView( - padding: const EdgeInsets.all(21), - physics: const BouncingScrollPhysics(), - children: [ - if (dashboardProviderModel == null && dashboardProviderModel?.accrualTicketBalanceList == null) ...[Utils.getNoDataWidget(context).paddingOnly(top: 50)] else ...[ - Container( - padding: const EdgeInsets.all(16.0), - decoration: BoxDecoration( - color: Colors.white, - borderRadius: BorderRadius.circular(12.0), - boxShadow: [BoxShadow(color: Colors.grey.withOpacity(0.2), spreadRadius: 2, blurRadius: 5, offset: const Offset(0, 3))], - ), - child: Column( - children: [ - Row( - children: [ - LocaleKeys.currentTicketBalance.tr().toText20().expanded, + Expanded( + child: ListView( + padding: const EdgeInsets.all(21), + physics: const BouncingScrollPhysics(), + children: [ + if (dashboardProviderModel == null && dashboardProviderModel?.accrualTicketBalanceList == null) ...[Utils.getNoDataWidget(context).paddingOnly(top: 50)] else ...[ + Container( + padding: const EdgeInsets.all(16.0), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(12.0), + boxShadow: [BoxShadow(color: Colors.grey.withOpacity(0.2), spreadRadius: 2, blurRadius: 5, offset: const Offset(0, 3))], + ), + child: Column( + children: [ + Row( + children: [ + Expanded(child: LocaleKeys.currentTicketBalance.tr().toText20()), Row( children: [ const Icon(Icons.calendar_month_rounded, color: MyColors.darkIconColor, size: 16), @@ -116,11 +116,10 @@ class _TicketDetailedScreenState extends State { ), const SizedBox(height: 21), (dashboardProviderModel != null && dashboardProviderModel!.ticketHistoryTransactionList != null && dashboardProviderModel!.ticketHistoryTransactionList!.isNotEmpty) - ? ListView( - shrinkWrap: true, - physics: const NeverScrollableScrollPhysics(), + ? Column( + crossAxisAlignment: CrossAxisAlignment.start, children: [ - LocaleKeys.ticketHistory.tr().toText20().expanded, + LocaleKeys.ticketHistory.tr().toText20(), 12.height, ListView.separated( physics: const NeverScrollableScrollPhysics(), @@ -220,9 +219,10 @@ class _TicketDetailedScreenState extends State { ], ) : const SizedBox(), + ], ], - ], - ).expanded, + ), + ), DefaultButton(LocaleKeys.proceedBooking.tr(), () { if (widget.url != null && widget.jwtToken != null) { Navigator.push(context, MaterialPageRoute(builder: (BuildContext context) => SsoLoginWebView(url: widget.url, jwtToken: widget.jwtToken))); From f218dab93effab1e07b44264a6feddbaa9eebf55 Mon Sep 17 00:00:00 2001 From: Sultan khan Date: Wed, 1 Jul 2026 10:53:11 +0300 Subject: [PATCH 2/3] PR changes done. --- assets/langs/ar-SA.json | 15 +- assets/langs/en-US.json | 15 +- lib/generated/codegen_loader.g.dart | 18 +- lib/generated/locale_keys.g.dart | 7 + .../get_pr_notification_body_list_model.dart | 54 +- .../worklist_fragments/info_fragments.dart | 1 + .../worklist_fragments/request_fragment.dart | 634 ++++++++++++------ 7 files changed, 505 insertions(+), 239 deletions(-) diff --git a/assets/langs/ar-SA.json b/assets/langs/ar-SA.json index f3552d5..f956a2f 100644 --- a/assets/langs/ar-SA.json +++ b/assets/langs/ar-SA.json @@ -667,9 +667,16 @@ "incidentDetails": "تفاصيل الحادث", "ticketNumber": "رقم التذكرة", "ticketId": "معرف التذكرة", - "pleaseSelectProject": "الرجاء اختيار مشروع", - "viewAttachment" : "عرض المرفق", - "parkingQr": "وقوف السيارات QR", - "startNow": "ابدأ الآن" + "pleaseSelectProject": "الرجاء اختيار مشروع", + "viewAttachment" : "عرض المرفق", + "parkingQr": "وقوف السيارات QR", + "startNow": "ابدأ الآن", + "destination_type": "نوع الوجهة", + "source_organization_name": "اسم منظمة المصدر", + "destination_organization_name": "اسم منظمة الوجهة", + "costCenter": "مركز التكلفة", + "priceSAR": "السعر (ريال سعودي)", + "amountSAR": "المبلغ (ريال سعودي)", + "amuLastThreeMonths": "AMU (آخر 3 أشهر)" } diff --git a/assets/langs/en-US.json b/assets/langs/en-US.json index a227a73..6be72ed 100644 --- a/assets/langs/en-US.json +++ b/assets/langs/en-US.json @@ -665,8 +665,15 @@ "incidentDetails": "Incident Details", "ticketNumber": "Ticket Number", "ticketId": "Ticket ID", - "pleaseSelectProject": "Please select a project", - "viewAttachment" : "View Attachment", - "parkingQr": "Parking QR", - "startNow": "Start Now" + "pleaseSelectProject": "Please select a project", + "viewAttachment" : "View Attachment", + "parkingQr": "Parking QR", + "startNow": "Start Now", + "destination_type": "Destination Type", + "source_organization_name": "Source Organization Name", + "destination_organization_name": "Destination Organization Name", + "costCenter": "Cost Center", + "priceSAR": "Price (SAR)", + "amountSAR": "Amount (SAR)", + "amuLastThreeMonths": "AMU (Last 3 months)" } \ No newline at end of file diff --git a/lib/generated/codegen_loader.g.dart b/lib/generated/codegen_loader.g.dart index f186a22..516fe03 100644 --- a/lib/generated/codegen_loader.g.dart +++ b/lib/generated/codegen_loader.g.dart @@ -683,7 +683,14 @@ class CodegenLoader extends AssetLoader{ "pleaseSelectProject": "الرجاء اختيار مشروع", "viewAttachment": "عرض المرفق", "parkingQr": "وقوف السيارات QR", - "startNow": "ابدأ الآن" + "startNow": "ابدأ الآن", + "destination_type": "نوع الوجهة", + "source_organization_name": "اسم منظمة المصدر", + "destination_organization_name": "اسم منظمة الوجهة", + "costCenter": "مركز التكلفة", + "priceSAR": "السعر (ريال سعودي)", + "amountSAR": "المبلغ (ريال سعودي)", + "amuLastThreeMonths": "AMU (آخر 3 أشهر)" }; static const Map _en_US = { "mohemm": "Mohemm", @@ -1354,7 +1361,14 @@ static const Map _en_US = { "pleaseSelectProject": "Please select a project", "viewAttachment": "View Attachment", "parkingQr": "Parking QR", - "startNow": "Start Now" + "startNow": "Start Now", + "destination_type": "Destination Type", + "source_organization_name": "Source Organization Name", + "destination_organization_name": "Destination Organization Name", + "costCenter": "Cost Center", + "priceSAR": "Price (SAR)", + "amountSAR": "Amount (SAR)", + "amuLastThreeMonths": "AMU (Last 3 months)" }; 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 972583a..2d5cb51 100644 --- a/lib/generated/locale_keys.g.dart +++ b/lib/generated/locale_keys.g.dart @@ -656,5 +656,12 @@ abstract class LocaleKeys { static const viewAttachment = 'viewAttachment'; static const parkingQr = 'parkingQr'; static const startNow = 'startNow'; + static const destination_type = 'destination_type'; + static const source_organization_name = 'source_organization_name'; + static const destination_organization_name = 'destination_organization_name'; + static const costCenter = 'costCenter'; + static const priceSAR = 'priceSAR'; + static const amountSAR = 'amountSAR'; + static const amuLastThreeMonths = 'amuLastThreeMonths'; } diff --git a/lib/models/get_pr_notification_body_list_model.dart b/lib/models/get_pr_notification_body_list_model.dart index dfc8b39..35b7f2d 100644 --- a/lib/models/get_pr_notification_body_list_model.dart +++ b/lib/models/get_pr_notification_body_list_model.dart @@ -5,12 +5,13 @@ class GetPrNotificationBodyList { String? pINFORMATION; String? pQUESTION; - GetPrNotificationBodyList( - {this.pRHeader, - this.pRLines, - this.pCURRENCYCODE, - this.pINFORMATION, - this.pQUESTION}); + GetPrNotificationBodyList({ + this.pRHeader, + this.pRLines, + this.pCURRENCYCODE, + this.pINFORMATION, + this.pQUESTION, + }); GetPrNotificationBodyList.fromJson(Map json) { if (json['PRHeader'] != null) { @@ -78,21 +79,28 @@ class PRLines { int? tOROWNUM; num? uNITPRICE; String? uOM; + String? dESTINATIONTYPE; + String? sOURCEORGANIZATIONNAME; + String? dESTINATIONORGANIZATIONNAME; - PRLines( - {this.cOSTCENTER, - this.dESCRIPTION, - this.fROMROWNUM, - this.iTEMAMU, - this.iTEMCODE, - this.lINEAMOUNT, - this.lINENUM, - this.nOOFROWS, - this.qUANTITY, - this.rOWNUM, - this.tOROWNUM, - this.uNITPRICE, - this.uOM}); + PRLines({ + this.cOSTCENTER, + this.dESCRIPTION, + this.fROMROWNUM, + this.iTEMAMU, + this.iTEMCODE, + this.lINEAMOUNT, + this.lINENUM, + this.nOOFROWS, + this.qUANTITY, + this.rOWNUM, + this.tOROWNUM, + this.uNITPRICE, + this.uOM, + this.dESTINATIONTYPE, + this.sOURCEORGANIZATIONNAME, + this.dESTINATIONORGANIZATIONNAME, + }); PRLines.fromJson(Map json) { cOSTCENTER = json['COST_CENTER']; @@ -108,6 +116,9 @@ class PRLines { tOROWNUM = json['TO_ROW_NUM']; uNITPRICE = json['UNIT_PRICE']; uOM = json['UOM']; + dESTINATIONTYPE = json['DESTINATION_TYPE']; + sOURCEORGANIZATIONNAME = json['SOURCE_ORGANIZATION_NAME']; + dESTINATIONORGANIZATIONNAME = json['DESTINATION_ORGANIZATION_NAME']; } Map toJson() { @@ -125,6 +136,9 @@ class PRLines { data['TO_ROW_NUM'] = this.tOROWNUM; data['UNIT_PRICE'] = this.uNITPRICE; data['UOM'] = this.uOM; + data['DESTINATION_TYPE'] = this.dESTINATIONTYPE; + data['SOURCE_ORGANIZATION_NAME'] = this.sOURCEORGANIZATIONNAME; + data['DESTINATION_ORGANIZATION_NAME'] = this.dESTINATIONORGANIZATIONNAME; return data; } } diff --git a/lib/ui/work_list/worklist_fragments/info_fragments.dart b/lib/ui/work_list/worklist_fragments/info_fragments.dart index 541d347..31850ae 100644 --- a/lib/ui/work_list/worklist_fragments/info_fragments.dart +++ b/lib/ui/work_list/worklist_fragments/info_fragments.dart @@ -602,6 +602,7 @@ class InfoFragment extends StatelessWidget { ItemDetailViewCol( LocaleKeys.responder.tr(), workListData!.rESPONDER ?? ""), ), + Column( children: getPRHeaderValues(), ) diff --git a/lib/ui/work_list/worklist_fragments/request_fragment.dart b/lib/ui/work_list/worklist_fragments/request_fragment.dart index b2bc0b6..7ea6596 100644 --- a/lib/ui/work_list/worklist_fragments/request_fragment.dart +++ b/lib/ui/work_list/worklist_fragments/request_fragment.dart @@ -13,7 +13,8 @@ import 'package:mohem_flutter_app/models/get_item_creation_ntf_body_list_model.d import 'package:mohem_flutter_app/models/get_mo_notification_body_list_model.dart'; import 'package:mohem_flutter_app/models/get_po_notification_body_list_model.dart'; import 'package:mohem_flutter_app/models/get_pr_information_list.dart'; -import 'package:mohem_flutter_app/models/get_pr_notification_body_list_model.dart' as get_pr_notification_body_list_model; +import 'package:mohem_flutter_app/models/get_pr_notification_body_list_model.dart' + as get_pr_notification_body_list_model; import 'package:mohem_flutter_app/ui/work_list/item_history_screen.dart'; import 'package:mohem_flutter_app/widgets/button/default_button.dart'; import 'package:mohem_flutter_app/widgets/item_detail_view_widget.dart'; @@ -51,250 +52,465 @@ class RequestFragment extends StatelessWidget { Widget poLinesDataView(BuildContext context) { return ExpandableNotifier( child: ListView.separated( - shrinkWrap: true, - physics: const NeverScrollableScrollPhysics(), - itemBuilder: (cxt, index) => ExpandablePanel( - header: poLinesList[index].iTEMDESCRIPTION!.toText14(), - collapsed: Column( - crossAxisAlignment: CrossAxisAlignment.start, - mainAxisSize: MainAxisSize.min, - children: [ - ItemDetailGrid( - ItemDetailViewCol(LocaleKeys.code.tr(), poLinesList[index].iTEMCODE ?? ""), - ItemDetailViewCol(LocaleKeys.mfg.tr(), poLinesList[index].mFG ?? ""), - ), - ItemDetailGrid( - ItemDetailViewCol(LocaleKeys.lineType.tr(), poLinesList[index].lINETYPE?.toString() ?? ""), - ItemDetailViewCol(LocaleKeys.unit.tr(), poLinesList[index].uOM ?? ""), - ), - ItemDetailGrid( - ItemDetailViewCol(LocaleKeys.price.tr(), poLinesList[index].uNITPRICE?.toString() ?? ""), - ItemDetailViewCol(LocaleKeys.lineAmount.tr(), poLinesList[index].lINEAMOUNT?.toString() ?? ""), - ), - ItemDetailGrid( - ItemDetailViewCol(LocaleKeys.quantity.tr(), poLinesList[index].qUANTITY?.toString() ?? ""), - ItemDetailViewCol(LocaleKeys.lineDiscount.tr(), poLinesList[index].lINEDISCPERCENTAGE?.toString() ?? ""), - ), - ItemDetailGrid( - ItemDetailViewCol(LocaleKeys.needByDate.tr(), poLinesList[index].nEEDBYDATE ?? ""), - ItemDetailViewCol(LocaleKeys.promisedDate.tr(), poLinesList[index].pROMISEDDATE ?? ""), - ), - ItemDetailGrid( - ItemDetailViewCol(LocaleKeys.deliverToLocation.tr(), poLinesList[index].dELIVERTOLOCATION ?? ""), - ItemDetailViewCol(LocaleKeys.requisitionNumber.tr(), poLinesList[index].pRNUM ?? ""), - ), - ItemDetailGrid( - ItemDetailViewCol(LocaleKeys.requester.tr(), poLinesList[index].rEQUESTOR ?? ""), - Container(), - ), - 12.height, - Row( - children: [ - DefaultButton( - LocaleKeys.itemHistory.tr(), - () { + shrinkWrap: true, + physics: const NeverScrollableScrollPhysics(), + itemBuilder: + (cxt, index) => + ExpandablePanel( + header: poLinesList[index].iTEMDESCRIPTION!.toText14(), + collapsed: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisSize: MainAxisSize.min, + children: [ + ItemDetailGrid( + ItemDetailViewCol( + LocaleKeys.code.tr(), + poLinesList[index].iTEMCODE ?? "", + ), + ItemDetailViewCol( + LocaleKeys.mfg.tr(), + poLinesList[index].mFG ?? "", + ), + ), + ItemDetailGrid( + ItemDetailViewCol( + LocaleKeys.lineType.tr(), + poLinesList[index].lINETYPE?.toString() ?? "", + ), + ItemDetailViewCol( + LocaleKeys.unit.tr(), + poLinesList[index].uOM ?? "", + ), + ), + ItemDetailGrid( + ItemDetailViewCol( + LocaleKeys.price.tr(), + poLinesList[index].uNITPRICE?.toString() ?? "", + ), + ItemDetailViewCol( + LocaleKeys.lineAmount.tr(), + poLinesList[index].lINEAMOUNT?.toString() ?? "", + ), + ), + ItemDetailGrid( + ItemDetailViewCol( + LocaleKeys.quantity.tr(), + poLinesList[index].qUANTITY?.toString() ?? "", + ), + ItemDetailViewCol( + LocaleKeys.lineDiscount.tr(), + poLinesList[index].lINEDISCPERCENTAGE?.toString() ?? + "", + ), + ), + ItemDetailGrid( + ItemDetailViewCol( + LocaleKeys.needByDate.tr(), + poLinesList[index].nEEDBYDATE ?? "", + ), + ItemDetailViewCol( + LocaleKeys.promisedDate.tr(), + poLinesList[index].pROMISEDDATE ?? "", + ), + ), + ItemDetailGrid( + ItemDetailViewCol( + LocaleKeys.deliverToLocation.tr(), + poLinesList[index].dELIVERTOLOCATION ?? "", + ), + ItemDetailViewCol( + LocaleKeys.requisitionNumber.tr(), + poLinesList[index].pRNUM ?? "", + ), + ), + ItemDetailGrid( + ItemDetailViewCol( + LocaleKeys.requester.tr(), + poLinesList[index].rEQUESTOR ?? "", + ), + Container(), + ), + 12.height, + Row( + children: [ + DefaultButton(LocaleKeys.itemHistory.tr(), () { Navigator.pushNamed( cxt, AppRoutes.itemHistory, - arguments: ItemHistoryScreenParams(title: LocaleKeys.itemHistory.tr(), isMO: false, pItemId: poLinesList[index].iTEMID), + arguments: ItemHistoryScreenParams( + title: LocaleKeys.itemHistory.tr(), + isMO: false, + pItemId: poLinesList[index].iTEMID, + ), ); - }, - fontSize: 13, - ).expanded, - 12.width, - DefaultButton( - LocaleKeys.quotationAnalysis.tr(), - () { + }, fontSize: 13).expanded, + 12.width, + DefaultButton(LocaleKeys.quotationAnalysis.tr(), () { Navigator.pushNamed( cxt, AppRoutes.itemHistory, arguments: ItemHistoryScreenParams( - isItemHistory: false, isMO: false, title: LocaleKeys.quotationAnalysis.tr(), pItemId: poLinesList[index].iTEMID, pPoHeaderId: poLinesList[index].pOHEADERID), + isItemHistory: false, + isMO: false, + title: LocaleKeys.quotationAnalysis.tr(), + pItemId: poLinesList[index].iTEMID, + pPoHeaderId: poLinesList[index].pOHEADERID, + ), + ); + }, fontSize: 13).expanded, + 12.width, + DefaultButton("PR Details", () { + getPRDetails( + context, + poLinesList[index].pOLINEID.toString(), ); - }, - fontSize: 13, - ).expanded, - 12.width, - DefaultButton( - "PR Details", - () { - getPRDetails(context, poLinesList[index].pOLINEID.toString()); - }, - fontSize: 13, - ).expanded, - ], - ) - ], - ), - expanded: const SizedBox(), - ).objectContainerView(), - separatorBuilder: (cxt, index) => 12.height, - itemCount: poLinesList.length), + }, fontSize: 13).expanded, + ], + ), + ], + ), + expanded: const SizedBox(), + ).objectContainerView(), + separatorBuilder: (cxt, index) => 12.height, + itemCount: poLinesList.length, + ), ); } Widget prLinesDataView() { return ExpandableNotifier( child: ListView.separated( - shrinkWrap: true, - physics: const NeverScrollableScrollPhysics(), - itemBuilder: (cxt, index) => ExpandablePanel( - header: prLinesList[index].dESCRIPTION.toString().toText14(color: MyColors.textMixColor), - collapsed: Column( - children: [ - ItemDetailGrid( - ItemDetailViewCol("Cost Center", prLinesList[index].cOSTCENTER ?? ""), - ItemDetailViewCol("Code", prLinesList[index].iTEMCODE ?? ""), - ), - ItemDetailGrid( - ItemDetailViewCol("Unit", prLinesList[index].uOM ?? ""), - ItemDetailViewCol("Price (SAR)", prLinesList[index].uNITPRICE.toString() ?? ""), - ), - ItemDetailGrid( - ItemDetailViewCol("Amount (SAR)", prLinesList[index].lINEAMOUNT.toString() ?? ""), - ItemDetailViewCol("Quantity", prLinesList[index].qUANTITY.toString() ?? ""), - ), - ItemDetailGrid( - ItemDetailViewCol("AMU (Last 3 months)", prLinesList[index].iTEMAMU.toString() ?? ""), - Container(), - isItLast: true, - ), - // ItemDetailGrid( - // ItemDetailViewCol(getPrNotificationBodyList.pRHeader![1].hDRATTRIBUTENAME!, getPrNotificationBodyList.pRHeader![1].hDRATTRIBUTEVALUE ?? ""), - // Container(), - // isItLast: true, - // ), - ], - ), - expanded: const SizedBox(), - ).objectContainerView(), - separatorBuilder: (cxt, index) => 12.height, - itemCount: prLinesList.length), + shrinkWrap: true, + physics: const NeverScrollableScrollPhysics(), + itemBuilder: + (cxt, index) => + ExpandablePanel( + header: prLinesList[index].dESCRIPTION.toString().toText14( + color: MyColors.textMixColor, + ), + collapsed: Column( + children: [ + ItemDetailGrid( + ItemDetailViewCol( + LocaleKeys.costCenter.tr(), + prLinesList[index].cOSTCENTER ?? "", + ), + ItemDetailViewCol( + LocaleKeys.code.tr(), + prLinesList[index].iTEMCODE ?? "", + ), + ), + ItemDetailGrid( + ItemDetailViewCol( + LocaleKeys.unit.tr(), + prLinesList[index].uOM ?? "", + ), + ItemDetailViewCol( + LocaleKeys.priceSAR.tr(), + prLinesList[index].uNITPRICE.toString() ?? "", + ), + ), + ItemDetailGrid( + ItemDetailViewCol( + LocaleKeys.amountSAR.tr(), + prLinesList[index].lINEAMOUNT.toString() ?? "", + ), + ItemDetailViewCol( + LocaleKeys.quantity.tr(), + prLinesList[index].qUANTITY.toString() ?? "", + ), + ), + ItemDetailGrid( + ItemDetailViewCol( + LocaleKeys.destination_type.tr(), + prLinesList[index].dESTINATIONTYPE ?? "", + ), + ItemDetailViewCol( + LocaleKeys.destination_organization_name.tr(), + prLinesList[index].dESTINATIONORGANIZATIONNAME ?? "", + ), + ), + ItemDetailGrid( + ItemDetailViewCol( + LocaleKeys.amuLastThreeMonths.tr(), + prLinesList[index].iTEMAMU.toString() ?? "", + ), + Container(), + isItLast: true, + ), + // ItemDetailGrid( + // ItemDetailViewCol(getPrNotificationBodyList.pRHeader![1].hDRATTRIBUTENAME!, getPrNotificationBodyList.pRHeader![1].hDRATTRIBUTEVALUE ?? ""), + // Container(), + // isItLast: true, + // ), + ], + ), + expanded: const SizedBox(), + ).objectContainerView(), + separatorBuilder: (cxt, index) => 12.height, + itemCount: prLinesList.length, + ), ); } Widget moNotificationDataView() { return ListView.separated( - shrinkWrap: true, - physics: const NeverScrollableScrollPhysics(), - itemBuilder: (cxt, index) => Column( - crossAxisAlignment: CrossAxisAlignment.start, - mainAxisSize: MainAxisSize.min, - children: [ - ItemDetailGrid( - ItemDetailViewCol(LocaleKeys.code.tr(), moNotificationBodyList[index].iTEMCODE ?? ""), - ItemDetailViewCol(LocaleKeys.unit.tr(), moNotificationBodyList[index].uOM ?? ""), - ), - ItemDetailGrid( - ItemDetailViewCol(LocaleKeys.quantity.tr(), moNotificationBodyList[index].qUANTITY?.toString() ?? ""), - ItemDetailViewCol(LocaleKeys.dateRequired.tr(), moNotificationBodyList[index].dATEREQUIRED ?? ""), - ), - ItemDetailGrid( - ItemDetailViewCol(LocaleKeys.lineStatus.tr(), moNotificationBodyList[index].lINESTATUS ?? ""), - ItemDetailViewCol(LocaleKeys.statusDate.tr(), moNotificationBodyList[index].sTATUSDATE ?? ""), - ), - ItemDetailGrid( - ItemDetailViewCol(LocaleKeys.transactionType.tr(), moNotificationBodyList[index].tRANSACTIONTYPENAME ?? ""), - ItemDetailViewCol(LocaleKeys.operatingUnit.tr(), moNotificationBodyList[index].oPERATINGUNIT ?? ""), - ), - ItemDetailGrid( - ItemDetailViewCol(LocaleKeys.organizationCode.tr(), moNotificationBodyList[index].oRGANIZATIONCODE ?? ""), - ItemDetailViewCol(LocaleKeys.organization.tr(), moNotificationBodyList[index].oRGANIZATIONNAME ?? ""), - ), - ItemDetailGrid( - ItemDetailViewCol(LocaleKeys.fromSubInventory.tr(), moNotificationBodyList[index].fROMSUBINVENTORY ?? ""), - ItemDetailViewCol(LocaleKeys.fromLocator.tr(), moNotificationBodyList[index].fROMLOCATOR ?? ""), - ), - ItemDetailGrid( - ItemDetailViewCol(LocaleKeys.toSubInventory.tr(), moNotificationBodyList[index].tOSUBINVENTORY ?? ""), - ItemDetailViewCol(LocaleKeys.toLocator.tr(), moNotificationBodyList[index].tOLOCATOR ?? ""), - ), - ItemDetailGrid(ItemDetailViewCol(LocaleKeys.shipToLocator.tr(), moNotificationBodyList[index].sHIPTOLOCATION ?? ""), Container()), - 12.height, - DefaultButton(LocaleKeys.itemHistory.tr(), () { - Navigator.pushNamed( - cxt, - AppRoutes.itemHistory, - arguments: ItemHistoryScreenParams(title: LocaleKeys.itemHistory.tr(), pItemId: moNotificationBodyList[index].iTEMID, pOrgId: moNotificationBodyList[index].oRGID), - ); - }) - ], - ).objectContainerView(title: moNotificationBodyList[index].dESCRIPTION ?? ""), - separatorBuilder: (cxt, index) => 12.height, - itemCount: moNotificationBodyList.length); + shrinkWrap: true, + physics: const NeverScrollableScrollPhysics(), + itemBuilder: + (cxt, index) => Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisSize: MainAxisSize.min, + children: [ + ItemDetailGrid( + ItemDetailViewCol( + LocaleKeys.code.tr(), + moNotificationBodyList[index].iTEMCODE ?? "", + ), + ItemDetailViewCol( + LocaleKeys.unit.tr(), + moNotificationBodyList[index].uOM ?? "", + ), + ), + ItemDetailGrid( + ItemDetailViewCol( + LocaleKeys.quantity.tr(), + moNotificationBodyList[index].qUANTITY?.toString() ?? "", + ), + ItemDetailViewCol( + LocaleKeys.dateRequired.tr(), + moNotificationBodyList[index].dATEREQUIRED ?? "", + ), + ), + ItemDetailGrid( + ItemDetailViewCol( + LocaleKeys.lineStatus.tr(), + moNotificationBodyList[index].lINESTATUS ?? "", + ), + ItemDetailViewCol( + LocaleKeys.statusDate.tr(), + moNotificationBodyList[index].sTATUSDATE ?? "", + ), + ), + ItemDetailGrid( + ItemDetailViewCol( + LocaleKeys.transactionType.tr(), + moNotificationBodyList[index].tRANSACTIONTYPENAME ?? "", + ), + ItemDetailViewCol( + LocaleKeys.operatingUnit.tr(), + moNotificationBodyList[index].oPERATINGUNIT ?? "", + ), + ), + ItemDetailGrid( + ItemDetailViewCol( + LocaleKeys.organizationCode.tr(), + moNotificationBodyList[index].oRGANIZATIONCODE ?? "", + ), + ItemDetailViewCol( + LocaleKeys.organization.tr(), + moNotificationBodyList[index].oRGANIZATIONNAME ?? "", + ), + ), + ItemDetailGrid( + ItemDetailViewCol( + LocaleKeys.fromSubInventory.tr(), + moNotificationBodyList[index].fROMSUBINVENTORY ?? "", + ), + ItemDetailViewCol( + LocaleKeys.fromLocator.tr(), + moNotificationBodyList[index].fROMLOCATOR ?? "", + ), + ), + ItemDetailGrid( + ItemDetailViewCol( + LocaleKeys.toSubInventory.tr(), + moNotificationBodyList[index].tOSUBINVENTORY ?? "", + ), + ItemDetailViewCol( + LocaleKeys.toLocator.tr(), + moNotificationBodyList[index].tOLOCATOR ?? "", + ), + ), + ItemDetailGrid( + ItemDetailViewCol( + LocaleKeys.shipToLocator.tr(), + moNotificationBodyList[index].sHIPTOLOCATION ?? "", + ), + Container(), + ), + 12.height, + DefaultButton(LocaleKeys.itemHistory.tr(), () { + Navigator.pushNamed( + cxt, + AppRoutes.itemHistory, + arguments: ItemHistoryScreenParams( + title: LocaleKeys.itemHistory.tr(), + pItemId: moNotificationBodyList[index].iTEMID, + pOrgId: moNotificationBodyList[index].oRGID, + ), + ); + }), + ], + ).objectContainerView( + title: moNotificationBodyList[index].dESCRIPTION ?? "", + ), + separatorBuilder: (cxt, index) => 12.height, + itemCount: moNotificationBodyList.length, + ); } Widget itemCreationLinesView() { return ListView.separated( - shrinkWrap: true, - physics: const NeverScrollableScrollPhysics(), - itemBuilder: (cxt, index) => Column( - crossAxisAlignment: CrossAxisAlignment.start, - mainAxisSize: MainAxisSize.min, - children: [ - ItemDetailGrid( - ItemDetailViewCol(LocaleKeys.productName.tr(), itemCreationLines[index].pRODUCTNAME ?? ""), - ItemDetailViewCol(LocaleKeys.productDescription.tr(), itemCreationLines[index].pRODUCTDESCRIPTION ?? ""), - ), - ItemDetailGrid( - ItemDetailViewCol(LocaleKeys.unitPrice.tr(), itemCreationLines[index].uNITPRICE?.toString() ?? ""), - ItemDetailViewCol(LocaleKeys.manufacturerName.tr(), itemCreationLines[index].uSERMANUFACTURERNAME ?? ""), - ), - ItemDetailGrid( - ItemDetailViewCol(LocaleKeys.manufacturerPartName.tr(), itemCreationLines[index].uSERMFGPARTNUM ?? ""), - ItemDetailViewCol(LocaleKeys.supplierName.tr(), itemCreationLines[index].sUPPLIERNAME ?? ""), - ), - ItemDetailGrid( - ItemDetailViewCol(LocaleKeys.supplierContact.tr(), itemCreationLines[index].sUPPLIERCONTACT ?? ""), - ItemDetailViewCol(LocaleKeys.chargeToPatient.tr(), itemCreationLines[index].cHARGETOPATIENT ?? ""), - ), - ItemDetailGrid( - ItemDetailViewCol(LocaleKeys.justification.tr(), itemCreationLines[index].jUSTIFICATION ?? ""), - ItemDetailViewCol(LocaleKeys.itemCode.tr(), itemCreationLines[index].iTEMCODE ?? ""), - ), - ItemDetailGrid( - ItemDetailViewCol(LocaleKeys.itemDescription.tr(), itemCreationLines[index].iTEMDESCRIPTION ?? ""), - ItemDetailViewCol(LocaleKeys.groupCode.tr(), itemCreationLines[index].iTEMGROUPCODE ?? ""), - ), - ItemDetailGrid( - ItemDetailViewCol(LocaleKeys.groupDescription.tr(), itemCreationLines[index].iTEMGROUP ?? ""), - ItemDetailViewCol(LocaleKeys.subgroupCode.tr(), itemCreationLines[index].iTEMSUBGROUPCODE ?? ""), - ), - ItemDetailGrid( - ItemDetailViewCol(LocaleKeys.subgroupDescription.tr(), itemCreationLines[index].iTEMSUBGROUP ?? ""), - ItemDetailViewCol(LocaleKeys.primaryUOM.tr(), itemCreationLines[index].pRIMARYUOM ?? ""), - ), - ItemDetailGrid( - ItemDetailViewCol(LocaleKeys.manufacturerName.tr(), itemCreationLines[index].sTANDARDMANUFACTURERNAME ?? ""), - ItemDetailViewCol(LocaleKeys.manufacturerPartName.tr(), itemCreationLines[index].sTANDARDMFGPARTNUM ?? ""), - ), - ItemDetailGrid( - ItemDetailViewCol(LocaleKeys.templateName.tr(), itemCreationLines[index].tEMPLATENAME ?? ""), - ItemDetailViewCol(LocaleKeys.itemCreationStatus.tr(), itemCreationLines[index].iTEMCREATIONSTATUS ?? ""), - ), - ItemDetailGrid( - ItemDetailViewCol(LocaleKeys.standardizationApprovalStatus.tr(), itemCreationLines[index].sTANDARDSTATUS ?? ""), - ItemDetailViewCol(LocaleKeys.standardizationApprovalRejectionReason.tr(), itemCreationLines[index].sTANDARDREJECTREASON ?? ""), - isItLast: true, - ), - ], - ).objectContainerView(title: itemCreationLines[index].iTEMDESCRIPTION!), - separatorBuilder: (cxt, index) => 12.height, - itemCount: itemCreationLines.length); + shrinkWrap: true, + physics: const NeverScrollableScrollPhysics(), + itemBuilder: + (cxt, index) => Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisSize: MainAxisSize.min, + children: [ + ItemDetailGrid( + ItemDetailViewCol( + LocaleKeys.productName.tr(), + itemCreationLines[index].pRODUCTNAME ?? "", + ), + ItemDetailViewCol( + LocaleKeys.productDescription.tr(), + itemCreationLines[index].pRODUCTDESCRIPTION ?? "", + ), + ), + ItemDetailGrid( + ItemDetailViewCol( + LocaleKeys.unitPrice.tr(), + itemCreationLines[index].uNITPRICE?.toString() ?? "", + ), + ItemDetailViewCol( + LocaleKeys.manufacturerName.tr(), + itemCreationLines[index].uSERMANUFACTURERNAME ?? "", + ), + ), + ItemDetailGrid( + ItemDetailViewCol( + LocaleKeys.manufacturerPartName.tr(), + itemCreationLines[index].uSERMFGPARTNUM ?? "", + ), + ItemDetailViewCol( + LocaleKeys.supplierName.tr(), + itemCreationLines[index].sUPPLIERNAME ?? "", + ), + ), + ItemDetailGrid( + ItemDetailViewCol( + LocaleKeys.supplierContact.tr(), + itemCreationLines[index].sUPPLIERCONTACT ?? "", + ), + ItemDetailViewCol( + LocaleKeys.chargeToPatient.tr(), + itemCreationLines[index].cHARGETOPATIENT ?? "", + ), + ), + ItemDetailGrid( + ItemDetailViewCol( + LocaleKeys.justification.tr(), + itemCreationLines[index].jUSTIFICATION ?? "", + ), + ItemDetailViewCol( + LocaleKeys.itemCode.tr(), + itemCreationLines[index].iTEMCODE ?? "", + ), + ), + ItemDetailGrid( + ItemDetailViewCol( + LocaleKeys.itemDescription.tr(), + itemCreationLines[index].iTEMDESCRIPTION ?? "", + ), + ItemDetailViewCol( + LocaleKeys.groupCode.tr(), + itemCreationLines[index].iTEMGROUPCODE ?? "", + ), + ), + ItemDetailGrid( + ItemDetailViewCol( + LocaleKeys.groupDescription.tr(), + itemCreationLines[index].iTEMGROUP ?? "", + ), + ItemDetailViewCol( + LocaleKeys.subgroupCode.tr(), + itemCreationLines[index].iTEMSUBGROUPCODE ?? "", + ), + ), + ItemDetailGrid( + ItemDetailViewCol( + LocaleKeys.subgroupDescription.tr(), + itemCreationLines[index].iTEMSUBGROUP ?? "", + ), + ItemDetailViewCol( + LocaleKeys.primaryUOM.tr(), + itemCreationLines[index].pRIMARYUOM ?? "", + ), + ), + ItemDetailGrid( + ItemDetailViewCol( + LocaleKeys.manufacturerName.tr(), + itemCreationLines[index].sTANDARDMANUFACTURERNAME ?? "", + ), + ItemDetailViewCol( + LocaleKeys.manufacturerPartName.tr(), + itemCreationLines[index].sTANDARDMFGPARTNUM ?? "", + ), + ), + ItemDetailGrid( + ItemDetailViewCol( + LocaleKeys.templateName.tr(), + itemCreationLines[index].tEMPLATENAME ?? "", + ), + ItemDetailViewCol( + LocaleKeys.itemCreationStatus.tr(), + itemCreationLines[index].iTEMCREATIONSTATUS ?? "", + ), + ), + ItemDetailGrid( + ItemDetailViewCol( + LocaleKeys.standardizationApprovalStatus.tr(), + itemCreationLines[index].sTANDARDSTATUS ?? "", + ), + ItemDetailViewCol( + LocaleKeys.standardizationApprovalRejectionReason.tr(), + itemCreationLines[index].sTANDARDREJECTREASON ?? "", + ), + isItLast: true, + ), + ], + ).objectContainerView( + title: itemCreationLines[index].iTEMDESCRIPTION!, + ), + separatorBuilder: (cxt, index) => 12.height, + itemCount: itemCreationLines.length, + ); } void getPRDetails(BuildContext context, String poLineID) async { try { Utils.showLoading(context); GetPRInformationList? getPRInformationList = GetPRInformationList(); - getPRInformationList = await WorkListApiClient().getPRDetailsForPO(poLineID); + getPRInformationList = await WorkListApiClient().getPRDetailsForPO( + poLineID, + ); Utils.hideLoading(context); Navigator.pushNamed( context, AppRoutes.itemHistory, arguments: ItemHistoryScreenParams( - isItemHistory: false, isMO: false, isPRInfo: true, getPRInformationList: getPRInformationList, title: "PR Details", pItemId: 0, pPoHeaderId: 0, pOLineID: poLineID), + isItemHistory: false, + isMO: false, + isPRInfo: true, + getPRInformationList: getPRInformationList, + title: "PR Details", + pItemId: 0, + pPoHeaderId: 0, + pOLineID: poLineID, + ), ); } catch (ex) { Utils.hideLoading(context); From a9f0cb8216dfee72737a281d0fd3d133aaca7f43 Mon Sep 17 00:00:00 2001 From: Sultan khan Date: Sun, 30 Aug 2026 17:08:48 +0300 Subject: [PATCH 3/3] CEI, worklist po pr filter, date issue in absence dynamic screen --- assets/langs/ar-SA.json | 2 + assets/langs/en-US.json | 2 + lib/api/login_api_client.dart | 17 +++- lib/classes/consts.dart | 5 ++ lib/classes/date_uitl.dart | 39 ++++++++- lib/generated/locale_keys.g.dart | 2 + .../get_accural_ticket_balance_model.dart | 2 +- lib/ui/landing/widget/services_widget.dart | 2 + .../add_leave_balance_screen.dart | 48 ++++------- .../child_education_assistance.dart | 84 +++++++++++-------- lib/ui/work_list/work_list_screen.dart | 55 ++++++++++-- .../worklist_advance_search_bottom_sheet.dart | 2 +- 12 files changed, 180 insertions(+), 80 deletions(-) diff --git a/assets/langs/ar-SA.json b/assets/langs/ar-SA.json index f956a2f..89a6568 100644 --- a/assets/langs/ar-SA.json +++ b/assets/langs/ar-SA.json @@ -320,6 +320,8 @@ "createdFor": "انشاء لأجل", "requestCreatedSuccessfully": "تم انشاء الطلب بنجاح", "search": "بحث", + "filterEnterPrDetailsHere": "ادخل تفاصيل طلب الشراء هنا", + "filterEnterPoDetailsHere": "ادخل تفاصيل أمر الشراء هنا", "wantToReject": "هل انت متأكد تريد الرفض", "requestType": "نوع الطلب", "employeeDigitalID": "هويةالموظف الرقمية", diff --git a/assets/langs/en-US.json b/assets/langs/en-US.json index 6be72ed..306620b 100644 --- a/assets/langs/en-US.json +++ b/assets/langs/en-US.json @@ -315,6 +315,8 @@ "requestType": "Request Type", "requestCreatedSuccessfully": "Request created successfully", "search": "Search", + "filterEnterPrDetailsHere": "Enter PR Details here", + "filterEnterPoDetailsHere": "Enter PO Details here", "wantToReject": "Are you sure want to reject?", "employeeDigitalID": "Employee Digital ID", "businessCard": "Business Card", diff --git a/lib/api/login_api_client.dart b/lib/api/login_api_client.dart index 1b6b19e..24d248a 100644 --- a/lib/api/login_api_client.dart +++ b/lib/api/login_api_client.dart @@ -71,7 +71,14 @@ class LoginApiClient { Future mohemmSendActivationCodeByOTPNotificationType(int isMobileFingerPrint, String? mobileNumber, int optSendType, String? pUserName) async { String url = "${ApiConsts.erpRest}Mohemm_SendActivationCodebyOTPNotificationType"; - Map postParams = {"IsMobileFingerPrint": isMobileFingerPrint, "MobileNumber": mobileNumber, "OTP_SendType": optSendType, "P_USER_NAME": pUserName}; + Map postParams = { + "IsMobileFingerPrint": isMobileFingerPrint, + "MobileNumber": mobileNumber, + "OTP_SendType": optSendType, + "P_USER_NAME": pUserName, + "NotificationCenterAppGUID": ApiConsts.notificationCenterAppGUID, + "NotificationCenterAppSeviceGUID": ApiConsts.notificationCenterLoginServiceGUID, + }; postParams.addAll(AppState().postParamsJson); return await ApiClient().postJsonForObject((json) => GenericResponseModel.fromJson(json).basicMemberInformation, url, postParams); } @@ -105,7 +112,13 @@ class LoginApiClient { Future sendPublicActivationCode(String? mobileNumber, String? pUsername) async { String url = "${ApiConsts.erpRest}SendPublicActivationCode"; - Map postParams = {"MobileNumber": mobileNumber, "P_MOBILE_NUMBER": mobileNumber, "P_USER_NAME": pUsername}; + Map postParams = { + "MobileNumber": mobileNumber, + "P_MOBILE_NUMBER": mobileNumber, + "P_USER_NAME": pUsername, + "NotificationCenterAppGUID": ApiConsts.notificationCenterAppGUID, + "NotificationCenterAppSeviceGUID": ApiConsts.notificationCenterForgotPasswordServiceGUID, + }; postParams.addAll(AppState().postParamsJson); return await ApiClient().postJsonForObject((json) { GenericResponseModel responseData = GenericResponseModel.fromJson(json); diff --git a/lib/classes/consts.dart b/lib/classes/consts.dart index 3881f3c..ca6d578 100644 --- a/lib/classes/consts.dart +++ b/lib/classes/consts.dart @@ -80,6 +80,11 @@ class ApiConsts { //DummyCards for the UI static int tabletMinLength = 500; + + // Notification Center GUIDs for OTP + static String notificationCenterAppGUID = "VDZreDY5TTNmTDVudzc4aDkwU3ZqcW9OcmI0"; + static String notificationCenterLoginServiceGUID = "D8BD5C76-4B50-4122-81D0-C3AA25DB08A2"; + static String notificationCenterForgotPasswordServiceGUID = "5CCCC2C9-EEA0-4207-9BE9-EE1FBBFFE8D0"; } class SharedPrefsConsts { diff --git a/lib/classes/date_uitl.dart b/lib/classes/date_uitl.dart index 8714b40..1f4396e 100644 --- a/lib/classes/date_uitl.dart +++ b/lib/classes/date_uitl.dart @@ -524,14 +524,47 @@ class DateUtil { // } // return ""; // } - static String replaceArabicNumber(String input) { + static String replaceArabicNumber(String? input) { + if (input == null || input.isEmpty) return input ?? ""; const english = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9']; const arabic = ['٠', '١', '٢', '٣', '٤', '٥', '٦', '٧', '٨', '٩']; + const persian = ['۰', '۱', '۲', '۳', '۴', '۵', '۶', '۷', '۸', '۹']; for (int i = 0; i < english.length; i++) { - input = input.replaceAll(arabic[i], english[i]); + input = input!.replaceAll(arabic[i], english[i]).replaceAll(persian[i], english[i]); } - return input; + return input!; + } + + static DateTime? parseFlexibleDateTime(String? dateStr) { + if (dateStr == null || dateStr.trim().isEmpty) return null; + String cleanStr = replaceArabicNumber(dateStr.trim()).replaceAll('/"', '').replaceAll('"', ''); + if (cleanStr.contains(' 00:00:00')) { + cleanStr = cleanStr.replaceAll(' 00:00:00', '').trim(); + } + + DateTime? result = DateTime.tryParse(cleanStr); + if (result != null) return result; + + if (cleanStr.contains('/')) { + try { + return DateFormat("yyyy/MM/dd", "en_US").parseLoose(cleanStr); + } catch (_) {} + try { + return DateFormat("dd/MM/yyyy", "en_US").parseLoose(cleanStr); + } catch (_) {} + } + + if (cleanStr.contains('-')) { + try { + return DateFormat("yyyy-MM-dd", "en_US").parseLoose(cleanStr); + } catch (_) {} + try { + return DateFormat("dd-MM-yyyy", "en_US").parseLoose(cleanStr); + } catch (_) {} + } + + return null; } } diff --git a/lib/generated/locale_keys.g.dart b/lib/generated/locale_keys.g.dart index 2d5cb51..9abe224 100644 --- a/lib/generated/locale_keys.g.dart +++ b/lib/generated/locale_keys.g.dart @@ -323,6 +323,8 @@ abstract class LocaleKeys { static const createdFor = 'createdFor'; static const requestCreatedSuccessfully = 'requestCreatedSuccessfully'; static const search = 'search'; + static const filterEnterPrDetailsHere = 'filterEnterPrDetailsHere'; + static const filterEnterPoDetailsHere = 'filterEnterPoDetailsHere'; static const wantToReject = 'wantToReject'; static const requestType = 'requestType'; static const employeeDigitalID = 'employeeDigitalID'; diff --git a/lib/models/dashboard/get_accural_ticket_balance_model.dart b/lib/models/dashboard/get_accural_ticket_balance_model.dart index cc6520d..6e7deb1 100644 --- a/lib/models/dashboard/get_accural_ticket_balance_model.dart +++ b/lib/models/dashboard/get_accural_ticket_balance_model.dart @@ -1,7 +1,7 @@ import 'dart:convert'; class GetTicketAccuralBalanceModel { - int? accrualNetEntitlement; + num? accrualNetEntitlement; String? accuralPlanCode; GetTicketAccuralBalanceModel({ diff --git a/lib/ui/landing/widget/services_widget.dart b/lib/ui/landing/widget/services_widget.dart index 0a30857..f3c4945 100644 --- a/lib/ui/landing/widget/services_widget.dart +++ b/lib/ui/landing/widget/services_widget.dart @@ -254,6 +254,8 @@ class ServicesWidget extends StatelessWidget { Navigator.pushNamed(context, AppRoutes.dynamicScreen, arguments: DynamicListViewParams(menuEntry.prompt!, menuEntry.functionName!)); } else if (menuEntry.requestType == "PAYSLIP") { Navigator.pushNamed(context, AppRoutes.monthlyPaySlip); + } else if (menuEntry.requestType == "CEI") { + Navigator.pushNamed(context, AppRoutes.childEducation, arguments: menuEntry); } } else { if (menuEntry.menuName == "HMG_TICKET_REQUESTS") { diff --git a/lib/ui/leave_balance/add_leave_balance_screen.dart b/lib/ui/leave_balance/add_leave_balance_screen.dart index 830ca85..a97bb7c 100644 --- a/lib/ui/leave_balance/add_leave_balance_screen.dart +++ b/lib/ui/leave_balance/add_leave_balance_screen.dart @@ -326,7 +326,7 @@ class _AddLeaveBalanceScreenState extends State { displayText = displayText.replaceAll(" 00:00:00", ""); } if (displayText.contains("/")) { - displayText = DateFormat('yyyy-MM-dd').format(DateFormat("yyyy/MM/dd").parse(displayText)); + displayText = DateFormat('yyyy-MM-dd', "en_US").format(DateFormat("yyyy/MM/dd", "en_US").parse(DateUtil.replaceArabicNumber(displayText))); } } return DynamicTextFieldWidget( @@ -336,11 +336,7 @@ class _AddLeaveBalanceScreenState extends State { isEnable: false, onTap: () async { if ((getabsenceDffStructureList![index].eSERVICESDV?.pVALUECOLUMNNAME != null)) { - if (getabsenceDffStructureList![index].isDefaultTypeIsCDPS) { - selectedDate = DateFormat("yyyy/MM/dd").parse(getabsenceDffStructureList![index].eSERVICESDV!.pVALUECOLUMNNAME!.replaceAll('/"', '').replaceAll(" 00:00:00", "")); - } else { - selectedDate = DateTime.parse(getabsenceDffStructureList![index].eSERVICESDV!.pVALUECOLUMNNAME!); - } + selectedDate = DateUtil.parseFlexibleDateTime(getabsenceDffStructureList![index].eSERVICESDV!.pVALUECOLUMNNAME) ?? selectedDate; } DateTime date = await _selectDate(context); String dateString = date.toString().split(' ').first; @@ -353,14 +349,14 @@ class _AddLeaveBalanceScreenState extends State { pRETURNMSG: "null", pRETURNSTATUS: getabsenceDffStructureList![index].dEFAULTVALUE, pVALUECOLUMNNAME: - getabsenceDffStructureList![index].isDefaultTypeIsCDPS ? Utils.reverseFormatStandardDate(Utils.formatDate(dateString)) : DateFormat('yyyy-MM-ddThh:mm:ss.s').format(date)); + getabsenceDffStructureList![index].isDefaultTypeIsCDPS ? Utils.reverseFormatStandardDate(Utils.formatDate(dateString)) : DateFormat('yyyy-MM-ddThh:mm:ss.s', "en_US").format(date)); } else { eservicesdv = ESERVICESDV( pIDCOLUMNNAME: dateString, pRETURNMSG: "null", pRETURNSTATUS: getabsenceDffStructureList![index].dEFAULTVALUE, pVALUECOLUMNNAME: - getabsenceDffStructureList![index].isDefaultTypeIsCDPS ? Utils.reverseFormatStandardDate(Utils.formatDate(dateString)) : DateFormat('yyyy-MM-ddThh:mm:ss.s').format(date)); + getabsenceDffStructureList![index].isDefaultTypeIsCDPS ? Utils.reverseFormatStandardDate(Utils.formatDate(dateString)) : DateFormat('yyyy-MM-ddThh:mm:ss.s', "en_US").format(date)); } getabsenceDffStructureList![index].eSERVICESDV = eservicesdv; setState(() {}); @@ -374,7 +370,7 @@ class _AddLeaveBalanceScreenState extends State { ).paddingOnly(bottom: 12); } else if (model.fORMATTYPE == "Y") { String displayText = model.eSERVICESDV?.pIDCOLUMNNAME ?? ""; - if (getabsenceDffStructureList![index].isDefaultTypeIsCDPS) { + if (getabsenceDffStructureList[index].isDefaultTypeIsCDPS) { displayText = Utils.reverseFormatDate(displayText); // if (displayText.contains(" 00:00:00")) { // displayText = displayText.replaceAll(" 00:00:00", ""); @@ -390,19 +386,7 @@ class _AddLeaveBalanceScreenState extends State { isEnable: false, onTap: () async { if ((getabsenceDffStructureList![index].eSERVICESDV?.pVALUECOLUMNNAME != null)) { - if (getabsenceDffStructureList![index].isDefaultTypeIsCDPS) { - String tempDate = getabsenceDffStructureList![index].eSERVICESDV!.pVALUECOLUMNNAME!; - if (tempDate.contains("00:00:00")) { - tempDate = tempDate.replaceAll("00:00:00", '').trim(); - } - if (tempDate.contains("/")) { - selectedDate = DateFormat("yyyy/MM/dd").parse(tempDate); - } else { - selectedDate = DateFormat("yyyy-MM-dd").parse(tempDate); - } - } else { - selectedDate = DateTime.parse(getabsenceDffStructureList![index].eSERVICESDV!.pVALUECOLUMNNAME!); - } + selectedDate = DateUtil.parseFlexibleDateTime(getabsenceDffStructureList![index].eSERVICESDV!.pVALUECOLUMNNAME) ?? selectedDate; } DateTime date = await _selectDate(context); String dateString = date.toString().split(' ').first; @@ -414,14 +398,14 @@ class _AddLeaveBalanceScreenState extends State { pRETURNMSG: "null", pRETURNSTATUS: getabsenceDffStructureList![index].dEFAULTVALUE, pVALUECOLUMNNAME: - getabsenceDffStructureList![index].isDefaultTypeIsCDPS ? Utils.reverseFormatStandardDate(Utils.formatDate(dateString)) : DateFormat('yyyy-MM-ddThh:mm:ss.s').format(date)); + getabsenceDffStructureList![index].isDefaultTypeIsCDPS ? Utils.reverseFormatStandardDate(Utils.formatDate(dateString)) : DateFormat('yyyy-MM-ddThh:mm:ss.s', "en_US").format(date)); } else { eservicesdv = ESERVICESDV( pIDCOLUMNNAME: dateString, pRETURNMSG: "null", pRETURNSTATUS: getabsenceDffStructureList![index].dEFAULTVALUE, pVALUECOLUMNNAME: - getabsenceDffStructureList![index].isDefaultTypeIsCDPS ? Utils.reverseFormatStandardDate(Utils.formatDate(dateString)) : DateFormat('yyyy-MM-ddThh:mm:ss.s').format(date)); + getabsenceDffStructureList![index].isDefaultTypeIsCDPS ? Utils.reverseFormatStandardDate(Utils.formatDate(dateString)) : DateFormat('yyyy-MM-ddThh:mm:ss.s', "en_US").format(date)); } getabsenceDffStructureList![index].eSERVICESDV = eservicesdv; @@ -512,7 +496,7 @@ class _AddLeaveBalanceScreenState extends State { displayText = displayText.replaceAll(" 00:00:00", ""); } if (!displayText.contains("-")) { - displayText = DateFormat('yyyy-MM-dd').format(DateFormat("yyyy/MM/dd").parse(displayText)); + displayText = DateFormat('yyyy-MM-dd', "en_US").format(DateFormat("yyyy/MM/dd", "en_US").parse(DateUtil.replaceArabicNumber(displayText))); } } return DynamicTextFieldWidget( @@ -522,11 +506,7 @@ class _AddLeaveBalanceScreenState extends State { isEnable: false, onTap: () async { if ((getabsenceDffStructureList![index].eSERVICESDV?.pVALUECOLUMNNAME != null)) { - if (getabsenceDffStructureList![index].isDefaultTypeIsCDPS) { - selectedDate = DateFormat("yyyy/MM/dd").parse(getabsenceDffStructureList![index].eSERVICESDV!.pVALUECOLUMNNAME!.replaceAll('/"', '').replaceAll(" 00:00:00", "")); - } else { - selectedDate = DateTime.parse(getabsenceDffStructureList![index].eSERVICESDV!.pVALUECOLUMNNAME!); - } + selectedDate = DateUtil.parseFlexibleDateTime(getabsenceDffStructureList![index].eSERVICESDV!.pVALUECOLUMNNAME) ?? selectedDate; } DateTime date = await _selectDate(context); String dateString = date.toString().split(' ').first; @@ -536,7 +516,7 @@ class _AddLeaveBalanceScreenState extends State { pRETURNMSG: "null", pRETURNSTATUS: getabsenceDffStructureList![index].dEFAULTVALUE, pVALUECOLUMNNAME: - getabsenceDffStructureList![index].isDefaultTypeIsCDPS ? Utils.reverseFormatStandardDate(Utils.formatDate(dateString)) : DateFormat('yyyy-MM-ddThh:mm:ss.s').format(date)); + getabsenceDffStructureList![index].isDefaultTypeIsCDPS ? Utils.reverseFormatStandardDate(Utils.formatDate(dateString)) : DateFormat('yyyy-MM-ddThh:mm:ss.s', "en_US").format(date)); getabsenceDffStructureList![index].eSERVICESDV = eservicesdv; setState(() {}); // if (model.cHILDSEGMENTSVSSplited?.isNotEmpty ?? false) { @@ -557,14 +537,14 @@ class _AddLeaveBalanceScreenState extends State { if (getabsenceDffStructureList[index].mOBILEENABLED != "Y") return; if ((getabsenceDffStructureList![index].eSERVICESDV?.pVALUECOLUMNNAME != null)) { - var timeString = getabsenceDffStructureList![index].eSERVICESDV!.pVALUECOLUMNNAME!.split(":"); - selectedDate = DateTime(0, 0, 0, int.parse(timeString[0]), int.parse(timeString[1])); + var timeString = DateUtil.replaceArabicNumber(getabsenceDffStructureList![index].eSERVICESDV!.pVALUECOLUMNNAME).split(":"); + selectedDate = DateTime(0, 0, 0, int.tryParse(timeString[0]) ?? 0, timeString.length > 1 ? (int.tryParse(timeString[1]) ?? 0) : 0); //DateTime.parse(getabsenceDffStructureList![index].eSERVICESDV!.pVALUECOLUMNNAME!); } TimeOfDay _time = await _selectTime(context); DateTime tempTime = DateTime(0, 1, 1, _time.hour, _time.minute); - String time = DateFormat('HH:mm').format(tempTime).trim(); + String time = DateFormat('HH:mm', "en_US").format(tempTime).trim(); // DateTime date1 = DateTime(date.year, date.month, date.day); // getabsenceDffStructureList![index].fieldAnswer = date.toString(); diff --git a/lib/ui/screens/child_education/child_education_assistance.dart b/lib/ui/screens/child_education/child_education_assistance.dart index 283dab3..02e8fcb 100644 --- a/lib/ui/screens/child_education/child_education_assistance.dart +++ b/lib/ui/screens/child_education/child_education_assistance.dart @@ -2,6 +2,7 @@ import 'package:easy_localization/easy_localization.dart'; import 'package:flutter/material.dart'; import 'package:mohem_flutter_app/api/profile_api_client.dart'; import 'package:mohem_flutter_app/classes/colors.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'; import 'package:mohem_flutter_app/extensions/string_extensions.dart'; @@ -12,47 +13,64 @@ import 'package:mohem_flutter_app/models/get_employee_contacts.model.dart'; import 'package:mohem_flutter_app/ui/my_attendance/dynamic_screens/dynamic_listview_screen.dart'; import 'package:mohem_flutter_app/widgets/app_bar_widget.dart'; -class ChildEducationAssistance extends StatelessWidget { - ChildEducationAssistance({Key? key}) : super(key: key); +class ChildEducationAssistance extends StatefulWidget { + const ChildEducationAssistance({Key? key}) : super(key: key); + @override + State createState() => _ChildEducationAssistanceState(); +} + +class _ChildEducationAssistanceState extends State { GetMenuEntriesList? menuEntry; + List empContactList = []; + + @override + void initState() { + super.initState(); + WidgetsBinding.instance.addPostFrameCallback((_) { + menuEntry = ModalRoute.of(context)!.settings.arguments as GetMenuEntriesList; + getEmployeeContacts(); + }); + } @override Widget build(BuildContext context) { - menuEntry ??= ModalRoute.of(context)!.settings.arguments as GetMenuEntriesList; return Scaffold( backgroundColor: Colors.white, - appBar: AppBarWidget(context, title: menuEntry!.prompt!), - body: FutureBuilder( - future: ProfileApiClient().getEmployeeContacts(), - builder: (BuildContext cxt, AsyncSnapshot> snapshot) { - if (snapshot.connectionState == ConnectionState.waiting) { - return const Center(child: CircularProgressIndicator()); - } else if (snapshot.hasData) { - List empContactList = snapshot.data!; - return ListView.separated( - padding: const EdgeInsets.all(21), - separatorBuilder: (BuildContext cxt, int index) => 12.height, - itemCount: empContactList.length, - itemBuilder: (BuildContext context, int index) { - return Column( - crossAxisAlignment: CrossAxisAlignment.start, - mainAxisSize: MainAxisSize.min, - children: [ - "${empContactList[index].cONTACTNAME}".toText16(color: MyColors.grey3AColor), - "${LocaleKeys.dateOfBirth.tr()}: ${empContactList[index].dATEOFBIRTH?.split(" ").first ?? ""}".toText14(color: MyColors.grey3AColor, weight: FontWeight.w400), - "${empContactList[index].rELATIONSHIP}".toText11(color: MyColors.textMixColor), - ], - ).objectContainerView(disablePadding: false, center: false).onPress(() { - Navigator.pushNamed(context, AppRoutes.dynamicScreen, - arguments: DynamicListViewParams(empContactList[index].cONTACTNAME!, menuEntry!.functionName!, pContactRelationshipId: empContactList[index].cONTACTRELATIONSHIPID)); - }); + appBar: AppBarWidget(context, title: menuEntry?.prompt ?? ""), + body: empContactList.isNotEmpty + ? ListView.separated( + physics: const BouncingScrollPhysics(), + padding: const EdgeInsets.all(21), + separatorBuilder: (BuildContext cxt, int index) => 12.height, + itemCount: empContactList.length, + itemBuilder: (BuildContext context, int index) { + return Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisSize: MainAxisSize.min, + children: [ + "${empContactList[index].cONTACTNAME}".toText16(color: MyColors.grey3AColor), + "${LocaleKeys.dateOfBirth.tr()}: ${empContactList[index].dATEOFBIRTH?.split(" ").first ?? ""}".toText14(color: MyColors.grey3AColor, weight: FontWeight.w400), + "${empContactList[index].rELATIONSHIP}".toText11(color: MyColors.textMixColor), + ], + ).objectContainerView(disablePadding: false, center: false).onPress(() { + Navigator.pushNamed(context, AppRoutes.dynamicScreen, + arguments: DynamicListViewParams(empContactList[index].cONTACTNAME!, menuEntry!.functionName!, pContactRelationshipId: empContactList[index].cONTACTRELATIONSHIPID)); }); - } else { - return LocaleKeys.noDataAvailable.tr().toText16().center; - } - }, - ), + }) + : Utils.getNoDataWidget(context), ); } + + void getEmployeeContacts() async { + try { + Utils.showLoading(context); + empContactList = await ProfileApiClient().getEmployeeContacts(); + Utils.hideLoading(context); + setState(() {}); + } catch (ex) { + Utils.hideLoading(context); + Utils.handleException(ex, context, null); + } + } } diff --git a/lib/ui/work_list/work_list_screen.dart b/lib/ui/work_list/work_list_screen.dart index 63169ac..7e45503 100644 --- a/lib/ui/work_list/work_list_screen.dart +++ b/lib/ui/work_list/work_list_screen.dart @@ -22,6 +22,7 @@ import 'package:mohem_flutter_app/provider/dashboard_provider_model.dart'; import 'package:mohem_flutter_app/widgets/app_bar_widget.dart'; import 'package:mohem_flutter_app/widgets/bottom_sheet.dart'; import 'package:mohem_flutter_app/widgets/bottom_sheets/worklist_advance_search_bottom_sheet.dart'; +import 'package:mohem_flutter_app/widgets/dynamic_forms/dynamic_textfield_widget.dart'; import 'package:mohem_flutter_app/widgets/sso_webview_widget.dart'; import 'package:provider/provider.dart'; import 'package:pull_to_refresh/pull_to_refresh.dart'; @@ -151,6 +152,7 @@ class _WorkListScreenState extends State { final ScrollController _controller = ScrollController(); int pNotificationType = 1; + String prPoFilterText = ""; ScrollController? _scrollController; @override @@ -318,6 +320,7 @@ class _WorkListScreenState extends State { } if (workListItemIndex != index && !workListItemTypes[index].disable) { workListItemIndex = index; + prPoFilterText = ""; pageNumber = 1; if (workListItemTypes[index].value == 0) { workList = []; @@ -352,6 +355,20 @@ class _WorkListScreenState extends State { .paddingOnly(left: 21, right: 21), ], ), + if (_isPrOrPoSelected()) + DynamicTextFieldWidget( + "", + _getPrPoFilterHint(), + isEnable: true, + isPopup: false, + lines: 1, + isInputTypeNum: false, + isReadOnly: false, + onChange: (String value) { + prPoFilterText = value; + setState(() {}); + }, + ).paddingOnly(left: 21, right: 21, top: 10), SmartRefresher( enablePullDown: true, enablePullUp: false, @@ -404,16 +421,16 @@ class _WorkListScreenState extends State { ], ) : workList != null - ? ((workList!).isEmpty + ? ((_getDisplayedWorkList()).isEmpty ? Utils.getNoDataWidget(context).paddingOnly(top: 100) : ListView.separated( shrinkWrap: true, physics: const NeverScrollableScrollPhysics(), itemBuilder: (context, index) { - return rowItem(workListItemTypes[workListItemIndex!], workList![index], index); + return rowItem(workListItemTypes[workListItemIndex!], _getDisplayedWorkList()[index], index); }, separatorBuilder: (context, index) => 12.height, - itemCount: workList?.length ?? 0, + itemCount: _getDisplayedWorkList().length, padding: const EdgeInsets.all(21), )) : const SizedBox(), @@ -507,7 +524,7 @@ class _WorkListScreenState extends State { } } Utils.showLoading(context); - workList = await WorkListApiClient().getWorkList( + List? responseList = await WorkListApiClient().getWorkList( pageNumber, selectedItemTypeID, selectedViewID.toString(), @@ -516,6 +533,8 @@ class _WorkListScreenState extends State { pSentDate: searchByDate, pSearchItemType: searchByInput, ); + workList = responseList; + prPoFilterText = ""; workListItemIndex = index; AppState().setWorkList = workList; Utils.hideLoading(context); @@ -525,11 +544,35 @@ class _WorkListScreenState extends State { ); } + bool _isPrOrPoSelected() { + if (workListItemIndex == null) return false; + String key = workListItemTypes[workListItemIndex!].key ?? ""; + return key == "REQAPPRV" || key == "POAPPRV"; + } + + List _getDisplayedWorkList() { + List source = workList ?? []; + if (!_isPrOrPoSelected()) return source; + + String query = prPoFilterText.trim().toLowerCase(); + if (query.isEmpty) return source; + return source.where((item) => (item.sUBJECT ?? "").toLowerCase().contains(query)).toList(); + } + + String _getPrPoFilterHint() { + if (workListItemIndex == null) return "filterEnterPrDetailsHere".tr(); + String key = workListItemTypes[workListItemIndex!].key; + if (key == "POAPPRV") { + return "filterEnterPoDetailsHere".tr(); + } + return "filterEnterPrDetailsHere".tr(); + } + Widget rowItem(WorkListItemTypeModelData data, WorkListResponseModel workData, int index) { return InkWell( onTap: () async { AppState().setWorkListIndex = index; - var data = workList![index]; + var data = workData; var shouldReloadData = await Navigator.pushNamed(context, AppRoutes.workListDetail, arguments: workData); if (shouldReloadData != null) { if (shouldReloadData.toString() == "delegate_reload") { @@ -542,7 +585,7 @@ class _WorkListScreenState extends State { setState(() {}); } } else { - workList!.remove(data); + workList!.removeWhere((item) => item.nOTIFICATIONID == data.nOTIFICATIONID); AppState().setWorkList = workList; if (data.iTEMTYPE == "ITG") { } else { diff --git a/lib/widgets/bottom_sheets/worklist_advance_search_bottom_sheet.dart b/lib/widgets/bottom_sheets/worklist_advance_search_bottom_sheet.dart index b669218..b2d705c 100644 --- a/lib/widgets/bottom_sheets/worklist_advance_search_bottom_sheet.dart +++ b/lib/widgets/bottom_sheets/worklist_advance_search_bottom_sheet.dart @@ -11,7 +11,7 @@ import 'package:mohem_flutter_app/widgets/button/default_button.dart'; import 'package:mohem_flutter_app/widgets/dynamic_forms/dynamic_textfield_widget.dart'; class WorkListAdvanceSearch extends StatefulWidget { - Function(int, String, String, String) onSearch; + final Function(int, String, String, String) onSearch; WorkListAdvanceSearch(this.onSearch, {Key? key}) : super(key: key);