Merge branch 'master' of http://34.17.182.140/Haroon6138/mohemm-flutter-app into flutter_upgrade_with_timesheet_changes

* 'master' of http://34.17.182.140/Haroon6138/mohemm-flutter-app:
  CEI, worklist po pr filter, date issue in absence dynamic screen
  PR changes done.
  fixes for monthly calendar color coding .. and ticket screen
flutter_upgrade_with_timesheet_changes
Sultan khan 1 month ago
commit d2eaa863d6

@ -320,6 +320,8 @@
"createdFor": "انشاء لأجل", "createdFor": "انشاء لأجل",
"requestCreatedSuccessfully": "تم انشاء الطلب بنجاح", "requestCreatedSuccessfully": "تم انشاء الطلب بنجاح",
"search": "بحث", "search": "بحث",
"filterEnterPrDetailsHere": "ادخل تفاصيل طلب الشراء هنا",
"filterEnterPoDetailsHere": "ادخل تفاصيل أمر الشراء هنا",
"wantToReject": "هل انت متأكد تريد الرفض", "wantToReject": "هل انت متأكد تريد الرفض",
"requestType": "نوع الطلب", "requestType": "نوع الطلب",
"employeeDigitalID": "هويةالموظف الرقمية", "employeeDigitalID": "هويةالموظف الرقمية",
@ -667,9 +669,16 @@
"incidentDetails": "تفاصيل الحادث", "incidentDetails": "تفاصيل الحادث",
"ticketNumber": "رقم التذكرة", "ticketNumber": "رقم التذكرة",
"ticketId": "معرف التذكرة", "ticketId": "معرف التذكرة",
"pleaseSelectProject": "الرجاء اختيار مشروع", "pleaseSelectProject": "الرجاء اختيار مشروع",
"viewAttachment" : "عرض المرفق", "viewAttachment" : "عرض المرفق",
"parkingQr": "وقوف السيارات QR", "parkingQr": "وقوف السيارات QR",
"startNow": "ابدأ الآن" "startNow": "ابدأ الآن",
"destination_type": "نوع الوجهة",
"source_organization_name": "اسم منظمة المصدر",
"destination_organization_name": "اسم منظمة الوجهة",
"costCenter": "مركز التكلفة",
"priceSAR": "السعر (ريال سعودي)",
"amountSAR": "المبلغ (ريال سعودي)",
"amuLastThreeMonths": "AMU (آخر 3 أشهر)"
} }

@ -315,6 +315,8 @@
"requestType": "Request Type", "requestType": "Request Type",
"requestCreatedSuccessfully": "Request created successfully", "requestCreatedSuccessfully": "Request created successfully",
"search": "Search", "search": "Search",
"filterEnterPrDetailsHere": "Enter PR Details here",
"filterEnterPoDetailsHere": "Enter PO Details here",
"wantToReject": "Are you sure want to reject?", "wantToReject": "Are you sure want to reject?",
"employeeDigitalID": "Employee Digital ID", "employeeDigitalID": "Employee Digital ID",
"businessCard": "Business Card", "businessCard": "Business Card",
@ -665,8 +667,15 @@
"incidentDetails": "Incident Details", "incidentDetails": "Incident Details",
"ticketNumber": "Ticket Number", "ticketNumber": "Ticket Number",
"ticketId": "Ticket ID", "ticketId": "Ticket ID",
"pleaseSelectProject": "Please select a project", "pleaseSelectProject": "Please select a project",
"viewAttachment" : "View Attachment", "viewAttachment" : "View Attachment",
"parkingQr": "Parking QR", "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)"
} }

