diff --git a/assets/langs/ar-SA.json b/assets/langs/ar-SA.json index fe71e90..3b98c3e 100644 --- a/assets/langs/ar-SA.json +++ b/assets/langs/ar-SA.json @@ -52,6 +52,30 @@ "confirm": "تؤكد", "passwordChangedSuccessfully": "تم تغيير الرقم السري بنجاح", "itemsForSale": "سلع للبيع", + "attendanceDetails": "تفاصيل الحضور", + "order": "الطلبات", + "earlyOut": "الخروج مبكرا", + "shortage": "ساعات التقصير", + "excess": "Excess", + "lateIn": "القدوم المتاخر", + "approvedCheckOut": "وقت الخروج", + "approvedCheckIn": "وقت الدخول", + "actualCheckOut": "وقت الخروج", + "actualCheckIn": "وقت الدخول", + "present": "حضور", + "pres": "حضور", + "shiftTime": "وقت التناوب", + "absent": "غياب", + "attendance": "الحضور", + "scheduleDays": "ايام العمل", + "offDays": "ايام الراحه", + "nonAnalyzed": "لايوجد تحليل", + "shortageHour": "ساعات التقصير", + "stats": "الحاله", + "completed": "تم اكمال", + "msg": "Hello {} in the {} world ", + "msg_named": "{} are written in the {lang} language", + "clickMe": "Click me", "doNotUseRecentPassword": "لا تستخدم كلمة مرور حديثة", "atLeastOneLowercase": "حرف صغير واحد على الأقل", "atLeastOneUppercase": "حرف كبير واحد على الأقل", @@ -171,9 +195,6 @@ "rfqUOM": "RFQ UOM", "rfqQty": "RFQ الكمية", "rfqNumber": "رقم RFQ", - "msg": "Hello {} in the {} world ", - "msg_named": "{} are written in the {lang} language", - "clickMe": "Click me", "human": "بشري", "resources": "موارد", "details": "تفاصيل", diff --git a/assets/langs/en-US.json b/assets/langs/en-US.json index a1bfdfa..6b365b8 100644 --- a/assets/langs/en-US.json +++ b/assets/langs/en-US.json @@ -52,6 +52,27 @@ "confirm": "Confirm", "passwordChangedSuccessfully": "Password changed successfully", "itemsForSale": "Items for Sale", + "attendanceDetails": "Attendance Details", + "order": "order", + "earlyOut" : "Early Out", + "shortage" : "Shortage", + "excess" : "Excess", + "lateIn" : "Late In", + "approvedCheckOut": "Approved Check Out", + "approvedCheckIn":"Approved Check In", + "actualCheckOut": "Actual Check Out", + "actualCheckIn": "Actual Check In", + "present": "PRESENT 11", + "pres" : "present", + "shiftTime": "Shift Time", + "absent": "ABSENT 10", + "attendance": "Attendance", + "scheduleDays" :"Schedule\nDays", + "offDays":"Off\nDays", + "nonAnalyzed" : "Non\nAnalyzed", + "shortageHour": "Shortage\nHour", + "stats": "Stats", + "completed": "Completed", "doNotUseRecentPassword": "Do not use recent password", "atLeastOneLowercase": "At least one lowercase", "atLeastOneUppercase": "At least one uppercase", @@ -203,6 +224,7 @@ "relatedTo": "Related To", "requestDate": "Request Date", "analyzedDate": "Analyzed Date", + "approvedCheckIn" : "Approved Check In", "urgent": "Urgent", "requestDetails": "Request Details", "approvalLevel": "Approval Level", diff --git a/lib/api/monthlyAttendance_api_client.dart b/lib/api/monthlyAttendance_api_client.dart new file mode 100644 index 0000000..4f6aca7 --- /dev/null +++ b/lib/api/monthlyAttendance_api_client.dart @@ -0,0 +1,72 @@ + +import 'dart:async'; + +import 'package:mohem_flutter_app/app_state/app_state.dart'; +import 'package:mohem_flutter_app/classes/consts.dart'; +import 'package:mohem_flutter_app/models/generic_response_model.dart'; +import 'package:mohem_flutter_app/models/get_day_hours_type_details_list_model.dart'; +import 'package:mohem_flutter_app/models/get_mobile_login_info_list_model.dart'; +import 'package:mohem_flutter_app/models/get_schedule_shifts_details_list_model.dart'; +import 'package:mohem_flutter_app/models/get_time_card_summary_list_model.dart'; +import 'api_client.dart'; + +class MonthlyAttendanceApiClient { + static final MonthlyAttendanceApiClient _instance = MonthlyAttendanceApiClient._internal(); + + MonthlyAttendanceApiClient._internal(); + + factory MonthlyAttendanceApiClient() => _instance; + + + Future getTimeCardSummary(String month, int year) async { + String url = "${ApiConsts.erpRest}GET_TIME_CARD_SUMMARY"; + Map postParams = { + "P_MENU_TYPE": "E", + "P_SELECTED_RESP_ID": -999, + "SearchMonth": month, + "SearchYear": year, + }; + postParams.addAll(AppState().postParamsJson); + return await ApiClient().postJsonForObject((json) { + GenericResponseModel? responseData = GenericResponseModel.fromJson(json); + return (responseData.getTimeCardSummaryList?.length ?? 0) > 0 ? responseData.getTimeCardSummaryList!.first : null; + }, url, postParams); + } + + Future> getDayHoursTypeDetails(String month, int year) async { + String url = "${ApiConsts.erpRest}GET_DAY_HOURS_TYPE_DETAILS"; + Map postParams = { + "P_MENU_TYPE": "E", + "P_PAGE_LIMIT": 100, + "P_PAGE_NUM": 1, + "P_SELECTED_RESP_ID": -999, + "SearchMonth": month, + "SearchYear": year, + }; + postParams.addAll(AppState().postParamsJson); + // postParams["DeviceToken"] = deviceToken; + // postParams["DeviceType"] = deviceType; + return await ApiClient().postJsonForObject((json) { + GenericResponseModel? responseData = GenericResponseModel.fromJson(json); + print("Response Data______"); + print(responseData.getDayHoursTypeDetailsList!.length); + return responseData.getDayHoursTypeDetailsList ?? []; + }, url, postParams); + } + + + Future getScheduleShiftsDetails(int pRTPID) async { + String url = "${ApiConsts.erpRest}GET_SCHEDULE_SHIFTS_DETAILS"; + Map postParams = { + "P_PAGE_LIMIT": 10, + "P_PAGE_NUM": 1, + "P_RTP_ID": pRTPID, + }; + postParams.addAll(AppState().postParamsJson); + return await ApiClient().postJsonForObject((json) { + GenericResponseModel? responseData = GenericResponseModel.fromJson(json); + return (responseData.getScheduleShiftsDetailsList?.length ?? 0) > 0 ? responseData.getScheduleShiftsDetailsList!.first : null; + }, url, postParams); + } + +} \ No newline at end of file diff --git a/lib/api/profile_api_client.dart b/lib/api/profile_api_client.dart new file mode 100644 index 0000000..9109815 --- /dev/null +++ b/lib/api/profile_api_client.dart @@ -0,0 +1,73 @@ + + +import 'dart:async'; + +import 'package:mohem_flutter_app/app_state/app_state.dart'; +import 'package:mohem_flutter_app/classes/consts.dart'; +import 'package:mohem_flutter_app/models/generic_response_model.dart'; +import 'package:mohem_flutter_app/models/get_employee_address_model.dart'; +import 'package:mohem_flutter_app/models/get_employee_basic_details.model.dart'; +import 'package:mohem_flutter_app/models/get_employee_contacts.model.dart'; +import 'package:mohem_flutter_app/models/get_employee_phones_model.dart'; +import 'api_client.dart'; + +class ProfileApiClient { + static final ProfileApiClient _instance = ProfileApiClient._internal(); + + ProfileApiClient._internal(); + + factory ProfileApiClient() => _instance; + + + Future getEmployeeContacts() async { + String url = "${ApiConsts.erpRest}GET_EMPLOYEE_CONTACTS"; + Map postParams = { + "P_MENU_TYPE": "E", + "P_SELECTED_RESP_ID": -999, + }; + postParams.addAll(AppState().postParamsJson); + return await ApiClient().postJsonForObject((json) { + GenericResponseModel? responseData = GenericResponseModel.fromJson(json); + return (responseData.getEmployeeContactsList?.length ?? 0) > 0 ? responseData.getEmployeeContactsList!.first : null; + }, url, postParams); + } + + Future> getEmployeeBasicDetails() async { + String url = "${ApiConsts.erpRest}GET_EMPLOYEE_BASIC_DETAILS"; + Map postParams = { + "P_MENU_TYPE": "E", + "P_SELECTED_RESP_ID": -999, + }; + postParams.addAll(AppState().postParamsJson); + return await ApiClient().postJsonForObject((json) { + GenericResponseModel? responseData = GenericResponseModel.fromJson(json); + return responseData.getEmployeeBasicDetailsList ?? []; + }, url, postParams); + } + + Future getEmployeePhones() async { + String url = "${ApiConsts.erpRest}GET_EMPLOYEE_PHONES"; + Map postParams = { + "P_MENU_TYPE": "E", + "P_SELECTED_RESP_ID": -999, + }; + postParams.addAll(AppState().postParamsJson); + return await ApiClient().postJsonForObject((json) { + GenericResponseModel? responseData = GenericResponseModel.fromJson(json); + return (responseData.getEmployeePhonesList?.length ?? 0) > 0 ? responseData.getEmployeePhonesList!.first : null; + }, url, postParams); + } + + Future getEmployeeAddress() async { + String url = "${ApiConsts.erpRest}GET_EMPLOYEE_ADDRESS"; + Map postParams = { + "P_MENU_TYPE": "E", + "P_SELECTED_RESP_ID": -999, + }; + postParams.addAll(AppState().postParamsJson); + return await ApiClient().postJsonForObject((json) { + GenericResponseModel? responseData = GenericResponseModel.fromJson(json); + return (responseData.getEmployeeAddressList?.length ?? 0) > 0 ? responseData.getEmployeeAddressList!.first : null; + }, url, postParams); + } +} \ No newline at end of file diff --git a/lib/classes/colors.dart b/lib/classes/colors.dart index 6036534..08ce1c5 100644 --- a/lib/classes/colors.dart +++ b/lib/classes/colors.dart @@ -27,4 +27,14 @@ class MyColors { static const Color white = Color(0xffffffff); static const Color green = Color(0xffffffff); static const Color borderColor = Color(0xffE8E8E8); + // static const Color grey67Color = Color(0xff676767); + static const Color whiteColor = Color(0xFFEEEEEE); + static const Color greenColor = Color(0xff1FA269); + static const Color lightGreenColor = Color(0xff2AB2AB); + static const Color darkGreyColor = Color(0xff464646); + static const Color greyA5Color = Color(0xffA5A5A5); + static const Color blackColor = Color(0xff000014); + static const Color grey3AColor = Color(0xff2E303A); + static const Color darkColor = Color(0xff000015); + static const Color lightGrayColor = Color(0xff808080); } diff --git a/lib/config/routes.dart b/lib/config/routes.dart index b614080..30adb5a 100644 --- a/lib/config/routes.dart +++ b/lib/config/routes.dart @@ -16,6 +16,9 @@ import 'package:mohem_flutter_app/ui/work_list/item_history_screen.dart'; import 'package:mohem_flutter_app/ui/work_list/itg_detail_screen.dart'; import 'package:mohem_flutter_app/ui/work_list/worklist_detail_screen.dart'; import 'package:mohem_flutter_app/ui/work_list/work_list_screen.dart'; +import 'package:mohem_flutter_app/ui/bottom_sheets/attendence_details_bottom_sheet.dart'; +import 'package:mohem_flutter_app/ui/attendance/monthly_attendance.dart'; +import 'package:mohem_flutter_app/ui/profile/profile.dart'; class AppRoutes { static const String splash = "/splash"; @@ -44,6 +47,14 @@ class AppRoutes { static const String addWorkFromHome = "/addWorkFromHome"; //profile + //Attendance + static const String attendance = "/attendance"; + static const String monthlyAttendance = "/monthlyAttendance"; + + //Bottom Sheet + static const String attendanceDetailsBottomSheet = "/attendanceDetailsBottomSheet"; + + //Profile static const String profile = "/profile"; static final Map routes = { @@ -70,5 +81,13 @@ class AppRoutes { workFromHome: (context) => WorkFromHomeScreen(), addWorkFromHome: (context) => AddWorkFromHomeScreen(), profile: (context) => ProfileScreen(), + //Attendance + monthlyAttendance: (context) => MonthlyAttendance(), + + //Bottom Sheet + attendanceDetailsBottomSheet: (context) => AttendenceDetailsBottomSheet(), + + //Profile + //profile: (context) => Profile(), }; } diff --git a/lib/extensions/string_extensions.dart b/lib/extensions/string_extensions.dart index 2db6135..a953734 100644 --- a/lib/extensions/string_extensions.dart +++ b/lib/extensions/string_extensions.dart @@ -63,6 +63,10 @@ extension EmailValidator on String { this, style: TextStyle(color: color ?? MyColors.darkTextColor, fontSize: 17, letterSpacing: -0.68, fontWeight: isBold ? FontWeight.bold : FontWeight.w600), ); + Widget toText20({Color? color, bool isBold = false}) => Text( + this, + style: TextStyle(fontSize: 20, fontWeight: isBold ? FontWeight.bold : FontWeight.w600, color: color ?? MyColors.darkTextColor, letterSpacing: -0.4), + ); Widget toText22({Color? color, bool isBold = false}) => Text( this, @@ -79,6 +83,11 @@ extension EmailValidator on String { style: TextStyle(height: 32 / 32, color: color ?? MyColors.darkTextColor, fontSize: 32, letterSpacing: -1.92, fontWeight: isBold ? FontWeight.bold : FontWeight.w600), ); + Widget toText44({Color? color, bool isBold = false}) => Text( + this, + style: TextStyle(height: 32 / 32, color: color ?? MyColors.darkTextColor, fontSize: 44, letterSpacing: -2.64, fontWeight: isBold ? FontWeight.bold : FontWeight.w600), + ); + Widget toSectionHeading({String upperHeading = "", String lowerHeading = ""}) { String upper = ""; String lower = ""; diff --git a/lib/models/generic_response_model.dart b/lib/models/generic_response_model.dart index 3f3e3b7..8e96eb7 100644 --- a/lib/models/generic_response_model.dart +++ b/lib/models/generic_response_model.dart @@ -4,6 +4,10 @@ import 'package:mohem_flutter_app/models/get_attachement_list_model.dart'; import 'package:mohem_flutter_app/models/get_basic_det_ntf_body_list_model.dart'; import 'package:mohem_flutter_app/models/get_eit_dff_structure_list_model.dart'; import 'package:mohem_flutter_app/models/get_eit_transaction_list_model.dart'; +import 'package:mohem_flutter_app/models/get_day_hours_type_details_list_model.dart'; +import 'package:mohem_flutter_app/models/get_employee_basic_details.model.dart'; +import 'package:mohem_flutter_app/models/get_employee_contacts.model.dart'; +import 'package:mohem_flutter_app/models/get_employee_phones_model.dart'; import 'package:mohem_flutter_app/models/get_item_creation_ntf_body_list_model.dart'; import 'package:mohem_flutter_app/models/get_mo_Item_history_list_model.dart'; import 'package:mohem_flutter_app/models/get_mo_notification_body_list_model.dart'; @@ -11,8 +15,10 @@ import 'package:mohem_flutter_app/models/get_notification_buttons_list_model.dar import 'package:mohem_flutter_app/models/get_po_Item_history_list_model.dart'; import 'package:mohem_flutter_app/models/get_po_notification_body_list_model.dart'; import 'package:mohem_flutter_app/models/get_quotation_analysis_list_model.dart'; +import 'package:mohem_flutter_app/models/get_schedule_shifts_details_list_model.dart'; import 'package:mohem_flutter_app/models/get_stamp_ms_notification_body_list_model.dart'; import 'package:mohem_flutter_app/models/get_stamp_ns_notification_body_list_model.dart'; +import 'package:mohem_flutter_app/models/get_time_card_summary_list_model.dart'; import 'package:mohem_flutter_app/models/member_login_list_model.dart'; import 'package:mohem_flutter_app/models/notification_action_model.dart'; import 'package:mohem_flutter_app/models/notification_get_respond_attributes_list_model.dart'; @@ -106,17 +112,17 @@ class GenericResponseModel { List? getContactDffStructureList; List? getContactNotificationBodyList; List? getCountriesList; - List? getDayHoursTypeDetailsList; + List? getDayHoursTypeDetailsList; List? getDeductionsList; List? getDefaultValueList; List? getEITCollectionNotificationBodyList; List? getEITDFFStructureList; List? getEITTransactionList; List? getEarningsList; - List? getEmployeeAddressList; - List? getEmployeeBasicDetailsList; - List? getEmployeeContactsList; - List? getEmployeePhonesList; + List? getEmployeeAddressList; + List? getEmployeeBasicDetailsList; + List? getEmployeeContactsList; + List? getEmployeePhonesList; List? getEmployeeSubordinatesList; List? getFliexfieldStructureList; List? getHrCollectionNotificationBodyList; @@ -151,7 +157,7 @@ class GenericResponseModel { List? getSITCollectionNotificationBodyList; List? getSITDFFStructureList; List? getSITTransactionList; - List? getScheduleShiftsDetailsList; + List? getScheduleShiftsDetailsList; List? getShiftTypesList; List? getStampMsNotificationBodyList; List? getStampNsNotificationBodyList; @@ -163,7 +169,7 @@ class GenericResponseModel { List? getTermColsStructureList; List? getTermDffStructureList; List? getTermNotificationBodyList; - List? getTimeCardSummaryList; + List? getTimeCardSummaryList; List? getUserItemTypesList; List? getVacationRulesList; List? getVaccinationOnHandList; @@ -639,7 +645,12 @@ class GenericResponseModel { getContactDffStructureList = json['GetContactDffStructureList']; getContactNotificationBodyList = json['GetContactNotificationBodyList']; getCountriesList = json['GetCountriesList']; - getDayHoursTypeDetailsList = json['GetDayHoursTypeDetailsList']; + if (json['GetDayHoursTypeDetailsList'] != null) { + getDayHoursTypeDetailsList = []; + json['GetDayHoursTypeDetailsList'].forEach((v) { + getDayHoursTypeDetailsList!.add(new GetDayHoursTypeDetailsList.fromJson(v)); + }); + } getDeductionsList = json['GetDeductionsList']; getDefaultValueList = json['GetDefaultValueList']; getEITCollectionNotificationBodyList = json['GetEITCollectionNotificationBodyList']; @@ -656,10 +667,30 @@ class GenericResponseModel { }); } getEarningsList = json['GetEarningsList']; - getEmployeeAddressList = json['GetEmployeeAddressList']; - getEmployeeBasicDetailsList = json['GetEmployeeBasicDetailsList']; - getEmployeeContactsList = json['GetEmployeeContactsList']; - getEmployeePhonesList = json['GetEmployeePhonesList']; + if (json['GetEmployeeAddressList'] != null) { + getEmployeeAddressList = []; + json['GetEmployeeAddressList'].forEach((v) { + getEmployeeAddressList!.add(dynamic); + }); + } + if (json['GetEmployeeBasicDetailsList'] != null) { + getEmployeeBasicDetailsList = []; + json['GetEmployeeBasicDetailsList'].forEach((v) { + getEmployeeBasicDetailsList!.add(new GetEmployeeBasicDetailsList.fromJson(v)); + }); + } + if (json['GetEmployeeContactsList'] != null) { + getEmployeeContactsList = []; + json['GetEmployeeContactsList'].forEach((v) { + getEmployeeContactsList!.add(new GetEmployeeContactsList.fromJson(v)); + }); + } + if (json['GetEmployeePhonesList'] != null) { + getEmployeePhonesList = []; + json['GetEmployeePhonesList'].forEach((v) { + getEmployeePhonesList!.add(new GetEmployeePhonesList.fromJson(v)); + }); + } getEmployeeSubordinatesList = json['GetEmployeeSubordinatesList']; getFliexfieldStructureList = json['GetFliexfieldStructureList']; getHrCollectionNotificationBodyList = json['GetHrCollectionNotificationBodyList']; @@ -724,7 +755,12 @@ class GenericResponseModel { getSITCollectionNotificationBodyList = json['GetSITCollectionNotificationBodyList']; getSITDFFStructureList = json['GetSITDFFStructureList']; getSITTransactionList = json['GetSITTransactionList']; - getScheduleShiftsDetailsList = json['GetScheduleShiftsDetailsList']; + if (json['GetScheduleShiftsDetailsList'] != null) { + getScheduleShiftsDetailsList = []; + json['GetScheduleShiftsDetailsList'].forEach((v) { + getScheduleShiftsDetailsList!.add(new GetScheduleShiftsDetailsList.fromJson(v)); + }); + } getShiftTypesList = json['GetShiftTypesList']; if (json['GetStampMsNotificationBodyList'] != null) { @@ -755,7 +791,13 @@ class GenericResponseModel { getTermColsStructureList = json['GetTermColsStructureList']; getTermDffStructureList = json['GetTermDffStructureList']; getTermNotificationBodyList = json['GetTermNotificationBodyList']; - getTimeCardSummaryList = json['GetTimeCardSummaryList']; + + if (json['GetTimeCardSummaryList'] != null) { + getTimeCardSummaryList = []; + json['GetTimeCardSummaryList'].forEach((v) { + getTimeCardSummaryList!.add(new GetTimeCardSummaryList.fromJson(v)); + }); + } getUserItemTypesList = json['GetUserItemTypesList']; getVacationRulesList = json['GetVacationRulesList']; getVaccinationOnHandList = json['GetVaccinationOnHandList']; @@ -1014,7 +1056,9 @@ class GenericResponseModel { data['GetContactDffStructureList'] = this.getContactDffStructureList; data['GetContactNotificationBodyList'] = this.getContactNotificationBodyList; data['GetCountriesList'] = this.getCountriesList; - data['GetDayHoursTypeDetailsList'] = this.getDayHoursTypeDetailsList; + if (this.getDayHoursTypeDetailsList != null) { + data['GetDayHoursTypeDetailsList'] = this.getDayHoursTypeDetailsList!.map((v) => v.toJson()).toList(); + } data['GetDeductionsList'] = this.getDeductionsList; data['GetDefaultValueList'] = this.getDefaultValueList; data['GetEITCollectionNotificationBodyList'] = this.getEITCollectionNotificationBodyList; @@ -1025,10 +1069,18 @@ class GenericResponseModel { data['GetEITTransactionList'] = this.getEITTransactionList!.map((v) => v.toJson()).toList(); } data['GetEarningsList'] = this.getEarningsList; - data['GetEmployeeAddressList'] = this.getEmployeeAddressList; - data['GetEmployeeBasicDetailsList'] = this.getEmployeeBasicDetailsList; - data['GetEmployeeContactsList'] = this.getEmployeeContactsList; - data['GetEmployeePhonesList'] = this.getEmployeePhonesList; + if (this.getEmployeeAddressList != null) { + data['GetEmployeeAddressList'] = this.getEmployeeAddressList!.map((v) => v.toJson()).toList(); + } + if (this.getEmployeeBasicDetailsList != null) { + data['GetEmployeeBasicDetailsList'] = this.getEmployeeBasicDetailsList!.map((v) => v.toJson()).toList(); + } + if (this.getEmployeeContactsList != null) { + data['GetEmployeeContactsList'] = this.getEmployeeContactsList!.map((v) => v.toJson()).toList(); + } + if (this.getEmployeePhonesList != null) { + data['GetEmployeePhonesList'] = this.getEmployeePhonesList!.map((v) => v.toJson()).toList(); + } data['GetEmployeeSubordinatesList'] = this.getEmployeeSubordinatesList; data['GetFliexfieldStructureList'] = this.getFliexfieldStructureList; data['GetHrCollectionNotificationBodyList'] = this.getHrCollectionNotificationBodyList; @@ -1083,7 +1135,9 @@ class GenericResponseModel { data['GetSITCollectionNotificationBodyList'] = this.getSITCollectionNotificationBodyList; data['GetSITDFFStructureList'] = this.getSITDFFStructureList; data['GetSITTransactionList'] = this.getSITTransactionList; - data['GetScheduleShiftsDetailsList'] = this.getScheduleShiftsDetailsList; + if (this.getScheduleShiftsDetailsList != null) { + data['GetScheduleShiftsDetailsList'] = this.getScheduleShiftsDetailsList!.map((v) => v.toJson()).toList(); + } data['GetShiftTypesList'] = this.getShiftTypesList; if (this.getStampMsNotificationBodyList != null) { @@ -1108,7 +1162,9 @@ class GenericResponseModel { data['GetTermColsStructureList'] = this.getTermColsStructureList; data['GetTermDffStructureList'] = this.getTermDffStructureList; data['GetTermNotificationBodyList'] = this.getTermNotificationBodyList; - data['GetTimeCardSummaryList'] = this.getTimeCardSummaryList; + if (this.getTimeCardSummaryList != null) { + data['GetTimeCardSummaryList'] = this.getTimeCardSummaryList!.map((v) => v.toJson()).toList(); + } data['GetUserItemTypesList'] = this.getUserItemTypesList; data['GetVacationRulesList'] = this.getVacationRulesList; data['GetVaccinationOnHandList'] = this.getVaccinationOnHandList; diff --git a/lib/models/get_day_hours_type_details_list_model.dart b/lib/models/get_day_hours_type_details_list_model.dart new file mode 100644 index 0000000..5d0a0ab --- /dev/null +++ b/lib/models/get_day_hours_type_details_list_model.dart @@ -0,0 +1,180 @@ +class GetDayHoursTypeDetailsList { + Null? aBSENCEATTENDANCEID; + Null? aBSENCEATTENDANCETYPEID; + String? aBSENTFLAG; + String? aCTUALHRS; + String? aNALAYZEDFLAG; + String? aPPROVEDTIMEBACKHRS; + String? aPPRTIMEBACKFLAG; + int? aSSIGNMENTID; + String? aTTENDEDFLAG; + Null? cALENDARENTRYID; + String? cOMPOFFFLAG; + String? cOMPOFFHRS; + String? cOMPOFFHHRS; + String? cOMPOFFNHRS; + String? cOMPOFFWHRS; + String? dAYTYPE; + String? eARLYOUTFLAG; + String? eARLYOUTHRS; + String? eXCESSFLAG; + String? eXCESSHRS; + int? fROMROWNUM; + String? lATEINFLAG; + String? lATEINHRS; + String? mISSINGSWIPEFLAG; + String? nONSCHEDULEDFLAG; + Null? nOOFROWS; + String? oNCALLHRS; + Null? pERSONEXTRAINFOID; + String? pLANNEDOTHRS; + String? pLANNEDOTHRSFLAG; + String? rEMARKS; + int? rOWNUM; + int? rTPID; + String? sCHEDULEDHRS; + String? sCHEDULEDONCALLHRS; + String? sCHEDULEDPLANNEDOTHRS; + String? sCHEDULEDATE; + String? sHORTAGEFLAG; + String? sHORTAGEHRS; + String? tIMEBACKFLAG; + String? tIMEBACKHRS; + int? tOROWNUM; + + GetDayHoursTypeDetailsList( + {this.aBSENCEATTENDANCEID, + this.aBSENCEATTENDANCETYPEID, + this.aBSENTFLAG, + this.aCTUALHRS, + this.aNALAYZEDFLAG, + this.aPPROVEDTIMEBACKHRS, + this.aPPRTIMEBACKFLAG, + this.aSSIGNMENTID, + this.aTTENDEDFLAG, + this.cALENDARENTRYID, + this.cOMPOFFFLAG, + this.cOMPOFFHRS, + this.cOMPOFFHHRS, + this.cOMPOFFNHRS, + this.cOMPOFFWHRS, + this.dAYTYPE, + this.eARLYOUTFLAG, + this.eARLYOUTHRS, + this.eXCESSFLAG, + this.eXCESSHRS, + this.fROMROWNUM, + this.lATEINFLAG, + this.lATEINHRS, + this.mISSINGSWIPEFLAG, + this.nONSCHEDULEDFLAG, + this.nOOFROWS, + this.oNCALLHRS, + this.pERSONEXTRAINFOID, + this.pLANNEDOTHRS, + this.pLANNEDOTHRSFLAG, + this.rEMARKS, + this.rOWNUM, + this.rTPID, + this.sCHEDULEDHRS, + this.sCHEDULEDONCALLHRS, + this.sCHEDULEDPLANNEDOTHRS, + this.sCHEDULEDATE, + this.sHORTAGEFLAG, + this.sHORTAGEHRS, + this.tIMEBACKFLAG, + this.tIMEBACKHRS, + this.tOROWNUM}); + + GetDayHoursTypeDetailsList.fromJson(Map json) { + aBSENCEATTENDANCEID = json['ABSENCE_ATTENDANCE_ID']; + aBSENCEATTENDANCETYPEID = json['ABSENCE_ATTENDANCE_TYPE_ID']; + aBSENTFLAG = json['ABSENT_FLAG']; + aCTUALHRS = json['ACTUAL_HRS']; + aNALAYZEDFLAG = json['ANALAYZED_FLAG']; + aPPROVEDTIMEBACKHRS = json['APPROVED_TIMEBACK_HRS']; + aPPRTIMEBACKFLAG = json['APPR_TIMEBACK_FLAG']; + aSSIGNMENTID = json['ASSIGNMENT_ID']; + aTTENDEDFLAG = json['ATTENDED_FLAG']; + cALENDARENTRYID = json['CALENDAR_ENTRY_ID']; + cOMPOFFFLAG = json['COMP_OFF_FLAG']; + cOMPOFFHRS = json['COMP_OFF_HRS']; + cOMPOFFHHRS = json['COMP_OFF_H_HRS']; + cOMPOFFNHRS = json['COMP_OFF_N_HRS']; + cOMPOFFWHRS = json['COMP_OFF_W_HRS']; + dAYTYPE = json['DAY_TYPE']; + eARLYOUTFLAG = json['EARLY_OUT_FLAG']; + eARLYOUTHRS = json['EARLY_OUT_HRS']; + eXCESSFLAG = json['EXCESS_FLAG']; + eXCESSHRS = json['EXCESS_HRS']; + fROMROWNUM = json['FROM_ROW_NUM']; + lATEINFLAG = json['LATE_IN_FLAG']; + lATEINHRS = json['LATE_IN_HRS']; + mISSINGSWIPEFLAG = json['MISSING_SWIPE_FLAG']; + nONSCHEDULEDFLAG = json['NON_SCHEDULED_FLAG']; + nOOFROWS = json['NO_OF_ROWS']; + oNCALLHRS = json['ON_CALL_HRS']; + pERSONEXTRAINFOID = json['PERSON_EXTRA_INFO_ID']; + pLANNEDOTHRS = json['PLANNED_OT_HRS']; + pLANNEDOTHRSFLAG = json['PLANNED_OT_HRS_FLAG']; + rEMARKS = json['REMARKS']; + rOWNUM = json['ROW_NUM']; + rTPID = json['RTP_ID']; + sCHEDULEDHRS = json['SCHEDULED_HRS']; + sCHEDULEDONCALLHRS = json['SCHEDULED_ON_CALL_HRS']; + sCHEDULEDPLANNEDOTHRS = json['SCHEDULED_PLANNED_OT_HRS']; + sCHEDULEDATE = json['SCHEDULE_DATE']; + sHORTAGEFLAG = json['SHORTAGE_FLAG']; + sHORTAGEHRS = json['SHORTAGE_HRS']; + tIMEBACKFLAG = json['TIMEBACK_FLAG']; + tIMEBACKHRS = json['TIMEBACK_HRS']; + tOROWNUM = json['TO_ROW_NUM']; + } + + Map toJson() { + final Map data = new Map(); + data['ABSENCE_ATTENDANCE_ID'] = this.aBSENCEATTENDANCEID; + data['ABSENCE_ATTENDANCE_TYPE_ID'] = this.aBSENCEATTENDANCETYPEID; + data['ABSENT_FLAG'] = this.aBSENTFLAG; + data['ACTUAL_HRS'] = this.aCTUALHRS; + data['ANALAYZED_FLAG'] = this.aNALAYZEDFLAG; + data['APPROVED_TIMEBACK_HRS'] = this.aPPROVEDTIMEBACKHRS; + data['APPR_TIMEBACK_FLAG'] = this.aPPRTIMEBACKFLAG; + data['ASSIGNMENT_ID'] = this.aSSIGNMENTID; + data['ATTENDED_FLAG'] = this.aTTENDEDFLAG; + data['CALENDAR_ENTRY_ID'] = this.cALENDARENTRYID; + data['COMP_OFF_FLAG'] = this.cOMPOFFFLAG; + data['COMP_OFF_HRS'] = this.cOMPOFFHRS; + data['COMP_OFF_H_HRS'] = this.cOMPOFFHHRS; + data['COMP_OFF_N_HRS'] = this.cOMPOFFNHRS; + data['COMP_OFF_W_HRS'] = this.cOMPOFFWHRS; + data['DAY_TYPE'] = this.dAYTYPE; + data['EARLY_OUT_FLAG'] = this.eARLYOUTFLAG; + data['EARLY_OUT_HRS'] = this.eARLYOUTHRS; + data['EXCESS_FLAG'] = this.eXCESSFLAG; + data['EXCESS_HRS'] = this.eXCESSHRS; + data['FROM_ROW_NUM'] = this.fROMROWNUM; + data['LATE_IN_FLAG'] = this.lATEINFLAG; + data['LATE_IN_HRS'] = this.lATEINHRS; + data['MISSING_SWIPE_FLAG'] = this.mISSINGSWIPEFLAG; + data['NON_SCHEDULED_FLAG'] = this.nONSCHEDULEDFLAG; + data['NO_OF_ROWS'] = this.nOOFROWS; + data['ON_CALL_HRS'] = this.oNCALLHRS; + data['PERSON_EXTRA_INFO_ID'] = this.pERSONEXTRAINFOID; + data['PLANNED_OT_HRS'] = this.pLANNEDOTHRS; + data['PLANNED_OT_HRS_FLAG'] = this.pLANNEDOTHRSFLAG; + data['REMARKS'] = this.rEMARKS; + data['ROW_NUM'] = this.rOWNUM; + data['RTP_ID'] = this.rTPID; + data['SCHEDULED_HRS'] = this.sCHEDULEDHRS; + data['SCHEDULED_ON_CALL_HRS'] = this.sCHEDULEDONCALLHRS; + data['SCHEDULED_PLANNED_OT_HRS'] = this.sCHEDULEDPLANNEDOTHRS; + data['SCHEDULE_DATE'] = this.sCHEDULEDATE; + data['SHORTAGE_FLAG'] = this.sHORTAGEFLAG; + data['SHORTAGE_HRS'] = this.sHORTAGEHRS; + data['TIMEBACK_FLAG'] = this.tIMEBACKFLAG; + data['TIMEBACK_HRS'] = this.tIMEBACKHRS; + data['TO_ROW_NUM'] = this.tOROWNUM; + return data; + } +} \ No newline at end of file diff --git a/lib/models/get_employee_address_model.dart b/lib/models/get_employee_address_model.dart new file mode 100644 index 0000000..6770264 --- /dev/null +++ b/lib/models/get_employee_address_model.dart @@ -0,0 +1,4 @@ + +class GetEmployeeAddressList { + +} \ No newline at end of file diff --git a/lib/models/get_employee_basic_details.model.dart b/lib/models/get_employee_basic_details.model.dart new file mode 100644 index 0000000..06713c0 --- /dev/null +++ b/lib/models/get_employee_basic_details.model.dart @@ -0,0 +1,53 @@ + +class GetEmployeeBasicDetailsList { + String? aPPLICATIONCOLUMNNAME; + String? dATATYPE; + String? dATEVALUE; + String? dISPLAYFLAG; + int? gROUPNUM; + int? nUMBERVALUE; + String? sEGMENTPROMPT; + int? sEGMENTSEQNUM; + String? sEGMENTVALUEDSP; + String? vARCHAR2VALUE; + + GetEmployeeBasicDetailsList( + {this.aPPLICATIONCOLUMNNAME, + this.dATATYPE, + this.dATEVALUE, + this.dISPLAYFLAG, + this.gROUPNUM, + this.nUMBERVALUE, + this.sEGMENTPROMPT, + this.sEGMENTSEQNUM, + this.sEGMENTVALUEDSP, + this.vARCHAR2VALUE}); + + GetEmployeeBasicDetailsList.fromJson(Map json) { + aPPLICATIONCOLUMNNAME = json['APPLICATION_COLUMN_NAME']; + dATATYPE = json['DATATYPE']; + dATEVALUE = json['DATE_VALUE']; + dISPLAYFLAG = json['DISPLAY_FLAG']; + gROUPNUM = json['GROUP_NUM']; + nUMBERVALUE = json['NUMBER_VALUE']; + sEGMENTPROMPT = json['SEGMENT_PROMPT']; + sEGMENTSEQNUM = json['SEGMENT_SEQ_NUM']; + sEGMENTVALUEDSP = json['SEGMENT_VALUE_DSP']; + vARCHAR2VALUE = json['VARCHAR2_VALUE']; + } + + Map toJson() { + final Map data = new Map(); + data['APPLICATION_COLUMN_NAME'] = this.aPPLICATIONCOLUMNNAME; + data['DATATYPE'] = this.dATATYPE; + data['DATE_VALUE'] = this.dATEVALUE; + data['DISPLAY_FLAG'] = this.dISPLAYFLAG; + data['GROUP_NUM'] = this.gROUPNUM; + data['NUMBER_VALUE'] = this.nUMBERVALUE; + data['SEGMENT_PROMPT'] = this.sEGMENTPROMPT; + data['SEGMENT_SEQ_NUM'] = this.sEGMENTSEQNUM; + data['SEGMENT_VALUE_DSP'] = this.sEGMENTVALUEDSP; + data['VARCHAR2_VALUE'] = this.vARCHAR2VALUE; + return data; + } +} \ No newline at end of file diff --git a/lib/models/get_employee_contacts.model.dart b/lib/models/get_employee_contacts.model.dart new file mode 100644 index 0000000..4064d10 --- /dev/null +++ b/lib/models/get_employee_contacts.model.dart @@ -0,0 +1,45 @@ + +class GetEmployeeContactsList { + String? cONTACTNAME; + int? cONTACTPERSONID; + int? cONTACTRELATIONSHIPID; + String? cONTACTTYPE; + String? dATEOFBIRTH; + int? pERSONID; + String? pRIMARYCONTACTFLAG; + String? rELATIONSHIP; + + GetEmployeeContactsList( + {this.cONTACTNAME, + this.cONTACTPERSONID, + this.cONTACTRELATIONSHIPID, + this.cONTACTTYPE, + this.dATEOFBIRTH, + this.pERSONID, + this.pRIMARYCONTACTFLAG, + this.rELATIONSHIP}); + + GetEmployeeContactsList.fromJson(Map json) { + cONTACTNAME = json['CONTACT_NAME']; + cONTACTPERSONID = json['CONTACT_PERSON_ID']; + cONTACTRELATIONSHIPID = json['CONTACT_RELATIONSHIP_ID']; + cONTACTTYPE = json['CONTACT_TYPE']; + dATEOFBIRTH = json['DATE_OF_BIRTH']; + pERSONID = json['PERSON_ID']; + pRIMARYCONTACTFLAG = json['PRIMARY_CONTACT_FLAG']; + rELATIONSHIP = json['RELATIONSHIP']; + } + + Map toJson() { + final Map data = new Map(); + data['CONTACT_NAME'] = this.cONTACTNAME; + data['CONTACT_PERSON_ID'] = this.cONTACTPERSONID; + data['CONTACT_RELATIONSHIP_ID'] = this.cONTACTRELATIONSHIPID; + data['CONTACT_TYPE'] = this.cONTACTTYPE; + data['DATE_OF_BIRTH'] = this.dATEOFBIRTH; + data['PERSON_ID'] = this.pERSONID; + data['PRIMARY_CONTACT_FLAG'] = this.pRIMARYCONTACTFLAG; + data['RELATIONSHIP'] = this.rELATIONSHIP; + return data; + } +} \ No newline at end of file diff --git a/lib/models/get_employee_phones_model.dart b/lib/models/get_employee_phones_model.dart new file mode 100644 index 0000000..1fbba7f --- /dev/null +++ b/lib/models/get_employee_phones_model.dart @@ -0,0 +1,53 @@ + +class GetEmployeePhonesList { + String? dATEFROM; + String? dATETO; + int? oBJECTVERSIONNUMBER; + int? pARENTID; + String? pARENTTABLE; + int? pHONEID; + String? pHONENUMBER; + String? pHONETYPE; + String? pHONETYPEMEANING; + int? rOWINDEX; + + GetEmployeePhonesList( + {this.dATEFROM, + this.dATETO, + this.oBJECTVERSIONNUMBER, + this.pARENTID, + this.pARENTTABLE, + this.pHONEID, + this.pHONENUMBER, + this.pHONETYPE, + this.pHONETYPEMEANING, + this.rOWINDEX}); + + GetEmployeePhonesList.fromJson(Map json) { + dATEFROM = json['DATE_FROM']; + dATETO = json['DATE_TO']; + oBJECTVERSIONNUMBER = json['OBJECT_VERSION_NUMBER']; + pARENTID = json['PARENT_ID']; + pARENTTABLE = json['PARENT_TABLE']; + pHONEID = json['PHONE_ID']; + pHONENUMBER = json['PHONE_NUMBER']; + pHONETYPE = json['PHONE_TYPE']; + pHONETYPEMEANING = json['PHONE_TYPE_MEANING']; + rOWINDEX = json['ROW_INDEX']; + } + + Map toJson() { + final Map data = new Map(); + data['DATE_FROM'] = this.dATEFROM; + data['DATE_TO'] = this.dATETO; + data['OBJECT_VERSION_NUMBER'] = this.oBJECTVERSIONNUMBER; + data['PARENT_ID'] = this.pARENTID; + data['PARENT_TABLE'] = this.pARENTTABLE; + data['PHONE_ID'] = this.pHONEID; + data['PHONE_NUMBER'] = this.pHONENUMBER; + data['PHONE_TYPE'] = this.pHONETYPE; + data['PHONE_TYPE_MEANING'] = this.pHONETYPEMEANING; + data['ROW_INDEX'] = this.rOWINDEX; + return data; + } +} \ No newline at end of file diff --git a/lib/models/get_schedule_shifts_details_list_model.dart b/lib/models/get_schedule_shifts_details_list_model.dart new file mode 100644 index 0000000..8003446 --- /dev/null +++ b/lib/models/get_schedule_shifts_details_list_model.dart @@ -0,0 +1,129 @@ + +class GetScheduleShiftsDetailsList { + String? aCTUALWOBHRS; + String? aPPROVEDENDDATETIME; + String? aPPROVEDENDREASON; + String? aPPROVEDENDREASONDESC; + String? aPPROVEDENDTIME; + String? aPPROVEDSTARTDATETIME; + String? aPPROVEDSTARTREASON; + String? aPPROVEDSTARTREASONDESC; + String? aPPROVEDSTARTTIME; + int? aSSIGNMENTID; + String? bREAKNAME; + int? fROMROWNUM; + int? nOOFROWS; + String? pERCENTAGE; + int? rOWNUM; + int? rTPID; + int? rTPSCHEDULEID; + String? sCHEDULEDATE; + int? sEQNO; + String? sHTACTUALENDDATETIME; + String? sHTACTUALENDTIME; + String? sHTACTUALHRS; + String? sHTACTUALSTARTDATETIME; + String? sHTACTUALSTARTTIME; + String? sHTCODE; + String? sHTNAME; + String? sHTTYPE; + String? sHTTYPEDESC; + int? tOROWNUM; + + GetScheduleShiftsDetailsList( + {this.aCTUALWOBHRS, + this.aPPROVEDENDDATETIME, + this.aPPROVEDENDREASON, + this.aPPROVEDENDREASONDESC, + this.aPPROVEDENDTIME, + this.aPPROVEDSTARTDATETIME, + this.aPPROVEDSTARTREASON, + this.aPPROVEDSTARTREASONDESC, + this.aPPROVEDSTARTTIME, + this.aSSIGNMENTID, + this.bREAKNAME, + this.fROMROWNUM, + this.nOOFROWS, + this.pERCENTAGE, + this.rOWNUM, + this.rTPID, + this.rTPSCHEDULEID, + this.sCHEDULEDATE, + this.sEQNO, + this.sHTACTUALENDDATETIME, + this.sHTACTUALENDTIME, + this.sHTACTUALHRS, + this.sHTACTUALSTARTDATETIME, + this.sHTACTUALSTARTTIME, + this.sHTCODE, + this.sHTNAME, + this.sHTTYPE, + this.sHTTYPEDESC, + this.tOROWNUM}); + + GetScheduleShiftsDetailsList.fromJson(Map json) { + aCTUALWOBHRS = json['ACTUAL_WOB_HRS']; + aPPROVEDENDDATETIME = json['APPROVED_END_DATETIME']; + aPPROVEDENDREASON = json['APPROVED_END_REASON']; + aPPROVEDENDREASONDESC = json['APPROVED_END_REASON_DESC']; + aPPROVEDENDTIME = json['APPROVED_END_TIME']; + aPPROVEDSTARTDATETIME = json['APPROVED_START_DATETIME']; + aPPROVEDSTARTREASON = json['APPROVED_START_REASON']; + aPPROVEDSTARTREASONDESC = json['APPROVED_START_REASON_DESC']; + aPPROVEDSTARTTIME = json['APPROVED_START_TIME']; + aSSIGNMENTID = json['ASSIGNMENT_ID']; + bREAKNAME = json['BREAK_NAME']; + fROMROWNUM = json['FROM_ROW_NUM']; + nOOFROWS = json['NO_OF_ROWS']; + pERCENTAGE = json['PERCENTAGE']; + rOWNUM = json['ROW_NUM']; + rTPID = json['RTP_ID']; + rTPSCHEDULEID = json['RTP_SCHEDULE_ID']; + sCHEDULEDATE = json['SCHEDULE_DATE']; + sEQNO = json['SEQ_NO']; + sHTACTUALENDDATETIME = json['SHT_ACTUAL_END_DATETIME']; + sHTACTUALENDTIME = json['SHT_ACTUAL_END_TIME']; + sHTACTUALHRS = json['SHT_ACTUAL_HRS']; + sHTACTUALSTARTDATETIME = json['SHT_ACTUAL_START_DATETIME']; + sHTACTUALSTARTTIME = json['SHT_ACTUAL_START_TIME']; + sHTCODE = json['SHT_CODE']; + sHTNAME = json['SHT_NAME']; + sHTTYPE = json['SHT_TYPE']; + sHTTYPEDESC = json['SHT_TYPE_DESC']; + tOROWNUM = json['TO_ROW_NUM']; + } + + Map toJson() { + final Map data = new Map(); + data['ACTUAL_WOB_HRS'] = this.aCTUALWOBHRS; + data['APPROVED_END_DATETIME'] = this.aPPROVEDENDDATETIME; + data['APPROVED_END_REASON'] = this.aPPROVEDENDREASON; + data['APPROVED_END_REASON_DESC'] = this.aPPROVEDENDREASONDESC; + data['APPROVED_END_TIME'] = this.aPPROVEDENDTIME; + data['APPROVED_START_DATETIME'] = this.aPPROVEDSTARTDATETIME; + data['APPROVED_START_REASON'] = this.aPPROVEDSTARTREASON; + data['APPROVED_START_REASON_DESC'] = this.aPPROVEDSTARTREASONDESC; + data['APPROVED_START_TIME'] = this.aPPROVEDSTARTTIME; + data['ASSIGNMENT_ID'] = this.aSSIGNMENTID; + data['BREAK_NAME'] = this.bREAKNAME; + data['FROM_ROW_NUM'] = this.fROMROWNUM; + data['NO_OF_ROWS'] = this.nOOFROWS; + data['PERCENTAGE'] = this.pERCENTAGE; + data['ROW_NUM'] = this.rOWNUM; + data['RTP_ID'] = this.rTPID; + data['RTP_SCHEDULE_ID'] = this.rTPSCHEDULEID; + data['SCHEDULE_DATE'] = this.sCHEDULEDATE; + data['SEQ_NO'] = this.sEQNO; + data['SHT_ACTUAL_END_DATETIME'] = this.sHTACTUALENDDATETIME; + data['SHT_ACTUAL_END_TIME'] = this.sHTACTUALENDTIME; + data['SHT_ACTUAL_HRS'] = this.sHTACTUALHRS; + data['SHT_ACTUAL_START_DATETIME'] = this.sHTACTUALSTARTDATETIME; + data['SHT_ACTUAL_START_TIME'] = this.sHTACTUALSTARTTIME; + data['SHT_CODE'] = this.sHTCODE; + data['SHT_NAME'] = this.sHTNAME; + data['SHT_TYPE'] = this.sHTTYPE; + data['SHT_TYPE_DESC'] = this.sHTTYPEDESC; + data['TO_ROW_NUM'] = this.tOROWNUM; + return data; + } +} \ No newline at end of file diff --git a/lib/models/get_time_card_summary_list_model.dart b/lib/models/get_time_card_summary_list_model.dart new file mode 100644 index 0000000..6799bfa --- /dev/null +++ b/lib/models/get_time_card_summary_list_model.dart @@ -0,0 +1,153 @@ + + +class GetTimeCardSummaryList { + int? aBSENTDAYS; + int? aCTUALHRS; + int? aPPROVEDTIMEBACKHRS; + int? aSSIGNMENTID; + int? aTTENDEDDAYS; + int? bUSINESSTRIP; + int? cOMPOFFHHRS; + int? cOMPOFFNHRS; + int? cOMPOFFWHRS; + int? dESIREDSCHEDULEDHRS; + int? eARLYOUTHRS; + int? eXCESSHRS; + int? hALFDAYLEAVE; + int? lATEINHRS; + int? lEAVESHOLIDAYSHRS; + int? nONSCHEDULEDAYS; + int? nOTANALYZEDDAYS; + int? oFFDAYS; + int? oNCALLHRS; + int? pAIDLEAVE; + int? pERIODDAYS; + int? pLANNEDOTHRS; + int? pUBLICHOLIDAY; + int? sCHEDULEDHRS; + int? sCHEDULEDONCALLHRS; + int? sCHEDULEDPLANNEDOTHRS; + int? sCHEDULEDAYS; + int? sHORTAGEHRS; + int? sHORTAGESCHEDULEHRS; + int? sICKLEAVE; + int? tIMEBACKHRS; + double? tIMEBACKBALANCE; + int? uNAUTHORIZEDLEAVE; + int? uNCOVERDSHORTAGEHRS; + int? uNPAIDLEAVE; + + GetTimeCardSummaryList( + {this.aBSENTDAYS, + this.aCTUALHRS, + this.aPPROVEDTIMEBACKHRS, + this.aSSIGNMENTID, + this.aTTENDEDDAYS, + this.bUSINESSTRIP, + this.cOMPOFFHHRS, + this.cOMPOFFNHRS, + this.cOMPOFFWHRS, + this.dESIREDSCHEDULEDHRS, + this.eARLYOUTHRS, + this.eXCESSHRS, + this.hALFDAYLEAVE, + this.lATEINHRS, + this.lEAVESHOLIDAYSHRS, + this.nONSCHEDULEDAYS, + this.nOTANALYZEDDAYS, + this.oFFDAYS, + this.oNCALLHRS, + this.pAIDLEAVE, + this.pERIODDAYS, + this.pLANNEDOTHRS, + this.pUBLICHOLIDAY, + this.sCHEDULEDHRS, + this.sCHEDULEDONCALLHRS, + this.sCHEDULEDPLANNEDOTHRS, + this.sCHEDULEDAYS, + this.sHORTAGEHRS, + this.sHORTAGESCHEDULEHRS, + this.sICKLEAVE, + this.tIMEBACKHRS, + this.tIMEBACKBALANCE, + this.uNAUTHORIZEDLEAVE, + this.uNCOVERDSHORTAGEHRS, + this.uNPAIDLEAVE}); + + GetTimeCardSummaryList.fromJson(Map json) { + aBSENTDAYS = json['ABSENT_DAYS']; + aCTUALHRS = json['ACTUAL_HRS']; + aPPROVEDTIMEBACKHRS = json['APPROVED_TIMEBACK_HRS']; + aSSIGNMENTID = json['ASSIGNMENT_ID']; + aTTENDEDDAYS = json['ATTENDED_DAYS']; + bUSINESSTRIP = json['BUSINESS_TRIP']; + cOMPOFFHHRS = json['COMP_OFF_H_HRS']; + cOMPOFFNHRS = json['COMP_OFF_N_HRS']; + cOMPOFFWHRS = json['COMP_OFF_W_HRS']; + dESIREDSCHEDULEDHRS = json['DESIRED_SCHEDULED_HRS']; + eARLYOUTHRS = json['EARLY_OUT_HRS']; + eXCESSHRS = json['EXCESS_HRS']; + hALFDAYLEAVE = json['HALF_DAY_LEAVE']; + lATEINHRS = json['LATE_IN_HRS']; + lEAVESHOLIDAYSHRS = json['LEAVES_HOLIDAYS_HRS']; + nONSCHEDULEDAYS = json['NON_SCHEDULE_DAYS']; + nOTANALYZEDDAYS = json['NOT_ANALYZED_DAYS']; + oFFDAYS = json['OFF_DAYS']; + oNCALLHRS = json['ON_CALL_HRS']; + pAIDLEAVE = json['PAID_LEAVE']; + pERIODDAYS = json['PERIOD_DAYS']; + pLANNEDOTHRS = json['PLANNED_OTHRS']; + pUBLICHOLIDAY = json['PUBLIC_HOLIDAY']; + sCHEDULEDHRS = json['SCHEDULED_HRS']; + sCHEDULEDONCALLHRS = json['SCHEDULED_ON_CALL_HRS']; + sCHEDULEDPLANNEDOTHRS = json['SCHEDULED_PLANNED_OT_HRS']; + sCHEDULEDAYS = json['SCHEDULE_DAYS']; + sHORTAGEHRS = json['SHORTAGE_HRS']; + sHORTAGESCHEDULEHRS = json['SHORTAGE_SCHEDULE_HRS']; + sICKLEAVE = json['SICK_LEAVE']; + tIMEBACKHRS = json['TIMEBACK_HRS']; + tIMEBACKBALANCE = json['TIME_BACK_BALANCE']; + uNAUTHORIZEDLEAVE = json['UNAUTHORIZED_LEAVE']; + uNCOVERDSHORTAGEHRS = json['UNCOVERD_SHORTAGE_HRS']; + uNPAIDLEAVE = json['UNPAID_LEAVE']; + } + + Map toJson() { + final Map data = new Map(); + data['ABSENT_DAYS'] = this.aBSENTDAYS; + data['ACTUAL_HRS'] = this.aCTUALHRS; + data['APPROVED_TIMEBACK_HRS'] = this.aPPROVEDTIMEBACKHRS; + data['ASSIGNMENT_ID'] = this.aSSIGNMENTID; + data['ATTENDED_DAYS'] = this.aTTENDEDDAYS; + data['BUSINESS_TRIP'] = this.bUSINESSTRIP; + data['COMP_OFF_H_HRS'] = this.cOMPOFFHHRS; + data['COMP_OFF_N_HRS'] = this.cOMPOFFNHRS; + data['COMP_OFF_W_HRS'] = this.cOMPOFFWHRS; + data['DESIRED_SCHEDULED_HRS'] = this.dESIREDSCHEDULEDHRS; + data['EARLY_OUT_HRS'] = this.eARLYOUTHRS; + data['EXCESS_HRS'] = this.eXCESSHRS; + data['HALF_DAY_LEAVE'] = this.hALFDAYLEAVE; + data['LATE_IN_HRS'] = this.lATEINHRS; + data['LEAVES_HOLIDAYS_HRS'] = this.lEAVESHOLIDAYSHRS; + data['NON_SCHEDULE_DAYS'] = this.nONSCHEDULEDAYS; + data['NOT_ANALYZED_DAYS'] = this.nOTANALYZEDDAYS; + data['OFF_DAYS'] = this.oFFDAYS; + data['ON_CALL_HRS'] = this.oNCALLHRS; + data['PAID_LEAVE'] = this.pAIDLEAVE; + data['PERIOD_DAYS'] = this.pERIODDAYS; + data['PLANNED_OTHRS'] = this.pLANNEDOTHRS; + data['PUBLIC_HOLIDAY'] = this.pUBLICHOLIDAY; + data['SCHEDULED_HRS'] = this.sCHEDULEDHRS; + data['SCHEDULED_ON_CALL_HRS'] = this.sCHEDULEDONCALLHRS; + data['SCHEDULED_PLANNED_OT_HRS'] = this.sCHEDULEDPLANNEDOTHRS; + data['SCHEDULE_DAYS'] = this.sCHEDULEDAYS; + data['SHORTAGE_HRS'] = this.sHORTAGEHRS; + data['SHORTAGE_SCHEDULE_HRS'] = this.sHORTAGESCHEDULEHRS; + data['SICK_LEAVE'] = this.sICKLEAVE; + data['TIMEBACK_HRS'] = this.tIMEBACKHRS; + data['TIME_BACK_BALANCE'] = this.tIMEBACKBALANCE; + data['UNAUTHORIZED_LEAVE'] = this.uNAUTHORIZEDLEAVE; + data['UNCOVERD_SHORTAGE_HRS'] = this.uNCOVERDSHORTAGEHRS; + data['UNPAID_LEAVE'] = this.uNPAIDLEAVE; + return data; + }} \ No newline at end of file diff --git a/lib/ui/attendance/monthly_attendance.dart b/lib/ui/attendance/monthly_attendance.dart new file mode 100644 index 0000000..7391211 --- /dev/null +++ b/lib/ui/attendance/monthly_attendance.dart @@ -0,0 +1,805 @@ +import 'package:easy_localization/easy_localization.dart'; +import 'package:easy_localization/src/public_ext.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter/painting.dart'; +import 'package:mohem_flutter_app/api/monthlyAttendance_api_client.dart'; +import 'package:mohem_flutter_app/classes/colors.dart'; +import 'package:mohem_flutter_app/classes/utils.dart'; +import 'package:mohem_flutter_app/extensions/int_extensions.dart'; +import 'package:mohem_flutter_app/extensions/string_extensions.dart'; +import 'package:mohem_flutter_app/extensions/widget_extensions.dart'; +import 'package:mohem_flutter_app/models/get_day_hours_type_details_list_model.dart'; +import 'package:mohem_flutter_app/models/get_schedule_shifts_details_list_model.dart'; +import 'package:mohem_flutter_app/models/get_time_card_summary_list_model.dart'; +import 'package:mohem_flutter_app/widgets/circular_step_progress_bar.dart'; +import 'package:provider/provider.dart'; +import 'package:syncfusion_flutter_calendar/calendar.dart'; +import 'package:mohem_flutter_app/generated/locale_keys.g.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:pie_chart/pie_chart.dart'; + +class MonthlyAttendance extends StatefulWidget { + MonthlyAttendance({Key? key}) : super(key: key); + + @override + _MonthlyAttendanceState createState() { + return _MonthlyAttendanceState(); + } +} + +class _MonthlyAttendanceState extends State { + bool isPresent = true; + bool isAbsent = true; + bool isMissingDays = true; + bool isOffDays = true; + DateTime date = DateTime.now(); + late var formattedDate; + var currentMonth = DateTime.now().month; + String searchMonth = getMonth(DateTime.now().month); + int searchYear = DateTime.now().year; + int? pRTPID; + + List getDayHoursTypeDetailsList = []; + GetTimeCardSummaryList? getTimeCardSummaryList; + + // GetDayHoursTypeDetailsList? getDayHoursTypeDetailsList; + GetScheduleShiftsDetailsList? getScheduleShiftsDetailsList; + + @override + void initState() { + super.initState(); + getTimeCardSummary(searchMonth, searchYear); + getDayHoursTypeDetails(date.day, searchMonth, searchYear); + formattedDate = DateFormat('MMM-yyyy').format(date); + } + + void getTimeCardSummary(searchMonth, searchYear) async { + try { + Utils.showLoading(context); + getTimeCardSummaryList = await MonthlyAttendanceApiClient().getTimeCardSummary(searchMonth, searchYear); + Utils.hideLoading(context); + setState(() {}); + } catch (ex) { + Utils.hideLoading(context); + Utils.handleException(ex, context, null); + } + } + + void getDayHoursTypeDetails(index, searchMonth, searchYear) async { + try { + Utils.showLoading(context); + getDayHoursTypeDetailsList = await MonthlyAttendanceApiClient().getDayHoursTypeDetails(searchMonth, searchYear); + Utils.hideLoading(context); + pRTPID = getDayHoursTypeDetailsList[index].rTPID; + setState(() {}); + } catch (ex) { + Utils.hideLoading(context); + Utils.handleException(ex, context, null); + } + countAllAttendDays(); + getScheduleShiftsDetails(pRTPID); + } + + getScheduleShiftsDetails(pRTPID) async { + try { + Utils.showLoading(context); + getScheduleShiftsDetailsList = await MonthlyAttendanceApiClient().getScheduleShiftsDetails(pRTPID); + Utils.hideLoading(context); + setState(() {}); + } catch (ex) { + Utils.hideLoading(context); + Utils.handleException(ex, context, null); + } + } + + countAllAttendDays() { + // print(getDayHoursTypeDetailsList.length); + for (int i = 0; i < getDayHoursTypeDetailsList.length; i++) { + if (getDayHoursTypeDetailsList[i].aTTENDEDFLAG == 'Y') { + isPresent = true; + isAbsent = false; + isMissingDays = false; + isOffDays = false; + } else if (getDayHoursTypeDetailsList[i].aTTENDEDFLAG == 'N' && getDayHoursTypeDetailsList[i].aBSENTFLAG == 'Y') { + isPresent = false; + isAbsent = true; + isMissingDays = false; + isOffDays = false; + } else if (getDayHoursTypeDetailsList[i].aTTENDEDFLAG == 'N' && getDayHoursTypeDetailsList[i].dAYTYPE == 'OFF') { + isPresent = false; + isAbsent = false; + isMissingDays = false; + isOffDays = true; + } else { + isPresent = false; + isAbsent = false; + isMissingDays = true; + isOffDays = false; + } + } + } + + final CalendarController _calendarController = CalendarController(); + + final List _colorList = [Color(0xff2AB2AB), Color(0xff202529)]; + + @override + Widget build(BuildContext context) { + Map dataMap = { + "Present": getTimeCardSummaryList!.aTTENDEDDAYS!.toDouble(), + "Absent": getTimeCardSummaryList!.aBSENTDAYS!.toDouble(), + }; + return Scaffold( + appBar: AppBar( + backgroundColor: MyColors.white, + leading: IconButton( + icon: const Icon( + Icons.arrow_back_ios, + color: MyColors.backgroundBlackColor, + ), + onPressed: () => Navigator.pop(context), + ), + ), + backgroundColor: Colors.white, + body: ListView( + scrollDirection: Axis.vertical, + children: [ + Column( + children: [ + 20.height, + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + "Attendance".toText24(isBold: true, color: MyColors.darkIconColor), + Row( + children: [ + Text(formattedDate), + const Icon(Icons.keyboard_arrow_down_rounded, color: MyColors.greyACColor), + ], + ).onPress(() async { + await showDatePicker( + context: context, + initialDate: DateTime.now(), + firstDate: DateTime(2021), + lastDate: DateTime.now(), + builder: (context, child) { + return Theme( + data: ThemeData.dark().copyWith( + colorScheme: const ColorScheme.dark( + primary: MyColors.lightGreenColor, + onPrimary: MyColors.white, + surface: MyColors.lightGreenColor, + onSurface: MyColors.darkTextColor, + ), + dialogBackgroundColor: Colors.white, + ), + child: child!, + ); + }, + ).then((selectedDate) { + if (selectedDate != null) { + var selectedMonth = DateFormat('MMMM').format(selectedDate); + var selectedYear = DateFormat('yyyy').format(selectedDate); + searchMonth = selectedMonth; + searchYear = int.parse(selectedYear); + setState(() { + // date = selectedDate; + formattedDate = DateFormat('MMMM-yyyy').format(selectedDate); + getTimeCardSummary(searchMonth, searchYear); + getDayHoursTypeDetails(selectedDate.day, searchMonth, searchYear); + }); + } + }); + }) + ], + ).paddingOnly(left: 21, right: 21), + 18.height, + AspectRatio(aspectRatio: 333 / 270, child: calendarWidget()).paddingOnly(left: 21, right: 21), + Row( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + optionUI("Schedule\nDays", "${getTimeCardSummaryList!.sCHEDULEDAYS}"), + 6.width, + optionUI("Off\nDays", "${getTimeCardSummaryList!.oFFDAYS}"), + 6.width, + optionUI("Non\nAnalyzed", "${getTimeCardSummaryList!.uNAUTHORIZEDLEAVE}"), + 6.width, + optionUI("Shortage\nHour", "${getTimeCardSummaryList!.sHORTAGEHRS}"), + ], + ).paddingOnly(left: 21, right: 21), + 35.height, + Container( + width: double.infinity, + height: 227, + decoration: BoxDecoration( + color: Colors.white, + borderRadius: const BorderRadius.only(topLeft: Radius.circular(25), topRight: Radius.circular(25)), + boxShadow: [ + BoxShadow( + offset: const Offset(0, 2), + blurRadius: 26, + color: MyColors.darkColor.withOpacity(0.1), + ), + ], + ), + child: Row( + children: [ + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Column( + children: [ + "Attendance".toText12(isBold: true, color: MyColors.grey3AColor), + "Stats".toText24(isBold: true, color: MyColors.grey3AColor), + ], + ).paddingOnly(left: 21, top: 29, bottom: 36), + Row( + children: [ + Container( + height: 9, + width: 9, + decoration: BoxDecoration( + color: MyColors.lightGreenColor, + borderRadius: BorderRadius.circular(100), + ), + ), + Container( + margin: const EdgeInsets.only(left: 5, right: 5), + child: "PRESENT ${getTimeCardSummaryList!.aTTENDEDDAYS}".toText16(isBold: true, color: MyColors.lightGreenColor), + ), + ], + ).paddingOnly(left: 21, right: 23), + 8.height, + Row( + children: [ + Container( + height: 9, + width: 9, + decoration: BoxDecoration( + color: MyColors.backgroundBlackColor, + borderRadius: BorderRadius.circular(100), + ), + ), + Container( + margin: const EdgeInsets.only(left: 5, right: 5), + child: "ABSENT ${getTimeCardSummaryList!.aBSENTDAYS}".toText16( + isBold: true, + color: MyColors.backgroundBlackColor, + ), + ) + ], + ).paddingOnly(left: 21, top: 8), + ], + ), + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + width: 169, + height: 170, + child: PieChart( + dataMap: dataMap, + animationDuration: const Duration(milliseconds: 800), + chartLegendSpacing: 0, + chartRadius: MediaQuery.of(context).size.width / 5.2, + colorList: _colorList, + initialAngleInDegree: 0, + chartType: ChartType.ring, + ringStrokeWidth: 80, + legendOptions: const LegendOptions( + showLegendsInRow: false, + showLegends: false, + ), + chartValuesOptions: const ChartValuesOptions( + showChartValueBackground: false, + showChartValues: true, + showChartValuesInPercentage: true, + showChartValuesOutside: false, + decimalPlaces: 1, + chartValueStyle: TextStyle( + fontWeight: FontWeight.bold, + fontSize: 16, + color: MyColors.white, + )), + ), + ), + ], + ).paddingOnly(left: 65, top: 27, right: 21, bottom: 28), + ], + ), + ), + ], + ), + ], + ), + ); + } + + Widget optionUI(String title, String value) { + return AspectRatio( + aspectRatio: 1 / 1, + child: Container( + padding: const EdgeInsets.only(top: 10, left: 8, right: 8, bottom: 10), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(12), + boxShadow: [ + BoxShadow( + offset: const Offset(0, 1), + blurRadius: 15, + color: MyColors.darkColor.withOpacity(0.1), + ), + ], + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [title.toText10(color: MyColors.darkTextColor).expanded, value.toText20(color: MyColors.darkTextColor)], + ), + ), + ).expanded; + } + + Widget calendarWidget() { + return SfCalendar( + view: CalendarView.month, + // onViewChanged: viewChanged, + controller: _calendarController, + headerHeight: 0, + todayHighlightColor: MyColors.grey3AColor, + viewHeaderStyle: const ViewHeaderStyle( + dayTextStyle: TextStyle(color: MyColors.grey3AColor, fontSize: 13, fontWeight: FontWeight.w600), + ), + monthCellBuilder: (cxt, build) { + int val = build.date.day; + val == countAllAttendDays(); + if (isPresent) { + return Container( + margin: const EdgeInsets.all(4), + decoration: BoxDecoration( + gradient: const LinearGradient( + transform: GradientRotation(.46), + begin: Alignment.topRight, + end: Alignment.bottomLeft, + colors: [MyColors.gradiantEndColor, MyColors.gradiantStartColor], + ), + shape: BoxShape.circle, + boxShadow: [ + BoxShadow( + offset: const Offset(0, 2), + blurRadius: 26, + color: MyColors.blackColor.withOpacity(0.100), + ), + ], + ), + alignment: Alignment.center, + child: Text( + "${build.date.day}", + style: const TextStyle( + fontSize: 13, + fontWeight: FontWeight.w500, + color: MyColors.white, + ), + ), + ); + } else if (isAbsent) { + return Container( + margin: const EdgeInsets.all(4), + decoration: BoxDecoration( + color: MyColors.backgroundBlackColor, + shape: BoxShape.circle, + boxShadow: [ + BoxShadow( + offset: const Offset(0, 2), + blurRadius: 26, + color: MyColors.blackColor.withOpacity(0.100), + ), + ], + ), + alignment: Alignment.center, + child: Text( + "${build.date.day}", + style: const TextStyle( + fontSize: 13, + fontWeight: FontWeight.w500, + color: MyColors.white, + ), + ), + ); + } else if (isMissingDays) { + return Container( + margin: const EdgeInsets.all(4), + decoration: BoxDecoration( + border: Border.all(color: MyColors.backgroundBlackColor, width: 2.0, style: BorderStyle.solid), //Border.all + shape: BoxShape.circle, + boxShadow: [ + BoxShadow( + offset: const Offset(0, 2), + blurRadius: 26, + color: MyColors.blackColor.withOpacity(0.100), + ), + ], + ), + alignment: Alignment.center, + child: Text( + "${build.date.day}", + style: const TextStyle( + fontSize: 13, + fontWeight: FontWeight.w500, + color: Color(0xff1F2428), + ), + ), + ); + } else if (isOffDays) { + return Container( + margin: const EdgeInsets.all(4), + decoration: BoxDecoration( + color: MyColors.greyACColor.withOpacity(.12), + shape: BoxShape.circle, + ), + alignment: Alignment.center, + child: Text( + "${build.date.day}", + style: const TextStyle( + fontSize: 13, + fontWeight: FontWeight.w500, + color: MyColors.greyA5Color, + ), + ), + ); + } else { + return Container(); + } + }, + monthViewSettings: const MonthViewSettings( + dayFormat: 'EEE', + showTrailingAndLeadingDates: false, + appointmentDisplayMode: MonthAppointmentDisplayMode.appointment, + showAgenda: false, + navigationDirection: MonthNavigationDirection.horizontal, + monthCellStyle: MonthCellStyle( + textStyle: TextStyle( + fontStyle: FontStyle.normal, + fontSize: 13, + color: Colors.white, + ), + ), + ), + showNavigationArrow: false, + showDatePickerButton: false, + showCurrentTimeIndicator: false, + showWeekNumber: false, + cellBorderColor: Colors.white, + selectionDecoration: BoxDecoration( + border: Border.all(color: MyColors.white, width: 10), + borderRadius: const BorderRadius.all(Radius.circular(100)), + shape: BoxShape.circle, + ), + dataSource: MeetingDataSource(_getDataSource()), + onTap: calendarTapped, + ); + } + + calendarTapped(CalendarTapDetails details) { + dynamic string = getScheduleShiftsDetailsList!.pERCENTAGE; + dynamic percentage = string!.indexOf('%'); + print(percentage); + print(details.date?.day.toString()); + int? index = details.date?.day; + if (index != null) { + index = index - 1; + } + getDayHoursTypeDetails(index, getMonth(details.date!.month), details.date?.year); + showModalBottomSheet( + context: context, + shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(25)), + isScrollControlled: true, + backgroundColor: MyColors.backgroundBlackColor, + builder: (_) { + return DraggableScrollableSheet( + maxChildSize: 0.9, + expand: false, + builder: (_, controller) { + return Column( + children: [ + Container( + width: 75, + height: 7, + margin: const EdgeInsets.symmetric(vertical: 10), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(20), + color: MyColors.darkGreyColor, + ), + ), + Expanded( + child: ListView.builder( + controller: controller, + itemCount: 1, + itemBuilder: (_, i) => Container( + decoration: const BoxDecoration( + borderRadius: BorderRadius.vertical( + top: Radius.circular(35.0), + ), + color: MyColors.backgroundBlackColor, + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Column(children: [ + "${getScheduleShiftsDetailsList!.sCHEDULEDATE!.substring(0, 9)}".toText24(isBold: true, color: Colors.white), + "Attendance Details".tr().toText16(color: MyColors.lightGreyEFColor), + 21.height, + ]).paddingOnly(top: 25, left: 21, right: 21, bottom: 10), + Center( + child: CircularStepProgressBar( + totalSteps: 16 * 4, + currentStep: percentage, + width: 210, + height: 210, + selectedColor: MyColors.gradiantEndColor, + unselectedColor: MyColors.grey70Color, + child: Center( + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + "${getScheduleShiftsDetailsList!.pERCENTAGE}".toText44(color: Colors.white, isBold: true), + "Completed".tr().toText11(color: MyColors.greyACColor), + 19.height, + "Shift Time".tr().toText11(color: MyColors.greyACColor), + "${getScheduleShiftsDetailsList!.sHTNAME}".toText22(color: Colors.white, isBold: true), + ], + ), + ), + ), + ), + Container( + padding: const EdgeInsets.only(top: 20, bottom: 20), + ), + Stack( + children: [ + Container( + height: 5, + padding: const EdgeInsets.only(top: 24, bottom: 24), + color: MyColors.backgroundBlackColor, + ), + Container( + width: double.infinity, + decoration: const BoxDecoration(borderRadius: BorderRadius.only(topLeft: Radius.circular(25), topRight: Radius.circular(25)), color: Colors.white), + padding: const EdgeInsets.only(left: 21, right: 21, top: 28, bottom: 24), + child: Column( + children: [ + Row( + children: [ + Container( + margin: const EdgeInsets.only(right: 30, left: 15), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + "Actual Check In ".tr().toText11( + color: MyColors.grey67Color, + ), + 8.height, + "${getScheduleShiftsDetailsList!.sHTACTUALSTARTTIME}".toText22(color: Colors.black, isBold: true), + ], + ), + ), + 40.width, + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + "Actual Check Out".tr().toText11( + color: MyColors.grey67Color, + ), + 8.height, + "${getScheduleShiftsDetailsList!.sHTACTUALENDTIME}".toText22(color: Colors.black, isBold: true), + ], + ), + ], + ), + 25.height, + const Divider( + height: 1, + thickness: 1, + color: MyColors.whiteColor, + ), + 25.height, + Row( + children: [ + Container( + margin: const EdgeInsets.only(right: 30, left: 15), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + "Approved Check In".tr().toText11( + color: MyColors.grey67Color, + ), + 8.height, + "${getScheduleShiftsDetailsList!.aPPROVEDSTARTTIME}".toText22(color: MyColors.greenColor, isBold: true), + ], + ), + ), + 30.width, + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + "Approved Check Out".tr().toText11( + color: MyColors.grey67Color, + ), + 8.height, + "${getScheduleShiftsDetailsList!.aPPROVEDENDTIME}".toText22(color: MyColors.greenColor, isBold: true), + ], + ), + ], + ), + 25.height, + const Divider( + height: 1, + thickness: 1, + color: MyColors.whiteColor, + ), + 25.height, + Row( + children: [ + Container( + margin: const EdgeInsets.only(right: 30, left: 15), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + "Late In".tr().toText11( + color: MyColors.grey67Color, + ), + 8.height, + "${getDayHoursTypeDetailsList[i].lATEINHRS}".toText22(color: MyColors.redColor, isBold: true), + ], + ), + ), + 80.width, + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + "Excess".tr().toText11( + color: MyColors.grey67Color, + ), + 8.height, + "${getDayHoursTypeDetailsList[i].eXCESSHRS}".toText22(color: Colors.black, isBold: true), + ], + ), + ], + ), + 25.height, + const Divider( + height: 1, + thickness: 1, + color: MyColors.whiteColor, + ), + 25.height, + Row( + children: [ + Container( + margin: const EdgeInsets.only(right: 30, left: 15), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + "Shortage".tr().toText11( + color: MyColors.grey67Color, + ), + 8.height, + "${getDayHoursTypeDetailsList[i].sHORTAGEHRS}".toText22(color: Colors.black, isBold: true), + ], + ), + ), + 80.width, + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + "Early Out".tr().toText11( + color: MyColors.grey67Color, + ), + 8.height, + "${getDayHoursTypeDetailsList[i].eARLYOUTHRS}".toText22(color: Colors.black, isBold: true), + ], + ), + ], + ), + ], + ), + ), + ], + ), + ], + ), + ), + ), + ), + ], + ); + }, + ); + }, + ); + } + + + List _getDataSource() { + final List meetings = []; + return meetings; + } + + static getMonth(int month) { + switch (month) { + case 1: + return "January"; + case 2: + return "February"; + case 3: + return "March"; + case 4: + return "April"; + case 5: + return "May"; + case 6: + return "June"; + case 7: + return "July"; + case 8: + return "August"; + case 9: + return "September"; + case 10: + return "October"; + case 11: + return "November"; + case 12: + return "December"; + } + } +} + +class MeetingDataSource extends CalendarDataSource { + MeetingDataSource(List source) { + appointments = source; + } + + @override + DateTime getStartTime(int index) { + return _getMeetingData(index).from; + } + + @override + DateTime getEndTime(int index) { + return _getMeetingData(index).to; + } + + @override + String getSubject(int index) { + return _getMeetingData(index).eventName; + } + + @override + Color getColor(int index) { + return _getMeetingData(index).background; + } + + @override + bool isAllDay(int index) { + return _getMeetingData(index).isAllDay; + } + + Meeting _getMeetingData(int index) { + final dynamic meeting = appointments; + Meeting meetingData; + if (meeting is Meeting) { + meetingData = meeting; + } + return meeting; + } +} + +class Meeting { + Meeting(this.eventName, this.from, this.to, this.background, this.isAllDay); + + String eventName; + DateTime from; + DateTime to; + Color background; + bool isAllDay; +} diff --git a/lib/ui/bottom_sheets/attendence_details_bottom_sheet.dart b/lib/ui/bottom_sheets/attendence_details_bottom_sheet.dart new file mode 100644 index 0000000..ea9f798 --- /dev/null +++ b/lib/ui/bottom_sheets/attendence_details_bottom_sheet.dart @@ -0,0 +1,228 @@ +import 'package:easy_localization/src/public_ext.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_svg/flutter_svg.dart'; +import 'package:mohem_flutter_app/classes/colors.dart'; +import 'package:mohem_flutter_app/extensions/int_extensions.dart'; +import 'package:mohem_flutter_app/extensions/string_extensions.dart'; +import 'package:mohem_flutter_app/extensions/widget_extensions.dart'; +import 'package:mohem_flutter_app/generated/locale_keys.g.dart'; +import 'package:mohem_flutter_app/widgets/circular_step_progress_bar.dart'; + +class AttendenceDetailsBottomSheet extends StatefulWidget { + + AttendenceDetailsBottomSheet({Key? key}) : super(key: key); + + @override + _AttendenceDetailsBottomSheetState createState() => _AttendenceDetailsBottomSheetState(); +} + +class _AttendenceDetailsBottomSheetState extends State { + @override + void initState() { + super.initState(); + } + + @override + void dispose() { + super.dispose(); + } + + @override + Widget build(BuildContext context) { + return Scaffold( + bottomSheet:BottomSheet( + + onClosing: () => print("not getting called"), + builder: (_) => Container( + color: Colors.red, + height: MediaQuery.of(context).size.height*0.9, + child: Column( + children: [ + Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.vertical( top: Radius.circular(25.0),), + color: MyColors.backgroundBlackColor, + ), + margin:EdgeInsets.only(top: 45) , + padding: EdgeInsets.only(left: 11, right: 11, bottom: 21), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Center( + child: Padding( + padding: const EdgeInsets.all(10), + child: Container( + margin:EdgeInsets.only(top: 5) , + decoration: BoxDecoration( + borderRadius: BorderRadius.all(Radius.circular(35.0),), + color: Color(0xff464646), + ), + width: 80, + height: 6, + ), + ), + ), + Container( + padding: EdgeInsets.only(top: 25,left: 11, right: 11, bottom: 10), + child: Column(children: [ + "June 13, 2021".toText24(isBold: true, color: Colors.white), + // LocaleKeys.attendanceDetails.tr().toText16(color: Color(0xffACACAC)), + // LocaleKeys.timeLeftToday.tr().toText16(color: Color(0xffACACAC)), + 21.height, + ] ), + ), + Center( + child: CircularStepProgressBar( + totalSteps: 16 * 4, + currentStep: 16, + width: 210, + height: 210, + selectedColor: MyColors.gradiantEndColor, + unselectedColor: MyColors.grey70Color, + child: Center( + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + "99%".toText32(color: Colors.white, isBold: true), + "Completed".tr().toText12(color: MyColors.greyACColor), + 19.height, + "Shift Time".tr().toText12(color: MyColors.greyACColor), + "08:00 - 17:00".toText22(color: Colors.white, isBold: true), + ], + ), + ), + ), + ), + ], + ), + ), + Stack( + children: [ + Container( + height: 32, + // padding: EdgeInsets.only(top: 24, bottom: 24), + color: MyColors.backgroundBlackColor, + ), + Container( + width: double.infinity, + decoration: BoxDecoration(borderRadius: BorderRadius.only(topLeft: Radius.circular(25), topRight: Radius.circular(25)), color: Colors.white), + margin: EdgeInsets.only(top: 10), + padding: EdgeInsets.only(left: 21, right: 21, top: 24, bottom: 24), + child: Row( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.spaceAround, + children:[ + Row( + children: [ + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + children: [ + "Actual Check In ".tr().toText12(color: MyColors.black), + ], + ), + SizedBox(height: 8,), + Row( + children: [ + "08:27".toText22(color: Colors.black, isBold: true), + ], + ), + SizedBox(height: 30,), + Row( + children: [ + "Approved Check In".tr().toText12(color: MyColors.black), + ], + ), + SizedBox(height: 8,), + Row( + children: [ + "09:27".toText22(color: Color(0xff1FA269), isBold: true), + ], + ), + SizedBox(height: 30,), + Row( + children: [ + "Late In".tr().toText12(color: MyColors.black), + ], + ), + SizedBox(height: 8,), + Row( + children: [ + "00:27".toText22(color: Color(0xffD02127), isBold: true), + ], + ), + SizedBox(height: 30,), + Row( + children: [ "Shortage".tr().toText12(color: MyColors.black), + ] ), + SizedBox(height: 8,), + Row( + children: [ + "00:00".toText22(color: Colors.black, isBold: true),], + ), + ], + ), + ], + ), + Row( + children: [ + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + children: [ + "Actual Check Out".tr().toText12(color: MyColors.black), + ], + ), + SizedBox(height: 8,), + Row( + children: [ + "18:20".toText22(color: Colors.black, isBold: true),], + ), + SizedBox(height: 30,), + Row( + children: [ "Approved Check Out".tr().toText12(color: MyColors.black), + ], + ), + SizedBox(height: 8,), + Row( + children: [ + "18:20".toText22(color: Color(0xff1FA269), isBold: true),], + ), + SizedBox(height: 30,), + Row( + children: ["Excess".tr().toText12(color: MyColors.black), + ], + ), + SizedBox(height: 8,), + Row( + children: [ + "00:00".toText22(color: Colors.black, isBold: true),], + ), + SizedBox(height: 30,), + Row( + children: ["Early Out".tr().toText12(color: MyColors.black), + ], + ), + SizedBox(height: 8,), + Row( + children: [ + "00:00".toText22(color: Colors.black, isBold: true),], + ), + ], + ), + ], + ), + ] ), + ), + ]), + ], + ), + ) + )); + + } + + +} diff --git a/lib/ui/profile/profile.dart b/lib/ui/profile/profile.dart new file mode 100644 index 0000000..a3fa1ae --- /dev/null +++ b/lib/ui/profile/profile.dart @@ -0,0 +1,288 @@ +import 'package:easy_localization/src/public_ext.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/extensions/int_extensions.dart'; +import 'package:mohem_flutter_app/extensions/string_extensions.dart'; +import 'package:mohem_flutter_app/extensions/widget_extensions.dart'; +import 'package:mohem_flutter_app/models/get_employee_basic_details.model.dart'; +import 'package:mohem_flutter_app/models/get_employee_contacts.model.dart'; + +class Profile extends StatefulWidget { + const Profile({Key? key}) : super(key: key); + + @override + _ProfileState createState() => _ProfileState(); +} + +class _ProfileState extends State { + String? fullName = ""; + String? maritalStatus = ""; + String? birthDate = ""; + String? civilIdentityNumber = ""; + String? emailAddress = ""; + String? employeeNo = ""; + + List getEmployeeBasicDetailsList = []; + + @override + void initState() { + super.initState(); + getEmployeeBasicDetails(); + basicDetails(); + } + + void getEmployeeBasicDetails() async { + try { + Utils.showLoading(context); + getEmployeeBasicDetailsList = await ProfileApiClient().getEmployeeBasicDetails(); + Utils.hideLoading(context); + basicDetails(); + print("getEmployeeBasicDetailsList.length"); + print(getEmployeeBasicDetailsList.length); + setState(() {}); + } catch (ex) { + Utils.hideLoading(context); + Utils.handleException(ex, context, null); + } + } + + basicDetails() { + for (int i = 0; i < getEmployeeBasicDetailsList.length; i++) { + if (getEmployeeBasicDetailsList[i].aPPLICATIONCOLUMNNAME == 'FULL_NAME') { + fullName = getEmployeeBasicDetailsList[i].sEGMENTVALUEDSP; + } else if (getEmployeeBasicDetailsList[i].aPPLICATIONCOLUMNNAME == 'MARITAL_STATUS') { + maritalStatus = getEmployeeBasicDetailsList[i].sEGMENTVALUEDSP; + } else if (getEmployeeBasicDetailsList[i].aPPLICATIONCOLUMNNAME == 'DATE_OF_BIRTH') { + birthDate = getEmployeeBasicDetailsList[i].sEGMENTVALUEDSP; + } else if (getEmployeeBasicDetailsList[i].aPPLICATIONCOLUMNNAME == 'NATIONAL_IDENTIFIER') { + civilIdentityNumber = getEmployeeBasicDetailsList[i].sEGMENTVALUEDSP; + } else if (getEmployeeBasicDetailsList[i].aPPLICATIONCOLUMNNAME == 'EMAIL_ADDRESS') { + emailAddress = getEmployeeBasicDetailsList[i].sEGMENTVALUEDSP; + } else if (getEmployeeBasicDetailsList[i].aPPLICATIONCOLUMNNAME == 'EMPLOYEE_NUMBER') { + employeeNo = getEmployeeBasicDetailsList[i].sEGMENTVALUEDSP; + } + } + } + + Widget build(BuildContext context) { + return Scaffold( + appBar: AppBar( + backgroundColor: MyColors.lightGreenColor, + leading: Row( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: [ + IconButton( + icon: const Icon( + Icons.arrow_back_ios, + color: MyColors.backgroundBlackColor, + ), + onPressed: () => Navigator.pop(context), + ), + ], + ), + ), + backgroundColor: MyColors.lightGreenColor, + body: Stack(children: [ + Align( + alignment: Alignment.topRight, + child: Container( + height: 30, + width: 80, + padding: EdgeInsets.only(left: 10.0, right: 10.0, top: 5, bottom: 5), + decoration: BoxDecoration( + border: Border.all( + color: MyColors.gradiantEndColor, + style: BorderStyle.solid, + ), + color: MyColors.gradiantEndColor, + borderRadius: BorderRadius.circular(100.0)), + child: InkWell( + onTap: () {}, + child: RichText( + text: TextSpan( + children: [ + WidgetSpan( + child: Icon( + Icons.image, + size: 20, + color: Colors.white, + ), + ), + TextSpan( + text: " Edit", + ), + ], + ), + ), + )), + ), + Container( + width: double.infinity, + margin: EdgeInsets.only(top: 48), + height: double.infinity, + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.only(topLeft: Radius.circular(30.0), topRight: Radius.circular(30.0)), + ), + child: Column( + children: [ + "${fullName}".toText20(isBold: true, color: MyColors.blackColor), + "${employeeNo}".toText12(isBold: false, color: MyColors.lightGrayColor), + "${emailAddress}".toText12(isBold: false, color: MyColors.black), + SizedBox( + height: 5, + ), + Divider( + color: MyColors.lightGreyE6Color, + height: 20, + thickness: 8, + indent: 0, + endIndent: 0, + ), + + Container( + padding: EdgeInsets.only(left: 10.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + InkWell( + onTap: () { + + }, + child: Row( + children: [ + + SizedBox( + width: 15, + ), + "Personal Information".toText16(isBold: true, color: MyColors.grey3AColor), + ], + ), + ), + SizedBox( + height: 5, + ), + InkWell( + onTap: () { + + }, + child: Row( + children: [ + + SizedBox( + width: 15, + ), + "Basic Details".toText16(isBold: true, color: MyColors.grey3AColor), + ], + ), + ), + SizedBox( + height: 5, + ), + InkWell( + onTap: () { + + }, + child: Row( + children: [ + + SizedBox( + width: 20, + ), + "Contact Details".toText16(isBold: true, color: MyColors.grey3AColor), + ], + ), + ), + SizedBox( + height: 5, + ), + InkWell( + onTap: () { + + }, + child: Row( + children: [ + + SizedBox( + width: 20, + ), + "Family Members".toText16(isBold: true, color: MyColors.grey3AColor), + ], + ), + ), + SizedBox( + height: 5, + ), + ], + ), + ), + ], + ).paddingOnly( top: 35, bottom: 36), + ), + Align( + alignment: Alignment.topCenter, + child: SizedBox( + child: CircleAvatar( + radius: 40.0, + backgroundColor: Colors.white, + child: CircleAvatar( + child: Align( + alignment: Alignment.bottomRight, + // child: CircleAvatar( + // backgroundColor: Colors.white, + // radius: 12.0, + // child: Icon( + // Icons.camera_alt, + // size: 15.0, + // color: Color(0xFF404040), + // ), + // ), + ), + radius: 38.0, + // url:"", + ), + ), + )), + ]) + // Container( + // margin: const EdgeInsets.only(top:50), + // decoration: const BoxDecoration( + // color: Colors.white, + // borderRadius: BorderRadius.only( + // topLeft: Radius.circular(30.0), + // topRight: Radius.circular(30.0)) + // ), + // // color: MyColors.white, + // child: Stack( + // children: [ + // Container( + // height: 30, + // color: MyColors.lightGreenColor, + // margin: const EdgeInsets.only(bottom: 20,), + // child: Row( + // mainAxisAlignment: MainAxisAlignment.center, + // children: [ + // CircleAvatar( + // backgroundColor: Colors.grey.shade800, + // ), + // ], + // ), + // ), + // ListView( + // scrollDirection: Axis.vertical, + // children: [ + // Column( + // children: [ + // // 20.height, + // ], + // ) + // ], + // ), + // ] + // ), + // ), + ); + } +} diff --git a/pubspec.yaml b/pubspec.yaml index d38cc5a..8afdae3 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -44,6 +44,9 @@ dependencies: sizer: ^2.0.15 local_auth: ^1.1.9 fluttertoast: ^8.0.8 + syncfusion_flutter_calendar: ^19.4.48 + flutter_calendar_carousel: ^2.1.0 + pie_chart: ^5.1.0 shared_preferences: ^2.0.12 firebase_messaging: ^11.2.8 shimmer: ^2.0.0