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": "انشاء لأجل",
"requestCreatedSuccessfully": "تم انشاء الطلب بنجاح",
"search": "بحث",
"filterEnterPrDetailsHere": "ادخل تفاصيل طلب الشراء هنا",
"filterEnterPoDetailsHere": "ادخل تفاصيل أمر الشراء هنا",
"wantToReject": "هل انت متأكد تريد الرفض",
"requestType": "نوع الطلب",
"employeeDigitalID": "هويةالموظف الرقمية",
@ -667,9 +669,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 أشهر)"
}

@ -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",
@ -665,8 +667,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)"
}

@ -71,7 +71,14 @@ class LoginApiClient {
Future<BasicMemberInformationModel?> mohemmSendActivationCodeByOTPNotificationType(int isMobileFingerPrint, String? mobileNumber, int optSendType, String? pUserName) async {
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);
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 {
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);
return await ApiClient().postJsonForObject((json) {
GenericResponseModel responseData = GenericResponseModel.fromJson(json);

@ -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 {

@ -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;
}
}

@ -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<String,dynamic> _en_US = {
"mohemm": "Mohemm",
@ -1354,7 +1361,14 @@ static const Map<String,dynamic> _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<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 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';
@ -656,5 +658,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';
}

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

@ -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<String, dynamic> 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<String, dynamic> 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<String, dynamic> 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;
}
}

@ -57,6 +57,15 @@ class _MonthlyAttendanceScreenState extends State<MonthlyAttendanceScreen> {
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<MonthlyAttendanceScreen> {
// bool isDayIsPresent = getDayHoursTypeDetailsList[val - 1].aTTENDEDFLAG == 'Y';
// bool isDayIsAbsent = getDayHoursTypeDetailsList[val - 1].aTTENDEDFLAG == 'N' && getDayHoursTypeDetailsList[val - 1].aBSENTFLAG == 'Y';
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) {
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<MonthlyAttendanceScreen> {
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<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(
margin: const EdgeInsets.all(4),
@ -430,14 +471,22 @@ class _MonthlyAttendanceScreenState extends State<MonthlyAttendanceScreen> {
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<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.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;

@ -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") {

@ -326,7 +326,7 @@ class _AddLeaveBalanceScreenState extends State<AddLeaveBalanceScreen> {
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<AddLeaveBalanceScreen> {
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<AddLeaveBalanceScreen> {
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<AddLeaveBalanceScreen> {
).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<AddLeaveBalanceScreen> {
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<AddLeaveBalanceScreen> {
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<AddLeaveBalanceScreen> {
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<AddLeaveBalanceScreen> {
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<AddLeaveBalanceScreen> {
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<AddLeaveBalanceScreen> {
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();

@ -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<ChildEducationAssistance> createState() => _ChildEducationAssistanceState();
}
class _ChildEducationAssistanceState extends State<ChildEducationAssistance> {
GetMenuEntriesList? menuEntry;
List<GetEmployeeContactsList> 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<List<GetEmployeeContactsList>> snapshot) {
if (snapshot.connectionState == ConnectionState.waiting) {
return const Center(child: CircularProgressIndicator());
} else if (snapshot.hasData) {
List<GetEmployeeContactsList> 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);
}
}
}

@ -61,23 +61,24 @@ class _TicketDetailedScreenState extends State<TicketDetailedScreen> {
appBar: AppBarWidget(context, title: LocaleKeys.ticketDetails.tr()),
body: Column(
children: <Widget>[
ListView(
padding: const EdgeInsets.all(21),
physics: const BouncingScrollPhysics(),
children: <Widget>[
if (dashboardProviderModel == null && dashboardProviderModel?.accrualTicketBalanceList == null) ...<Widget>[Utils.getNoDataWidget(context).paddingOnly(top: 50)] else ...<Widget>[
Container(
padding: const EdgeInsets.all(16.0),
decoration: BoxDecoration(
color: Colors.white,
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>[
Row(
children: <Widget>[
LocaleKeys.currentTicketBalance.tr().toText20().expanded,
Expanded(
child: ListView(
padding: const EdgeInsets.all(21),
physics: const BouncingScrollPhysics(),
children: <Widget>[
if (dashboardProviderModel == null && dashboardProviderModel?.accrualTicketBalanceList == null) ...<Widget>[Utils.getNoDataWidget(context).paddingOnly(top: 50)] else ...<Widget>[
Container(
padding: const EdgeInsets.all(16.0),
decoration: BoxDecoration(
color: Colors.white,
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>[
Row(
children: <Widget>[
Expanded(child: LocaleKeys.currentTicketBalance.tr().toText20()),
Row(
children: <Widget>[
const Icon(Icons.calendar_month_rounded, color: MyColors.darkIconColor, size: 16),
@ -116,11 +117,10 @@ class _TicketDetailedScreenState extends State<TicketDetailedScreen> {
),
const SizedBox(height: 21),
(dashboardProviderModel != null && dashboardProviderModel!.ticketHistoryTransactionList != null && dashboardProviderModel!.ticketHistoryTransactionList!.isNotEmpty)
? ListView(
shrinkWrap: true,
physics: const NeverScrollableScrollPhysics(),
? Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
LocaleKeys.ticketHistory.tr().toText20().expanded,
LocaleKeys.ticketHistory.tr().toText20(),
12.height,
ListView.separated(
physics: const NeverScrollableScrollPhysics(),
@ -220,9 +220,10 @@ class _TicketDetailedScreenState extends State<TicketDetailedScreen> {
],
)
: 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, 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/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<WorkListScreen> {
final ScrollController _controller = ScrollController();
int pNotificationType = 1;
String prPoFilterText = "";
ScrollController? _scrollController;
@override
@ -318,6 +320,7 @@ class _WorkListScreenState extends State<WorkListScreen> {
}
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<WorkListScreen> {
.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<WorkListScreen> {
],
)
: 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<WorkListScreen> {
}
}
Utils.showLoading(context);
workList = await WorkListApiClient().getWorkList(
List<WorkListResponseModel>? responseList = await WorkListApiClient().getWorkList(
pageNumber,
selectedItemTypeID,
selectedViewID.toString(),
@ -516,6 +533,8 @@ class _WorkListScreenState extends State<WorkListScreen> {
pSentDate: searchByDate,
pSearchItemType: searchByInput,
);
workList = responseList;
prPoFilterText = "";
workListItemIndex = index;
AppState().setWorkList = workList;
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) {
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<WorkListScreen> {
setState(() {});
}
} else {
workList!.remove(data);
workList!.removeWhere((item) => item.nOTIFICATIONID == data.nOTIFICATIONID);
AppState().setWorkList = workList;
if (data.iTEMTYPE == "ITG") {
} else {

@ -602,6 +602,7 @@ class InfoFragment extends StatelessWidget {
ItemDetailViewCol(
LocaleKeys.responder.tr(), workListData!.rESPONDER ?? ""),
),
Column(
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_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);

@ -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);

Loading…
Cancel
Save