@ -71,7 +71,14 @@ class LoginApiClient {
Future<BasicMemberInformationModel?> mohemmSendActivationCodeByOTPNotificationType(int isMobileFingerPrint, String? mobileNumber, int optSendType, String? pUserName) async { Future<BasicMemberInformationModel?> mohemmSendActivationCodeByOTPNotificationType(int isMobileFingerPrint, String? mobileNumber, int optSendType, String? pUserName) async {
String url = "${ApiConsts.erpRest}Mohemm_SendActivationCodebyOTPNotificationType"; String url = "${ApiConsts.erpRest}Mohemm_SendActivationCodebyOTPNotificationType";
Map<String, dynamic> postParams = {"IsMobileFingerPrint": isMobileFingerPrint, "MobileNumber": mobileNumber, "OTP_SendType": optSendType, "P_USER_NAME": pUserName}; Map<String, dynamic> postParams = {
"IsMobileFingerPrint": isMobileFingerPrint,
"MobileNumber": mobileNumber,
"OTP_SendType": optSendType,
"P_USER_NAME": pUserName,
"NotificationCenterAppGUID": ApiConsts.notificationCenterAppGUID,
"NotificationCenterAppSeviceGUID": ApiConsts.notificationCenterLoginServiceGUID,
};
postParams.addAll(AppState().postParamsJson); postParams.addAll(AppState().postParamsJson);
return await ApiClient().postJsonForObject((json) => GenericResponseModel.fromJson(json).basicMemberInformation, url, postParams); return await ApiClient().postJsonForObject((json) => GenericResponseModel.fromJson(json).basicMemberInformation, url, postParams);
} }
@ -105,7 +112,13 @@ class LoginApiClient {
Future<GenericResponseModel?> sendPublicActivationCode(String? mobileNumber, String? pUsername) async { Future<GenericResponseModel?> sendPublicActivationCode(String? mobileNumber, String? pUsername) async {
String url = "${ApiConsts.erpRest}SendPublicActivationCode"; String url = "${ApiConsts.erpRest}SendPublicActivationCode";
Map<String, dynamic> postParams = {"MobileNumber": mobileNumber, "P_MOBILE_NUMBER": mobileNumber, "P_USER_NAME": pUsername}; Map<String, dynamic> postParams = {
"MobileNumber": mobileNumber,
"P_MOBILE_NUMBER": mobileNumber,
"P_USER_NAME": pUsername,
"NotificationCenterAppGUID": ApiConsts.notificationCenterAppGUID,
"NotificationCenterAppSeviceGUID": ApiConsts.notificationCenterForgotPasswordServiceGUID,
};
postParams.addAll(AppState().postParamsJson); postParams.addAll(AppState().postParamsJson);
return await ApiClient().postJsonForObject((json) { return await ApiClient().postJsonForObject((json) {
GenericResponseModel responseData = GenericResponseModel.fromJson(json); GenericResponseModel responseData = GenericResponseModel.fromJson(json);

@ -80,6 +80,11 @@ class ApiConsts {
//DummyCards for the UI //DummyCards for the UI
static int tabletMinLength = 500; 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 { class SharedPrefsConsts {

@ -524,14 +524,47 @@ class DateUtil {
// } // }
// return ""; // 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 english = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9'];
const arabic = ['٠', '١', '٢', '٣', '٤', '٥', '٦', '٧', '٨', '٩']; const arabic = ['٠', '١', '٢', '٣', '٤', '٥', '٦', '٧', '٨', '٩'];
const persian = ['۰', '۱', '۲', '۳', '۴', '۵', '۶', '۷', '۸', '۹'];
for (int i = 0; i < english.length; i++) { 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;
} }
} }

@ -683,7 +683,14 @@ class CodegenLoader extends AssetLoader{
"pleaseSelectProject": "الرجاء اختيار مشروع", "pleaseSelectProject": "الرجاء اختيار مشروع",
"viewAttachment": "عرض المرفق", "viewAttachment": "عرض المرفق",
"parkingQr": "وقوف السيارات QR", "parkingQr": "وقوف السيارات QR",
"startNow": "ابدأ الآن" "startNow": "ابدأ الآن",
"destination_type": "نوع الوجهة",
"source_organization_name": "اسم منظمة المصدر",
"destination_organization_name": "اسم منظمة الوجهة",
"costCenter": "مركز التكلفة",
"priceSAR": "السعر (ريال سعودي)",
"amountSAR": "المبلغ (ريال سعودي)",
"amuLastThreeMonths": "AMU (آخر 3 أشهر)"
}; };
static const Map<String,dynamic> _en_US = { static const Map<String,dynamic> _en_US = {
"mohemm": "Mohemm", "mohemm": "Mohemm",
@ -1354,7 +1361,14 @@ static const Map<String,dynamic> _en_US = {
"pleaseSelectProject": "Please select a project", "pleaseSelectProject": "Please select a project",
"viewAttachment": "View Attachment", "viewAttachment": "View Attachment",
"parkingQr": "Parking QR", "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<String, Map<String,dynamic>> mapLocales = {"ar_SA": _ar_SA, "en_US": _en_US}; static const Map<String, Map<String,dynamic>> mapLocales = {"ar_SA": _ar_SA, "en_US": _en_US};
} }

@ -323,6 +323,8 @@ abstract class LocaleKeys {
static const createdFor = 'createdFor'; static const createdFor = 'createdFor';
static const requestCreatedSuccessfully = 'requestCreatedSuccessfully'; static const requestCreatedSuccessfully = 'requestCreatedSuccessfully';
static const search = 'search'; static const search = 'search';
static const filterEnterPrDetailsHere = 'filterEnterPrDetailsHere';
static const filterEnterPoDetailsHere = 'filterEnterPoDetailsHere';
static const wantToReject = 'wantToReject'; static const wantToReject = 'wantToReject';
static const requestType = 'requestType'; static const requestType = 'requestType';
static const employeeDigitalID = 'employeeDigitalID'; static const employeeDigitalID = 'employeeDigitalID';
@ -656,5 +658,12 @@ abstract class LocaleKeys {
static const viewAttachment = 'viewAttachment'; static const viewAttachment = 'viewAttachment';
static const parkingQr = 'parkingQr'; static const parkingQr = 'parkingQr';
static const startNow = 'startNow'; 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';
} }

@ -1,7 +1,7 @@
import 'dart:convert'; import 'dart:convert';
class GetTicketAccuralBalanceModel { class GetTicketAccuralBalanceModel {
int? accrualNetEntitlement; num? accrualNetEntitlement;
String? accuralPlanCode; String? accuralPlanCode;
GetTicketAccuralBalanceModel({ GetTicketAccuralBalanceModel({

@ -5,12 +5,13 @@ class GetPrNotificationBodyList {
String? pINFORMATION; String? pINFORMATION;
String? pQUESTION; String? pQUESTION;
GetPrNotificationBodyList( GetPrNotificationBodyList({
{this.pRHeader, this.pRHeader,
this.pRLines, this.pRLines,
this.pCURRENCYCODE, this.pCURRENCYCODE,
this.pINFORMATION, this.pINFORMATION,
this.pQUESTION}); this.pQUESTION,
});
GetPrNotificationBodyList.fromJson(Map<String, dynamic> json) { GetPrNotificationBodyList.fromJson(Map<String, dynamic> json) {
if (json['PRHeader'] != null) { if (json['PRHeader'] != null) {
@ -78,21 +79,28 @@ class PRLines {
int? tOROWNUM; int? tOROWNUM;
num? uNITPRICE; num? uNITPRICE;
String? uOM; String? uOM;
String? dESTINATIONTYPE;
String? sOURCEORGANIZATIONNAME;
String? dESTINATIONORGANIZATIONNAME;
PRLines( PRLines({
{this.cOSTCENTER, this.cOSTCENTER,
this.dESCRIPTION, this.dESCRIPTION,
this.fROMROWNUM, this.fROMROWNUM,
this.iTEMAMU, this.iTEMAMU,
this.iTEMCODE, this.iTEMCODE,
this.lINEAMOUNT, this.lINEAMOUNT,
this.lINENUM, this.lINENUM,
this.nOOFROWS, this.nOOFROWS,
this.qUANTITY, this.qUANTITY,
this.rOWNUM, this.rOWNUM,
this.tOROWNUM, this.tOROWNUM,
this.uNITPRICE, this.uNITPRICE,
this.uOM}); this.uOM,
this.dESTINATIONTYPE,
this.sOURCEORGANIZATIONNAME,
this.dESTINATIONORGANIZATIONNAME,
});
PRLines.fromJson(Map<String, dynamic> json) { PRLines.fromJson(Map<String, dynamic> json) {
cOSTCENTER = json['COST_CENTER']; cOSTCENTER = json['COST_CENTER'];
@ -108,6 +116,9 @@ class PRLines {
tOROWNUM = json['TO_ROW_NUM']; tOROWNUM = json['TO_ROW_NUM'];
uNITPRICE = json['UNIT_PRICE']; uNITPRICE = json['UNIT_PRICE'];
uOM = json['UOM']; uOM = json['UOM'];
dESTINATIONTYPE = json['DESTINATION_TYPE'];
sOURCEORGANIZATIONNAME = json['SOURCE_ORGANIZATION_NAME'];
dESTINATIONORGANIZATIONNAME = json['DESTINATION_ORGANIZATION_NAME'];
} }
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
@ -125,6 +136,9 @@ class PRLines {
data['TO_ROW_NUM'] = this.tOROWNUM; data['TO_ROW_NUM'] = this.tOROWNUM;
data['UNIT_PRICE'] = this.uNITPRICE; data['UNIT_PRICE'] = this.uNITPRICE;
data['UOM'] = this.uOM; data['UOM'] = this.uOM;
data['DESTINATION_TYPE'] = this.dESTINATIONTYPE;
data['SOURCE_ORGANIZATION_NAME'] = this.sOURCEORGANIZATIONNAME;
data['DESTINATION_ORGANIZATION_NAME'] = this.dESTINATIONORGANIZATIONNAME;
return data; return data;
} }
} }

@ -57,6 +57,15 @@ class _MonthlyAttendanceScreenState extends State<MonthlyAttendanceScreen> {
Utils.showLoading(context); Utils.showLoading(context);
getTimeCardSummaryList = await MonthlyAttendanceApiClient().getTimeCardSummary(searchMonth, searchYear); getTimeCardSummaryList = await MonthlyAttendanceApiClient().getTimeCardSummary(searchMonth, searchYear);
getDayHoursTypeDetailsList = await MonthlyAttendanceApiClient().getDayHoursTypeDetails(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); Utils.hideLoading(context);
_calendarController.displayDate = formattedDate; _calendarController.displayDate = formattedDate;
setState(() {}); setState(() {});
@ -307,10 +316,19 @@ class _MonthlyAttendanceScreenState extends State<MonthlyAttendanceScreen> {
// bool isDayIsPresent = getDayHoursTypeDetailsList[val - 1].aTTENDEDFLAG == 'Y'; // bool isDayIsPresent = getDayHoursTypeDetailsList[val - 1].aTTENDEDFLAG == 'Y';
// bool isDayIsAbsent = getDayHoursTypeDetailsList[val - 1].aTTENDEDFLAG == 'N' && getDayHoursTypeDetailsList[val - 1].aBSENTFLAG == 'Y'; // bool isDayIsAbsent = getDayHoursTypeDetailsList[val - 1].aTTENDEDFLAG == 'N' && getDayHoursTypeDetailsList[val - 1].aBSENTFLAG == 'Y';
List<GetDayHoursTypeDetailsList> getDayHours = List<GetDayHoursTypeDetailsList> 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) { if (getDayHours.isNotEmpty) {
GetDayHoursTypeDetailsList dayData = getDayHours.first; 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 isDayIsOff = dayData.aTTENDEDFLAG == 'N' && dayData.dAYTYPE == 'OFF';
bool isDayIsPresent = dayData.aTTENDEDFLAG == 'Y'; bool isDayIsPresent = dayData.aTTENDEDFLAG == 'Y';
bool isDayIsAbsent = dayData.aTTENDEDFLAG == 'N' && dayData.aBSENTFLAG == 'Y'; bool isDayIsAbsent = dayData.aTTENDEDFLAG == 'N' && dayData.aBSENTFLAG == 'Y';
@ -321,8 +339,9 @@ class _MonthlyAttendanceScreenState extends State<MonthlyAttendanceScreen> {
bool useGradient = false; bool useGradient = false;
// Determine color based on leave type code // Determine color based on leave type code
if (leaveTypeCode != null && leaveTypeCode.isNotEmpty) { if (leaveTypeCode != null && leaveTypeCode.isNotEmpty && leaveTypeCode.trim().isNotEmpty) {
leaveTypeColor = leaveTypeColors[leaveTypeCode]; leaveTypeColor = leaveTypeColors[leaveTypeCode];
print('Matched color for $leaveTypeCode: $leaveTypeColor');
} }
// If no leave type color found, use default colors based on attendance status // If no leave type color found, use default colors based on attendance status
@ -396,6 +415,28 @@ class _MonthlyAttendanceScreenState extends State<MonthlyAttendanceScreen> {
), ),
); );
} }
// 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( return Container(
margin: const EdgeInsets.all(4), margin: const EdgeInsets.all(4),
@ -430,14 +471,22 @@ class _MonthlyAttendanceScreenState extends State<MonthlyAttendanceScreen> {
void calendarTapped(CalendarTapDetails details) async { void calendarTapped(CalendarTapDetails details) async {
if (details.date == null) return; if (details.date == null) return;
// Filter to find the matching day data // Filter to find the matching day data with full date comparison
List<GetDayHoursTypeDetailsList> getDayHours = List<GetDayHoursTypeDetailsList> getDayHours =
getDayHoursTypeDetailsList.where((GetDayHoursTypeDetailsList element) => getDayHoursTypeDetailsList.where((GetDayHoursTypeDetailsList element) {
DateFormat("MM/dd/yyyy", "en_US").parse(element.sCHEDULEDATE!).day == details.date!.day).toList(); 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; if (getDayHours.isEmpty) return;
GetDayHoursTypeDetailsList dayData = getDayHours.first; GetDayHoursTypeDetailsList dayData = getDayHours.first;
// Debug logging
print('Tapped Day: ${details.date!.day}, LEAVE_TYPE_CODE: ${dayData.lEAVETYPECODE}');
pRTPID = dayData.rTPID; pRTPID = dayData.rTPID;
await getScheduleShiftsDetails(details.date!.day, pRTPID); await getScheduleShiftsDetails(details.date!.day, pRTPID);
dynamic value = getScheduleShiftsDetailsList!.pERCENTAGE; dynamic value = getScheduleShiftsDetailsList!.pERCENTAGE;

@ -254,6 +254,8 @@ class ServicesWidget extends StatelessWidget {
Navigator.pushNamed(context, AppRoutes.dynamicScreen, arguments: DynamicListViewParams(menuEntry.prompt!, menuEntry.functionName!)); Navigator.pushNamed(context, AppRoutes.dynamicScreen, arguments: DynamicListViewParams(menuEntry.prompt!, menuEntry.functionName!));
} else if (menuEntry.requestType == "PAYSLIP") { } else if (menuEntry.requestType == "PAYSLIP") {
Navigator.pushNamed(context, AppRoutes.monthlyPaySlip); Navigator.pushNamed(context, AppRoutes.monthlyPaySlip);
} else if (menuEntry.requestType == "CEI") {
Navigator.pushNamed(context, AppRoutes.childEducation, arguments: menuEntry);
} }
} else { } else {
if (menuEntry.menuName == "HMG_TICKET_REQUESTS") { if (menuEntry.menuName == "HMG_TICKET_REQUESTS") {

@ -326,7 +326,7 @@ class _AddLeaveBalanceScreenState extends State<AddLeaveBalanceScreen> {
displayText = displayText.replaceAll(" 00:00:00", ""); displayText = displayText.replaceAll(" 00:00:00", "");
} }
if (displayText.contains("/")) { 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( return DynamicTextFieldWidget(
@ -336,11 +336,7 @@ class _AddLeaveBalanceScreenState extends State<AddLeaveBalanceScreen> {
isEnable: false, isEnable: false,
onTap: () async { onTap: () async {
if ((getabsenceDffStructureList![index].eSERVICESDV?.pVALUECOLUMNNAME != null)) { if ((getabsenceDffStructureList![index].eSERVICESDV?.pVALUECOLUMNNAME != null)) {
if (getabsenceDffStructureList![index].isDefaultTypeIsCDPS) { selectedDate = DateUtil.parseFlexibleDateTime(getabsenceDffStructureList![index].eSERVICESDV!.pVALUECOLUMNNAME) ?? selectedDate;
selectedDate = DateFormat("yyyy/MM/dd").parse(getabsenceDffStructureList![index].eSERVICESDV!.pVALUECOLUMNNAME!.replaceAll('/"', '').replaceAll(" 00:00:00", ""));
} else {
selectedDate = DateTime.parse(getabsenceDffStructureList![index].eSERVICESDV!.pVALUECOLUMNNAME!);
}
} }
DateTime date = await _selectDate(context); DateTime date = await _selectDate(context);
String dateString = date.toString().split(' ').first; String dateString = date.toString().split(' ').first;
@ -353,14 +349,14 @@ class _AddLeaveBalanceScreenState extends State<AddLeaveBalanceScreen> {
pRETURNMSG: "null", pRETURNMSG: "null",
pRETURNSTATUS: getabsenceDffStructureList![index].dEFAULTVALUE, pRETURNSTATUS: getabsenceDffStructureList![index].dEFAULTVALUE,
pVALUECOLUMNNAME: 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 { } else {
eservicesdv = ESERVICESDV( eservicesdv = ESERVICESDV(
pIDCOLUMNNAME: dateString, pIDCOLUMNNAME: dateString,
pRETURNMSG: "null", pRETURNMSG: "null",
pRETURNSTATUS: getabsenceDffStructureList![index].dEFAULTVALUE, pRETURNSTATUS: getabsenceDffStructureList![index].dEFAULTVALUE,
pVALUECOLUMNNAME: 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; getabsenceDffStructureList![index].eSERVICESDV = eservicesdv;
setState(() {}); setState(() {});
@ -374,7 +370,7 @@ class _AddLeaveBalanceScreenState extends State<AddLeaveBalanceScreen> {
).paddingOnly(bottom: 12); ).paddingOnly(bottom: 12);
} else if (model.fORMATTYPE == "Y") { } else if (model.fORMATTYPE == "Y") {
String displayText = model.eSERVICESDV?.pIDCOLUMNNAME ?? ""; String displayText = model.eSERVICESDV?.pIDCOLUMNNAME ?? "";
if (getabsenceDffStructureList![index].isDefaultTypeIsCDPS) { if (getabsenceDffStructureList[index].isDefaultTypeIsCDPS) {
displayText = Utils.reverseFormatDate(displayText); displayText = Utils.reverseFormatDate(displayText);
// if (displayText.contains(" 00:00:00")) { // if (displayText.contains(" 00:00:00")) {
// displayText = displayText.replaceAll(" 00:00:00", ""); // displayText = displayText.replaceAll(" 00:00:00", "");
@ -390,19 +386,7 @@ class _AddLeaveBalanceScreenState extends State<AddLeaveBalanceScreen> {
isEnable: false, isEnable: false,
onTap: () async { onTap: () async {
if ((getabsenceDffStructureList![index].eSERVICESDV?.pVALUECOLUMNNAME != null)) { if ((getabsenceDffStructureList![index].eSERVICESDV?.pVALUECOLUMNNAME != null)) {
if (getabsenceDffStructureList![index].isDefaultTypeIsCDPS) { selectedDate = DateUtil.parseFlexibleDateTime(getabsenceDffStructureList![index].eSERVICESDV!.pVALUECOLUMNNAME) ?? selectedDate;
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!);
}
} }
DateTime date = await _selectDate(context); DateTime date = await _selectDate(context);
String dateString = date.toString().split(' ').first; String dateString = date.toString().split(' ').first;
@ -414,14 +398,14 @@ class _AddLeaveBalanceScreenState extends State<AddLeaveBalanceScreen> {
pRETURNMSG: "null", pRETURNMSG: "null",
pRETURNSTATUS: getabsenceDffStructureList![index].dEFAULTVALUE, pRETURNSTATUS: getabsenceDffStructureList![index].dEFAULTVALUE,
pVALUECOLUMNNAME: 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 { } else {
eservicesdv = ESERVICESDV( eservicesdv = ESERVICESDV(
pIDCOLUMNNAME: dateString, pIDCOLUMNNAME: dateString,
pRETURNMSG: "null", pRETURNMSG: "null",
pRETURNSTATUS: getabsenceDffStructureList![index].dEFAULTVALUE, pRETURNSTATUS: getabsenceDffStructureList![index].dEFAULTVALUE,
pVALUECOLUMNNAME: 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; getabsenceDffStructureList![index].eSERVICESDV = eservicesdv;
@ -512,7 +496,7 @@ class _AddLeaveBalanceScreenState extends State<AddLeaveBalanceScreen> {
displayText = displayText.replaceAll(" 00:00:00", ""); displayText = displayText.replaceAll(" 00:00:00", "");
} }
if (!displayText.contains("-")) { 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( return DynamicTextFieldWidget(
@ -522,11 +506,7 @@ class _AddLeaveBalanceScreenState extends State<AddLeaveBalanceScreen> {
isEnable: false, isEnable: false,
onTap: () async { onTap: () async {
if ((getabsenceDffStructureList![index].eSERVICESDV?.pVALUECOLUMNNAME != null)) { if ((getabsenceDffStructureList![index].eSERVICESDV?.pVALUECOLUMNNAME != null)) {
if (getabsenceDffStructureList![index].isDefaultTypeIsCDPS) { selectedDate = DateUtil.parseFlexibleDateTime(getabsenceDffStructureList![index].eSERVICESDV!.pVALUECOLUMNNAME) ?? selectedDate;
selectedDate = DateFormat("yyyy/MM/dd").parse(getabsenceDffStructureList![index].eSERVICESDV!.pVALUECOLUMNNAME!.replaceAll('/"', '').replaceAll(" 00:00:00", ""));
} else {
selectedDate = DateTime.parse(getabsenceDffStructureList![index].eSERVICESDV!.pVALUECOLUMNNAME!);
}
} }
DateTime date = await _selectDate(context); DateTime date = await _selectDate(context);
String dateString = date.toString().split(' ').first; String dateString = date.toString().split(' ').first;
@ -536,7 +516,7 @@ class _AddLeaveBalanceScreenState extends State<AddLeaveBalanceScreen> {
pRETURNMSG: "null", pRETURNMSG: "null",
pRETURNSTATUS: getabsenceDffStructureList![index].dEFAULTVALUE, pRETURNSTATUS: getabsenceDffStructureList![index].dEFAULTVALUE,
pVALUECOLUMNNAME: 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; getabsenceDffStructureList![index].eSERVICESDV = eservicesdv;
setState(() {}); setState(() {});
// if (model.cHILDSEGMENTSVSSplited?.isNotEmpty ?? false) { // if (model.cHILDSEGMENTSVSSplited?.isNotEmpty ?? false) {
@ -557,14 +537,14 @@ class _AddLeaveBalanceScreenState extends State<AddLeaveBalanceScreen> {
if (getabsenceDffStructureList[index].mOBILEENABLED != "Y") return; if (getabsenceDffStructureList[index].mOBILEENABLED != "Y") return;
if ((getabsenceDffStructureList![index].eSERVICESDV?.pVALUECOLUMNNAME != null)) { if ((getabsenceDffStructureList![index].eSERVICESDV?.pVALUECOLUMNNAME != null)) {
var timeString = getabsenceDffStructureList![index].eSERVICESDV!.pVALUECOLUMNNAME!.split(":"); var timeString = DateUtil.replaceArabicNumber(getabsenceDffStructureList![index].eSERVICESDV!.pVALUECOLUMNNAME).split(":");
selectedDate = DateTime(0, 0, 0, int.parse(timeString[0]), int.parse(timeString[1])); 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!); //DateTime.parse(getabsenceDffStructureList![index].eSERVICESDV!.pVALUECOLUMNNAME!);
} }
TimeOfDay _time = await _selectTime(context); TimeOfDay _time = await _selectTime(context);
DateTime tempTime = DateTime(0, 1, 1, _time.hour, _time.minute); 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); // DateTime date1 = DateTime(date.year, date.month, date.day);
// getabsenceDffStructureList![index].fieldAnswer = date.toString(); // getabsenceDffStructureList![index].fieldAnswer = date.toString();

@ -2,6 +2,7 @@ import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:mohem_flutter_app/api/profile_api_client.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/colors.dart';
import 'package:mohem_flutter_app/classes/utils.dart';
import 'package:mohem_flutter_app/config/routes.dart'; import 'package:mohem_flutter_app/config/routes.dart';
import 'package:mohem_flutter_app/extensions/int_extensions.dart'; import 'package:mohem_flutter_app/extensions/int_extensions.dart';
import 'package:mohem_flutter_app/extensions/string_extensions.dart'; import 'package:mohem_flutter_app/extensions/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/ui/my_attendance/dynamic_screens/dynamic_listview_screen.dart';
import 'package:mohem_flutter_app/widgets/app_bar_widget.dart'; import 'package:mohem_flutter_app/widgets/app_bar_widget.dart';
class ChildEducationAssistance extends StatelessWidget { class ChildEducationAssistance extends StatefulWidget {
ChildEducationAssistance({Key? key}) : super(key: key); const ChildEducationAssistance({Key? key}) : super(key: key);
@override
State<ChildEducationAssistance> createState() => _ChildEducationAssistanceState();
}
class _ChildEducationAssistanceState extends State<ChildEducationAssistance> {
GetMenuEntriesList? menuEntry; GetMenuEntriesList? menuEntry;
List<GetEmployeeContactsList> empContactList = [];
@override
void initState() {
super.initState();
WidgetsBinding.instance.addPostFrameCallback((_) {
menuEntry = ModalRoute.of(context)!.settings.arguments as GetMenuEntriesList;
getEmployeeContacts();
});
}
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
menuEntry ??= ModalRoute.of(context)!.settings.arguments as GetMenuEntriesList;
return Scaffold( return Scaffold(
backgroundColor: Colors.white, backgroundColor: Colors.white,
appBar: AppBarWidget(context, title: menuEntry!.prompt!), appBar: AppBarWidget(context, title: menuEntry?.prompt ?? ""),
body: FutureBuilder( body: empContactList.isNotEmpty
future: ProfileApiClient().getEmployeeContacts(), ? ListView.separated(
builder: (BuildContext cxt, AsyncSnapshot<List<GetEmployeeContactsList>> snapshot) { physics: const BouncingScrollPhysics(),
if (snapshot.connectionState == ConnectionState.waiting) { padding: const EdgeInsets.all(21),
return const Center(child: CircularProgressIndicator()); separatorBuilder: (BuildContext cxt, int index) => 12.height,
} else if (snapshot.hasData) { itemCount: empContactList.length,
List<GetEmployeeContactsList> empContactList = snapshot.data!; itemBuilder: (BuildContext context, int index) {
return ListView.separated( return Column(
padding: const EdgeInsets.all(21), crossAxisAlignment: CrossAxisAlignment.start,
separatorBuilder: (BuildContext cxt, int index) => 12.height, mainAxisSize: MainAxisSize.min,
itemCount: empContactList.length, children: [
itemBuilder: (BuildContext context, int index) { "${empContactList[index].cONTACTNAME}".toText16(color: MyColors.grey3AColor),
return Column( "${LocaleKeys.dateOfBirth.tr()}: ${empContactList[index].dATEOFBIRTH?.split(" ").first ?? ""}".toText14(color: MyColors.grey3AColor, weight: FontWeight.w400),
crossAxisAlignment: CrossAxisAlignment.start, "${empContactList[index].rELATIONSHIP}".toText11(color: MyColors.textMixColor),
mainAxisSize: MainAxisSize.min, ],
children: [ ).objectContainerView(disablePadding: false, center: false).onPress(() {
"${empContactList[index].cONTACTNAME}".toText16(color: MyColors.grey3AColor), Navigator.pushNamed(context, AppRoutes.dynamicScreen,
"${LocaleKeys.dateOfBirth.tr()}: ${empContactList[index].dATEOFBIRTH?.split(" ").first ?? ""}".toText14(color: MyColors.grey3AColor, weight: FontWeight.w400), arguments: DynamicListViewParams(empContactList[index].cONTACTNAME!, menuEntry!.functionName!, pContactRelationshipId: empContactList[index].cONTACTRELATIONSHIPID));
"${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);
}
}
} }

@ -61,23 +61,24 @@ class _TicketDetailedScreenState extends State<TicketDetailedScreen> {
appBar: AppBarWidget(context, title: LocaleKeys.ticketDetails.tr()), appBar: AppBarWidget(context, title: LocaleKeys.ticketDetails.tr()),
body: Column( body: Column(
children: <Widget>[ children: <Widget>[
ListView( Expanded(
padding: const EdgeInsets.all(21), child: ListView(
physics: const BouncingScrollPhysics(), padding: const EdgeInsets.all(21),
children: <Widget>[ physics: const BouncingScrollPhysics(),
if (dashboardProviderModel == null && dashboardProviderModel?.accrualTicketBalanceList == null) ...<Widget>[Utils.getNoDataWidget(context).paddingOnly(top: 50)] else ...<Widget>[ children: <Widget>[
Container( if (dashboardProviderModel == null && dashboardProviderModel?.accrualTicketBalanceList == null) ...<Widget>[Utils.getNoDataWidget(context).paddingOnly(top: 50)] else ...<Widget>[
padding: const EdgeInsets.all(16.0), Container(
decoration: BoxDecoration( padding: const EdgeInsets.all(16.0),
color: Colors.white, decoration: BoxDecoration(
borderRadius: BorderRadius.circular(12.0), color: Colors.white,
boxShadow: <BoxShadow>[BoxShadow(color: Colors.grey.withOpacity(0.2), spreadRadius: 2, blurRadius: 5, offset: const Offset(0, 3))], borderRadius: BorderRadius.circular(12.0),
), boxShadow: <BoxShadow>[BoxShadow(color: Colors.grey.withOpacity(0.2), spreadRadius: 2, blurRadius: 5, offset: const Offset(0, 3))],
child: Column( ),
children: <Widget>[ child: Column(
Row( children: <Widget>[
children: <Widget>[ Row(
LocaleKeys.currentTicketBalance.tr().toText20().expanded, children: <Widget>[
Expanded(child: LocaleKeys.currentTicketBalance.tr().toText20()),
Row( Row(
children: <Widget>[ children: <Widget>[
const Icon(Icons.calendar_month_rounded, color: MyColors.darkIconColor, size: 16), const Icon(Icons.calendar_month_rounded, color: MyColors.darkIconColor, size: 16),
@ -116,11 +117,10 @@ class _TicketDetailedScreenState extends State<TicketDetailedScreen> {
), ),
const SizedBox(height: 21), const SizedBox(height: 21),
(dashboardProviderModel != null && dashboardProviderModel!.ticketHistoryTransactionList != null && dashboardProviderModel!.ticketHistoryTransactionList!.isNotEmpty) (dashboardProviderModel != null && dashboardProviderModel!.ticketHistoryTransactionList != null && dashboardProviderModel!.ticketHistoryTransactionList!.isNotEmpty)
? ListView( ? Column(
shrinkWrap: true, crossAxisAlignment: CrossAxisAlignment.start,
physics: const NeverScrollableScrollPhysics(),
children: <Widget>[ children: <Widget>[
LocaleKeys.ticketHistory.tr().toText20().expanded, LocaleKeys.ticketHistory.tr().toText20(),
12.height, 12.height,
ListView.separated( ListView.separated(
physics: const NeverScrollableScrollPhysics(), physics: const NeverScrollableScrollPhysics(),
@ -220,9 +220,10 @@ class _TicketDetailedScreenState extends State<TicketDetailedScreen> {
], ],
) )
: const SizedBox(), : const SizedBox(),
],
], ],
], ),
).expanded, ),
DefaultButton(LocaleKeys.proceedBooking.tr(), () { DefaultButton(LocaleKeys.proceedBooking.tr(), () {
if (widget.url != null && widget.jwtToken != null) { if (widget.url != null && widget.jwtToken != null) {
Navigator.push(context, MaterialPageRoute(builder: (BuildContext context) => SsoLoginWebView(url: widget.url, jwtToken: widget.jwtToken, ssoType: SsoType.forTicket))); Navigator.push(context, MaterialPageRoute(builder: (BuildContext context) => SsoLoginWebView(url: widget.url, jwtToken: widget.jwtToken, ssoType: SsoType.forTicket)));

@ -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/app_bar_widget.dart';
import 'package:mohem_flutter_app/widgets/bottom_sheet.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/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:mohem_flutter_app/widgets/sso_webview_widget.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:pull_to_refresh/pull_to_refresh.dart'; import 'package:pull_to_refresh/pull_to_refresh.dart';
@ -151,6 +152,7 @@ class _WorkListScreenState extends State<WorkListScreen> {
final ScrollController _controller = ScrollController(); final ScrollController _controller = ScrollController();
int pNotificationType = 1; int pNotificationType = 1;
String prPoFilterText = "";
ScrollController? _scrollController; ScrollController? _scrollController;
@override @override
@ -318,6 +320,7 @@ class _WorkListScreenState extends State<WorkListScreen> {
} }
if (workListItemIndex != index && !workListItemTypes[index].disable) { if (workListItemIndex != index && !workListItemTypes[index].disable) {
workListItemIndex = index; workListItemIndex = index;
prPoFilterText = "";
pageNumber = 1; pageNumber = 1;
if (workListItemTypes[index].value == 0) { if (workListItemTypes[index].value == 0) {
workList = []; workList = [];
@ -352,6 +355,20 @@ class _WorkListScreenState extends State<WorkListScreen> {
.paddingOnly(left: 21, right: 21), .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( SmartRefresher(
enablePullDown: true, enablePullDown: true,
enablePullUp: false, enablePullUp: false,
@ -404,16 +421,16 @@ class _WorkListScreenState extends State<WorkListScreen> {
], ],
) )
: workList != null : workList != null
? ((workList!).isEmpty ? ((_getDisplayedWorkList()).isEmpty
? Utils.getNoDataWidget(context).paddingOnly(top: 100) ? Utils.getNoDataWidget(context).paddingOnly(top: 100)
: ListView.separated( : ListView.separated(
shrinkWrap: true, shrinkWrap: true,
physics: const NeverScrollableScrollPhysics(), physics: const NeverScrollableScrollPhysics(),
itemBuilder: (context, index) { itemBuilder: (context, index) {
return rowItem(workListItemTypes[workListItemIndex!], workList![index], index); return rowItem(workListItemTypes[workListItemIndex!], _getDisplayedWorkList()[index], index);
}, },
separatorBuilder: (context, index) => 12.height, separatorBuilder: (context, index) => 12.height,
itemCount: workList?.length ?? 0, itemCount: _getDisplayedWorkList().length,
padding: const EdgeInsets.all(21), padding: const EdgeInsets.all(21),
)) ))
: const SizedBox(), : const SizedBox(),
@ -507,7 +524,7 @@ class _WorkListScreenState extends State<WorkListScreen> {
} }
} }
Utils.showLoading(context); Utils.showLoading(context);
workList = await WorkListApiClient().getWorkList( List<WorkListResponseModel>? responseList = await WorkListApiClient().getWorkList(
pageNumber, pageNumber,
selectedItemTypeID, selectedItemTypeID,
selectedViewID.toString(), selectedViewID.toString(),
@ -516,6 +533,8 @@ class _WorkListScreenState extends State<WorkListScreen> {
pSentDate: searchByDate, pSentDate: searchByDate,
pSearchItemType: searchByInput, pSearchItemType: searchByInput,
); );
workList = responseList;
prPoFilterText = "";
workListItemIndex = index; workListItemIndex = index;
AppState().setWorkList = workList; AppState().setWorkList = workList;
Utils.hideLoading(context); Utils.hideLoading(context);
@ -525,11 +544,35 @@ class _WorkListScreenState extends State<WorkListScreen> {
); );
} }
bool _isPrOrPoSelected() {
if (workListItemIndex == null) return false;
String key = workListItemTypes[workListItemIndex!].key ?? "";
return key == "REQAPPRV" || key == "POAPPRV";
}
List<WorkListResponseModel> _getDisplayedWorkList() {
List<WorkListResponseModel> 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) { Widget rowItem(WorkListItemTypeModelData data, WorkListResponseModel workData, int index) {
return InkWell( return InkWell(
onTap: () async { onTap: () async {
AppState().setWorkListIndex = index; AppState().setWorkListIndex = index;
var data = workList![index]; var data = workData;
var shouldReloadData = await Navigator.pushNamed(context, AppRoutes.workListDetail, arguments: workData); var shouldReloadData = await Navigator.pushNamed(context, AppRoutes.workListDetail, arguments: workData);
if (shouldReloadData != null) { if (shouldReloadData != null) {
if (shouldReloadData.toString() == "delegate_reload") { if (shouldReloadData.toString() == "delegate_reload") {
@ -542,7 +585,7 @@ class _WorkListScreenState extends State<WorkListScreen> {
setState(() {}); setState(() {});
} }
} else { } else {
workList!.remove(data); workList!.removeWhere((item) => item.nOTIFICATIONID == data.nOTIFICATIONID);
AppState().setWorkList = workList; AppState().setWorkList = workList;
if (data.iTEMTYPE == "ITG") { if (data.iTEMTYPE == "ITG") {
} else { } else {

@ -602,6 +602,7 @@ class InfoFragment extends StatelessWidget {
ItemDetailViewCol( ItemDetailViewCol(
LocaleKeys.responder.tr(), workListData!.rESPONDER ?? ""), LocaleKeys.responder.tr(), workListData!.rESPONDER ?? ""),
), ),
Column( Column(
children: getPRHeaderValues(), children: getPRHeaderValues(),
) )

@ -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_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_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_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/ui/work_list/item_history_screen.dart';
import 'package:mohem_flutter_app/widgets/button/default_button.dart'; import 'package:mohem_flutter_app/widgets/button/default_button.dart';
import 'package:mohem_flutter_app/widgets/item_detail_view_widget.dart'; import 'package:mohem_flutter_app/widgets/item_detail_view_widget.dart';
@ -51,250 +52,465 @@ class RequestFragment extends StatelessWidget {
Widget poLinesDataView(BuildContext context) { Widget poLinesDataView(BuildContext context) {
return ExpandableNotifier( return ExpandableNotifier(
child: ListView.separated( child: ListView.separated(
shrinkWrap: true, shrinkWrap: true,
physics: const NeverScrollableScrollPhysics(), physics: const NeverScrollableScrollPhysics(),
itemBuilder: (cxt, index) => ExpandablePanel( itemBuilder:
header: poLinesList[index].iTEMDESCRIPTION!.toText14(), (cxt, index) =>
collapsed: Column( ExpandablePanel(
crossAxisAlignment: CrossAxisAlignment.start, header: poLinesList[index].iTEMDESCRIPTION!.toText14(),
mainAxisSize: MainAxisSize.min, collapsed: Column(
children: [ crossAxisAlignment: CrossAxisAlignment.start,
ItemDetailGrid( mainAxisSize: MainAxisSize.min,
ItemDetailViewCol(LocaleKeys.code.tr(), poLinesList[index].iTEMCODE ?? ""), children: [
ItemDetailViewCol(LocaleKeys.mfg.tr(), poLinesList[index].mFG ?? ""), ItemDetailGrid(
), ItemDetailViewCol(
ItemDetailGrid( LocaleKeys.code.tr(),
ItemDetailViewCol(LocaleKeys.lineType.tr(), poLinesList[index].lINETYPE?.toString() ?? ""), poLinesList[index].iTEMCODE ?? "",
ItemDetailViewCol(LocaleKeys.unit.tr(), poLinesList[index].uOM ?? ""), ),
), ItemDetailViewCol(
ItemDetailGrid( LocaleKeys.mfg.tr(),
ItemDetailViewCol(LocaleKeys.price.tr(), poLinesList[index].uNITPRICE?.toString() ?? ""), poLinesList[index].mFG ?? "",
ItemDetailViewCol(LocaleKeys.lineAmount.tr(), poLinesList[index].lINEAMOUNT?.toString() ?? ""), ),
), ),
ItemDetailGrid( ItemDetailGrid(
ItemDetailViewCol(LocaleKeys.quantity.tr(), poLinesList[index].qUANTITY?.toString() ?? ""), ItemDetailViewCol(
ItemDetailViewCol(LocaleKeys.lineDiscount.tr(), poLinesList[index].lINEDISCPERCENTAGE?.toString() ?? ""), LocaleKeys.lineType.tr(),
), poLinesList[index].lINETYPE?.toString() ?? "",
ItemDetailGrid( ),
ItemDetailViewCol(LocaleKeys.needByDate.tr(), poLinesList[index].nEEDBYDATE ?? ""), ItemDetailViewCol(
ItemDetailViewCol(LocaleKeys.promisedDate.tr(), poLinesList[index].pROMISEDDATE ?? ""), LocaleKeys.unit.tr(),
), poLinesList[index].uOM ?? "",
ItemDetailGrid( ),
ItemDetailViewCol(LocaleKeys.deliverToLocation.tr(), poLinesList[index].dELIVERTOLOCATION ?? ""), ),
ItemDetailViewCol(LocaleKeys.requisitionNumber.tr(), poLinesList[index].pRNUM ?? ""), ItemDetailGrid(
), ItemDetailViewCol(
ItemDetailGrid( LocaleKeys.price.tr(),
ItemDetailViewCol(LocaleKeys.requester.tr(), poLinesList[index].rEQUESTOR ?? ""), poLinesList[index].uNITPRICE?.toString() ?? "",
Container(), ),
), ItemDetailViewCol(
12.height, LocaleKeys.lineAmount.tr(),
Row( poLinesList[index].lINEAMOUNT?.toString() ?? "",
children: [ ),
DefaultButton( ),
LocaleKeys.itemHistory.tr(), 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( Navigator.pushNamed(
cxt, cxt,
AppRoutes.itemHistory, 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,
fontSize: 13, 12.width,
).expanded, DefaultButton(LocaleKeys.quotationAnalysis.tr(), () {
12.width,
DefaultButton(
LocaleKeys.quotationAnalysis.tr(),
() {
Navigator.pushNamed( Navigator.pushNamed(
cxt, cxt,
AppRoutes.itemHistory, AppRoutes.itemHistory,
arguments: ItemHistoryScreenParams( 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,
fontSize: 13, ],
).expanded, ),
12.width, ],
DefaultButton( ),
"PR Details", expanded: const SizedBox(),
() { ).objectContainerView(),
getPRDetails(context, poLinesList[index].pOLINEID.toString()); 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() { Widget prLinesDataView() {
return ExpandableNotifier( return ExpandableNotifier(
child: ListView.separated( child: ListView.separated(
shrinkWrap: true, shrinkWrap: true,
physics: const NeverScrollableScrollPhysics(), physics: const NeverScrollableScrollPhysics(),
itemBuilder: (cxt, index) => ExpandablePanel( itemBuilder:
header: prLinesList[index].dESCRIPTION.toString().toText14(color: MyColors.textMixColor), (cxt, index) =>
collapsed: Column( ExpandablePanel(
children: [ header: prLinesList[index].dESCRIPTION.toString().toText14(
ItemDetailGrid( color: MyColors.textMixColor,
ItemDetailViewCol("Cost Center", prLinesList[index].cOSTCENTER ?? ""), ),
ItemDetailViewCol("Code", prLinesList[index].iTEMCODE ?? ""), collapsed: Column(
), children: [
ItemDetailGrid( ItemDetailGrid(
ItemDetailViewCol("Unit", prLinesList[index].uOM ?? ""), ItemDetailViewCol(
ItemDetailViewCol("Price (SAR)", prLinesList[index].uNITPRICE.toString() ?? ""), LocaleKeys.costCenter.tr(),
), prLinesList[index].cOSTCENTER ?? "",
ItemDetailGrid( ),
ItemDetailViewCol("Amount (SAR)", prLinesList[index].lINEAMOUNT.toString() ?? ""), ItemDetailViewCol(
ItemDetailViewCol("Quantity", prLinesList[index].qUANTITY.toString() ?? ""), LocaleKeys.code.tr(),
), prLinesList[index].iTEMCODE ?? "",
ItemDetailGrid( ),
ItemDetailViewCol("AMU (Last 3 months)", prLinesList[index].iTEMAMU.toString() ?? ""), ),
Container(), ItemDetailGrid(
isItLast: true, ItemDetailViewCol(
), LocaleKeys.unit.tr(),
// ItemDetailGrid( prLinesList[index].uOM ?? "",
// ItemDetailViewCol(getPrNotificationBodyList.pRHeader![1].hDRATTRIBUTENAME!, getPrNotificationBodyList.pRHeader![1].hDRATTRIBUTEVALUE ?? ""), ),
// Container(), ItemDetailViewCol(
// isItLast: true, LocaleKeys.priceSAR.tr(),
// ), prLinesList[index].uNITPRICE.toString() ?? "",
], ),
), ),
expanded: const SizedBox(), ItemDetailGrid(
).objectContainerView(), ItemDetailViewCol(
separatorBuilder: (cxt, index) => 12.height, LocaleKeys.amountSAR.tr(),
itemCount: prLinesList.length), 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() { Widget moNotificationDataView() {
return ListView.separated( return ListView.separated(
shrinkWrap: true, shrinkWrap: true,
physics: const NeverScrollableScrollPhysics(), physics: const NeverScrollableScrollPhysics(),
itemBuilder: (cxt, index) => Column( itemBuilder:
crossAxisAlignment: CrossAxisAlignment.start, (cxt, index) => Column(
mainAxisSize: MainAxisSize.min, crossAxisAlignment: CrossAxisAlignment.start,
children: [ mainAxisSize: MainAxisSize.min,
ItemDetailGrid( children: [
ItemDetailViewCol(LocaleKeys.code.tr(), moNotificationBodyList[index].iTEMCODE ?? ""), ItemDetailGrid(
ItemDetailViewCol(LocaleKeys.unit.tr(), moNotificationBodyList[index].uOM ?? ""), ItemDetailViewCol(
), LocaleKeys.code.tr(),
ItemDetailGrid( moNotificationBodyList[index].iTEMCODE ?? "",
ItemDetailViewCol(LocaleKeys.quantity.tr(), moNotificationBodyList[index].qUANTITY?.toString() ?? ""), ),
ItemDetailViewCol(LocaleKeys.dateRequired.tr(), moNotificationBodyList[index].dATEREQUIRED ?? ""), ItemDetailViewCol(
), LocaleKeys.unit.tr(),
ItemDetailGrid( moNotificationBodyList[index].uOM ?? "",
ItemDetailViewCol(LocaleKeys.lineStatus.tr(), moNotificationBodyList[index].lINESTATUS ?? ""), ),
ItemDetailViewCol(LocaleKeys.statusDate.tr(), moNotificationBodyList[index].sTATUSDATE ?? ""), ),
), ItemDetailGrid(
ItemDetailGrid( ItemDetailViewCol(
ItemDetailViewCol(LocaleKeys.transactionType.tr(), moNotificationBodyList[index].tRANSACTIONTYPENAME ?? ""), LocaleKeys.quantity.tr(),
ItemDetailViewCol(LocaleKeys.operatingUnit.tr(), moNotificationBodyList[index].oPERATINGUNIT ?? ""), moNotificationBodyList[index].qUANTITY?.toString() ?? "",
), ),
ItemDetailGrid( ItemDetailViewCol(
ItemDetailViewCol(LocaleKeys.organizationCode.tr(), moNotificationBodyList[index].oRGANIZATIONCODE ?? ""), LocaleKeys.dateRequired.tr(),
ItemDetailViewCol(LocaleKeys.organization.tr(), moNotificationBodyList[index].oRGANIZATIONNAME ?? ""), moNotificationBodyList[index].dATEREQUIRED ?? "",
), ),
ItemDetailGrid( ),
ItemDetailViewCol(LocaleKeys.fromSubInventory.tr(), moNotificationBodyList[index].fROMSUBINVENTORY ?? ""), ItemDetailGrid(
ItemDetailViewCol(LocaleKeys.fromLocator.tr(), moNotificationBodyList[index].fROMLOCATOR ?? ""), ItemDetailViewCol(
), LocaleKeys.lineStatus.tr(),
ItemDetailGrid( moNotificationBodyList[index].lINESTATUS ?? "",
ItemDetailViewCol(LocaleKeys.toSubInventory.tr(), moNotificationBodyList[index].tOSUBINVENTORY ?? ""), ),
ItemDetailViewCol(LocaleKeys.toLocator.tr(), moNotificationBodyList[index].tOLOCATOR ?? ""), ItemDetailViewCol(
), LocaleKeys.statusDate.tr(),
ItemDetailGrid(ItemDetailViewCol(LocaleKeys.shipToLocator.tr(), moNotificationBodyList[index].sHIPTOLOCATION ?? ""), Container()), moNotificationBodyList[index].sTATUSDATE ?? "",
12.height, ),
DefaultButton(LocaleKeys.itemHistory.tr(), () { ),
Navigator.pushNamed( ItemDetailGrid(
cxt, ItemDetailViewCol(
AppRoutes.itemHistory, LocaleKeys.transactionType.tr(),
arguments: ItemHistoryScreenParams(title: LocaleKeys.itemHistory.tr(), pItemId: moNotificationBodyList[index].iTEMID, pOrgId: moNotificationBodyList[index].oRGID), moNotificationBodyList[index].tRANSACTIONTYPENAME ?? "",
); ),
}) ItemDetailViewCol(
], LocaleKeys.operatingUnit.tr(),
).objectContainerView(title: moNotificationBodyList[index].dESCRIPTION ?? ""), moNotificationBodyList[index].oPERATINGUNIT ?? "",
separatorBuilder: (cxt, index) => 12.height, ),
itemCount: moNotificationBodyList.length); ),
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() { Widget itemCreationLinesView() {
return ListView.separated( return ListView.separated(
shrinkWrap: true, shrinkWrap: true,
physics: const NeverScrollableScrollPhysics(), physics: const NeverScrollableScrollPhysics(),
itemBuilder: (cxt, index) => Column( itemBuilder:
crossAxisAlignment: CrossAxisAlignment.start, (cxt, index) => Column(
mainAxisSize: MainAxisSize.min, crossAxisAlignment: CrossAxisAlignment.start,
children: [ mainAxisSize: MainAxisSize.min,
ItemDetailGrid( children: [
ItemDetailViewCol(LocaleKeys.productName.tr(), itemCreationLines[index].pRODUCTNAME ?? ""), ItemDetailGrid(
ItemDetailViewCol(LocaleKeys.productDescription.tr(), itemCreationLines[index].pRODUCTDESCRIPTION ?? ""), ItemDetailViewCol(
), LocaleKeys.productName.tr(),
ItemDetailGrid( itemCreationLines[index].pRODUCTNAME ?? "",
ItemDetailViewCol(LocaleKeys.unitPrice.tr(), itemCreationLines[index].uNITPRICE?.toString() ?? ""), ),
ItemDetailViewCol(LocaleKeys.manufacturerName.tr(), itemCreationLines[index].uSERMANUFACTURERNAME ?? ""), ItemDetailViewCol(
), LocaleKeys.productDescription.tr(),
ItemDetailGrid( itemCreationLines[index].pRODUCTDESCRIPTION ?? "",
ItemDetailViewCol(LocaleKeys.manufacturerPartName.tr(), itemCreationLines[index].uSERMFGPARTNUM ?? ""), ),
ItemDetailViewCol(LocaleKeys.supplierName.tr(), itemCreationLines[index].sUPPLIERNAME ?? ""), ),
), ItemDetailGrid(
ItemDetailGrid( ItemDetailViewCol(
ItemDetailViewCol(LocaleKeys.supplierContact.tr(), itemCreationLines[index].sUPPLIERCONTACT ?? ""), LocaleKeys.unitPrice.tr(),
ItemDetailViewCol(LocaleKeys.chargeToPatient.tr(), itemCreationLines[index].cHARGETOPATIENT ?? ""), itemCreationLines[index].uNITPRICE?.toString() ?? "",
), ),
ItemDetailGrid( ItemDetailViewCol(
ItemDetailViewCol(LocaleKeys.justification.tr(), itemCreationLines[index].jUSTIFICATION ?? ""), LocaleKeys.manufacturerName.tr(),
ItemDetailViewCol(LocaleKeys.itemCode.tr(), itemCreationLines[index].iTEMCODE ?? ""), itemCreationLines[index].uSERMANUFACTURERNAME ?? "",
), ),
ItemDetailGrid( ),
ItemDetailViewCol(LocaleKeys.itemDescription.tr(), itemCreationLines[index].iTEMDESCRIPTION ?? ""), ItemDetailGrid(
ItemDetailViewCol(LocaleKeys.groupCode.tr(), itemCreationLines[index].iTEMGROUPCODE ?? ""), ItemDetailViewCol(
), LocaleKeys.manufacturerPartName.tr(),
ItemDetailGrid( itemCreationLines[index].uSERMFGPARTNUM ?? "",
ItemDetailViewCol(LocaleKeys.groupDescription.tr(), itemCreationLines[index].iTEMGROUP ?? ""), ),
ItemDetailViewCol(LocaleKeys.subgroupCode.tr(), itemCreationLines[index].iTEMSUBGROUPCODE ?? ""), ItemDetailViewCol(
), LocaleKeys.supplierName.tr(),
ItemDetailGrid( itemCreationLines[index].sUPPLIERNAME ?? "",
ItemDetailViewCol(LocaleKeys.subgroupDescription.tr(), itemCreationLines[index].iTEMSUBGROUP ?? ""), ),
ItemDetailViewCol(LocaleKeys.primaryUOM.tr(), itemCreationLines[index].pRIMARYUOM ?? ""), ),
), ItemDetailGrid(
ItemDetailGrid( ItemDetailViewCol(
ItemDetailViewCol(LocaleKeys.manufacturerName.tr(), itemCreationLines[index].sTANDARDMANUFACTURERNAME ?? ""), LocaleKeys.supplierContact.tr(),
ItemDetailViewCol(LocaleKeys.manufacturerPartName.tr(), itemCreationLines[index].sTANDARDMFGPARTNUM ?? ""), itemCreationLines[index].sUPPLIERCONTACT ?? "",
), ),
ItemDetailGrid( ItemDetailViewCol(
ItemDetailViewCol(LocaleKeys.templateName.tr(), itemCreationLines[index].tEMPLATENAME ?? ""), LocaleKeys.chargeToPatient.tr(),
ItemDetailViewCol(LocaleKeys.itemCreationStatus.tr(), itemCreationLines[index].iTEMCREATIONSTATUS ?? ""), itemCreationLines[index].cHARGETOPATIENT ?? "",
), ),
ItemDetailGrid( ),
ItemDetailViewCol(LocaleKeys.standardizationApprovalStatus.tr(), itemCreationLines[index].sTANDARDSTATUS ?? ""), ItemDetailGrid(
ItemDetailViewCol(LocaleKeys.standardizationApprovalRejectionReason.tr(), itemCreationLines[index].sTANDARDREJECTREASON ?? ""), ItemDetailViewCol(
isItLast: true, LocaleKeys.justification.tr(),
), itemCreationLines[index].jUSTIFICATION ?? "",
], ),
).objectContainerView(title: itemCreationLines[index].iTEMDESCRIPTION!), ItemDetailViewCol(
separatorBuilder: (cxt, index) => 12.height, LocaleKeys.itemCode.tr(),
itemCount: itemCreationLines.length); 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 { void getPRDetails(BuildContext context, String poLineID) async {
try { try {
Utils.showLoading(context); Utils.showLoading(context);
GetPRInformationList? getPRInformationList = GetPRInformationList(); GetPRInformationList? getPRInformationList = GetPRInformationList();
getPRInformationList = await WorkListApiClient().getPRDetailsForPO(poLineID); getPRInformationList = await WorkListApiClient().getPRDetailsForPO(
poLineID,
);
Utils.hideLoading(context); Utils.hideLoading(context);
Navigator.pushNamed( Navigator.pushNamed(
context, context,
AppRoutes.itemHistory, AppRoutes.itemHistory,
arguments: ItemHistoryScreenParams( 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) { } catch (ex) {
Utils.hideLoading(context); Utils.hideLoading(context);

@ -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'; import 'package:mohem_flutter_app/widgets/dynamic_forms/dynamic_textfield_widget.dart';
class WorkListAdvanceSearch extends StatefulWidget { 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); WorkListAdvanceSearch(this.onSearch, {Key? key}) : super(key: key);

Loading…
Cancel
Save