Merge branch 'master' into development_haroon
# Conflicts: # lib/models/generic_response_model.dart # lib/ui/landing/widget/app_drawer.dart # pubspec.yamlfaiz_marathon_signalR_critical
commit
fb2924964b
@ -0,0 +1,7 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="30" height="30" viewBox="0 0 30 30">
|
||||
<g id="phone-call_2_" data-name="phone-call (2)" transform="translate(0 0)">
|
||||
<g id="Group_7730" data-name="Group 7730" transform="translate(0 0)">
|
||||
<path id="Path_4724" data-name="Path 4724" d="M25.6,4.391A15,15,0,1,0,30,15,15,15,0,0,0,25.6,4.391Zm-2.888,16.5,0,0v0l-.76.755a4,4,0,0,1-3.775,1.08A13.291,13.291,0,0,1,14.32,21a17.834,17.834,0,0,1-3.045-2.455A17.971,17.971,0,0,1,9,15.781a14,14,0,0,1-1.71-3.46,4,4,0,0,1,1-4.085l.89-.89a.635.635,0,0,1,.9,0l0,0,2.81,2.81a.635.635,0,0,1,0,.9l0,0-1.65,1.65a1.345,1.345,0,0,0-.14,1.75,19.3,19.3,0,0,0,1.975,2.305,19.179,19.179,0,0,0,2.6,2.185,1.355,1.355,0,0,0,1.73-.15L19,17.177a.635.635,0,0,1,.9,0l0,0L22.715,20A.635.635,0,0,1,22.717,20.894Z" transform="translate(0 0)" fill="#2bb8a6"/>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 851 B |
@ -0,0 +1,6 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="20.438" height="20.438" viewBox="0 0 20.438 20.438">
|
||||
<g id="new-page" transform="translate(-1 -1)">
|
||||
<path id="Path_14" data-name="Path 14" d="M22.669,7H7.681A.681.681,0,0,0,7,7.681V22.669a.681.681,0,0,0,.681.681H22.669a.681.681,0,0,0,.681-.681V7.681A.681.681,0,0,0,22.669,7Zm-3.406,8.857H15.857v3.406H14.494V15.857H11.088V14.494h3.406V11.088h1.363v3.406h3.406Z" transform="translate(-1.912 -1.912)" fill="#2bb8a6"/>
|
||||
<path id="Path_15" data-name="Path 15" d="M17.351,3.725V1.681A.681.681,0,0,0,16.669,1H1.681A.681.681,0,0,0,1,1.681V16.669a.681.681,0,0,0,.681.681H3.725V5.769A2.044,2.044,0,0,1,5.769,3.725Z" fill="#2bb8a6"/>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 694 B |
@ -0,0 +1,14 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="17.232" height="19.606" viewBox="0 0 17.232 19.606">
|
||||
<g id="user_19_" data-name="user (19)" transform="translate(-31)">
|
||||
<g id="Group_7233" data-name="Group 7233" transform="translate(34.446)">
|
||||
<g id="Group_7232" data-name="Group 7232">
|
||||
<path id="Path_16" data-name="Path 16" d="M126.17,0a5.17,5.17,0,1,0,5.169,5.17A5.175,5.175,0,0,0,126.17,0Z" transform="translate(-121)" fill="#2bb8a6"/>
|
||||
</g>
|
||||
</g>
|
||||
<g id="Group_7235" data-name="Group 7235" transform="translate(31 11.488)">
|
||||
<g id="Group_7234" data-name="Group 7234">
|
||||
<path id="Path_17" data-name="Path 17" d="M46.048,302.228A7.369,7.369,0,0,0,40.765,300h-2.3a7.37,7.37,0,0,0-5.283,2.228A7.534,7.534,0,0,0,31,307.544a.574.574,0,0,0,.574.574H47.657a.574.574,0,0,0,.574-.574A7.534,7.534,0,0,0,46.048,302.228Z" transform="translate(-31 -300)" fill="#2bb8a6"/>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 936 B |
@ -0,0 +1,34 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="22.515" height="19.099" viewBox="0 0 22.515 19.099">
|
||||
<g id="group_2_" data-name="group (2)" transform="translate(0 -38.84)">
|
||||
<g id="Group_7238" data-name="Group 7238" transform="translate(17.523 49.151)">
|
||||
<g id="Group_7237" data-name="Group 7237" transform="translate(0 0)">
|
||||
<path id="Path_23" data-name="Path 23" d="M400.235,273.32h-1.741a4.53,4.53,0,0,1,.274,1.557v6.581a1.94,1.94,0,0,1-.112.65h2.879a1.952,1.952,0,0,0,1.95-1.95V276.57A3.254,3.254,0,0,0,400.235,273.32Z" transform="translate(-398.494 -273.32)" fill="#2bb8a6"/>
|
||||
</g>
|
||||
</g>
|
||||
<g id="Group_7240" data-name="Group 7240" transform="translate(0 49.151)">
|
||||
<g id="Group_7239" data-name="Group 7239">
|
||||
<path id="Path_24" data-name="Path 24" d="M4.717,274.878a4.529,4.529,0,0,1,.274-1.557H3.25A3.254,3.254,0,0,0,0,276.571v3.587a1.952,1.952,0,0,0,1.95,1.95H4.829a1.941,1.941,0,0,1-.112-.65Z" transform="translate(0 -273.321)" fill="#2bb8a6"/>
|
||||
</g>
|
||||
</g>
|
||||
<g id="Group_7242" data-name="Group 7242" transform="translate(6.017 47.458)">
|
||||
<g id="Group_7241" data-name="Group 7241" transform="translate(0 0)">
|
||||
<path id="Path_25" data-name="Path 25" d="M144.06,234.815h-3.981a3.254,3.254,0,0,0-3.25,3.25v6.581a.65.65,0,0,0,.65.65h9.181a.65.65,0,0,0,.65-.65v-6.581A3.254,3.254,0,0,0,144.06,234.815Z" transform="translate(-136.829 -234.815)" fill="#2bb8a6"/>
|
||||
</g>
|
||||
</g>
|
||||
<g id="Group_7244" data-name="Group 7244" transform="translate(7.349 38.84)">
|
||||
<g id="Group_7243" data-name="Group 7243" transform="translate(0 0)">
|
||||
<path id="Path_26" data-name="Path 26" d="M171.023,38.84a3.908,3.908,0,1,0,3.909,3.909A3.913,3.913,0,0,0,171.023,38.84Z" transform="translate(-167.114 -38.84)" fill="#2bb8a6"/>
|
||||
</g>
|
||||
</g>
|
||||
<g id="Group_7246" data-name="Group 7246" transform="translate(1.471 42.483)">
|
||||
<g id="Group_7245" data-name="Group 7245" transform="translate(0 0)">
|
||||
<path id="Path_27" data-name="Path 27" d="M36.366,121.689a2.922,2.922,0,1,0,2.923,2.923A2.926,2.926,0,0,0,36.366,121.689Z" transform="translate(-33.443 -121.689)" fill="#2bb8a6"/>
|
||||
</g>
|
||||
</g>
|
||||
<g id="Group_7248" data-name="Group 7248" transform="translate(15.198 42.483)">
|
||||
<g id="Group_7247" data-name="Group 7247" transform="translate(0 0)">
|
||||
<path id="Path_28" data-name="Path 28" d="M348.53,121.689a2.923,2.923,0,1,0,2.923,2.923A2.926,2.926,0,0,0,348.53,121.689Z" transform="translate(-345.607 -121.689)" fill="#2bb8a6"/>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 2.5 KiB |
@ -0,0 +1,6 @@
|
||||
<svg id="user_5_" data-name="user (5)" xmlns="http://www.w3.org/2000/svg" width="52.998" height="53" viewBox="0 0 52.998 53">
|
||||
<path id="Path_5018" data-name="Path 5018" d="M18.613,41.552l-7.907,4.313a7.106,7.106,0,0,0-1.269.9,26.483,26.483,0,0,0,34.027.088,7.015,7.015,0,0,0-1.394-.934L33.6,41.689A3.229,3.229,0,0,1,31.818,38.8V35.479a12.788,12.788,0,0,0,.8-1.03,19.483,19.483,0,0,0,2.632-5.3,2.659,2.659,0,0,0,1.886-2.53V23.069a2.647,2.647,0,0,0-.886-1.965V15.978S37.3,8,26.5,8s-9.75,7.977-9.75,7.977V21.1a2.644,2.644,0,0,0-.886,1.965v3.546a2.658,2.658,0,0,0,1.226,2.231A17.6,17.6,0,0,0,20.3,35.479v3.24A3.232,3.232,0,0,1,18.613,41.552Z" fill="#bcbcbc"/>
|
||||
<g id="Group_8632" data-name="Group 8632">
|
||||
<path id="Path_5019" data-name="Path 5019" d="M26.953,0A26.483,26.483,0,0,0,9.448,46.76a7.041,7.041,0,0,1,1.257-.894l7.907-4.313A3.23,3.23,0,0,0,20.3,38.718v-3.24a17.58,17.58,0,0,1-3.206-6.633,2.66,2.66,0,0,1-1.226-2.231V23.068a2.647,2.647,0,0,1,.886-1.965V15.977S15.7,8,26.5,8s9.75,7.977,9.75,7.977V21.1a2.644,2.644,0,0,1,.886,1.965v3.546a2.659,2.659,0,0,1-1.886,2.53,19.482,19.482,0,0,1-2.632,5.3,12.788,12.788,0,0,1-.8,1.03V38.8A3.228,3.228,0,0,0,33.6,41.688l8.467,4.233a7.05,7.05,0,0,1,1.39.932A26.494,26.494,0,0,0,26.953,0Z" fill="#e0e0e0"/>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.2 KiB |
@ -0,0 +1,8 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="18.591" height="22" viewBox="0 0 18.591 22">
|
||||
<g id="calendar_26_" data-name="calendar (26)" transform="translate(-7.31 -1.5)">
|
||||
<path id="Path_18" data-name="Path 18" d="M7.31,42.646a1.5,1.5,0,0,0,1.5,1.5h15.6a1.5,1.5,0,0,0,1.5-1.5V30.71H7.31Zm12.874-8.759H22.61v2.426H20.184Zm0,4.124H22.61v2.426H20.184Zm-4.79-4.124h2.423v2.426H15.394Zm0,4.124h2.423v2.426H15.394Zm-4.8-4.124h2.426v2.426H10.6Zm0,4.124h2.426v2.426H10.6Z" transform="translate(0 -20.642)" fill="#2bb8a6"/>
|
||||
<path id="Path_19" data-name="Path 19" d="M54.364,6.4a.264.264,0,0,0,.264-.264V1.764a.264.264,0,1,0-.528,0V6.141a.264.264,0,0,0,.264.264Z" transform="translate(-33.065)" fill="#2bb8a6"/>
|
||||
<path id="Path_20" data-name="Path 20" d="M24.405,9.4H22.082v2.323a.795.795,0,0,1-1.59,0V9.4H12.716v2.323a.795.795,0,1,1-1.587,0V9.4H8.806a1.5,1.5,0,0,0-1.5,1.5v4.227H25.9V10.9a1.5,1.5,0,0,0-1.5-1.5Z" transform="translate(0 -5.583)" fill="#2bb8a6"/>
|
||||
<path id="Path_21" data-name="Path 21" d="M22.364,6.465a.264.264,0,0,0,.267-.264V1.824a.267.267,0,0,0-.531,0V6.2a.264.264,0,0,0,.264.264Z" transform="translate(-10.452 -0.06)" fill="#2bb8a6"/>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.2 KiB |
@ -0,0 +1,146 @@
|
||||
import 'package:mohem_flutter_app/api/api_client.dart';
|
||||
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/leave_balance/calculate_absence_duration_model.dart';
|
||||
import 'package:mohem_flutter_app/models/leave_balance/cancel_hr_transaction_list_model.dart';
|
||||
import 'package:mohem_flutter_app/models/leave_balance/get_absence_attendance_types_list_model.dart';
|
||||
import 'package:mohem_flutter_app/models/leave_balance/get_absence_dff_structure_list_model.dart';
|
||||
import 'package:mohem_flutter_app/models/leave_balance/get_absence_transaction_list_model.dart';
|
||||
import 'package:mohem_flutter_app/models/leave_balance/start_absence_approval_proccess_model.dart';
|
||||
import 'package:mohem_flutter_app/models/leave_balance/sumbit_absence_transaction_list_model.dart';
|
||||
|
||||
class LeaveBalanceApiClient {
|
||||
static final LeaveBalanceApiClient _instance = LeaveBalanceApiClient._internal();
|
||||
|
||||
LeaveBalanceApiClient._internal();
|
||||
|
||||
factory LeaveBalanceApiClient() => _instance;
|
||||
|
||||
Future<List<GetAbsenceTransactionList>> getAbsenceTransactions(int pSelectedResopID) async {
|
||||
String url = "${ApiConsts.erpRest}GET_ABSENCE_TRANSACTIONS";
|
||||
Map<String, dynamic> postParams = {"P_PAGE_LIMIT": 50, "P_PAGE_NUM": 1, "P_MENU_TYPE": "E", "P_SELECTED_RESP_ID": pSelectedResopID};
|
||||
postParams.addAll(AppState().postParamsJson);
|
||||
return await ApiClient().postJsonForObject((json) {
|
||||
GenericResponseModel? responseData = GenericResponseModel.fromJson(json);
|
||||
return responseData.getAbsenceTransactionList ?? [];
|
||||
}, url, postParams);
|
||||
}
|
||||
|
||||
Future<List<GetAbsenceAttendanceTypesList>> getAbsenceAttendanceTypes() async {
|
||||
String url = "${ApiConsts.erpRest}GET_ABSENCE_ATTENDANCE_TYPES";
|
||||
Map<String, dynamic> postParams = {};
|
||||
postParams.addAll(AppState().postParamsJson);
|
||||
return await ApiClient().postJsonForObject((json) {
|
||||
GenericResponseModel? responseData = GenericResponseModel.fromJson(json);
|
||||
return responseData.getAbsenceAttendanceTypesList ?? [];
|
||||
}, url, postParams);
|
||||
}
|
||||
|
||||
Future<CalculateAbsenceDuration> calculateAbsenceDuration(int pAbsenceAttendanceTypeID, String pDateStart, String pDateEnd, int pSelectedResopID) async {
|
||||
String url = "${ApiConsts.erpRest}CALCULATE_ABSENCE_DURATION";
|
||||
Map<String, dynamic> postParams = {
|
||||
"P_ABSENCE_ATTENDANCE_TYPE_ID": pAbsenceAttendanceTypeID,
|
||||
"P_DATE_START": pDateStart,
|
||||
"P_DATE_END": pDateEnd,
|
||||
"P_SELECTED_RESP_ID": pSelectedResopID,
|
||||
"P_MENU_TYPE": "E",
|
||||
"P_TIME_END": null,
|
||||
"P_TIME_START": null,
|
||||
};
|
||||
postParams.addAll(AppState().postParamsJson);
|
||||
return await ApiClient().postJsonForObject((json) {
|
||||
GenericResponseModel? responseData = GenericResponseModel.fromJson(json);
|
||||
return responseData.calculateAbsenceDuration!;
|
||||
}, url, postParams);
|
||||
}
|
||||
|
||||
Future<List<GetAbsenceDffStructureList>> getAbsenceDffStructure(String pDescFlexContextCode, String pFunctionName, int pSelectedResopID) async {
|
||||
String url = "${ApiConsts.erpRest}GET_ABSENCE_DFF_STRUCTURE";
|
||||
Map<String, dynamic> postParams = {"P_DESC_FLEX_CONTEXT_CODE": pDescFlexContextCode, "P_FUNCTION_NAME": pFunctionName, "P_MENU_TYPE": "E", "P_SELECTED_RESP_ID": pSelectedResopID};
|
||||
postParams.addAll(AppState().postParamsJson);
|
||||
return await ApiClient().postJsonForObject((json) {
|
||||
GenericResponseModel? responseData = GenericResponseModel.fromJson(json);
|
||||
return responseData.getAbsenceDffStructureList ?? [];
|
||||
}, url, postParams);
|
||||
}
|
||||
|
||||
Future<GenericResponseModel> validateAbsenceTransaction(
|
||||
String pDescFlexContextCode, String pFunctionName, int pAbsenceAttendanceTypeID, String pReplacementUserName, String pDateStart, String pDateEnd, int pSelectedResopID, Map<String, String?> data,
|
||||
{String comments = ""}) async {
|
||||
String url = "${ApiConsts.erpRest}VALIDATE_ABSENCE_TRANSACTION";
|
||||
Map<String, dynamic> postParams = {
|
||||
"P_DESC_FLEX_CONTEXT_CODE": pDescFlexContextCode,
|
||||
"P_FUNCTION_NAME": pFunctionName,
|
||||
"P_REPLACEMENT_USER_NAME": pReplacementUserName,
|
||||
"P_ABSENCE_ACTION": "CREATE",
|
||||
"P_ABSENCE_COMMENTS": comments,
|
||||
"P_ABSENCE_ATTENDANCE_ID": pAbsenceAttendanceTypeID,
|
||||
"P_ABSENCE_ATTENDANCE_TYPE_ID": pAbsenceAttendanceTypeID,
|
||||
"P_DATE_START": pDateStart,
|
||||
"P_DATE_END": pDateEnd, //"29-Sep-2022",
|
||||
"P_SELECTED_RESP_ID": pSelectedResopID,
|
||||
"P_MENU_TYPE": "E",
|
||||
"P_TIME_END": null,
|
||||
"P_TIME_START": null,
|
||||
};
|
||||
postParams.addAll(data);
|
||||
postParams.addAll(AppState().postParamsJson);
|
||||
return await ApiClient().postJsonForObject((json) {
|
||||
GenericResponseModel? responseData = GenericResponseModel.fromJson(json);
|
||||
return responseData;
|
||||
}, url, postParams);
|
||||
}
|
||||
|
||||
Future<SumbitAbsenceTransactionList> submitAbsenceTransaction(
|
||||
String pDescFlexContextCode, String pFunctionName, int pAbsenceAttendanceTypeID, String pReplacementUserName, String pDateStart, String pDateEnd, int pSelectedResopID, Map<String, String?> data,
|
||||
{String comments = ""}) async {
|
||||
String url = "${ApiConsts.erpRest}SUBMIT_ABSENCE_TRANSACTION";
|
||||
Map<String, dynamic> postParams = {
|
||||
"P_DESC_FLEX_CONTEXT_CODE": pDescFlexContextCode,
|
||||
"P_FUNCTION_NAME": pFunctionName,
|
||||
"P_REPLACEMENT_USER_NAME": pReplacementUserName,
|
||||
"P_ABSENCE_ACTION": "CREATE",
|
||||
"P_ABSENCE_COMMENTS": comments,
|
||||
"P_ABSENCE_ATTENDANCE_ID": pAbsenceAttendanceTypeID,
|
||||
"P_ABSENCE_ATTENDANCE_TYPE_ID": pAbsenceAttendanceTypeID,
|
||||
"P_DATE_START": pDateStart,
|
||||
"P_DATE_END": pDateEnd, //"29-Sep-2022",
|
||||
"P_SELECTED_RESP_ID": pSelectedResopID,
|
||||
"P_MENU_TYPE": "E",
|
||||
"P_TIME_END": null,
|
||||
"P_TIME_START": null,
|
||||
};
|
||||
postParams.addAll(data);
|
||||
postParams.addAll(AppState().postParamsJson);
|
||||
return await ApiClient().postJsonForObject((json) {
|
||||
GenericResponseModel? responseData = GenericResponseModel.fromJson(json);
|
||||
return responseData.sumbitAbsenceTransactionList!;
|
||||
}, url, postParams);
|
||||
}
|
||||
|
||||
Future<CancelHRTransactionLIst> cancelHrTransaction(int pTransactionID) async {
|
||||
String url = "${ApiConsts.erpRest}CANCEL_HR_TRANSACTION";
|
||||
Map<String, dynamic> postParams = {"P_TRANSACTION_ID": pTransactionID};
|
||||
postParams.addAll(AppState().postParamsJson);
|
||||
return await ApiClient().postJsonForObject((json) {
|
||||
GenericResponseModel? responseData = GenericResponseModel.fromJson(json);
|
||||
return responseData.cancelHRTransactionLIst!;
|
||||
}, url, postParams);
|
||||
}
|
||||
|
||||
Future<StartAbsenceApprovalProccess> startAbsenceApprovalProcess(int pTransactionID, String comments, int pSelectedResopID) async {
|
||||
String url = "${ApiConsts.erpRest}START_ABSENCE_APPROVAL_PROCESS";
|
||||
Map<String, dynamic> postParams = {
|
||||
"P_TRANSACTION_ID": pTransactionID,
|
||||
"P_SELECTED_RESP_ID": pSelectedResopID,
|
||||
"P_COMMENTS": comments,
|
||||
"P_MENU_TYPE": "E",
|
||||
};
|
||||
postParams.addAll(AppState().postParamsJson);
|
||||
return await ApiClient().postJsonForObject((json) {
|
||||
GenericResponseModel? responseData = GenericResponseModel.fromJson(json);
|
||||
return responseData.startAbsenceApprovalProccess!;
|
||||
}, url, postParams);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,163 @@
|
||||
|
||||
|
||||
import 'package:mohem_flutter_app/api/api_client.dart';
|
||||
import 'package:mohem_flutter_app/app_state/app_state.dart';
|
||||
import 'package:mohem_flutter_app/classes/consts.dart';
|
||||
import 'package:mohem_flutter_app/models/dashboard/get_attendance_tracking_list_model.dart';
|
||||
import 'package:mohem_flutter_app/models/dashboard/menu_entries.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_time_card_summary_list_model.dart';
|
||||
import 'package:mohem_flutter_app/models/my_team/get_employee_subordinates_list.dart';
|
||||
import 'package:mohem_flutter_app/models/my_team/get_subordinates_leaves_total_vacations_list_model.dart';
|
||||
import 'package:mohem_flutter_app/models/worklist/get_favorite_replacements_model.dart';
|
||||
|
||||
class MyTeamApiClient {
|
||||
static final MyTeamApiClient _instance = MyTeamApiClient._internal();
|
||||
|
||||
MyTeamApiClient._internal();
|
||||
|
||||
factory MyTeamApiClient() => _instance;
|
||||
|
||||
|
||||
Future<List<GetEmployeeSubordinatesList>> getEmployeeSubordinates(String searchEmpEmail, String searchEmpName, String searchEmpNo) async {
|
||||
String url = "${ApiConsts.erpRest}GET_EMPLOYEE_SUBORDINATES";
|
||||
Map<String, dynamic> postParams = {
|
||||
"P_PAGE_LIMIT": 50,
|
||||
"P_PAGE_NUM": 1,
|
||||
"P_SEARCH_EMAIL_ADDRESS": searchEmpEmail,
|
||||
"P_SEARCH_EMPLOYEE_DISPLAY_NAME": searchEmpName,
|
||||
"P_SEARCH_EMPLOYEE_NUMBER": searchEmpNo,
|
||||
};
|
||||
postParams.addAll(AppState().postParamsJson);
|
||||
return await ApiClient().postJsonForObject((json) {
|
||||
GenericResponseModel? responseData = GenericResponseModel.fromJson(json);
|
||||
return responseData.getEmployeeSubordinatesList ?? [];
|
||||
}, url, postParams);
|
||||
}
|
||||
|
||||
Future<GetTimeCardSummaryList?> getTimeCardSummary(String month, int year, String? empID) async {
|
||||
String url = "${ApiConsts.erpRest}GET_TIME_CARD_SUMMARY";
|
||||
Map<String, dynamic> postParams = {
|
||||
"P_MENU_TYPE": "M",
|
||||
"P_SELECTED_RESP_ID": -999,
|
||||
"SearchMonth": month,
|
||||
"SearchYear": year,
|
||||
};
|
||||
|
||||
postParams.addAll(AppState().postParamsJson);
|
||||
postParams['P_SELECTED_EMPLOYEE_NUMBER'] = empID;
|
||||
return await ApiClient().postJsonForObject((json) {
|
||||
GenericResponseModel? responseData = GenericResponseModel.fromJson(json);
|
||||
return (responseData.getTimeCardSummaryList?.length ?? 0) > 0 ? responseData.getTimeCardSummaryList!.first : null;
|
||||
}, url, postParams);
|
||||
}
|
||||
|
||||
Future<List<GetDayHoursTypeDetailsList>> getDayHoursTypeDetails(String month, int year, String? empID) async {
|
||||
String url = "${ApiConsts.erpRest}GET_DAY_HOURS_TYPE_DETAILS";
|
||||
Map<String, dynamic> postParams = {
|
||||
"P_MENU_TYPE": "M",
|
||||
"P_PAGE_LIMIT": 100,
|
||||
"P_PAGE_NUM": 1,
|
||||
"P_SELECTED_RESP_ID": -999,
|
||||
"SearchMonth": month,
|
||||
"SearchYear": year,
|
||||
};
|
||||
postParams.addAll(AppState().postParamsJson);
|
||||
postParams['P_SELECTED_EMPLOYEE_NUMBER'] = empID;
|
||||
return await ApiClient().postJsonForObject((json) {
|
||||
GenericResponseModel? responseData = GenericResponseModel.fromJson(json);
|
||||
print(responseData.getDayHoursTypeDetailsList!.length);
|
||||
return responseData.getDayHoursTypeDetailsList ?? [];
|
||||
}, url, postParams);
|
||||
}
|
||||
|
||||
|
||||
Future<GetAttendanceTracking?> getAttendanceTracking(String? empID) async {
|
||||
String url = "${ApiConsts.erpRest}GET_Attendance_Tracking";
|
||||
Map<String, dynamic> postParams = {};
|
||||
postParams.addAll(AppState().postParamsJson);
|
||||
postParams['P_SELECTED_EMPLOYEE_NUMBER'] = empID;
|
||||
return await ApiClient().postJsonForObject((json) {
|
||||
GenericResponseModel? responseData = GenericResponseModel.fromJson(json);
|
||||
print(responseData.getAttendanceTrackingList);
|
||||
return responseData.getAttendanceTrackingList;
|
||||
}, url, postParams);
|
||||
}
|
||||
|
||||
Future<List<GetEmployeeSubordinatesList>> employeeSubordinates(String searchEmpEmail, String searchEmpName, String searchEmpNo, String? empID) async {
|
||||
String url = "${ApiConsts.erpRest}GET_EMPLOYEE_SUBORDINATES";
|
||||
Map<String, dynamic> postParams = {
|
||||
"P_PAGE_LIMIT": 50,
|
||||
"P_PAGE_NUM": 1,
|
||||
"P_SEARCH_EMAIL_ADDRESS": searchEmpEmail,
|
||||
"P_SEARCH_EMPLOYEE_DISPLAY_NAME": searchEmpName,
|
||||
"P_SEARCH_EMPLOYEE_NUMBER": searchEmpNo,
|
||||
};
|
||||
postParams.addAll(AppState().postParamsJson);
|
||||
postParams['P_SELECTED_EMPLOYEE_NUMBER'] = empID;
|
||||
return await ApiClient().postJsonForObject((json) {
|
||||
GenericResponseModel? responseData = GenericResponseModel.fromJson(json);
|
||||
return responseData.getEmployeeSubordinatesList ?? [];
|
||||
}, url, postParams);
|
||||
}
|
||||
|
||||
Future<List<GetMenuEntriesList>> employeeSubordinatesRequest(String? empID) async {
|
||||
String url = "${ApiConsts.erpRest}GET_MENU_ENTRIES";
|
||||
Map<String, dynamic> postParams = {
|
||||
"P_MENU_TYPE": "M",
|
||||
"P_SELECTED_RESP_ID": -999,
|
||||
};
|
||||
postParams.addAll(AppState().postParamsJson);
|
||||
postParams['P_SELECTED_EMPLOYEE_NUMBER'] = empID;
|
||||
return await ApiClient().postJsonForObject((json) {
|
||||
GenericResponseModel? responseData = GenericResponseModel.fromJson(json);
|
||||
return responseData.getMenuEntriesList ?? [];
|
||||
}, url, postParams);
|
||||
}
|
||||
|
||||
Future<List<GetFavoriteReplacements>?> getFavoriteReplacement() async {
|
||||
String url = "${ApiConsts.erpRest}Mohemm_GetFavoriteReplacements";
|
||||
Map<String, dynamic> postParams = {
|
||||
};
|
||||
postParams.addAll(AppState().postParamsJson);
|
||||
return await ApiClient().postJsonForObject((json) {
|
||||
GenericResponseModel responseData = GenericResponseModel.fromJson(json);
|
||||
return responseData.mohemmGetFavoriteReplacementsList;
|
||||
}, url, postParams);
|
||||
}
|
||||
|
||||
Future<GenericResponseModel> changeFavoriteReplacements({required String email, required String employeName, required String image, required String userName, bool isFav = false}) async {
|
||||
String url = "${ApiConsts.erpRest}Mohemm_ChangeFavoriteReplacements";
|
||||
Map<String, dynamic> postParamsObj = {
|
||||
"EMAIL_ADDRESS": email,
|
||||
"EMPLOYEE_DISPLAY_NAME": employeName,
|
||||
"EMPLOYEE_IMAGE": image,
|
||||
"IsFavorite": isFav,
|
||||
"USER_NAME": userName,
|
||||
};
|
||||
Map<String, dynamic> postParams = {
|
||||
"Mohemm_ChangeReplacementsInputList": [postParamsObj],
|
||||
//postParams["Mohemm_ChangeReplacementsInputList"] = list;
|
||||
};
|
||||
postParams.addAll(AppState().postParamsJson);
|
||||
return await ApiClient().postJsonForObject((json) {
|
||||
GenericResponseModel responseData = GenericResponseModel.fromJson(json);
|
||||
return responseData;
|
||||
}, url, postParams);
|
||||
}
|
||||
|
||||
Future<List<GetSubordinatesLeavesTotalVacationsList>> getSubordinatesLeavesList(String dateFrom, String dateTo) async {
|
||||
String url = "${ApiConsts.erpRest}GET_SUBORDINATES_LEAVES_TOTAL_VACATIONS";
|
||||
Map<String, dynamic> postParams = {
|
||||
"P_DATE_FROM": dateFrom,
|
||||
"P_DATE_TO": dateTo,
|
||||
};
|
||||
postParams.addAll(AppState().postParamsJson);
|
||||
return await ApiClient().postJsonForObject((json) {
|
||||
GenericResponseModel responseData = GenericResponseModel.fromJson(json);
|
||||
return responseData.getSubordinatesLeavesTotalVacationsList ?? [];
|
||||
}, url, postParams);
|
||||
}
|
||||
}
|
||||
|
||||
@ -0,0 +1,35 @@
|
||||
|
||||
|
||||
class GetUserItemTypesList {
|
||||
String? fYAENABLEDFALG;
|
||||
String? fYIENABLEDFLAG;
|
||||
String? iTEMTYPE;
|
||||
int? uSERITEMTYPEID;
|
||||
bool? isFYI;
|
||||
bool? isFYA;
|
||||
|
||||
GetUserItemTypesList(
|
||||
{this.fYAENABLEDFALG,
|
||||
this.fYIENABLEDFLAG,
|
||||
this.iTEMTYPE,
|
||||
this.uSERITEMTYPEID,
|
||||
this.isFYI,
|
||||
this.isFYA
|
||||
});
|
||||
|
||||
GetUserItemTypesList.fromJson(Map<String, dynamic> json) {
|
||||
fYAENABLEDFALG = json['FYA_ENABLED_FALG'];
|
||||
fYIENABLEDFLAG = json['FYI_ENABLED_FLAG'];
|
||||
iTEMTYPE = json['ITEM_TYPE'];
|
||||
uSERITEMTYPEID = json['USER_ITEM_TYPE_ID'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
data['FYA_ENABLED_FALG'] = this.fYAENABLEDFALG;
|
||||
data['FYI_ENABLED_FLAG'] = this.fYIENABLEDFLAG;
|
||||
data['ITEM_TYPE'] = this.iTEMTYPE;
|
||||
data['USER_ITEM_TYPE_ID'] = this.uSERITEMTYPEID;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,24 @@
|
||||
class CalculateAbsenceDuration {
|
||||
int? pABSENCEDAYS;
|
||||
int? pABSENCEHOURS;
|
||||
String? pRETURNMSG;
|
||||
String? pRETURNSTATUS;
|
||||
|
||||
CalculateAbsenceDuration({this.pABSENCEDAYS, this.pABSENCEHOURS, this.pRETURNMSG, this.pRETURNSTATUS});
|
||||
|
||||
CalculateAbsenceDuration.fromJson(Map<String, dynamic> json) {
|
||||
pABSENCEDAYS = json['P_ABSENCE_DAYS'];
|
||||
pABSENCEHOURS = json['P_ABSENCE_HOURS'];
|
||||
pRETURNMSG = json['P_RETURN_MSG'];
|
||||
pRETURNSTATUS = json['P_RETURN_STATUS'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
data['P_ABSENCE_DAYS'] = this.pABSENCEDAYS;
|
||||
data['P_ABSENCE_HOURS'] = this.pABSENCEHOURS;
|
||||
data['P_RETURN_MSG'] = this.pRETURNMSG;
|
||||
data['P_RETURN_STATUS'] = this.pRETURNSTATUS;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,18 @@
|
||||
class CancelHRTransactionLIst {
|
||||
String? pRETURNMSG;
|
||||
String? pRETURNSTATUS;
|
||||
|
||||
CancelHRTransactionLIst({this.pRETURNMSG, this.pRETURNSTATUS});
|
||||
|
||||
CancelHRTransactionLIst.fromJson(Map<String, dynamic> json) {
|
||||
pRETURNMSG = json['P_RETURN_MSG'];
|
||||
pRETURNSTATUS = json['P_RETURN_STATUS'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
data['P_RETURN_MSG'] = this.pRETURNMSG;
|
||||
data['P_RETURN_STATUS'] = this.pRETURNSTATUS;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,24 @@
|
||||
class GetAbsenceAttendanceTypesList {
|
||||
int? aBSENCEATTENDANCETYPEID;
|
||||
String? aBSENCEATTENDANCETYPENAME;
|
||||
String? dESCFLEXCONTEXTCODE;
|
||||
String? hOURSORDAYS;
|
||||
|
||||
GetAbsenceAttendanceTypesList({this.aBSENCEATTENDANCETYPEID, this.aBSENCEATTENDANCETYPENAME, this.dESCFLEXCONTEXTCODE, this.hOURSORDAYS});
|
||||
|
||||
GetAbsenceAttendanceTypesList.fromJson(Map<String, dynamic> json) {
|
||||
aBSENCEATTENDANCETYPEID = json['ABSENCE_ATTENDANCE_TYPE_ID'];
|
||||
aBSENCEATTENDANCETYPENAME = json['ABSENCE_ATTENDANCE_TYPE_NAME'];
|
||||
dESCFLEXCONTEXTCODE = json['DESC_FLEX_CONTEXT_CODE'];
|
||||
hOURSORDAYS = json['HOURS_OR_DAYS'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
data['ABSENCE_ATTENDANCE_TYPE_ID'] = this.aBSENCEATTENDANCETYPEID;
|
||||
data['ABSENCE_ATTENDANCE_TYPE_NAME'] = this.aBSENCEATTENDANCETYPENAME;
|
||||
data['DESC_FLEX_CONTEXT_CODE'] = this.dESCFLEXCONTEXTCODE;
|
||||
data['HOURS_OR_DAYS'] = this.hOURSORDAYS;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,195 @@
|
||||
import 'package:mohem_flutter_app/models/get_eit_dff_structure_list_model.dart';
|
||||
|
||||
class GetAbsenceDffStructureList {
|
||||
String? aLPHANUMERICALLOWEDFLAG;
|
||||
String? aPPLICATIONCOLUMNNAME;
|
||||
String? cHILDSEGMENTSDV;
|
||||
List<String>? cHILDSEGMENTSDVSplited;
|
||||
String? cHILDSEGMENTSVS;
|
||||
List<String>? cHILDSEGMENTSVSSplited;
|
||||
String? dEFAULTTYPE;
|
||||
String? dEFAULTVALUE;
|
||||
String? dESCFLEXCONTEXTCODE;
|
||||
String? dESCFLEXCONTEXTNAME;
|
||||
String? dESCFLEXNAME;
|
||||
String? dISPLAYFLAG;
|
||||
String? eNABLEDFLAG;
|
||||
ESERVICESDV? eSERVICESDV;
|
||||
List<ESERVICESVS>? eSERVICESVS;
|
||||
String? fLEXVALUESETNAME;
|
||||
String? fORMATTYPE;
|
||||
String? fORMATTYPEDSP;
|
||||
bool? isEmptyOption;
|
||||
String? lONGLISTFLAG;
|
||||
int? mAXIMUMSIZE;
|
||||
String? mAXIMUMVALUE;
|
||||
String? mINIMUMVALUE;
|
||||
String? mOBILEENABLED;
|
||||
String? nUMBERPRECISION;
|
||||
String? nUMERICMODEENABLEDFLAG;
|
||||
String? pARENTSEGMENTSDV;
|
||||
List<PARENTSEGMENTSDVSplited>? pARENTSEGMENTSDVSplited;
|
||||
String? pARENTSEGMENTSVS;
|
||||
List<PARENTSEGMENTSVSSplitedVS>? pARENTSEGMENTSVSSplitedVS;
|
||||
String? rEADONLY;
|
||||
String? rEQUIREDFLAG;
|
||||
String? sEGMENTNAME;
|
||||
String? sEGMENTPROMPT;
|
||||
int? sEGMENTSEQNUM;
|
||||
String? uPPERCASEONLYFLAG;
|
||||
String? uSEDFLAG;
|
||||
String? vALIDATIONTYPE;
|
||||
String? vALIDATIONTYPEDSP;
|
||||
|
||||
GetAbsenceDffStructureList(
|
||||
{this.aLPHANUMERICALLOWEDFLAG,
|
||||
this.aPPLICATIONCOLUMNNAME,
|
||||
this.cHILDSEGMENTSDV,
|
||||
this.cHILDSEGMENTSDVSplited,
|
||||
this.cHILDSEGMENTSVS,
|
||||
this.cHILDSEGMENTSVSSplited,
|
||||
this.dEFAULTTYPE,
|
||||
this.dEFAULTVALUE,
|
||||
this.dESCFLEXCONTEXTCODE,
|
||||
this.dESCFLEXCONTEXTNAME,
|
||||
this.dESCFLEXNAME,
|
||||
this.dISPLAYFLAG,
|
||||
this.eNABLEDFLAG,
|
||||
this.eSERVICESDV,
|
||||
this.eSERVICESVS,
|
||||
this.fLEXVALUESETNAME,
|
||||
this.fORMATTYPE,
|
||||
this.fORMATTYPEDSP,
|
||||
this.isEmptyOption,
|
||||
this.lONGLISTFLAG,
|
||||
this.mAXIMUMSIZE,
|
||||
this.mAXIMUMVALUE,
|
||||
this.mINIMUMVALUE,
|
||||
this.mOBILEENABLED,
|
||||
this.nUMBERPRECISION,
|
||||
this.nUMERICMODEENABLEDFLAG,
|
||||
this.pARENTSEGMENTSDV,
|
||||
this.pARENTSEGMENTSDVSplited,
|
||||
this.pARENTSEGMENTSVS,
|
||||
this.pARENTSEGMENTSVSSplitedVS,
|
||||
this.rEADONLY,
|
||||
this.rEQUIREDFLAG,
|
||||
this.sEGMENTNAME,
|
||||
this.sEGMENTPROMPT,
|
||||
this.sEGMENTSEQNUM,
|
||||
this.uPPERCASEONLYFLAG,
|
||||
this.uSEDFLAG,
|
||||
this.vALIDATIONTYPE,
|
||||
this.vALIDATIONTYPEDSP});
|
||||
|
||||
GetAbsenceDffStructureList.fromJson(Map<String, dynamic> json) {
|
||||
aLPHANUMERICALLOWEDFLAG = json['ALPHANUMERIC_ALLOWED_FLAG'];
|
||||
aPPLICATIONCOLUMNNAME = json['APPLICATION_COLUMN_NAME'];
|
||||
cHILDSEGMENTSDV = json['CHILD_SEGMENTS_DV'];
|
||||
cHILDSEGMENTSDVSplited = json['CHILD_SEGMENTS_DV_Splited'] == null ? <String>[] : json['CHILD_SEGMENTS_DV_Splited'].cast<String>();
|
||||
cHILDSEGMENTSVS = json['CHILD_SEGMENTS_VS'];
|
||||
cHILDSEGMENTSVSSplited = json['CHILD_SEGMENTS_VS_Splited']== null ? <String>[] : json['CHILD_SEGMENTS_VS_Splited'].cast<String>();
|
||||
dEFAULTTYPE = json['DEFAULT_TYPE'];
|
||||
dEFAULTVALUE = json['DEFAULT_VALUE'];
|
||||
dESCFLEXCONTEXTCODE = json['DESC_FLEX_CONTEXT_CODE'];
|
||||
dESCFLEXCONTEXTNAME = json['DESC_FLEX_CONTEXT_NAME'];
|
||||
dESCFLEXNAME = json['DESC_FLEX_NAME'];
|
||||
dISPLAYFLAG = json['DISPLAY_FLAG'];
|
||||
eNABLEDFLAG = json['ENABLED_FLAG'];
|
||||
eSERVICESDV = json['E_SERVICES_DV'] != null ? new ESERVICESDV.fromJson(json['E_SERVICES_DV']) : null;
|
||||
if (json['E_SERVICES_VS'] != null) {
|
||||
eSERVICESVS = <ESERVICESVS>[];
|
||||
json['E_SERVICES_VS'].forEach((v) {
|
||||
eSERVICESVS!.add(new ESERVICESVS.fromJson(v));
|
||||
});
|
||||
}
|
||||
fLEXVALUESETNAME = json['FLEX_VALUE_SET_NAME'];
|
||||
fORMATTYPE = json['FORMAT_TYPE'];
|
||||
fORMATTYPEDSP = json['FORMAT_TYPE_DSP'];
|
||||
isEmptyOption = json['IsEmptyOption'];
|
||||
lONGLISTFLAG = json['LONGLIST_FLAG'];
|
||||
mAXIMUMSIZE = json['MAXIMUM_SIZE'];
|
||||
mAXIMUMVALUE = json['MAXIMUM_VALUE'];
|
||||
mINIMUMVALUE = json['MINIMUM_VALUE'];
|
||||
mOBILEENABLED = json['MOBILE_ENABLED'];
|
||||
nUMBERPRECISION = json['NUMBER_PRECISION'];
|
||||
nUMERICMODEENABLEDFLAG = json['NUMERIC_MODE_ENABLED_FLAG'];
|
||||
pARENTSEGMENTSDV = json['PARENT_SEGMENTS_DV'];
|
||||
if (json['PARENT_SEGMENTS_DV_Splited'] != null) {
|
||||
pARENTSEGMENTSDVSplited = <PARENTSEGMENTSDVSplited>[];
|
||||
json['PARENT_SEGMENTS_DV_Splited'].forEach((v) {
|
||||
pARENTSEGMENTSDVSplited!.add(PARENTSEGMENTSDVSplited.fromJson(v));
|
||||
});
|
||||
}
|
||||
pARENTSEGMENTSVS = json['PARENT_SEGMENTS_VS'];
|
||||
if (json['PARENT_SEGMENTS_VS_SplitedVS'] != null) {
|
||||
pARENTSEGMENTSVSSplitedVS = <PARENTSEGMENTSVSSplitedVS>[];
|
||||
json['PARENT_SEGMENTS_VS_SplitedVS'].forEach((v) {
|
||||
pARENTSEGMENTSVSSplitedVS!.add(new PARENTSEGMENTSVSSplitedVS.fromJson(v));
|
||||
});
|
||||
}
|
||||
rEADONLY = json['READ_ONLY'];
|
||||
rEQUIREDFLAG = json['REQUIRED_FLAG'];
|
||||
sEGMENTNAME = json['SEGMENT_NAME'];
|
||||
sEGMENTPROMPT = json['SEGMENT_PROMPT'];
|
||||
sEGMENTSEQNUM = json['SEGMENT_SEQ_NUM'];
|
||||
uPPERCASEONLYFLAG = json['UPPERCASE_ONLY_FLAG'];
|
||||
uSEDFLAG = json['USED_FLAG'];
|
||||
vALIDATIONTYPE = json['VALIDATION_TYPE'];
|
||||
vALIDATIONTYPEDSP = json['VALIDATION_TYPE_DSP'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
data['ALPHANUMERIC_ALLOWED_FLAG'] = this.aLPHANUMERICALLOWEDFLAG;
|
||||
data['APPLICATION_COLUMN_NAME'] = this.aPPLICATIONCOLUMNNAME;
|
||||
data['CHILD_SEGMENTS_DV'] = this.cHILDSEGMENTSDV;
|
||||
data['CHILD_SEGMENTS_DV_Splited'] = this.cHILDSEGMENTSDVSplited;
|
||||
data['CHILD_SEGMENTS_VS'] = this.cHILDSEGMENTSVS;
|
||||
data['CHILD_SEGMENTS_VS_Splited'] = this.cHILDSEGMENTSVSSplited;
|
||||
data['DEFAULT_TYPE'] = this.dEFAULTTYPE;
|
||||
data['DEFAULT_VALUE'] = this.dEFAULTVALUE;
|
||||
data['DESC_FLEX_CONTEXT_CODE'] = this.dESCFLEXCONTEXTCODE;
|
||||
data['DESC_FLEX_CONTEXT_NAME'] = this.dESCFLEXCONTEXTNAME;
|
||||
data['DESC_FLEX_NAME'] = this.dESCFLEXNAME;
|
||||
data['DISPLAY_FLAG'] = this.dISPLAYFLAG;
|
||||
data['ENABLED_FLAG'] = this.eNABLEDFLAG;
|
||||
if (this.eSERVICESDV != null) {
|
||||
data['E_SERVICES_DV'] = this.eSERVICESDV!.toJson();
|
||||
}
|
||||
if (this.eSERVICESVS != null) {
|
||||
data['E_SERVICES_VS'] = this.eSERVICESVS!.map((v) => v.toJson()).toList();
|
||||
}
|
||||
data['FLEX_VALUE_SET_NAME'] = this.fLEXVALUESETNAME;
|
||||
data['FORMAT_TYPE'] = this.fORMATTYPE;
|
||||
data['FORMAT_TYPE_DSP'] = this.fORMATTYPEDSP;
|
||||
data['IsEmptyOption'] = this.isEmptyOption;
|
||||
data['LONGLIST_FLAG'] = this.lONGLISTFLAG;
|
||||
data['MAXIMUM_SIZE'] = this.mAXIMUMSIZE;
|
||||
data['MAXIMUM_VALUE'] = this.mAXIMUMVALUE;
|
||||
data['MINIMUM_VALUE'] = this.mINIMUMVALUE;
|
||||
data['MOBILE_ENABLED'] = this.mOBILEENABLED;
|
||||
data['NUMBER_PRECISION'] = this.nUMBERPRECISION;
|
||||
data['NUMERIC_MODE_ENABLED_FLAG'] = this.nUMERICMODEENABLEDFLAG;
|
||||
data['PARENT_SEGMENTS_DV'] = this.pARENTSEGMENTSDV;
|
||||
if (this.pARENTSEGMENTSDVSplited != null) {
|
||||
data['PARENT_SEGMENTS_DV_Splited'] = this.pARENTSEGMENTSDVSplited!.map((v) => v.toJson()).toList();
|
||||
}
|
||||
data['PARENT_SEGMENTS_VS'] = this.pARENTSEGMENTSVS;
|
||||
if (this.pARENTSEGMENTSVSSplitedVS != null) {
|
||||
data['PARENT_SEGMENTS_VS_SplitedVS'] = this.pARENTSEGMENTSVSSplitedVS!.map((v) => v.toJson()).toList();
|
||||
}
|
||||
data['READ_ONLY'] = this.rEADONLY;
|
||||
data['REQUIRED_FLAG'] = this.rEQUIREDFLAG;
|
||||
data['SEGMENT_NAME'] = this.sEGMENTNAME;
|
||||
data['SEGMENT_PROMPT'] = this.sEGMENTPROMPT;
|
||||
data['SEGMENT_SEQ_NUM'] = this.sEGMENTSEQNUM;
|
||||
data['UPPERCASE_ONLY_FLAG'] = this.uPPERCASEONLYFLAG;
|
||||
data['USED_FLAG'] = this.uSEDFLAG;
|
||||
data['VALIDATION_TYPE'] = this.vALIDATIONTYPE;
|
||||
data['VALIDATION_TYPE_DSP'] = this.vALIDATIONTYPEDSP;
|
||||
return data;
|
||||
}
|
||||
|
||||
bool get isDefaultTypeIsCDPS => (dEFAULTTYPE == "C" || dEFAULTTYPE == "D" || dEFAULTTYPE == "P" || dEFAULTTYPE == "S");
|
||||
}
|
||||
@ -0,0 +1,80 @@
|
||||
class GetAbsenceTransactionList {
|
||||
int? aBSENCEATTENDANCEID;
|
||||
int? aBSENCEATTENDANCETYPEID;
|
||||
String? aBSENCECATEGORY;
|
||||
double? aBSENCEDAYS;
|
||||
double? aBSENCEHOURS;
|
||||
String? aBSENCESTATUS;
|
||||
String? aBSENCETYPE;
|
||||
String? aPPROVALSTATUS;
|
||||
String? aTTACHMENTEXIST;
|
||||
String? dELETEBUTTON;
|
||||
String? eNDDATE;
|
||||
int? fROMROWNUM;
|
||||
int? nOOFROWS;
|
||||
int? rOWNUM;
|
||||
String? sTARTDATE;
|
||||
int? tOROWNUM;
|
||||
String? uPDATEBUTTON;
|
||||
|
||||
GetAbsenceTransactionList(
|
||||
{this.aBSENCEATTENDANCEID,
|
||||
this.aBSENCEATTENDANCETYPEID,
|
||||
this.aBSENCECATEGORY,
|
||||
this.aBSENCEDAYS,
|
||||
this.aBSENCEHOURS,
|
||||
this.aBSENCESTATUS,
|
||||
this.aBSENCETYPE,
|
||||
this.aPPROVALSTATUS,
|
||||
this.aTTACHMENTEXIST,
|
||||
this.dELETEBUTTON,
|
||||
this.eNDDATE,
|
||||
this.fROMROWNUM,
|
||||
this.nOOFROWS,
|
||||
this.rOWNUM,
|
||||
this.sTARTDATE,
|
||||
this.tOROWNUM,
|
||||
this.uPDATEBUTTON});
|
||||
|
||||
GetAbsenceTransactionList.fromJson(Map<String, dynamic> json) {
|
||||
aBSENCEATTENDANCEID = json['ABSENCE_ATTENDANCE_ID'];
|
||||
aBSENCEATTENDANCETYPEID = json['ABSENCE_ATTENDANCE_TYPE_ID'];
|
||||
aBSENCECATEGORY = json['ABSENCE_CATEGORY'];
|
||||
aBSENCEDAYS = double.parse(json['ABSENCE_DAYS'].toString() ?? "0.0");
|
||||
aBSENCEHOURS = json['ABSENCE_HOURS'];
|
||||
aBSENCESTATUS = json['ABSENCE_STATUS'];
|
||||
aBSENCETYPE = json['ABSENCE_TYPE'];
|
||||
aPPROVALSTATUS = json['APPROVAL_STATUS'];
|
||||
aTTACHMENTEXIST = json['ATTACHMENT_EXIST'];
|
||||
dELETEBUTTON = json['DELETE_BUTTON'];
|
||||
eNDDATE = json['END_DATE'];
|
||||
fROMROWNUM = json['FROM_ROW_NUM'];
|
||||
nOOFROWS = json['NO_OF_ROWS'];
|
||||
rOWNUM = json['ROW_NUM'];
|
||||
sTARTDATE = json['START_DATE'];
|
||||
tOROWNUM = json['TO_ROW_NUM'];
|
||||
uPDATEBUTTON = json['UPDATE_BUTTON'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
data['ABSENCE_ATTENDANCE_ID'] = this.aBSENCEATTENDANCEID;
|
||||
data['ABSENCE_ATTENDANCE_TYPE_ID'] = this.aBSENCEATTENDANCETYPEID;
|
||||
data['ABSENCE_CATEGORY'] = this.aBSENCECATEGORY;
|
||||
data['ABSENCE_DAYS'] = this.aBSENCEDAYS;
|
||||
data['ABSENCE_HOURS'] = this.aBSENCEHOURS;
|
||||
data['ABSENCE_STATUS'] = this.aBSENCESTATUS;
|
||||
data['ABSENCE_TYPE'] = this.aBSENCETYPE;
|
||||
data['APPROVAL_STATUS'] = this.aPPROVALSTATUS;
|
||||
data['ATTACHMENT_EXIST'] = this.aTTACHMENTEXIST;
|
||||
data['DELETE_BUTTON'] = this.dELETEBUTTON;
|
||||
data['END_DATE'] = this.eNDDATE;
|
||||
data['FROM_ROW_NUM'] = this.fROMROWNUM;
|
||||
data['NO_OF_ROWS'] = this.nOOFROWS;
|
||||
data['ROW_NUM'] = this.rOWNUM;
|
||||
data['START_DATE'] = this.sTARTDATE;
|
||||
data['TO_ROW_NUM'] = this.tOROWNUM;
|
||||
data['UPDATE_BUTTON'] = this.uPDATEBUTTON;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,18 @@
|
||||
class StartAbsenceApprovalProccess {
|
||||
String? pRETURNMSG;
|
||||
String? pRETURNSTATUS;
|
||||
|
||||
StartAbsenceApprovalProccess({this.pRETURNMSG, this.pRETURNSTATUS});
|
||||
|
||||
StartAbsenceApprovalProccess.fromJson(Map<String, dynamic> json) {
|
||||
pRETURNMSG = json['P_RETURN_MSG'];
|
||||
pRETURNSTATUS = json['P_RETURN_STATUS'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
data['P_RETURN_MSG'] = this.pRETURNMSG;
|
||||
data['P_RETURN_STATUS'] = this.pRETURNSTATUS;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,22 @@
|
||||
class SumbitAbsenceTransactionList {
|
||||
String? pRETURNMSG;
|
||||
String? pRETURNSTATUS;
|
||||
int? pTRANSACTIONID;
|
||||
|
||||
SumbitAbsenceTransactionList(
|
||||
{this.pRETURNMSG, this.pRETURNSTATUS, this.pTRANSACTIONID});
|
||||
|
||||
SumbitAbsenceTransactionList.fromJson(Map<String, dynamic> json) {
|
||||
pRETURNMSG = json['P_RETURN_MSG'];
|
||||
pRETURNSTATUS = json['P_RETURN_STATUS'];
|
||||
pTRANSACTIONID = json['P_TRANSACTION_ID'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
data['P_RETURN_MSG'] = this.pRETURNMSG;
|
||||
data['P_RETURN_STATUS'] = this.pRETURNSTATUS;
|
||||
data['P_TRANSACTION_ID'] = this.pTRANSACTIONID;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,18 @@
|
||||
class ValidateAbsenceTransactionList {
|
||||
String? pRETURNMSG;
|
||||
String? pRETURNSTATUS;
|
||||
|
||||
ValidateAbsenceTransactionList({this.pRETURNMSG, this.pRETURNSTATUS});
|
||||
|
||||
ValidateAbsenceTransactionList.fromJson(Map<String, dynamic> json) {
|
||||
pRETURNMSG = json['P_RETURN_MSG'];
|
||||
pRETURNSTATUS = json['P_RETURN_STATUS'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
data['P_RETURN_MSG'] = this.pRETURNMSG;
|
||||
data['P_RETURN_STATUS'] = this.pRETURNSTATUS;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,58 @@
|
||||
|
||||
|
||||
class GetAttendanceTrackingList {
|
||||
String? pBREAKHOURS;
|
||||
String? pLATEINHOURS;
|
||||
String? pREMAININGHOURS;
|
||||
String? pRETURNMSG;
|
||||
String? pRETURNSTATUS;
|
||||
String? pSCHEDULEDHOURS;
|
||||
String? pSHTNAME;
|
||||
String? pSPENTHOURS;
|
||||
String? pSWIPESEXEMPTEDFLAG;
|
||||
Null? pSWIPEIN;
|
||||
Null? pSWIPEOUT;
|
||||
|
||||
GetAttendanceTrackingList(
|
||||
{this.pBREAKHOURS,
|
||||
this.pLATEINHOURS,
|
||||
this.pREMAININGHOURS,
|
||||
this.pRETURNMSG,
|
||||
this.pRETURNSTATUS,
|
||||
this.pSCHEDULEDHOURS,
|
||||
this.pSHTNAME,
|
||||
this.pSPENTHOURS,
|
||||
this.pSWIPESEXEMPTEDFLAG,
|
||||
this.pSWIPEIN,
|
||||
this.pSWIPEOUT});
|
||||
|
||||
GetAttendanceTrackingList.fromJson(Map<String, dynamic> json) {
|
||||
pBREAKHOURS = json['P_BREAK_HOURS'];
|
||||
pLATEINHOURS = json['P_LATE_IN_HOURS'];
|
||||
pREMAININGHOURS = json['P_REMAINING_HOURS'];
|
||||
pRETURNMSG = json['P_RETURN_MSG'];
|
||||
pRETURNSTATUS = json['P_RETURN_STATUS'];
|
||||
pSCHEDULEDHOURS = json['P_SCHEDULED_HOURS'];
|
||||
pSHTNAME = json['P_SHT_NAME'];
|
||||
pSPENTHOURS = json['P_SPENT_HOURS'];
|
||||
pSWIPESEXEMPTEDFLAG = json['P_SWIPES_EXEMPTED_FLAG'];
|
||||
pSWIPEIN = json['P_SWIPE_IN'];
|
||||
pSWIPEOUT = json['P_SWIPE_OUT'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
data['P_BREAK_HOURS'] = this.pBREAKHOURS;
|
||||
data['P_LATE_IN_HOURS'] = this.pLATEINHOURS;
|
||||
data['P_REMAINING_HOURS'] = this.pREMAININGHOURS;
|
||||
data['P_RETURN_MSG'] = this.pRETURNMSG;
|
||||
data['P_RETURN_STATUS'] = this.pRETURNSTATUS;
|
||||
data['P_SCHEDULED_HOURS'] = this.pSCHEDULEDHOURS;
|
||||
data['P_SHT_NAME'] = this.pSHTNAME;
|
||||
data['P_SPENT_HOURS'] = this.pSPENTHOURS;
|
||||
data['P_SWIPES_EXEMPTED_FLAG'] = this.pSWIPESEXEMPTEDFLAG;
|
||||
data['P_SWIPE_IN'] = this.pSWIPEIN;
|
||||
data['P_SWIPE_OUT'] = this.pSWIPEOUT;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,312 @@
|
||||
class GetEmployeeSubordinatesList {
|
||||
String? aCTUALTERMINATIONDATE;
|
||||
String? aSSIGNMENTENDDATE;
|
||||
int? aSSIGNMENTID;
|
||||
String? aSSIGNMENTNUMBER;
|
||||
String? aSSIGNMENTSTARTDATE;
|
||||
int? aSSIGNMENTSTATUSTYPEID;
|
||||
String? aSSIGNMENTTYPE;
|
||||
int? bUSINESSGROUPID;
|
||||
String? bUSINESSGROUPNAME;
|
||||
String? cURRENTEMPLOYEEFLAG;
|
||||
String? eMPLOYEEDISPLAYNAME;
|
||||
String? eMPLOYEEEMAILADDRESS;
|
||||
String? eMPLOYEEIMAGE;
|
||||
String? eMPLOYEEMOBILENUMBER;
|
||||
String? eMPLOYEENAME;
|
||||
String? eMPLOYEENUMBER;
|
||||
String? eMPLOYEEWORKNUMBER;
|
||||
String? eMPLOYMENTCATEGORY;
|
||||
String? eMPLOYMENTCATEGORYMEANING;
|
||||
String? fREQUENCY;
|
||||
String? fREQUENCYMEANING;
|
||||
int? fROMROWNUM;
|
||||
dynamic? gRADEID;
|
||||
dynamic? gRADENAME;
|
||||
dynamic? genderCode;
|
||||
dynamic? genderMeaning;
|
||||
String? hIREDATE;
|
||||
bool? isFavorite;
|
||||
int? jOBID;
|
||||
String? jOBNAME;
|
||||
int? lOCATIONID;
|
||||
String? lOCATIONNAME;
|
||||
String? mANUALTIMECARDFLAG;
|
||||
String? mANUALTIMECARDMEANING;
|
||||
String? nATIONALITYCODE;
|
||||
String? nATIONALITYMEANING;
|
||||
String? nATIONALIDENTIFIER;
|
||||
dynamic? nORMALHOURS;
|
||||
int? nOOFROWS;
|
||||
int? nUMOFSUBORDINATES;
|
||||
int? oRGANIZATIONID;
|
||||
String? oRGANIZATIONNAME;
|
||||
String? pAYROLLCODE;
|
||||
int? pAYROLLID;
|
||||
String? pAYROLLNAME;
|
||||
int? pERSONID;
|
||||
String? pERSONTYPE;
|
||||
int? pERSONTYPEID;
|
||||
String? pERINFORMATIONCATEGORY;
|
||||
int? pOSITIONID;
|
||||
String? pOSITIONNAME;
|
||||
String? pRIMARYFLAG;
|
||||
int? rOWNUM;
|
||||
int? sERVICEDAYS;
|
||||
int? sERVICEMONTHS;
|
||||
int? sERVICEYEARS;
|
||||
String? sUPERVISORASSIGNMENTID;
|
||||
String? sUPERVISORDISPLAYNAME;
|
||||
String? sUPERVISOREMAILADDRESS;
|
||||
int? sUPERVISORID;
|
||||
String? sUPERVISORMOBILENUMBER;
|
||||
String? sUPERVISORNAME;
|
||||
String? sUPERVISORNUMBER;
|
||||
String? sUPERVISORWORKNUMBER;
|
||||
String? sWIPESEXEMPTEDFLAG;
|
||||
String? sWIPESEXEMPTEDMEANING;
|
||||
String? sYSTEMPERSONTYPE;
|
||||
String? tKEMAILADDRESS;
|
||||
String? tKEMPLOYEEDISPLAYNAME;
|
||||
String? tKEMPLOYEENAME;
|
||||
String? tKEMPLOYEENUMBER;
|
||||
int? tKPERSONID;
|
||||
int? tOROWNUM;
|
||||
String? uNITNUMBER;
|
||||
String? uSERSTATUS;
|
||||
|
||||
GetEmployeeSubordinatesList(
|
||||
{this.aCTUALTERMINATIONDATE,
|
||||
this.aSSIGNMENTENDDATE,
|
||||
this.aSSIGNMENTID,
|
||||
this.aSSIGNMENTNUMBER,
|
||||
this.aSSIGNMENTSTARTDATE,
|
||||
this.aSSIGNMENTSTATUSTYPEID,
|
||||
this.aSSIGNMENTTYPE,
|
||||
this.bUSINESSGROUPID,
|
||||
this.bUSINESSGROUPNAME,
|
||||
this.cURRENTEMPLOYEEFLAG,
|
||||
this.eMPLOYEEDISPLAYNAME,
|
||||
this.eMPLOYEEEMAILADDRESS,
|
||||
this.eMPLOYEEIMAGE,
|
||||
this.eMPLOYEEMOBILENUMBER,
|
||||
this.eMPLOYEENAME,
|
||||
this.eMPLOYEENUMBER,
|
||||
this.eMPLOYEEWORKNUMBER,
|
||||
this.eMPLOYMENTCATEGORY,
|
||||
this.eMPLOYMENTCATEGORYMEANING,
|
||||
this.fREQUENCY,
|
||||
this.fREQUENCYMEANING,
|
||||
this.fROMROWNUM,
|
||||
this.gRADEID,
|
||||
this.gRADENAME,
|
||||
this.genderCode,
|
||||
this.genderMeaning,
|
||||
this.hIREDATE,
|
||||
this.isFavorite,
|
||||
this.jOBID,
|
||||
this.jOBNAME,
|
||||
this.lOCATIONID,
|
||||
this.lOCATIONNAME,
|
||||
this.mANUALTIMECARDFLAG,
|
||||
this.mANUALTIMECARDMEANING,
|
||||
this.nATIONALITYCODE,
|
||||
this.nATIONALITYMEANING,
|
||||
this.nATIONALIDENTIFIER,
|
||||
this.nORMALHOURS,
|
||||
this.nOOFROWS,
|
||||
this.nUMOFSUBORDINATES,
|
||||
this.oRGANIZATIONID,
|
||||
this.oRGANIZATIONNAME,
|
||||
this.pAYROLLCODE,
|
||||
this.pAYROLLID,
|
||||
this.pAYROLLNAME,
|
||||
this.pERSONID,
|
||||
this.pERSONTYPE,
|
||||
this.pERSONTYPEID,
|
||||
this.pERINFORMATIONCATEGORY,
|
||||
this.pOSITIONID,
|
||||
this.pOSITIONNAME,
|
||||
this.pRIMARYFLAG,
|
||||
this.rOWNUM,
|
||||
this.sERVICEDAYS,
|
||||
this.sERVICEMONTHS,
|
||||
this.sERVICEYEARS,
|
||||
this.sUPERVISORASSIGNMENTID,
|
||||
this.sUPERVISORDISPLAYNAME,
|
||||
this.sUPERVISOREMAILADDRESS,
|
||||
this.sUPERVISORID,
|
||||
this.sUPERVISORMOBILENUMBER,
|
||||
this.sUPERVISORNAME,
|
||||
this.sUPERVISORNUMBER,
|
||||
this.sUPERVISORWORKNUMBER,
|
||||
this.sWIPESEXEMPTEDFLAG,
|
||||
this.sWIPESEXEMPTEDMEANING,
|
||||
this.sYSTEMPERSONTYPE,
|
||||
this.tKEMAILADDRESS,
|
||||
this.tKEMPLOYEEDISPLAYNAME,
|
||||
this.tKEMPLOYEENAME,
|
||||
this.tKEMPLOYEENUMBER,
|
||||
this.tKPERSONID,
|
||||
this.tOROWNUM,
|
||||
this.uNITNUMBER,
|
||||
this.uSERSTATUS});
|
||||
|
||||
GetEmployeeSubordinatesList.fromJson(Map<String, dynamic> json) {
|
||||
aCTUALTERMINATIONDATE = json['ACTUAL_TERMINATION_DATE'];
|
||||
aSSIGNMENTENDDATE = json['ASSIGNMENT_END_DATE'];
|
||||
aSSIGNMENTID = json['ASSIGNMENT_ID'];
|
||||
aSSIGNMENTNUMBER = json['ASSIGNMENT_NUMBER'];
|
||||
aSSIGNMENTSTARTDATE = json['ASSIGNMENT_START_DATE'];
|
||||
aSSIGNMENTSTATUSTYPEID = json['ASSIGNMENT_STATUS_TYPE_ID'];
|
||||
aSSIGNMENTTYPE = json['ASSIGNMENT_TYPE'];
|
||||
bUSINESSGROUPID = json['BUSINESS_GROUP_ID'];
|
||||
bUSINESSGROUPNAME = json['BUSINESS_GROUP_NAME'];
|
||||
cURRENTEMPLOYEEFLAG = json['CURRENT_EMPLOYEE_FLAG'];
|
||||
eMPLOYEEDISPLAYNAME = json['EMPLOYEE_DISPLAY_NAME'];
|
||||
eMPLOYEEEMAILADDRESS = json['EMPLOYEE_EMAIL_ADDRESS'];
|
||||
eMPLOYEEIMAGE = json['EMPLOYEE_IMAGE'];
|
||||
eMPLOYEEMOBILENUMBER = json['EMPLOYEE_MOBILE_NUMBER'];
|
||||
eMPLOYEENAME = json['EMPLOYEE_NAME'];
|
||||
eMPLOYEENUMBER = json['EMPLOYEE_NUMBER'];
|
||||
eMPLOYEEWORKNUMBER = json['EMPLOYEE_WORK_NUMBER'];
|
||||
eMPLOYMENTCATEGORY = json['EMPLOYMENT_CATEGORY'];
|
||||
eMPLOYMENTCATEGORYMEANING = json['EMPLOYMENT_CATEGORY_MEANING'];
|
||||
fREQUENCY = json['FREQUENCY'];
|
||||
fREQUENCYMEANING = json['FREQUENCY_MEANING'];
|
||||
fROMROWNUM = json['FROM_ROW_NUM'];
|
||||
gRADEID = json['GRADE_ID'];
|
||||
gRADENAME = json['GRADE_NAME'];
|
||||
genderCode = json['GenderCode'];
|
||||
genderMeaning = json['GenderMeaning'];
|
||||
hIREDATE = json['HIRE_DATE'];
|
||||
isFavorite = json['IsFavorite'];
|
||||
jOBID = json['JOB_ID'];
|
||||
jOBNAME = json['JOB_NAME'];
|
||||
lOCATIONID = json['LOCATION_ID'];
|
||||
lOCATIONNAME = json['LOCATION_NAME'];
|
||||
mANUALTIMECARDFLAG = json['MANUAL_TIMECARD_FLAG'];
|
||||
mANUALTIMECARDMEANING = json['MANUAL_TIMECARD_MEANING'];
|
||||
nATIONALITYCODE = json['NATIONALITY_CODE'];
|
||||
nATIONALITYMEANING = json['NATIONALITY_MEANING'];
|
||||
nATIONALIDENTIFIER = json['NATIONAL_IDENTIFIER'];
|
||||
nORMALHOURS = json['NORMAL_HOURS'];
|
||||
nOOFROWS = json['NO_OF_ROWS'];
|
||||
nUMOFSUBORDINATES = json['NUM_OF_SUBORDINATES'];
|
||||
oRGANIZATIONID = json['ORGANIZATION_ID'];
|
||||
oRGANIZATIONNAME = json['ORGANIZATION_NAME'];
|
||||
pAYROLLCODE = json['PAYROLL_CODE'];
|
||||
pAYROLLID = json['PAYROLL_ID'];
|
||||
pAYROLLNAME = json['PAYROLL_NAME'];
|
||||
pERSONID = json['PERSON_ID'];
|
||||
pERSONTYPE = json['PERSON_TYPE'];
|
||||
pERSONTYPEID = json['PERSON_TYPE_ID'];
|
||||
pERINFORMATIONCATEGORY = json['PER_INFORMATION_CATEGORY'];
|
||||
pOSITIONID = json['POSITION_ID'];
|
||||
pOSITIONNAME = json['POSITION_NAME'];
|
||||
pRIMARYFLAG = json['PRIMARY_FLAG'];
|
||||
rOWNUM = json['ROW_NUM'];
|
||||
sERVICEDAYS = json['SERVICE_DAYS'];
|
||||
sERVICEMONTHS = json['SERVICE_MONTHS'];
|
||||
sERVICEYEARS = json['SERVICE_YEARS'];
|
||||
sUPERVISORASSIGNMENTID = json['SUPERVISOR_ASSIGNMENT_ID'];
|
||||
sUPERVISORDISPLAYNAME = json['SUPERVISOR_DISPLAY_NAME'];
|
||||
sUPERVISOREMAILADDRESS = json['SUPERVISOR_EMAIL_ADDRESS'];
|
||||
sUPERVISORID = json['SUPERVISOR_ID'];
|
||||
sUPERVISORMOBILENUMBER = json['SUPERVISOR_MOBILE_NUMBER'];
|
||||
sUPERVISORNAME = json['SUPERVISOR_NAME'];
|
||||
sUPERVISORNUMBER = json['SUPERVISOR_NUMBER'];
|
||||
sUPERVISORWORKNUMBER = json['SUPERVISOR_WORK_NUMBER'];
|
||||
sWIPESEXEMPTEDFLAG = json['SWIPES_EXEMPTED_FLAG'];
|
||||
sWIPESEXEMPTEDMEANING = json['SWIPES_EXEMPTED_MEANING'];
|
||||
sYSTEMPERSONTYPE = json['SYSTEM_PERSON_TYPE'];
|
||||
tKEMAILADDRESS = json['TK_EMAIL_ADDRESS'];
|
||||
tKEMPLOYEEDISPLAYNAME = json['TK_EMPLOYEE_DISPLAY_NAME'];
|
||||
tKEMPLOYEENAME = json['TK_EMPLOYEE_NAME'];
|
||||
tKEMPLOYEENUMBER = json['TK_EMPLOYEE_NUMBER'];
|
||||
tKPERSONID = json['TK_PERSON_ID'];
|
||||
tOROWNUM = json['TO_ROW_NUM'];
|
||||
uNITNUMBER = json['UNIT_NUMBER'];
|
||||
uSERSTATUS = json['USER_STATUS'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
data['ACTUAL_TERMINATION_DATE'] = this.aCTUALTERMINATIONDATE;
|
||||
data['ASSIGNMENT_END_DATE'] = this.aSSIGNMENTENDDATE;
|
||||
data['ASSIGNMENT_ID'] = this.aSSIGNMENTID;
|
||||
data['ASSIGNMENT_NUMBER'] = this.aSSIGNMENTNUMBER;
|
||||
data['ASSIGNMENT_START_DATE'] = this.aSSIGNMENTSTARTDATE;
|
||||
data['ASSIGNMENT_STATUS_TYPE_ID'] = this.aSSIGNMENTSTATUSTYPEID;
|
||||
data['ASSIGNMENT_TYPE'] = this.aSSIGNMENTTYPE;
|
||||
data['BUSINESS_GROUP_ID'] = this.bUSINESSGROUPID;
|
||||
data['BUSINESS_GROUP_NAME'] = this.bUSINESSGROUPNAME;
|
||||
data['CURRENT_EMPLOYEE_FLAG'] = this.cURRENTEMPLOYEEFLAG;
|
||||
data['EMPLOYEE_DISPLAY_NAME'] = this.eMPLOYEEDISPLAYNAME;
|
||||
data['EMPLOYEE_EMAIL_ADDRESS'] = this.eMPLOYEEEMAILADDRESS;
|
||||
data['EMPLOYEE_IMAGE'] = this.eMPLOYEEIMAGE;
|
||||
data['EMPLOYEE_MOBILE_NUMBER'] = this.eMPLOYEEMOBILENUMBER;
|
||||
data['EMPLOYEE_NAME'] = this.eMPLOYEENAME;
|
||||
data['EMPLOYEE_NUMBER'] = this.eMPLOYEENUMBER;
|
||||
data['EMPLOYEE_WORK_NUMBER'] = this.eMPLOYEEWORKNUMBER;
|
||||
data['EMPLOYMENT_CATEGORY'] = this.eMPLOYMENTCATEGORY;
|
||||
data['EMPLOYMENT_CATEGORY_MEANING'] = this.eMPLOYMENTCATEGORYMEANING;
|
||||
data['FREQUENCY'] = this.fREQUENCY;
|
||||
data['FREQUENCY_MEANING'] = this.fREQUENCYMEANING;
|
||||
data['FROM_ROW_NUM'] = this.fROMROWNUM;
|
||||
data['GRADE_ID'] = this.gRADEID;
|
||||
data['GRADE_NAME'] = this.gRADENAME;
|
||||
data['GenderCode'] = this.genderCode;
|
||||
data['GenderMeaning'] = this.genderMeaning;
|
||||
data['HIRE_DATE'] = this.hIREDATE;
|
||||
data['IsFavorite'] = this.isFavorite;
|
||||
data['JOB_ID'] = this.jOBID;
|
||||
data['JOB_NAME'] = this.jOBNAME;
|
||||
data['LOCATION_ID'] = this.lOCATIONID;
|
||||
data['LOCATION_NAME'] = this.lOCATIONNAME;
|
||||
data['MANUAL_TIMECARD_FLAG'] = this.mANUALTIMECARDFLAG;
|
||||
data['MANUAL_TIMECARD_MEANING'] = this.mANUALTIMECARDMEANING;
|
||||
data['NATIONALITY_CODE'] = this.nATIONALITYCODE;
|
||||
data['NATIONALITY_MEANING'] = this.nATIONALITYMEANING;
|
||||
data['NATIONAL_IDENTIFIER'] = this.nATIONALIDENTIFIER;
|
||||
data['NORMAL_HOURS'] = this.nORMALHOURS;
|
||||
data['NO_OF_ROWS'] = this.nOOFROWS;
|
||||
data['NUM_OF_SUBORDINATES'] = this.nUMOFSUBORDINATES;
|
||||
data['ORGANIZATION_ID'] = this.oRGANIZATIONID;
|
||||
data['ORGANIZATION_NAME'] = this.oRGANIZATIONNAME;
|
||||
data['PAYROLL_CODE'] = this.pAYROLLCODE;
|
||||
data['PAYROLL_ID'] = this.pAYROLLID;
|
||||
data['PAYROLL_NAME'] = this.pAYROLLNAME;
|
||||
data['PERSON_ID'] = this.pERSONID;
|
||||
data['PERSON_TYPE'] = this.pERSONTYPE;
|
||||
data['PERSON_TYPE_ID'] = this.pERSONTYPEID;
|
||||
data['PER_INFORMATION_CATEGORY'] = this.pERINFORMATIONCATEGORY;
|
||||
data['POSITION_ID'] = this.pOSITIONID;
|
||||
data['POSITION_NAME'] = this.pOSITIONNAME;
|
||||
data['PRIMARY_FLAG'] = this.pRIMARYFLAG;
|
||||
data['ROW_NUM'] = this.rOWNUM;
|
||||
data['SERVICE_DAYS'] = this.sERVICEDAYS;
|
||||
data['SERVICE_MONTHS'] = this.sERVICEMONTHS;
|
||||
data['SERVICE_YEARS'] = this.sERVICEYEARS;
|
||||
data['SUPERVISOR_ASSIGNMENT_ID'] = this.sUPERVISORASSIGNMENTID;
|
||||
data['SUPERVISOR_DISPLAY_NAME'] = this.sUPERVISORDISPLAYNAME;
|
||||
data['SUPERVISOR_EMAIL_ADDRESS'] = this.sUPERVISOREMAILADDRESS;
|
||||
data['SUPERVISOR_ID'] = this.sUPERVISORID;
|
||||
data['SUPERVISOR_MOBILE_NUMBER'] = this.sUPERVISORMOBILENUMBER;
|
||||
data['SUPERVISOR_NAME'] = this.sUPERVISORNAME;
|
||||
data['SUPERVISOR_NUMBER'] = this.sUPERVISORNUMBER;
|
||||
data['SUPERVISOR_WORK_NUMBER'] = this.sUPERVISORWORKNUMBER;
|
||||
data['SWIPES_EXEMPTED_FLAG'] = this.sWIPESEXEMPTEDFLAG;
|
||||
data['SWIPES_EXEMPTED_MEANING'] = this.sWIPESEXEMPTEDMEANING;
|
||||
data['SYSTEM_PERSON_TYPE'] = this.sYSTEMPERSONTYPE;
|
||||
data['TK_EMAIL_ADDRESS'] = this.tKEMAILADDRESS;
|
||||
data['TK_EMPLOYEE_DISPLAY_NAME'] = this.tKEMPLOYEEDISPLAYNAME;
|
||||
data['TK_EMPLOYEE_NAME'] = this.tKEMPLOYEENAME;
|
||||
data['TK_EMPLOYEE_NUMBER'] = this.tKEMPLOYEENUMBER;
|
||||
data['TK_PERSON_ID'] = this.tKPERSONID;
|
||||
data['TO_ROW_NUM'] = this.tOROWNUM;
|
||||
data['UNIT_NUMBER'] = this.uNITNUMBER;
|
||||
data['USER_STATUS'] = this.uSERSTATUS;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,62 @@
|
||||
|
||||
|
||||
class GetSubordinatesLeavesTotalVacationsList {
|
||||
String? aBSENCEATTENDANCETYPENAME;
|
||||
String? cALENDARENTRYDESC;
|
||||
String? dATEEND;
|
||||
String? dATESTART;
|
||||
String? eMPLOYEENAME;
|
||||
String? eMPLOYEENUMBER;
|
||||
String? lEAVETYPE;
|
||||
int? oRGANIZATIONID;
|
||||
String? oRGANIZATIONNAME;
|
||||
String? pOSITIONTITLE;
|
||||
String? rEPLACEMENTNAME;
|
||||
String? sTATUS;
|
||||
|
||||
GetSubordinatesLeavesTotalVacationsList(
|
||||
{this.aBSENCEATTENDANCETYPENAME,
|
||||
this.cALENDARENTRYDESC,
|
||||
this.dATEEND,
|
||||
this.dATESTART,
|
||||
this.eMPLOYEENAME,
|
||||
this.eMPLOYEENUMBER,
|
||||
this.lEAVETYPE,
|
||||
this.oRGANIZATIONID,
|
||||
this.oRGANIZATIONNAME,
|
||||
this.pOSITIONTITLE,
|
||||
this.rEPLACEMENTNAME,
|
||||
this.sTATUS});
|
||||
|
||||
GetSubordinatesLeavesTotalVacationsList.fromJson(Map<String, dynamic> json) {
|
||||
aBSENCEATTENDANCETYPENAME = json['ABSENCE_ATTENDANCE_TYPE_NAME'];
|
||||
cALENDARENTRYDESC = json['CALENDAR_ENTRY_DESC'];
|
||||
dATEEND = json['DATE_END'];
|
||||
dATESTART = json['DATE_START'];
|
||||
eMPLOYEENAME = json['EMPLOYEE_NAME'];
|
||||
eMPLOYEENUMBER = json['EMPLOYEE_NUMBER'];
|
||||
lEAVETYPE = json['LEAVE_TYPE'];
|
||||
oRGANIZATIONID = json['ORGANIZATION_ID'];
|
||||
oRGANIZATIONNAME = json['ORGANIZATION_NAME'];
|
||||
pOSITIONTITLE = json['POSITION_TITLE'];
|
||||
rEPLACEMENTNAME = json['REPLACEMENT_NAME'];
|
||||
sTATUS = json['STATUS'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
data['ABSENCE_ATTENDANCE_TYPE_NAME'] = this.aBSENCEATTENDANCETYPENAME;
|
||||
data['CALENDAR_ENTRY_DESC'] = this.cALENDARENTRYDESC;
|
||||
data['DATE_END'] = this.dATEEND;
|
||||
data['DATE_START'] = this.dATESTART;
|
||||
data['EMPLOYEE_NAME'] = this.eMPLOYEENAME;
|
||||
data['EMPLOYEE_NUMBER'] = this.eMPLOYEENUMBER;
|
||||
data['LEAVE_TYPE'] = this.lEAVETYPE;
|
||||
data['ORGANIZATION_ID'] = this.oRGANIZATIONID;
|
||||
data['ORGANIZATION_NAME'] = this.oRGANIZATIONNAME;
|
||||
data['POSITION_TITLE'] = this.pOSITIONTITLE;
|
||||
data['REPLACEMENT_NAME'] = this.rEPLACEMENTNAME;
|
||||
data['STATUS'] = this.sTATUS;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,25 @@
|
||||
|
||||
|
||||
class UpdateItemTypeSuccessList {
|
||||
int? itemID;
|
||||
String? updateError;
|
||||
bool? updateSuccess;
|
||||
|
||||
UpdateItemTypeSuccessList(
|
||||
{this.itemID, this.updateError, this.updateSuccess});
|
||||
|
||||
UpdateItemTypeSuccessList.fromJson(Map<String, dynamic> json) {
|
||||
itemID = json['ItemID'];
|
||||
updateError = json['UpdateError'];
|
||||
updateSuccess = json['UpdateSuccess'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
data['ItemID'] = this.itemID;
|
||||
data['UpdateError'] = this.updateError;
|
||||
data['UpdateSuccess'] = this.updateSuccess;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
@ -0,0 +1,18 @@
|
||||
class UpdateUserItemTypesList {
|
||||
String? pRETURNMSG;
|
||||
String? pRETURNSTATUS;
|
||||
|
||||
UpdateUserItemTypesList({this.pRETURNMSG, this.pRETURNSTATUS});
|
||||
|
||||
UpdateUserItemTypesList.fromJson(Map<String, dynamic> json) {
|
||||
pRETURNMSG = json['P_RETURN_MSG'];
|
||||
pRETURNSTATUS = json['P_RETURN_STATUS'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
data['P_RETURN_MSG'] = this.pRETURNMSG;
|
||||
data['P_RETURN_STATUS'] = this.pRETURNSTATUS;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,24 @@
|
||||
class UpdateUserTypesList {
|
||||
int? itemID;
|
||||
String? pFYAENABLEDFALG;
|
||||
String? pFYIENABLEDFALG;
|
||||
String? pITEMTYPE;
|
||||
|
||||
UpdateUserTypesList({this.itemID, this.pFYAENABLEDFALG, this.pFYIENABLEDFALG, this.pITEMTYPE});
|
||||
|
||||
UpdateUserTypesList.fromJson(Map<String, dynamic> json) {
|
||||
itemID = json['ItemID'];
|
||||
pFYAENABLEDFALG = json['P_FYAENABLED_FALG'];
|
||||
pFYIENABLEDFALG = json['P_FYIENABLED_FALG'];
|
||||
pITEMTYPE = json['P_ITEM_TYPE'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
data['ItemID'] = this.itemID;
|
||||
data['P_FYAENABLED_FALG'] = this.pFYAENABLEDFALG;
|
||||
data['P_FYIENABLED_FALG'] = this.pFYIENABLEDFALG;
|
||||
data['P_ITEM_TYPE'] = this.pITEMTYPE;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,637 @@
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:easy_localization/easy_localization.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:mohem_flutter_app/api/leave_balance_api_client.dart';
|
||||
import 'package:mohem_flutter_app/classes/date_uitl.dart';
|
||||
import 'package:mohem_flutter_app/classes/utils.dart';
|
||||
import 'package:mohem_flutter_app/config/routes.dart';
|
||||
import 'package:mohem_flutter_app/extensions/int_extensions.dart';
|
||||
import 'package:mohem_flutter_app/extensions/widget_extensions.dart';
|
||||
import 'package:mohem_flutter_app/generated/locale_keys.g.dart';
|
||||
import 'package:mohem_flutter_app/models/get_eit_dff_structure_list_model.dart';
|
||||
import 'package:mohem_flutter_app/models/leave_balance/calculate_absence_duration_model.dart';
|
||||
import 'package:mohem_flutter_app/models/leave_balance/get_absence_attendance_types_list_model.dart';
|
||||
import 'package:mohem_flutter_app/models/leave_balance/get_absence_dff_structure_list_model.dart';
|
||||
import 'package:mohem_flutter_app/models/leave_balance/sumbit_absence_transaction_list_model.dart';
|
||||
import 'package:mohem_flutter_app/models/worklist/replacement_list_model.dart';
|
||||
import 'package:mohem_flutter_app/ui/misc/request_submit_screen.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/search_employee_bottom_sheet.dart';
|
||||
import 'package:mohem_flutter_app/widgets/button/default_button.dart';
|
||||
import 'package:mohem_flutter_app/widgets/dynamic_forms/dynamic_textfield_widget.dart';
|
||||
|
||||
class AddLeaveBalanceScreen extends StatefulWidget {
|
||||
AddLeaveBalanceScreen({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
_AddLeaveBalanceScreenState createState() {
|
||||
return _AddLeaveBalanceScreenState();
|
||||
}
|
||||
}
|
||||
|
||||
class _AddLeaveBalanceScreenState extends State<AddLeaveBalanceScreen> {
|
||||
List<GetAbsenceDffStructureList> getabsenceDffStructureList = [];
|
||||
List<GetAbsenceAttendanceTypesList> absenceList = [];
|
||||
|
||||
GetAbsenceAttendanceTypesList? selectedAbsenceType;
|
||||
DateTime? startDateTime;
|
||||
DateTime? endDateTime;
|
||||
int? totalDays;
|
||||
String comment = "";
|
||||
ReplacementList? selectedReplacementEmployee;
|
||||
|
||||
DateTime selectedDate = DateTime(DateTime.now().year, DateTime.now().month, DateTime.now().day);
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
getAbsenceAttendanceTypes();
|
||||
}
|
||||
|
||||
void getAbsenceAttendanceTypes() async {
|
||||
try {
|
||||
Utils.showLoading(context);
|
||||
absenceList = await LeaveBalanceApiClient().getAbsenceAttendanceTypes();
|
||||
Utils.hideLoading(context);
|
||||
setState(() {});
|
||||
} catch (ex) {
|
||||
Utils.hideLoading(context);
|
||||
Utils.handleException(ex, context, null);
|
||||
}
|
||||
}
|
||||
|
||||
void getAbsenceDffStructure() async {
|
||||
try {
|
||||
Utils.showLoading(context);
|
||||
getabsenceDffStructureList.clear();
|
||||
getabsenceDffStructureList = await LeaveBalanceApiClient().getAbsenceDffStructure(selectedAbsenceType!.dESCFLEXCONTEXTCODE!, "HR_LOA_SS", -999);
|
||||
Utils.hideLoading(context);
|
||||
setState(() {});
|
||||
} catch (ex) {
|
||||
Utils.hideLoading(context);
|
||||
Utils.handleException(ex, context, null);
|
||||
}
|
||||
}
|
||||
|
||||
void getCalculatedAbsenceDuration() async {
|
||||
try {
|
||||
Utils.showLoading(context);
|
||||
CalculateAbsenceDuration duration = await LeaveBalanceApiClient()
|
||||
.calculateAbsenceDuration(selectedAbsenceType!.aBSENCEATTENDANCETYPEID!, Utils.getMonthNamedFormat(startDateTime!), Utils.getMonthNamedFormat(endDateTime!), -999);
|
||||
print(duration.toJson());
|
||||
totalDays = duration.pABSENCEDAYS;
|
||||
Utils.hideLoading(context);
|
||||
setState(() {});
|
||||
} catch (ex) {
|
||||
Utils.hideLoading(context);
|
||||
Utils.handleException(ex, context, null);
|
||||
}
|
||||
}
|
||||
|
||||
void validateAbsenceTransaction() async {
|
||||
try {
|
||||
Utils.showLoading(context);
|
||||
Map<String, String?> dffDataMap = {};
|
||||
for (int i = 1; i <= 20; i++) {
|
||||
dffDataMap["P_ATTRIBUTE$i"] = null;
|
||||
for (int dffIndex = 0; dffIndex < getabsenceDffStructureList.length; dffIndex++) {
|
||||
if ("ATTRIBUTE$i" == getabsenceDffStructureList[dffIndex].aPPLICATIONCOLUMNNAME) {
|
||||
if (getabsenceDffStructureList[dffIndex].fORMATTYPE == "X") {
|
||||
dffDataMap["P_ATTRIBUTE$i"] = Utils.formatDate(getabsenceDffStructureList[dffIndex].eSERVICESDV!.pIDCOLUMNNAME!);
|
||||
} else {
|
||||
dffDataMap["P_ATTRIBUTE$i"] = getabsenceDffStructureList[dffIndex].eSERVICESDV?.pIDCOLUMNNAME;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
await LeaveBalanceApiClient().validateAbsenceTransaction(selectedAbsenceType!.dESCFLEXCONTEXTCODE!, "HR_LOA_SS", selectedAbsenceType!.aBSENCEATTENDANCETYPEID!,
|
||||
selectedReplacementEmployee!.userName!, DateUtil.getFormattedDate(startDateTime!, "MM/dd/yyyy"), DateUtil.getFormattedDate(endDateTime!, "MM/dd/yyyy"), -999, dffDataMap,
|
||||
comments: comment);
|
||||
|
||||
SumbitAbsenceTransactionList submit = await LeaveBalanceApiClient().submitAbsenceTransaction(
|
||||
selectedAbsenceType!.dESCFLEXCONTEXTCODE!,
|
||||
"HR_LOA_SS",
|
||||
selectedAbsenceType!.aBSENCEATTENDANCETYPEID!,
|
||||
selectedReplacementEmployee!.userName!,
|
||||
DateUtil.getFormattedDate(startDateTime!, "MM/dd/yyyy"),
|
||||
DateUtil.getFormattedDate(endDateTime!, "MM/dd/yyyy"),
|
||||
-999,
|
||||
dffDataMap,
|
||||
comments: comment);
|
||||
|
||||
Utils.hideLoading(context);
|
||||
|
||||
await Navigator.pushNamed(context, AppRoutes.requestSubmitScreen, arguments: RequestSubmitScreenParams(LocaleKeys.submit.tr(), submit.pTRANSACTIONID!, "", "add_leave_balance"));
|
||||
Utils.showLoading(context);
|
||||
await LeaveBalanceApiClient().cancelHrTransaction(submit.pTRANSACTIONID!);
|
||||
Utils.hideLoading(context);
|
||||
} catch (ex) {
|
||||
Utils.hideLoading(context);
|
||||
Utils.handleException(ex, context, null);
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
backgroundColor: Colors.white,
|
||||
appBar: AppBarWidget(
|
||||
context,
|
||||
title: LocaleKeys.leaveBalance.tr(),
|
||||
),
|
||||
body: Column(
|
||||
children: [
|
||||
ListView(
|
||||
padding: const EdgeInsets.all(21),
|
||||
children: [
|
||||
PopupMenuButton(
|
||||
child: DynamicTextFieldWidget(
|
||||
LocaleKeys.absenceType.tr() + "*",
|
||||
selectedAbsenceType == null ? LocaleKeys.selectTypeT.tr() : selectedAbsenceType!.aBSENCEATTENDANCETYPENAME!,
|
||||
isEnable: false,
|
||||
isPopup: true,
|
||||
),
|
||||
itemBuilder: (_) => <PopupMenuItem<int>>[
|
||||
for (int i = 0; i < absenceList.length; i++) PopupMenuItem<int>(value: i, child: Text(absenceList[i].aBSENCEATTENDANCETYPENAME!)),
|
||||
],
|
||||
onSelected: (int popupIndex) {
|
||||
if (selectedAbsenceType == absenceList[popupIndex]) {
|
||||
return;
|
||||
}
|
||||
selectedAbsenceType = absenceList[popupIndex];
|
||||
setState(() {});
|
||||
getAbsenceDffStructure();
|
||||
},
|
||||
),
|
||||
12.height,
|
||||
DynamicTextFieldWidget(
|
||||
LocaleKeys.startDateT.tr() + "*",
|
||||
startDateTime == null ? "Select date" : startDateTime.toString().split(' ')[0],
|
||||
suffixIconData: Icons.calendar_today,
|
||||
isEnable: false,
|
||||
onTap: () async {
|
||||
var start = await _selectDate(context);
|
||||
if (start != startDateTime) {
|
||||
startDateTime = start;
|
||||
setState(() {});
|
||||
}
|
||||
},
|
||||
),
|
||||
12.height,
|
||||
DynamicTextFieldWidget(
|
||||
LocaleKeys.endDateT.tr() + "*",
|
||||
endDateTime == null ? "Select date" : endDateTime.toString().split(' ')[0],
|
||||
suffixIconData: Icons.calendar_today,
|
||||
isEnable: false,
|
||||
isReadOnly: selectedAbsenceType == null || startDateTime == null,
|
||||
onTap: () async {
|
||||
if (selectedAbsenceType == null || startDateTime == null) return;
|
||||
var end = await _selectDate(context);
|
||||
if (end != endDateTime) {
|
||||
endDateTime = end;
|
||||
setState(() {});
|
||||
getCalculatedAbsenceDuration();
|
||||
}
|
||||
},
|
||||
),
|
||||
12.height,
|
||||
DynamicTextFieldWidget(
|
||||
"Total Days",
|
||||
totalDays?.toString() ?? "Calculated days",
|
||||
isInputTypeNum: true,
|
||||
isEnable: false,
|
||||
onChange: (input) {
|
||||
totalDays = int.parse(input);
|
||||
},
|
||||
),
|
||||
12.height,
|
||||
DynamicTextFieldWidget(
|
||||
LocaleKeys.selectEmployee.tr(),
|
||||
selectedReplacementEmployee == null ? LocaleKeys.searchForEmployee.tr() : selectedReplacementEmployee!.employeeDisplayName ?? "",
|
||||
isEnable: false,
|
||||
onTap: () {
|
||||
showMyBottomSheet(
|
||||
context,
|
||||
child: SearchEmployeeBottomSheet(
|
||||
title: LocaleKeys.searchForEmployee.tr(),
|
||||
apiMode: LocaleKeys.delegate.tr(),
|
||||
onSelectEmployee: (_selectedEmployee) {
|
||||
// Navigator.pop(context);
|
||||
selectedReplacementEmployee = _selectedEmployee;
|
||||
setState(() {});
|
||||
},
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
12.height,
|
||||
DynamicTextFieldWidget(
|
||||
LocaleKeys.comments.tr(),
|
||||
LocaleKeys.writeComment.tr(),
|
||||
lines: 2,
|
||||
onChange: (input) {
|
||||
comment = input;
|
||||
},
|
||||
),
|
||||
ListView.separated(
|
||||
physics: const NeverScrollableScrollPhysics(),
|
||||
shrinkWrap: true,
|
||||
padding: const EdgeInsets.only(top: 12),
|
||||
itemBuilder: (cxt, int parentIndex) => parseDynamicFormatType(getabsenceDffStructureList[parentIndex], parentIndex),
|
||||
separatorBuilder: (cxt, index) => 0.height,
|
||||
itemCount: getabsenceDffStructureList.length,
|
||||
)
|
||||
],
|
||||
).expanded,
|
||||
DefaultButton(
|
||||
LocaleKeys.next.tr(),
|
||||
validateFieldData()
|
||||
? null
|
||||
: () {
|
||||
validateAbsenceTransaction();
|
||||
},
|
||||
).insideContainer
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
bool validateFieldData() {
|
||||
List filteredList = getabsenceDffStructureList.where((element) => element.rEQUIREDFLAG == "Y" && (element.eSERVICESDV?.pVALUECOLUMNNAME) == null).toList();
|
||||
return (selectedAbsenceType == null || startDateTime == null || endDateTime == null || filteredList.isNotEmpty);
|
||||
}
|
||||
|
||||
Widget parseDynamicFormatType(GetAbsenceDffStructureList model, int index) {
|
||||
if (model.dISPLAYFLAG != "N") {
|
||||
if (model.vALIDATIONTYPE == "N") {
|
||||
if (model.fORMATTYPE == "C") {
|
||||
return DynamicTextFieldWidget(
|
||||
(model.sEGMENTPROMPT ?? "") + (model.rEQUIREDFLAG == "Y" ? "*" : ""),
|
||||
model.eSERVICESDV?.pIDCOLUMNNAME ?? "",
|
||||
isReadOnly: model.rEADONLY == "Y",
|
||||
onChange: (text) {
|
||||
model.eSERVICESDV ??= ESERVICESDV();
|
||||
model.eSERVICESDV!.pIDCOLUMNNAME = text;
|
||||
},
|
||||
).paddingOnly(bottom: 12);
|
||||
} else if (model.fORMATTYPE == "N") {
|
||||
return DynamicTextFieldWidget(
|
||||
(model.sEGMENTPROMPT ?? "") + (model.rEQUIREDFLAG == "Y" ? "*" : ""),
|
||||
model.eSERVICESDV?.pIDCOLUMNNAME ?? "",
|
||||
isReadOnly: model.rEADONLY == "Y",
|
||||
isInputTypeNum: true,
|
||||
onChange: (text) {
|
||||
model.eSERVICESDV ??= ESERVICESDV();
|
||||
model.eSERVICESDV!.pIDCOLUMNNAME = text;
|
||||
},
|
||||
).paddingOnly(bottom: 12);
|
||||
} else if (model.fORMATTYPE == "X") {
|
||||
String displayText = model.eSERVICESDV?.pIDCOLUMNNAME ?? "";
|
||||
|
||||
if (getabsenceDffStructureList[index].isDefaultTypeIsCDPS) {
|
||||
if (displayText.contains(" 00:00:00")) {
|
||||
displayText = displayText.replaceAll(" 00:00:00", "");
|
||||
}
|
||||
if (displayText.contains("/")) {
|
||||
displayText = DateFormat('yyyy-MM-dd').format(DateFormat("yyyy/MM/dd").parse(displayText));
|
||||
}
|
||||
}
|
||||
return DynamicTextFieldWidget(
|
||||
(model.sEGMENTPROMPT ?? "") + (model.rEQUIREDFLAG == "Y" ? "*" : ""),
|
||||
displayText,
|
||||
suffixIconData: Icons.calendar_today,
|
||||
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!);
|
||||
}
|
||||
}
|
||||
DateTime date = await _selectDate(context);
|
||||
String dateString = date.toString().split(' ').first;
|
||||
// DateTime date1 = DateTime(date.year, date.month, date.day);
|
||||
// getabsenceDffStructureList![index].fieldAnswer = date.toString();
|
||||
ESERVICESDV eservicesdv;
|
||||
if (getabsenceDffStructureList![index].isDefaultTypeIsCDPS) {
|
||||
eservicesdv = ESERVICESDV(
|
||||
pIDCOLUMNNAME: Utils.formatDate(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));
|
||||
} 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].eSERVICESDV = eservicesdv;
|
||||
setState(() {});
|
||||
// if (model.cHILDSEGMENTSVSSplited?.isNotEmpty ?? false) {
|
||||
// await calGetValueSetValues(model);
|
||||
// }
|
||||
// if (model.cHILDSEGMENTSDVSplited?.isNotEmpty ?? false) {
|
||||
// await getDefaultValues(model);
|
||||
// }
|
||||
},
|
||||
).paddingOnly(bottom: 12);
|
||||
} else if (model.fORMATTYPE == "Y") {
|
||||
String displayText = model.eSERVICESDV?.pIDCOLUMNNAME ?? "";
|
||||
if (getabsenceDffStructureList![index].isDefaultTypeIsCDPS) {
|
||||
displayText = Utils.reverseFormatDate(displayText);
|
||||
// if (displayText.contains(" 00:00:00")) {
|
||||
// displayText = displayText.replaceAll(" 00:00:00", "");
|
||||
// }
|
||||
// if (!displayText.contains("-")) {
|
||||
// displayText = DateFormat('yyyy-MM-dd').format(DateFormat("yyyy/MM/dd").parse(displayText));
|
||||
// }
|
||||
}
|
||||
return DynamicTextFieldWidget(
|
||||
(model.sEGMENTPROMPT ?? "") + (model.rEQUIREDFLAG == "Y" ? "*" : ""),
|
||||
displayText,
|
||||
suffixIconData: Icons.calendar_today,
|
||||
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!);
|
||||
}
|
||||
}
|
||||
DateTime date = await _selectDate(context);
|
||||
String dateString = date.toString().split(' ').first;
|
||||
// getabsenceDffStructureList![index].fieldAnswer = date.toString();
|
||||
ESERVICESDV eservicesdv;
|
||||
if (getabsenceDffStructureList![index].isDefaultTypeIsCDPS) {
|
||||
eservicesdv = ESERVICESDV(
|
||||
pIDCOLUMNNAME: Utils.formatDate(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));
|
||||
} 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].eSERVICESDV = eservicesdv;
|
||||
setState(() {});
|
||||
// if (model.cHILDSEGMENTSVSSplited?.isNotEmpty ?? false) {
|
||||
// await calGetValueSetValues(model);
|
||||
// }
|
||||
// if (model.cHILDSEGMENTSDVSplited?.isNotEmpty ?? false) {
|
||||
// await getDefaultValues(model);
|
||||
// }
|
||||
},
|
||||
).paddingOnly(bottom: 12);
|
||||
}
|
||||
} else {
|
||||
return PopupMenuButton(
|
||||
child: DynamicTextFieldWidget(
|
||||
(model.sEGMENTPROMPT ?? "") + (model.rEQUIREDFLAG == "Y" ? "*" : ""),
|
||||
model.eSERVICESDV?.pVALUECOLUMNNAME ?? "",
|
||||
isEnable: false,
|
||||
isPopup: true,
|
||||
isInputTypeNum: true,
|
||||
isReadOnly: model.rEADONLY == "Y",
|
||||
).paddingOnly(bottom: 12),
|
||||
itemBuilder: (_) => <PopupMenuItem<int>>[
|
||||
if (model.rEADONLY != "Y")
|
||||
for (int i = 0; i < model.eSERVICESVS!.length; i++) PopupMenuItem<int>(child: Text(model.eSERVICESVS![i].vALUECOLUMNNAME!), value: i),
|
||||
],
|
||||
onSelected: (int popipIndex) async {
|
||||
ESERVICESDV eservicesdv = ESERVICESDV(
|
||||
pIDCOLUMNNAME: model.eSERVICESVS![popipIndex].iDCOLUMNNAME,
|
||||
pRETURNMSG: "null",
|
||||
pRETURNSTATUS: "null", //getabsenceDffStructureList![popipIndex].dEFAULTVALUE,
|
||||
pVALUECOLUMNNAME: model.eSERVICESVS![popipIndex].vALUECOLUMNNAME);
|
||||
getabsenceDffStructureList![index].eSERVICESDV = eservicesdv;
|
||||
setState(() {});
|
||||
// if (model.cHILDSEGMENTSVSSplited?.isNotEmpty ?? false) {
|
||||
// await calGetValueSetValues(model);
|
||||
// }
|
||||
// if (model.cHILDSEGMENTSDVSplited?.isNotEmpty ?? false) {
|
||||
// await getDefaultValues(model);
|
||||
// }
|
||||
});
|
||||
}
|
||||
} else {
|
||||
return const SizedBox();
|
||||
}
|
||||
if (model.fORMATTYPE == "N") {
|
||||
if (model.eSERVICESVS?.isNotEmpty ?? false) {
|
||||
return PopupMenuButton(
|
||||
child: DynamicTextFieldWidget(
|
||||
(model.sEGMENTPROMPT ?? "") + (model.rEQUIREDFLAG == "Y" ? "*" : ""),
|
||||
model.eSERVICESDV?.pVALUECOLUMNNAME ?? "",
|
||||
isEnable: false,
|
||||
isPopup: true,
|
||||
isInputTypeNum: true,
|
||||
isReadOnly: model.rEADONLY == "Y",
|
||||
).paddingOnly(bottom: 12),
|
||||
itemBuilder: (_) => <PopupMenuItem<int>>[
|
||||
if (model.rEADONLY != "Y")
|
||||
for (int i = 0; i < model.eSERVICESVS!.length; i++) PopupMenuItem<int>(value: i, child: Text(model.eSERVICESVS![i].vALUECOLUMNNAME!)),
|
||||
],
|
||||
onSelected: (int popipIndex) async {
|
||||
ESERVICESDV eservicesdv =
|
||||
ESERVICESDV(pIDCOLUMNNAME: model.eSERVICESVS![popipIndex].iDCOLUMNNAME, pRETURNMSG: "null", pRETURNSTATUS: "null", pVALUECOLUMNNAME: model.eSERVICESVS![popipIndex].vALUECOLUMNNAME);
|
||||
getabsenceDffStructureList![index].eSERVICESDV = eservicesdv;
|
||||
setState(() {});
|
||||
// if (model.cHILDSEGMENTSVSSplited?.isNotEmpty ?? false) {
|
||||
// await calGetValueSetValues(model);
|
||||
// }
|
||||
// if (model.cHILDSEGMENTSDVSplited?.isNotEmpty ?? false) {
|
||||
// await getDefaultValues(model);
|
||||
// }
|
||||
});
|
||||
}
|
||||
|
||||
return DynamicTextFieldWidget(
|
||||
(model.sEGMENTPROMPT ?? "") + (model.rEQUIREDFLAG == "Y" ? "*" : ""),
|
||||
model.eSERVICESDV?.pIDCOLUMNNAME ?? "",
|
||||
isReadOnly: model.rEADONLY == "Y",
|
||||
onChange: (text) {
|
||||
//model.fieldAnswer = text;
|
||||
},
|
||||
).paddingOnly(bottom: 12);
|
||||
} else if (model.fORMATTYPE == "X" || model.fORMATTYPE == "Y") {
|
||||
String displayText = model.eSERVICESDV?.pIDCOLUMNNAME ?? "";
|
||||
if (getabsenceDffStructureList![index].isDefaultTypeIsCDPS) {
|
||||
if (displayText.contains(" 00:00:00")) {
|
||||
displayText = displayText.replaceAll(" 00:00:00", "");
|
||||
}
|
||||
if (!displayText.contains("-")) {
|
||||
displayText = DateFormat('yyyy-MM-dd').format(DateFormat("yyyy/MM/dd").parse(displayText));
|
||||
}
|
||||
}
|
||||
return DynamicTextFieldWidget(
|
||||
(model.sEGMENTPROMPT ?? "") + (model.rEQUIREDFLAG == "Y" ? "*" : ""),
|
||||
displayText,
|
||||
suffixIconData: Icons.calendar_today,
|
||||
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!);
|
||||
}
|
||||
}
|
||||
DateTime date = await _selectDate(context);
|
||||
String dateString = date.toString().split(' ').first;
|
||||
// getabsenceDffStructureList![index].fieldAnswer = date.toString();
|
||||
ESERVICESDV 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].eSERVICESDV = eservicesdv;
|
||||
setState(() {});
|
||||
// if (model.cHILDSEGMENTSVSSplited?.isNotEmpty ?? false) {
|
||||
// await calGetValueSetValues(model);
|
||||
// }
|
||||
// if (model.cHILDSEGMENTSDVSplited?.isNotEmpty ?? false) {
|
||||
// await getDefaultValues(model);
|
||||
// }
|
||||
},
|
||||
).paddingOnly(bottom: 12);
|
||||
} else if (model.fORMATTYPE == "I") {
|
||||
return DynamicTextFieldWidget(
|
||||
(model.sEGMENTPROMPT ?? "") + (model.rEQUIREDFLAG == "Y" ? "*" : ""),
|
||||
model.eSERVICESDV?.pIDCOLUMNNAME ?? "",
|
||||
suffixIconData: Icons.access_time_filled_rounded,
|
||||
isEnable: false,
|
||||
onTap: () async {
|
||||
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]));
|
||||
|
||||
//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();
|
||||
|
||||
// DateTime date1 = DateTime(date.year, date.month, date.day);
|
||||
// getabsenceDffStructureList![index].fieldAnswer = date.toString();
|
||||
ESERVICESDV eservicesdv = ESERVICESDV(pIDCOLUMNNAME: time, pRETURNMSG: "null", pRETURNSTATUS: getabsenceDffStructureList![index].dEFAULTVALUE, pVALUECOLUMNNAME: time);
|
||||
getabsenceDffStructureList![index].eSERVICESDV = eservicesdv;
|
||||
setState(() {});
|
||||
// if (model.cHILDSEGMENTSVSSplited?.isNotEmpty ?? false) {
|
||||
// await calGetValueSetValues(model);
|
||||
// }
|
||||
// if (model.cHILDSEGMENTSDVSplited?.isNotEmpty ?? false) {
|
||||
// await getDefaultValues(model);
|
||||
// }
|
||||
},
|
||||
).paddingOnly(bottom: 12);
|
||||
}
|
||||
|
||||
return Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [],
|
||||
).objectContainerView();
|
||||
}
|
||||
|
||||
Future<DateTime> _selectDate(BuildContext context) async {
|
||||
DateTime time = selectedDate;
|
||||
if (Platform.isIOS) {
|
||||
await showCupertinoModalPopup(
|
||||
context: context,
|
||||
builder: (cxt) => Container(
|
||||
height: 250,
|
||||
color: Colors.white,
|
||||
child: CupertinoDatePicker(
|
||||
backgroundColor: Colors.white,
|
||||
mode: CupertinoDatePickerMode.date,
|
||||
onDateTimeChanged: (value) {
|
||||
if (value != null && value != selectedDate) {
|
||||
time = value;
|
||||
}
|
||||
},
|
||||
initialDateTime: selectedDate,
|
||||
),
|
||||
),
|
||||
);
|
||||
} else {
|
||||
DateTime? picked = await showDatePicker(context: context, initialDate: selectedDate, initialEntryMode: DatePickerEntryMode.calendarOnly, firstDate: DateTime(2015, 8), lastDate: DateTime(2101));
|
||||
if (picked != null && picked != selectedDate) {
|
||||
time = picked;
|
||||
}
|
||||
}
|
||||
time = DateTime(time.year, time.month, time.day);
|
||||
return time;
|
||||
}
|
||||
|
||||
Future<TimeOfDay> _selectTime(BuildContext context) async {
|
||||
TimeOfDay time = TimeOfDay(hour: selectedDate.hour, minute: selectedDate.minute);
|
||||
if (Platform.isIOS) {
|
||||
await showCupertinoModalPopup(
|
||||
context: context,
|
||||
builder: (cxt) => Container(
|
||||
height: 250,
|
||||
color: Colors.white,
|
||||
child: CupertinoDatePicker(
|
||||
backgroundColor: Colors.white,
|
||||
mode: CupertinoDatePickerMode.time,
|
||||
use24hFormat: true,
|
||||
onDateTimeChanged: (value) {
|
||||
if (value != null && value != selectedDate) {
|
||||
time = TimeOfDay(hour: value.hour, minute: value.minute);
|
||||
}
|
||||
},
|
||||
initialDateTime: selectedDate,
|
||||
),
|
||||
),
|
||||
);
|
||||
} else {
|
||||
TimeOfDay? picked = await showTimePicker(
|
||||
context: context,
|
||||
initialTime: time,
|
||||
builder: (cxt, child) {
|
||||
return MediaQuery(data: MediaQuery.of(context).copyWith(alwaysUse24HourFormat: true), child: child ?? Container());
|
||||
});
|
||||
|
||||
if (picked != null && picked != time) {
|
||||
time = picked;
|
||||
}
|
||||
// final DateTime? picked =
|
||||
// await showDatePicker(context: context, initialDate: selectedDate, initialEntryMode: DatePickerEntryMode.calendarOnly, firstDate: DateTime(2015, 8), lastDate: DateTime(2101));
|
||||
// if (picked != null && picked != selectedDate) {
|
||||
// time = picked;
|
||||
// }
|
||||
}
|
||||
return time;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,96 @@
|
||||
import 'package:easy_localization/easy_localization.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:mohem_flutter_app/api/leave_balance_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/widget_extensions.dart';
|
||||
import 'package:mohem_flutter_app/generated/locale_keys.g.dart';
|
||||
import 'package:mohem_flutter_app/models/leave_balance/get_absence_transaction_list_model.dart';
|
||||
import 'package:mohem_flutter_app/widgets/app_bar_widget.dart';
|
||||
import 'package:mohem_flutter_app/widgets/item_detail_view_widget.dart';
|
||||
|
||||
class LeaveBalance extends StatefulWidget {
|
||||
LeaveBalance({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
_LeaveBalanceState createState() {
|
||||
return _LeaveBalanceState();
|
||||
}
|
||||
}
|
||||
|
||||
class _LeaveBalanceState extends State<LeaveBalance> {
|
||||
List<GetAbsenceTransactionList>? absenceTransList;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
getAbsenceTransactions();
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
void getAbsenceTransactions() async {
|
||||
try {
|
||||
Utils.showLoading(context);
|
||||
absenceTransList = await LeaveBalanceApiClient().getAbsenceTransactions(-999);
|
||||
Utils.hideLoading(context);
|
||||
setState(() {});
|
||||
} catch (ex) {
|
||||
Utils.hideLoading(context);
|
||||
Utils.handleException(ex, context, null);
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
backgroundColor: Colors.white,
|
||||
appBar: AppBarWidget(
|
||||
context,
|
||||
title: LocaleKeys.leaveBalance.tr(),
|
||||
),
|
||||
body: absenceTransList == null
|
||||
? const SizedBox()
|
||||
: (absenceTransList!.isEmpty
|
||||
? Utils.getNoDataWidget(context)
|
||||
: ListView.separated(
|
||||
physics: const BouncingScrollPhysics(),
|
||||
padding: const EdgeInsets.all(21),
|
||||
itemBuilder: (cxt, int index) => Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
ItemDetailView(LocaleKeys.startDateT.tr(), absenceTransList![index].sTARTDATE ?? ""),
|
||||
ItemDetailView(LocaleKeys.endDateT.tr(), absenceTransList![index].eNDDATE ?? ""),
|
||||
ItemDetailView(LocaleKeys.absenceType.tr(), absenceTransList![index].aBSENCETYPE ?? ""),
|
||||
ItemDetailView(LocaleKeys.absenceCategory.tr(), absenceTransList![index].aBSENCECATEGORY ?? ""),
|
||||
ItemDetailView(LocaleKeys.days.tr(), absenceTransList![index].aBSENCEDAYS?.toString() ?? ""),
|
||||
ItemDetailView(LocaleKeys.hours.tr(), absenceTransList![index].aBSENCEHOURS?.toString() ?? ""),
|
||||
ItemDetailView(LocaleKeys.approvalStatus.tr(), absenceTransList![index].aPPROVALSTATUS ?? ""),
|
||||
ItemDetailView(LocaleKeys.absenceStatus.tr(), absenceTransList![index].aBSENCESTATUS ?? ""),
|
||||
],
|
||||
).objectContainerView(),
|
||||
separatorBuilder: (cxt, index) => 12.height,
|
||||
itemCount: absenceTransList!.length)),
|
||||
floatingActionButton: Container(
|
||||
height: 54,
|
||||
width: 54,
|
||||
decoration: const BoxDecoration(
|
||||
shape: BoxShape.circle,
|
||||
gradient: LinearGradient(transform: GradientRotation(.83), begin: Alignment.topRight, end: Alignment.bottomLeft, colors: [
|
||||
MyColors.gradiantEndColor,
|
||||
MyColors.gradiantStartColor,
|
||||
]),
|
||||
),
|
||||
child: const Icon(Icons.add, color: Colors.white, size: 30),
|
||||
).onPress(() {
|
||||
Navigator.pushNamed(context, AppRoutes.addLeaveBalance);
|
||||
}),
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,95 @@
|
||||
|
||||
import 'dart:ui';
|
||||
import 'package:easy_localization/easy_localization.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_svg/flutter_svg.dart';
|
||||
import 'package:mohem_flutter_app/api/my_team/my_team_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';
|
||||
import 'package:mohem_flutter_app/extensions/widget_extensions.dart';
|
||||
import 'package:mohem_flutter_app/generated/locale_keys.g.dart';
|
||||
import 'package:mohem_flutter_app/models/dashboard/menu_entries.dart';
|
||||
import 'package:mohem_flutter_app/models/my_team/get_employee_subordinates_list.dart';
|
||||
import 'package:mohem_flutter_app/provider/dashboard_provider_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 CreateRequest extends StatefulWidget {
|
||||
const CreateRequest ({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
_CreateRequestState createState() => _CreateRequestState();
|
||||
}
|
||||
|
||||
class _CreateRequestState extends State<CreateRequest> {
|
||||
String searchEmpEmail ="";
|
||||
String searchEmpName ="";
|
||||
String searchEmpNo = "";
|
||||
String? empId;
|
||||
List<GetEmployeeSubordinatesList> getEmployeeSubordinatesList = [];
|
||||
// late DashboardProviderModel data;
|
||||
List<GetMenuEntriesList> getMenuEntriesList = [];
|
||||
GetEmployeeSubordinatesList? getEmployeeSubordinates;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
// data.fetchMenuEntries();
|
||||
employeeSubRequest();
|
||||
}
|
||||
|
||||
void employeeSubRequest() async {
|
||||
try {
|
||||
Utils.showLoading(context);
|
||||
getEmployeeSubordinatesList = await MyTeamApiClient().getEmployeeSubordinates(searchEmpEmail.toString(), searchEmpName.toString(), searchEmpNo.toString());
|
||||
getMenuEntriesList = await MyTeamApiClient().employeeSubordinatesRequest(getEmployeeSubordinates?.eMPLOYEENUMBER);
|
||||
Utils.hideLoading(context);
|
||||
setState(() {});
|
||||
} catch (ex) {
|
||||
Utils.hideLoading(context);
|
||||
Utils.handleException(ex, context, null);
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
getEmployeeSubordinates ??= ModalRoute.of(context)?.settings.arguments as GetEmployeeSubordinatesList;
|
||||
print(getMenuEntriesList.length);
|
||||
return Scaffold(
|
||||
backgroundColor: Colors.white,
|
||||
appBar: AppBarWidget(
|
||||
context,
|
||||
title: LocaleKeys.createRequest.tr(),
|
||||
),
|
||||
body: SizedBox(
|
||||
width: double.infinity,
|
||||
height: double.infinity,
|
||||
child: getMenuEntriesList.isEmpty
|
||||
? Utils.getNoDataWidget(context)
|
||||
: ListView.separated(
|
||||
padding: const EdgeInsets.all(21),
|
||||
itemBuilder: (cxt, index) => itemView("assets/images/pdf.svg", getMenuEntriesList[index].prompt!, index).onPress(() {
|
||||
Navigator.pushNamed(context, AppRoutes.dynamicScreen, arguments: DynamicListViewParams(getMenuEntriesList[index].prompt!, getMenuEntriesList[index].functionName!));
|
||||
}),
|
||||
separatorBuilder: (cxt, index) => 12.height,
|
||||
itemCount: getMenuEntriesList.length),
|
||||
),
|
||||
|
||||
);
|
||||
}
|
||||
|
||||
Widget itemView(String icon, String title, index) {
|
||||
return getMenuEntriesList[index].parentMenuName !=""? Row(
|
||||
children: [
|
||||
(title).toText16().expanded, 12.width,
|
||||
SvgPicture.asset(
|
||||
"assets/images/arrow_next.svg",
|
||||
color: MyColors.darkIconColor,
|
||||
)
|
||||
],
|
||||
).objectContainerView() : SizedBox();
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,321 @@
|
||||
import 'dart:collection';
|
||||
import 'dart:ui';
|
||||
import 'package:easy_localization/easy_localization.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_html/html_parser.dart';
|
||||
import 'package:flutter_svg/flutter_svg.dart';
|
||||
import 'package:mohem_flutter_app/api/my_team/my_team_api_client.dart';
|
||||
import 'package:mohem_flutter_app/api/worklist/worklist_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';
|
||||
import 'package:mohem_flutter_app/extensions/widget_extensions.dart';
|
||||
import 'package:mohem_flutter_app/generated/locale_keys.g.dart';
|
||||
import 'package:mohem_flutter_app/models/dashboard/menu_entries.dart';
|
||||
import 'package:mohem_flutter_app/models/generic_response_model.dart';
|
||||
import 'package:mohem_flutter_app/models/my_team/get_employee_subordinates_list.dart';
|
||||
import 'package:mohem_flutter_app/models/profile_menu.model.dart';
|
||||
import 'package:mohem_flutter_app/models/worklist/get_favorite_replacements_model.dart';
|
||||
import 'package:mohem_flutter_app/models/worklist/replacement_list_model.dart';
|
||||
import 'package:mohem_flutter_app/provider/dashboard_provider_model.dart';
|
||||
import 'package:mohem_flutter_app/widgets/circular_avatar.dart';
|
||||
import 'package:url_launcher/url_launcher.dart';
|
||||
|
||||
class EmployeeDetails extends StatefulWidget {
|
||||
EmployeeDetails();
|
||||
|
||||
@override
|
||||
_EmployeeDetailsState createState() => _EmployeeDetailsState();
|
||||
|
||||
}
|
||||
|
||||
class _EmployeeDetailsState extends State<EmployeeDetails> {
|
||||
GetEmployeeSubordinatesList? getEmployeeSubordinates;
|
||||
static List<GetMenuEntriesList> menuData = [];
|
||||
List<ProfileMenu> menu =[];
|
||||
String? selectedFavLetter;
|
||||
List<String>? favLetters;
|
||||
List<GetFavoriteReplacements>? favUsersList;
|
||||
List<ReplacementList>? replacementList;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
// setState(() {});
|
||||
}
|
||||
|
||||
//favorite
|
||||
void fetchChangeFav({required String email, required String employeName, required String image, required String userName, bool isFav = false, bool isNeedToRefresh = false}) async {
|
||||
Utils.showLoading(context);
|
||||
getEmployeeSubordinates = ModalRoute.of(context)?.settings.arguments as GetEmployeeSubordinatesList;
|
||||
GenericResponseModel model = await MyTeamApiClient().changeFavoriteReplacements(
|
||||
email: email,
|
||||
employeName: employeName,
|
||||
image: image,
|
||||
userName: userName,
|
||||
isFav: isFav,
|
||||
);
|
||||
getEmployeeSubordinates!.isFavorite = isFav;
|
||||
Utils.hideLoading(context);
|
||||
setState(() {});
|
||||
}
|
||||
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
if(getEmployeeSubordinates == null) {
|
||||
getEmployeeSubordinates = ModalRoute.of(context)?.settings.arguments as GetEmployeeSubordinatesList;
|
||||
setMenu();
|
||||
}
|
||||
|
||||
|
||||
return Scaffold(
|
||||
extendBody: true,
|
||||
backgroundColor: MyColors.lightGreyEFColor,
|
||||
body: Stack(children: [
|
||||
Container(
|
||||
height: 200,
|
||||
margin: EdgeInsets.only(top: 30),
|
||||
decoration: BoxDecoration(image: DecorationImage(image: MemoryImage(Utils.getPostBytes(getEmployeeSubordinates!.eMPLOYEEIMAGE)), fit: BoxFit.cover)),
|
||||
child: new BackdropFilter(
|
||||
filter: new ImageFilter.blur(sigmaX: 10.0, sigmaY: 10.0),
|
||||
child: new Container(
|
||||
decoration: new BoxDecoration(color: Colors.white.withOpacity(0.0)),
|
||||
),
|
||||
),
|
||||
),
|
||||
SingleChildScrollView(
|
||||
scrollDirection: Axis.vertical,
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
80.height,
|
||||
Container(
|
||||
padding: EdgeInsets.only(left: 15, right: 15),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
IconButton(
|
||||
onPressed: () {
|
||||
Navigator.pop(context);
|
||||
},
|
||||
icon: Icon(
|
||||
Icons.arrow_back_ios,
|
||||
color: Colors.white,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
myTeamInfo()
|
||||
],
|
||||
),
|
||||
)
|
||||
]));
|
||||
}
|
||||
|
||||
Widget myTeamInfo() {
|
||||
Uri phoneNumber = Uri.parse('tel:${getEmployeeSubordinates?.eMPLOYEEMOBILENUMBER}');
|
||||
double _width = MediaQuery
|
||||
.of(context)
|
||||
.size
|
||||
.width;
|
||||
return Column(
|
||||
children: [
|
||||
Container(
|
||||
margin: EdgeInsets.fromLTRB(21, 0, 21, 10),
|
||||
child: Stack(children: [
|
||||
Container(
|
||||
width: _width,
|
||||
margin: EdgeInsets.only(top: 50),
|
||||
//padding: EdgeInsets.only(right: 17, left: 17),
|
||||
decoration: BoxDecoration(
|
||||
color: MyColors.whiteColor,
|
||||
borderRadius: const BorderRadius.all(Radius.circular(15)),
|
||||
boxShadow: [BoxShadow(color: MyColors.lightGreyColor, blurRadius: 15, spreadRadius: 3)],
|
||||
),
|
||||
child: Column(
|
||||
children: [
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
IconButton(
|
||||
onPressed: (){
|
||||
if(getEmployeeSubordinates!.isFavorite != true){
|
||||
showFavoriteAlertDialog(context);
|
||||
setState(() {});
|
||||
}else{
|
||||
fetchChangeFav(
|
||||
email: getEmployeeSubordinates?.eMPLOYEEEMAILADDRESS ?? "",
|
||||
employeName: getEmployeeSubordinates!.eMPLOYEENAME ?? "",
|
||||
image: getEmployeeSubordinates!.eMPLOYEEIMAGE ?? "",
|
||||
userName: getEmployeeSubordinates!.eMPLOYEENUMBER ?? "",
|
||||
isFav: false,);
|
||||
setState(() {});
|
||||
} },
|
||||
icon: getEmployeeSubordinates!.isFavorite != true
|
||||
? Icon(
|
||||
Icons.star_outline,
|
||||
size: 35,
|
||||
color: MyColors.green9CColor,
|
||||
)
|
||||
: Icon(
|
||||
Icons.star_outlined,
|
||||
size: 35,
|
||||
color: MyColors.green9CColor,
|
||||
),
|
||||
),
|
||||
InkWell(
|
||||
onTap:() {
|
||||
launchUrl(phoneNumber);
|
||||
},
|
||||
child: SvgPicture.asset("assets/images/call.svg"),
|
||||
),
|
||||
],
|
||||
).paddingOnly(left:6, right: 17, top: 16),
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
/// card header
|
||||
customLabel(getEmployeeSubordinates!.eMPLOYEENAME.toString(), 21, MyColors.grey3AColor, true),
|
||||
customLabel(getEmployeeSubordinates!.eMPLOYEENUMBER.toString() + ' | ' + getEmployeeSubordinates!.jOBNAME.toString(), 13, MyColors.grey80Color, true),
|
||||
customLabel(getEmployeeSubordinates!.eMPLOYEEEMAILADDRESS.toString(), 13, MyColors.grey3AColor, true),
|
||||
],
|
||||
).paddingOnly(bottom: 10, left: 35,right: 31),
|
||||
],
|
||||
),
|
||||
),
|
||||
Container(height: 100, alignment: Alignment.center, child: ProfileImage()),
|
||||
])
|
||||
),
|
||||
Container(
|
||||
margin: EdgeInsets.fromLTRB(21, 8, 21, 10),
|
||||
height: 260,
|
||||
padding: EdgeInsets.only(top: 15, bottom: 15),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
borderRadius: const BorderRadius.all(Radius.circular(15)),
|
||||
boxShadow: [BoxShadow(color: MyColors.lightGreyColor, blurRadius: 15, spreadRadius: 3)],
|
||||
),
|
||||
child: Column(
|
||||
children: menu.map((ProfileMenu i) => rowItem(i, context)).toList(),
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
Widget ProfileImage() =>
|
||||
CircleAvatar(
|
||||
radius: 70,
|
||||
backgroundImage: MemoryImage(Utils.getPostBytes(getEmployeeSubordinates?.eMPLOYEEIMAGE)),
|
||||
backgroundColor: Colors.black,
|
||||
);
|
||||
|
||||
Widget customLabel(String label, double size, Color color, bool isBold, {double padding = 0.0}) =>
|
||||
Container(
|
||||
padding: EdgeInsets.all(padding),
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [Text(label, style: TextStyle(color: color, fontSize: size, fontWeight: isBold ? FontWeight.bold : FontWeight.normal))]));
|
||||
|
||||
Widget rowItem(obj, context) {
|
||||
return InkWell(
|
||||
onTap: () {
|
||||
|
||||
Navigator.pushNamed(context, obj.route, arguments:obj.arguments);
|
||||
|
||||
},
|
||||
child: ListTile(
|
||||
leading: SvgPicture.asset('assets/images/' + obj.icon),
|
||||
title: Text(obj.name,
|
||||
style: TextStyle(color: MyColors.grey3AColor,
|
||||
fontWeight: FontWeight.w600,
|
||||
fontSize: 16)),
|
||||
trailing: Icon(Icons.arrow_forward,
|
||||
color: MyColors.grey3AColor,),
|
||||
),
|
||||
);
|
||||
}
|
||||
void setMenu(){
|
||||
menu = [
|
||||
ProfileMenu(name: "Profile Details", icon: "profile_details.svg", route: AppRoutes.profileDetails, arguments:getEmployeeSubordinates),
|
||||
ProfileMenu(name: "Create Request", icon: "create_request.svg", route: AppRoutes.createRequest,arguments: getEmployeeSubordinates),
|
||||
ProfileMenu(name: "View Attendance", icon: "view_attendance.svg", route: AppRoutes.viewAttendance, arguments: getEmployeeSubordinates),
|
||||
ProfileMenu(name: "Team Members", icon: "team.svg", route: AppRoutes.teamMembers, arguments: getEmployeeSubordinates),
|
||||
];
|
||||
}
|
||||
|
||||
void showFavoriteAlertDialog(BuildContext context) {
|
||||
Widget cancelButton = TextButton(
|
||||
child: Text(
|
||||
LocaleKeys.cancel.tr(),
|
||||
),
|
||||
onPressed: () {
|
||||
Navigator.pop(context);
|
||||
},
|
||||
);
|
||||
Widget continueButton = TextButton(
|
||||
child: Text(
|
||||
LocaleKeys.ok.tr(),
|
||||
),
|
||||
onPressed: () {
|
||||
fetchChangeFav(
|
||||
email: getEmployeeSubordinates?.eMPLOYEEEMAILADDRESS ?? "",
|
||||
employeName: getEmployeeSubordinates!.eMPLOYEENAME ?? "",
|
||||
image: getEmployeeSubordinates!.eMPLOYEEIMAGE ?? "",
|
||||
userName: getEmployeeSubordinates!.eMPLOYEENUMBER ?? "",
|
||||
isFav: true,
|
||||
);
|
||||
setState(() {});
|
||||
Navigator.pop(context);
|
||||
},
|
||||
);
|
||||
AlertDialog alert = AlertDialog(
|
||||
title: Text(
|
||||
LocaleKeys.confirm.tr(),
|
||||
),
|
||||
content: Container(
|
||||
height: 150,
|
||||
child: Column(
|
||||
children: [
|
||||
Text("Do you want to add" + "${getEmployeeSubordinates!.eMPLOYEENAME.toString()}" + "in your favorite list "),
|
||||
CircularAvatar(
|
||||
url: getEmployeeSubordinates!.eMPLOYEEIMAGE ?? "",
|
||||
height: 50,
|
||||
width: 50,
|
||||
isImageBase64: true,
|
||||
).paddingOnly(top: 21),
|
||||
// 16.width,
|
||||
],
|
||||
),
|
||||
),
|
||||
actions: [
|
||||
cancelButton,
|
||||
continueButton,
|
||||
],
|
||||
);
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (BuildContext context) {
|
||||
return alert;
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
GetMenuEntriesList getMenuEntries(String type) {
|
||||
List<GetMenuEntriesList> data = _EmployeeDetailsState.menuData.where((GetMenuEntriesList test) => test.functionName == type).toList();
|
||||
if (data.isNotEmpty) {
|
||||
return data[0];
|
||||
} else {
|
||||
return GetMenuEntriesList();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -0,0 +1,199 @@
|
||||
import 'package:easy_localization/easy_localization.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_svg/flutter_svg.dart';
|
||||
import 'package:mohem_flutter_app/api/my_team/my_team_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';
|
||||
import 'package:mohem_flutter_app/extensions/widget_extensions.dart';
|
||||
import 'package:mohem_flutter_app/generated/locale_keys.g.dart';
|
||||
import 'package:mohem_flutter_app/models/my_team/get_employee_subordinates_list.dart';
|
||||
import 'package:mohem_flutter_app/widgets/app_bar_widget.dart';
|
||||
import 'package:url_launcher/url_launcher.dart';
|
||||
|
||||
class MyTeam extends StatefulWidget {
|
||||
const MyTeam({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
_MyTeamState createState() => _MyTeamState();
|
||||
}
|
||||
|
||||
class _MyTeamState extends State<MyTeam> {
|
||||
String searchEmpEmail = "";
|
||||
String searchEmpName = "";
|
||||
String searchEmpNo = "";
|
||||
String? empId;
|
||||
List<GetEmployeeSubordinatesList> getEmployeeSubordinatesList = [];
|
||||
TextEditingController? _textEditingController = TextEditingController();
|
||||
List<GetEmployeeSubordinatesList> getEmployeeSListOnSearch = [];
|
||||
|
||||
String dropdownValue = 'Name';
|
||||
|
||||
void initState() {
|
||||
super.initState();
|
||||
getEmployeeSubordinates();
|
||||
}
|
||||
|
||||
void getEmployeeSubordinates() async {
|
||||
try {
|
||||
Utils.showLoading(context);
|
||||
getEmployeeSubordinatesList = await MyTeamApiClient().getEmployeeSubordinates(searchEmpEmail.toString(), searchEmpName.toString(), searchEmpNo.toString());
|
||||
getEmployeeSListOnSearch = getEmployeeSubordinatesList;
|
||||
Utils.hideLoading(context);
|
||||
setState(() {});
|
||||
} catch (ex) {
|
||||
Utils.hideLoading(context);
|
||||
Utils.handleException(ex, context, null);
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBarWidget(
|
||||
context,
|
||||
title: LocaleKeys.myTeamMembers.tr(),
|
||||
showMemberButton: true,
|
||||
),
|
||||
backgroundColor: MyColors.backgroundColor,
|
||||
body: SingleChildScrollView(
|
||||
child: Column(
|
||||
children: [
|
||||
Container(
|
||||
margin: EdgeInsets.only(left: 21, right: 21, top: 20, bottom: 6),
|
||||
padding: EdgeInsets.only(left: 14, right: 14, top: 21, bottom: 21),
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(15),
|
||||
color: Color(0xffFFFFFF),
|
||||
border: Border.all(
|
||||
color: Color(0xffefefef),
|
||||
width: 1,
|
||||
),
|
||||
),
|
||||
child: Row(
|
||||
children: [
|
||||
Expanded(
|
||||
child: TextField(
|
||||
onChanged: dropdownValue == "Name"
|
||||
? (String value) {
|
||||
getEmployeeSListOnSearch =
|
||||
getEmployeeSubordinatesList.where((GetEmployeeSubordinatesList element) => element.eMPLOYEENAME!.toLowerCase().contains(value.toLowerCase())).toList();
|
||||
setState(() {});
|
||||
}
|
||||
: (String value) {
|
||||
getEmployeeSListOnSearch =
|
||||
getEmployeeSubordinatesList.where((GetEmployeeSubordinatesList element) => element.eMPLOYEEEMAILADDRESS!.toLowerCase().contains(value.toLowerCase())).toList();
|
||||
setState(() {});
|
||||
},
|
||||
controller: _textEditingController,
|
||||
decoration: InputDecoration(
|
||||
filled: true,
|
||||
fillColor: Colors.white,
|
||||
border: InputBorder.none,
|
||||
enabledBorder: InputBorder.none,
|
||||
focusedBorder: InputBorder.none,
|
||||
// contentPadding: EdgeInsets.fromLTRB(10, 15, 10, 15),
|
||||
hintText: LocaleKeys.searchBy.tr() + " $dropdownValue",
|
||||
hintStyle: TextStyle(fontSize: 14.0, color: MyColors.grey57Color, fontWeight: FontWeight.w600),
|
||||
),
|
||||
)),
|
||||
Container(
|
||||
height: 36,
|
||||
width: 1,
|
||||
color: Color(0xffC4C4C4),
|
||||
),
|
||||
10.width,
|
||||
dropDown(),
|
||||
],
|
||||
),
|
||||
),
|
||||
Container(
|
||||
margin: EdgeInsets.only(left: 21, right: 21),
|
||||
width: MediaQuery.of(context).size.width,
|
||||
child: SingleChildScrollView(
|
||||
scrollDirection: Axis.vertical,
|
||||
child: Column(
|
||||
children: <Widget>[
|
||||
_textEditingController!.text.isNotEmpty && getEmployeeSListOnSearch.isEmpty
|
||||
? Container(
|
||||
child: LocaleKeys.noResultsFound.tr().toText16(color: MyColors.blackColor),
|
||||
).paddingOnly(top: 10)
|
||||
: ListView.separated(
|
||||
scrollDirection: Axis.vertical,
|
||||
shrinkWrap: true,
|
||||
physics: ScrollPhysics(),
|
||||
separatorBuilder: (cxt, index) => 12.height,
|
||||
itemCount: _textEditingController!.text.isNotEmpty ? getEmployeeSListOnSearch.length : getEmployeeSubordinatesList.length,
|
||||
itemBuilder: (context, index) {
|
||||
var phoneNumber = Uri.parse('tel:${getEmployeeSListOnSearch[index].eMPLOYEEMOBILENUMBER}');
|
||||
return Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
CircleAvatar(
|
||||
radius: 25,
|
||||
backgroundImage: MemoryImage(Utils.getPostBytes(getEmployeeSListOnSearch[index].eMPLOYEEIMAGE)),
|
||||
backgroundColor: Colors.black,
|
||||
),
|
||||
10.width,
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
// "Present".toText13(color: MyColors.greenColor),
|
||||
"${getEmployeeSListOnSearch[index].eMPLOYEENAME}".toText16(isBold: true, color: MyColors.grey3AColor),
|
||||
"${getEmployeeSListOnSearch[index].pOSITIONNAME}".toText10(isBold: true, color: MyColors.grey57Color),
|
||||
],
|
||||
).expanded,
|
||||
Column(
|
||||
children: [
|
||||
InkWell(
|
||||
onTap: () {
|
||||
launchUrl(phoneNumber);
|
||||
},
|
||||
child: SvgPicture.asset("assets/images/call.svg"),
|
||||
),
|
||||
21.height,
|
||||
InkWell(
|
||||
onTap: () async {
|
||||
Navigator.pushNamed(context, AppRoutes.employeeDetails, arguments: getEmployeeSListOnSearch[index]);
|
||||
},
|
||||
child: Icon(Icons.arrow_forward_outlined, color: MyColors.grey3AColor),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
).objectContainerView();
|
||||
})
|
||||
],
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
));
|
||||
}
|
||||
|
||||
Widget dropDown() {
|
||||
return
|
||||
DropdownButton<String>(
|
||||
value: dropdownValue,
|
||||
icon: const Icon(Icons.keyboard_arrow_down,
|
||||
color: MyColors.grey57Color).paddingOnly(left: 4),
|
||||
elevation: 16,
|
||||
onChanged: (String? newValue) {
|
||||
setState(() {
|
||||
dropdownValue = newValue!;
|
||||
});
|
||||
},
|
||||
items: <String>['Name', 'Email'].map<DropdownMenuItem<String>>((String value) {
|
||||
return DropdownMenuItem<String>(
|
||||
value: value,
|
||||
child: Text(value),
|
||||
);
|
||||
}).toList(),
|
||||
style: TextStyle(fontSize: 14.0, color: MyColors.grey57Color,
|
||||
fontWeight: FontWeight.w600),
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,79 @@
|
||||
import 'package:easy_localization/easy_localization.dart';
|
||||
import 'package:flutter/material.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/generated/locale_keys.g.dart';
|
||||
import 'package:mohem_flutter_app/models/my_team/get_employee_subordinates_list.dart';
|
||||
import 'package:mohem_flutter_app/widgets/app_bar_widget.dart';
|
||||
|
||||
|
||||
class ProfileDetails extends StatefulWidget {
|
||||
const ProfileDetails({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
_ProfileDetailsState createState() => _ProfileDetailsState();
|
||||
}
|
||||
|
||||
class _ProfileDetailsState extends State<ProfileDetails> {
|
||||
GetEmployeeSubordinatesList? getEmployeeSubordinates;
|
||||
|
||||
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
}
|
||||
|
||||
Widget build(BuildContext context) {
|
||||
getEmployeeSubordinates ??= ModalRoute.of(context)?.settings.arguments as GetEmployeeSubordinatesList;
|
||||
return Scaffold(
|
||||
appBar: AppBarWidget(
|
||||
context,
|
||||
title: LocaleKeys.profileDetails.tr(),
|
||||
),
|
||||
backgroundColor: MyColors.backgroundColor,
|
||||
body: Column(
|
||||
children: [
|
||||
Container(
|
||||
width: double.infinity,
|
||||
margin: EdgeInsets.only(
|
||||
top: 20,
|
||||
left: 21,
|
||||
right: 21,
|
||||
),
|
||||
padding: EdgeInsets.only(left: 14, right: 14, top: 13, bottom: 20),
|
||||
decoration: BoxDecoration(
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: Colors.grey.withOpacity(0.5),
|
||||
spreadRadius: 5,
|
||||
blurRadius: 26,
|
||||
offset: Offset(0, 3),
|
||||
),
|
||||
],
|
||||
color: Colors.white,
|
||||
borderRadius: BorderRadius.circular(10.0),
|
||||
),
|
||||
child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [
|
||||
LocaleKeys.category.tr().toText13(color: MyColors.lightGrayColor),
|
||||
"${getEmployeeSubordinates?.eMPLOYMENTCATEGORYMEANING}".toText16(isBold: true, color: MyColors.darkTextColor),
|
||||
23.height,
|
||||
LocaleKeys.address.tr().toText13(color: MyColors.lightGrayColor),
|
||||
"${getEmployeeSubordinates?.lOCATIONNAME}".toText16(isBold: true, color: MyColors.darkTextColor),
|
||||
23.height,
|
||||
LocaleKeys.phoneNumber.tr().toText13(color: MyColors.lightGrayColor),
|
||||
"${getEmployeeSubordinates?.eMPLOYEEMOBILENUMBER}".toText16(isBold: true, color: MyColors.darkTextColor),
|
||||
23.height,
|
||||
LocaleKeys.businessGroup.tr().toText13(color: MyColors.lightGrayColor),
|
||||
"${getEmployeeSubordinates?.bUSINESSGROUPNAME}".toText16(isBold: true, color: MyColors.darkTextColor),
|
||||
23.height,
|
||||
LocaleKeys.Payroll.tr().toText13(color: MyColors.lightGrayColor),
|
||||
"${getEmployeeSubordinates?.pAYROLLNAME}".toText16(isBold: true, color: MyColors.darkTextColor),
|
||||
]),
|
||||
),
|
||||
],
|
||||
));
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,187 @@
|
||||
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:easy_localization/easy_localization.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_svg/flutter_svg.dart';
|
||||
import 'package:mohem_flutter_app/api/my_team/my_team_api_client.dart';
|
||||
import 'package:mohem_flutter_app/classes/colors.dart';
|
||||
import 'package:mohem_flutter_app/classes/date_uitl.dart';
|
||||
import 'package:mohem_flutter_app/classes/utils.dart';
|
||||
import 'package:mohem_flutter_app/config/routes.dart';
|
||||
import 'package:mohem_flutter_app/extensions/int_extensions.dart';
|
||||
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/models/my_team/get_subordinates_leaves_total_vacations_list_model.dart';
|
||||
import 'package:mohem_flutter_app/widgets/app_bar_widget.dart';
|
||||
import 'package:mohem_flutter_app/widgets/button/default_button.dart';
|
||||
import 'package:mohem_flutter_app/widgets/dynamic_forms/dynamic_textfield_widget.dart';
|
||||
|
||||
|
||||
class SubordinateLeave extends StatefulWidget {
|
||||
const SubordinateLeave({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
_SubordinateLeaveState createState() => _SubordinateLeaveState();
|
||||
}
|
||||
|
||||
class _SubordinateLeaveState extends State<SubordinateLeave> {
|
||||
List<GetSubordinatesLeavesTotalVacationsList> getSubordinatesLeavesTotalList = [];
|
||||
DateTime selectedDateFrom = DateTime.now();
|
||||
DateTime selectedDateTo = DateTime.now();
|
||||
bool showList = false;
|
||||
|
||||
|
||||
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
}
|
||||
|
||||
void getSubordinatesLeaves()async {
|
||||
try {
|
||||
Utils.showLoading(context);
|
||||
getSubordinatesLeavesTotalList = await MyTeamApiClient().getSubordinatesLeavesList(DateUtil.convertDateToStringLocation(selectedDateFrom), DateUtil.convertDateToStringLocation(selectedDateTo));
|
||||
showList= true;
|
||||
Utils.hideLoading(context);
|
||||
setState(() {});
|
||||
} catch (ex) {
|
||||
Utils.hideLoading(context);
|
||||
Utils.handleException(ex, context, null);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBarWidget(
|
||||
context,
|
||||
title: LocaleKeys.subordinateLeave.tr(),
|
||||
),
|
||||
backgroundColor: MyColors.backgroundColor,
|
||||
body: Column(
|
||||
children: [
|
||||
Expanded(
|
||||
child: SingleChildScrollView(
|
||||
scrollDirection: Axis.vertical,
|
||||
child: Column(
|
||||
children: [
|
||||
Column(
|
||||
children: [
|
||||
DynamicTextFieldWidget(
|
||||
LocaleKeys.dateFrom.tr(),
|
||||
selectedDateFrom.toString().split(" ")[0],
|
||||
suffixIconData: Icons.calendar_today,
|
||||
isEnable: false,
|
||||
onTap: () async {
|
||||
selectedDateFrom = await _selectDate(context, DateTime.now());
|
||||
setState(() {});
|
||||
},
|
||||
),
|
||||
12.height,
|
||||
DynamicTextFieldWidget(
|
||||
LocaleKeys.dateTo.tr(),
|
||||
selectedDateTo.toString().split(" ")[0],
|
||||
suffixIconData: Icons.calendar_today,
|
||||
isEnable: false,
|
||||
onTap: () async {
|
||||
selectedDateTo = await _selectDate(context, DateTime.now());
|
||||
setState(() {});
|
||||
},
|
||||
)
|
||||
],
|
||||
).objectContainerView(),
|
||||
Container(
|
||||
margin: EdgeInsets.only(left: 21, right: 21),
|
||||
width: MediaQuery.of(context).size.width,
|
||||
child: SingleChildScrollView(
|
||||
scrollDirection: Axis.vertical,
|
||||
child: Column(
|
||||
children: [
|
||||
showList? ListView.separated(
|
||||
scrollDirection: Axis.vertical,
|
||||
shrinkWrap: true,
|
||||
physics: ScrollPhysics(),
|
||||
separatorBuilder: (BuildContext cxt,int index) => 12.height,
|
||||
itemCount: getSubordinatesLeavesTotalList.length,
|
||||
itemBuilder: (BuildContext context,int index) {
|
||||
var diffDays = DateUtil.convertStringToDate(getSubordinatesLeavesTotalList[index].dATEEND!).difference(DateUtil.convertStringToDate(getSubordinatesLeavesTotalList[index].dATESTART!)).inDays;
|
||||
return getSubordinatesLeavesTotalList.isEmpty
|
||||
? Utils.getNoDataWidget(context)
|
||||
: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
SvgPicture.asset("assets/images/user.svg"),
|
||||
14.width,
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
"${getSubordinatesLeavesTotalList[index].eMPLOYEENAME}".toText16(isBold: true, color: MyColors.grey3AColor),
|
||||
10.height,
|
||||
Row(
|
||||
children: [
|
||||
(LocaleKeys.from.tr() + ': ${DateUtil.getFormattedDate(DateUtil.convertStringToDate(getSubordinatesLeavesTotalList[index].dATESTART!), "MMM dd yyyy")}').toText10(isBold: true, color: MyColors.grey57Color),
|
||||
14.width,
|
||||
(LocaleKeys.to.tr() + ': ${DateUtil.getFormattedDate(DateUtil.convertStringToDate(getSubordinatesLeavesTotalList[index].dATEEND!), "MMM dd yyyy")}').toText10(isBold: true, color: MyColors.grey57Color),
|
||||
],
|
||||
),
|
||||
(LocaleKeys.numberDays.tr()+ ": $diffDays").toText10(color: MyColors.grey3AColor),
|
||||
],
|
||||
).expanded
|
||||
],
|
||||
).objectContainerView();
|
||||
}
|
||||
)
|
||||
:Container(),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
DefaultButton(
|
||||
LocaleKeys.submit.tr(), () async {
|
||||
getSubordinatesLeaves();
|
||||
}).insideContainer
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Future<DateTime> _selectDate(BuildContext context, DateTime selectedDate) async {
|
||||
DateTime time = selectedDate;
|
||||
if (!Platform.isIOS) {
|
||||
await showCupertinoModalPopup(
|
||||
context: context,
|
||||
builder: (cxt) => Container(
|
||||
height: 250,
|
||||
color: Colors.white,
|
||||
child: CupertinoDatePicker(
|
||||
backgroundColor: Colors.white,
|
||||
mode: CupertinoDatePickerMode.date,
|
||||
onDateTimeChanged: (value) {
|
||||
if (value != null && value != selectedDate) {
|
||||
time = value;
|
||||
}
|
||||
},
|
||||
initialDateTime: selectedDate,
|
||||
),
|
||||
),
|
||||
);
|
||||
} else {
|
||||
DateTime? picked = await showDatePicker(context: context, initialDate: selectedDate, initialEntryMode: DatePickerEntryMode.calendarOnly, firstDate: DateTime(2015, 8), lastDate: DateTime(2101));
|
||||
if (picked != null && picked != selectedDate) {
|
||||
time = picked;
|
||||
}
|
||||
}
|
||||
return time;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,111 @@
|
||||
import 'package:easy_localization/easy_localization.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:mohem_flutter_app/api/my_team/my_team_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';
|
||||
import 'package:mohem_flutter_app/extensions/widget_extensions.dart';
|
||||
import 'package:mohem_flutter_app/generated/locale_keys.g.dart';
|
||||
import 'package:mohem_flutter_app/models/my_team/get_employee_subordinates_list.dart';
|
||||
import 'package:mohem_flutter_app/widgets/app_bar_widget.dart';
|
||||
import 'package:url_launcher/url_launcher.dart';
|
||||
|
||||
class TeamMembers extends StatefulWidget {
|
||||
const TeamMembers({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
_TeamMembersState createState() => _TeamMembersState();
|
||||
}
|
||||
|
||||
class _TeamMembersState extends State<TeamMembers> {
|
||||
String searchEmpEmail ="";
|
||||
String searchEmpName ="";
|
||||
String searchEmpNo = "";
|
||||
String? empId;
|
||||
List<GetEmployeeSubordinatesList> getEmployeeSubordinatesList = [];
|
||||
GetEmployeeSubordinatesList? getEmployeeSubordinates;
|
||||
|
||||
void initState() {
|
||||
super.initState();
|
||||
employeeSubordinates();
|
||||
}
|
||||
|
||||
void employeeSubordinates() async {
|
||||
try {
|
||||
Utils.showLoading(context);
|
||||
getEmployeeSubordinatesList = await MyTeamApiClient().getEmployeeSubordinates(searchEmpEmail.toString(), searchEmpName.toString(), searchEmpNo.toString());
|
||||
getEmployeeSubordinatesList = await MyTeamApiClient().employeeSubordinates(searchEmpEmail.toString(), searchEmpName.toString(), searchEmpNo.toString(),getEmployeeSubordinates?.eMPLOYEENUMBER);
|
||||
Utils.hideLoading(context);
|
||||
setState(() {});
|
||||
} catch (ex) {
|
||||
Utils.hideLoading(context);
|
||||
Utils.handleException(ex, context, null);
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
getEmployeeSubordinates ??= ModalRoute.of(context)?.settings.arguments as GetEmployeeSubordinatesList;
|
||||
return Scaffold(
|
||||
appBar: AppBarWidget(
|
||||
context,
|
||||
title: LocaleKeys.teamMembers.tr(),
|
||||
),
|
||||
backgroundColor: MyColors.backgroundColor,
|
||||
body: SingleChildScrollView(
|
||||
scrollDirection: Axis.vertical,
|
||||
child: Column(
|
||||
children: <Widget>[
|
||||
getEmployeeSubordinatesList.isEmpty
|
||||
? Utils.getNoDataWidget(context):
|
||||
ListView.separated(
|
||||
scrollDirection: Axis.vertical,
|
||||
shrinkWrap: true,
|
||||
padding: EdgeInsets.all(21),
|
||||
physics: ScrollPhysics(),
|
||||
separatorBuilder: (cxt, index) => 12.height,
|
||||
itemCount: getEmployeeSubordinatesList.length,
|
||||
itemBuilder: (BuildContext context, int index) {
|
||||
var phoneNumber = Uri.parse('tel:${getEmployeeSubordinatesList[index].eMPLOYEEMOBILENUMBER}');
|
||||
return Container(
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
CircleAvatar(
|
||||
radius: 25,
|
||||
backgroundImage: MemoryImage(Utils.getPostBytes(getEmployeeSubordinatesList[index].eMPLOYEEIMAGE)),
|
||||
backgroundColor: Colors.black,
|
||||
),
|
||||
SizedBox(width: 10,),
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
// "Present".toText13(color: MyColors.greenColor),
|
||||
"${getEmployeeSubordinatesList[index].eMPLOYEENAME}".toText16(isBold: true, color: MyColors.grey3AColor),
|
||||
"${getEmployeeSubordinatesList[index].pOSITIONNAME}".toText10(isBold: true, color: MyColors.grey57Color),
|
||||
],
|
||||
).expanded,
|
||||
Column(
|
||||
children: [
|
||||
IconButton(
|
||||
onPressed: () {
|
||||
launchUrl(phoneNumber);
|
||||
},
|
||||
icon: Icon(
|
||||
Icons.whatsapp,
|
||||
color: Colors.green,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
).objectContainerView();
|
||||
}),
|
||||
],
|
||||
)
|
||||
));
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,557 @@
|
||||
import 'package:easy_localization/easy_localization.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:mohem_flutter_app/api/my_team/my_team_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/generated/locale_keys.g.dart';
|
||||
import 'package:mohem_flutter_app/models/dashboard/get_attendance_tracking_list_model.dart';
|
||||
import 'package:mohem_flutter_app/models/get_day_hours_type_details_list_model.dart';
|
||||
import 'package:mohem_flutter_app/models/get_time_card_summary_list_model.dart';
|
||||
import 'package:mohem_flutter_app/models/my_team/get_employee_subordinates_list.dart';
|
||||
import 'package:mohem_flutter_app/widgets/app_bar_widget.dart';
|
||||
import 'package:month_picker_dialog/month_picker_dialog.dart';
|
||||
import 'package:pie_chart/pie_chart.dart';
|
||||
import 'package:syncfusion_flutter_calendar/calendar.dart';
|
||||
|
||||
class ViewAttendance extends StatefulWidget {
|
||||
const ViewAttendance({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
_ViewAttendanceState createState() => _ViewAttendanceState();
|
||||
}
|
||||
|
||||
class _ViewAttendanceState extends State<ViewAttendance> {
|
||||
bool isPresent = false;
|
||||
bool isAbsent = false;
|
||||
bool isMissing = false;
|
||||
bool isOff = false;
|
||||
DateTime date = DateTime.now();
|
||||
late DateTime formattedDate;
|
||||
var currentMonth = DateTime.now().month;
|
||||
String searchMonth = getMonth(DateTime.now().month);
|
||||
int searchYear = DateTime.now().year;
|
||||
int? pRTPID;
|
||||
|
||||
String searchEmpEmail ="";
|
||||
String searchEmpName ="";
|
||||
String searchEmpNo = "";
|
||||
String? empId;
|
||||
List<GetEmployeeSubordinatesList> getEmployeeSubordinatesList = [];
|
||||
List<GetDayHoursTypeDetailsList> getDayHoursTypeDetailsList = [];
|
||||
GetTimeCardSummaryList? getTimeCardSummaryList;
|
||||
GetAttendanceTracking? attendanceTracking;
|
||||
GetEmployeeSubordinatesList? getEmployeeSubordinates;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
formattedDate = date;
|
||||
callTimeCardAndHourDetails(date.day, searchMonth, searchYear);
|
||||
}
|
||||
|
||||
|
||||
void callTimeCardAndHourDetails(index, searchMonth, searchYear) async {
|
||||
try {
|
||||
Utils.showLoading(context);
|
||||
getEmployeeSubordinatesList = await MyTeamApiClient().getEmployeeSubordinates(searchEmpEmail.toString(), searchEmpName.toString(), searchEmpNo.toString());
|
||||
getTimeCardSummaryList = await MyTeamApiClient().getTimeCardSummary(searchMonth, searchYear,getEmployeeSubordinates?.eMPLOYEENUMBER);
|
||||
getDayHoursTypeDetailsList = await MyTeamApiClient().getDayHoursTypeDetails(searchMonth, searchYear, getEmployeeSubordinates?.eMPLOYEENUMBER);
|
||||
attendanceTracking = await MyTeamApiClient().getAttendanceTracking(getEmployeeSubordinates?.eMPLOYEENUMBER);
|
||||
Utils.hideLoading(context);
|
||||
_calendarController.displayDate = formattedDate;
|
||||
setState(() {});
|
||||
} catch (ex) {
|
||||
Utils.hideLoading(context);
|
||||
Utils.handleException(ex, context, null);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
final CalendarController _calendarController = CalendarController();
|
||||
final List<Color> _colorList = [Color(0xff2AB2AB), Color(0xff202529)];
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
getEmployeeSubordinates ??= ModalRoute.of(context)?.settings.arguments as GetEmployeeSubordinatesList;
|
||||
Map<String, double> dataMap = {
|
||||
"Present": getTimeCardSummaryList?.aTTENDEDDAYS != null ? getTimeCardSummaryList!.aTTENDEDDAYS!.toDouble() : 0,
|
||||
"Absent": getTimeCardSummaryList?.aBSENTDAYS != null ? getTimeCardSummaryList!.aBSENTDAYS!.toDouble() : 0,
|
||||
};
|
||||
|
||||
return Scaffold(
|
||||
appBar: AppBarWidget(
|
||||
context,
|
||||
title: LocaleKeys.viewAttendance.tr(),
|
||||
),
|
||||
backgroundColor: MyColors.backgroundColor,
|
||||
body: SingleChildScrollView(
|
||||
child: Column(children: [
|
||||
Container(
|
||||
width: double.infinity,
|
||||
margin: EdgeInsets.only(
|
||||
top: 21,
|
||||
left: 21,
|
||||
right: 21,
|
||||
),
|
||||
padding: EdgeInsets.only(left: 14, right: 14, top: 15, bottom: 15),
|
||||
// height: 120,
|
||||
decoration: BoxDecoration(
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: Colors.grey.withOpacity(0.5),
|
||||
spreadRadius: 5,
|
||||
blurRadius: 26,
|
||||
offset: Offset(0, 3),
|
||||
),
|
||||
],
|
||||
color: Colors.white,
|
||||
borderRadius: BorderRadius.circular(10.0),
|
||||
),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
LocaleKeys.todayAttendance.tr().toText16(isBold: true, color: MyColors.darkColor),
|
||||
SizedBox(
|
||||
height: 10,
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Column(
|
||||
children: [
|
||||
LocaleKeys.checkIn.tr().toText10(isBold: true, color: MyColors.green69Color),
|
||||
"${(attendanceTracking?.pSwipeIn)?? "- - : - -"}".toText14(isBold: true, color: MyColors.grey57Color),
|
||||
],
|
||||
),
|
||||
Column(
|
||||
children: [
|
||||
LocaleKeys.checkOut.tr().toText10(isBold: true, color: MyColors.redA3Color),
|
||||
"${(attendanceTracking?.pSwipeOut)?? "- - : - -"}".toText14(isBold: true, color: MyColors.grey57Color),
|
||||
],
|
||||
),
|
||||
Column(
|
||||
children: [
|
||||
LocaleKeys.lateIn.tr().toText10(isBold: true, color: MyColors.darkGreyColor),
|
||||
"${(attendanceTracking?.pLateInHours)?? "- - : - -"}".toText14(isBold: true, color: MyColors.grey57Color),
|
||||
],
|
||||
),
|
||||
],
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
Container(
|
||||
width: double.infinity,
|
||||
margin: EdgeInsets.only(
|
||||
top: 18,
|
||||
left: 18,
|
||||
right: 18,
|
||||
bottom: 28,
|
||||
),
|
||||
padding: EdgeInsets.only(left: 16, right: 16, top: 16, bottom: 16),
|
||||
decoration: BoxDecoration(
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: Colors.grey.withOpacity(0.5),
|
||||
spreadRadius: 5,
|
||||
blurRadius: 26,
|
||||
offset: Offset(0, 3),
|
||||
),
|
||||
],
|
||||
color: Colors.white,
|
||||
borderRadius: BorderRadius.circular(10.0),
|
||||
),
|
||||
child: Column(
|
||||
children: [
|
||||
//20.height,
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
"${DateFormat("MMMM-yyyy").format(formattedDate)}".toText16(color: MyColors.grey3AColor),
|
||||
const Icon(Icons.keyboard_arrow_down_rounded, color: MyColors.grey3AColor),
|
||||
],
|
||||
).onPress(() async {
|
||||
showMonthPicker(
|
||||
context: context, //locale: EasyLocalization.of(context)?.locale,
|
||||
initialDate: formattedDate,
|
||||
firstDate: DateTime(searchYear - 2),
|
||||
lastDate: DateTime.now(),
|
||||
).then((selectedDate) {
|
||||
if (selectedDate != null) {
|
||||
searchMonth = getMonth(selectedDate.month);
|
||||
searchYear = selectedDate.year;
|
||||
formattedDate = selectedDate; //DateFormat('MMMM-yyyy').format(selectedDate);
|
||||
callTimeCardAndHourDetails(selectedDate.day, searchMonth, searchYear);
|
||||
}
|
||||
});
|
||||
})
|
||||
],
|
||||
),
|
||||
18.height,
|
||||
AspectRatio(aspectRatio: 333 / 270, child: calendarWidget()),
|
||||
Row(
|
||||
children: [
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: <Widget>[
|
||||
Column(
|
||||
children: [
|
||||
LocaleKeys.attendance.tr().toText12(isBold: true, color: MyColors.grey3AColor),
|
||||
LocaleKeys.stats.tr().toText24(isBold: true, color: MyColors.grey3AColor),
|
||||
],
|
||||
),
|
||||
30.height,
|
||||
Row(
|
||||
children: [
|
||||
Container(
|
||||
height: 8,
|
||||
width: 8,
|
||||
decoration: BoxDecoration(
|
||||
color: MyColors.lightGreenColor,
|
||||
borderRadius: BorderRadius.circular(100),
|
||||
),
|
||||
),
|
||||
Container(
|
||||
margin: const EdgeInsets.only(left: 5, right: 5),
|
||||
child: "${LocaleKeys.present.tr()} ${getTimeCardSummaryList?.aTTENDEDDAYS != null ? getTimeCardSummaryList?.aTTENDEDDAYS : 0}".toText16(isBold: true, color: MyColors.lightGreenColor),
|
||||
),
|
||||
],
|
||||
),
|
||||
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: "${LocaleKeys.absent.tr()} ${getTimeCardSummaryList?.aBSENTDAYS != null ? getTimeCardSummaryList?.aBSENTDAYS : 0 }".toText16(
|
||||
isBold: true,
|
||||
color: MyColors.backgroundBlackColor,
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
SizedBox(
|
||||
width: 20,
|
||||
),
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: <Widget>[
|
||||
Container(
|
||||
width: 170,
|
||||
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: 21, right: 21, bottom: 21),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
]),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget calendarWidget() {
|
||||
return SfCalendar(
|
||||
view: CalendarView.month,
|
||||
showDatePickerButton: false,
|
||||
controller: _calendarController,
|
||||
backgroundColor: Colors.white,
|
||||
headerHeight: 0,
|
||||
viewNavigationMode: ViewNavigationMode.none,
|
||||
todayHighlightColor: MyColors.grey3AColor,
|
||||
showNavigationArrow: 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()),
|
||||
monthViewSettings: const MonthViewSettings(
|
||||
dayFormat: 'EEE',
|
||||
showTrailingAndLeadingDates: false,
|
||||
showAgenda: false,
|
||||
monthCellStyle: MonthCellStyle(
|
||||
textStyle: TextStyle(
|
||||
fontStyle: FontStyle.normal,
|
||||
fontSize: 13,
|
||||
color: Colors.white,
|
||||
),
|
||||
),
|
||||
),
|
||||
viewHeaderStyle: const ViewHeaderStyle(
|
||||
dayTextStyle: TextStyle(color: MyColors.grey3AColor, fontSize: 13, fontWeight: FontWeight.w600),
|
||||
),
|
||||
monthCellBuilder: (build, details) {
|
||||
if (details.date.month == formattedDate.month && details.date.year == formattedDate.year) {
|
||||
int val = details.date.day;
|
||||
//check day is off
|
||||
if (getDayHoursTypeDetailsList.isNotEmpty) {
|
||||
if (getDayHoursTypeDetailsList?[val - 1].aTTENDEDFLAG == 'N' && getDayHoursTypeDetailsList?[val - 1].dAYTYPE == 'OFF') {
|
||||
return Container(
|
||||
margin: const EdgeInsets.all(4),
|
||||
decoration: BoxDecoration(
|
||||
color: MyColors.greyACColor.withOpacity(.12),
|
||||
shape: BoxShape.circle,
|
||||
),
|
||||
alignment: Alignment.center,
|
||||
child: Text(
|
||||
"$val",
|
||||
style: const TextStyle(
|
||||
fontSize: 13,
|
||||
fontWeight: FontWeight.w500,
|
||||
color: MyColors.greyA5Color,
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
//check day is Present
|
||||
else if (getDayHoursTypeDetailsList?[val - 1].aTTENDEDFLAG == 'Y') {
|
||||
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(
|
||||
"$val",
|
||||
style: const TextStyle(
|
||||
fontSize: 13,
|
||||
fontWeight: FontWeight.w500,
|
||||
color: MyColors.white,
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
//check day is Absent
|
||||
else if (getDayHoursTypeDetailsList?[val - 1].aTTENDEDFLAG == 'N' && getDayHoursTypeDetailsList?[val - 1].aBSENTFLAG == 'Y') {
|
||||
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(
|
||||
"$val",
|
||||
style: const TextStyle(
|
||||
fontSize: 13,
|
||||
fontWeight: FontWeight.w500,
|
||||
color: MyColors.white,
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
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(
|
||||
"$val",
|
||||
style: const TextStyle(
|
||||
fontSize: 13,
|
||||
fontWeight: FontWeight.w500,
|
||||
color: Color(0xff1F2428),
|
||||
),
|
||||
),
|
||||
);
|
||||
} else {
|
||||
return const SizedBox();
|
||||
}
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
List<Meeting> _getDataSource() {
|
||||
List<Meeting> meetings = <Meeting>[];
|
||||
return meetings;
|
||||
}
|
||||
|
||||
static String 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";
|
||||
default:
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
static String getMonthAr(int month) {
|
||||
switch (month) {
|
||||
case 1:
|
||||
return 'يناير';
|
||||
case 2:
|
||||
return ' فبراير';
|
||||
case 3:
|
||||
return 'مارس';
|
||||
case 4:
|
||||
return 'أبريل';
|
||||
case 5:
|
||||
return 'مايو';
|
||||
case 6:
|
||||
return 'يونيو';
|
||||
case 7:
|
||||
return 'يوليو';
|
||||
case 8:
|
||||
return 'أغسطس';
|
||||
case 9:
|
||||
return 'سبتمبر';
|
||||
case 10:
|
||||
return ' اكتوبر';
|
||||
case 11:
|
||||
return ' نوفمبر';
|
||||
case 12:
|
||||
return 'ديسمبر';
|
||||
default:
|
||||
return "";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class MeetingDataSource extends CalendarDataSource {
|
||||
MeetingDataSource(List<Meeting> 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) {
|
||||
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;
|
||||
}
|
||||
@ -0,0 +1,178 @@
|
||||
|
||||
import 'package:easy_localization/src/public_ext.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:mohem_flutter_app/api/worklist/worklist_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/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/models/get_user_item_type_list.dart';
|
||||
import 'package:mohem_flutter_app/models/update_user_item_type_list.dart';
|
||||
import 'package:mohem_flutter_app/models/worklist/update_user_type_list.dart';
|
||||
import 'package:mohem_flutter_app/widgets/app_bar_widget.dart';
|
||||
import 'package:mohem_flutter_app/widgets/button/default_button.dart';
|
||||
|
||||
class WorklistSettings extends StatefulWidget {
|
||||
const WorklistSettings({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
_WorklistSettingsState createState() => _WorklistSettingsState();
|
||||
}
|
||||
|
||||
class _WorklistSettingsState extends State<WorklistSettings> {
|
||||
List<GetUserItemTypesList> getUserItemTypesList = [];
|
||||
UpdateUserItemTypesList? updateUserItemTypesList;
|
||||
|
||||
|
||||
void initState() {
|
||||
super.initState();
|
||||
userItemTypesList();
|
||||
}
|
||||
|
||||
void userItemTypesList() async {
|
||||
try {
|
||||
Utils.showLoading(context);
|
||||
getUserItemTypesList = await WorkListApiClient().getUserItemTypes();
|
||||
Utils.hideLoading(context);
|
||||
setState(() {});
|
||||
} catch (ex) {
|
||||
Utils.hideLoading(context);
|
||||
Utils.handleException(ex, context, null);
|
||||
}
|
||||
}
|
||||
|
||||
void updateUserItem() async {
|
||||
try {
|
||||
Utils.showLoading(context);
|
||||
List<Map<String, dynamic>> itemList=[];
|
||||
for (var element in getUserItemTypesList) {
|
||||
itemList.add(UpdateUserTypesList(itemID: element.uSERITEMTYPEID, pITEMTYPE: element.iTEMTYPE,pFYAENABLEDFALG: element.fYAENABLEDFALG, pFYIENABLEDFALG: element.fYIENABLEDFLAG).toJson());
|
||||
|
||||
}
|
||||
updateUserItemTypesList = await WorkListApiClient().updateUserItemTypes(itemList);
|
||||
Utils.hideLoading(context);
|
||||
Navigator.pushNamed(context, AppRoutes.workList);
|
||||
setState(() {});
|
||||
} catch (ex) {
|
||||
Utils.hideLoading(context);
|
||||
Utils.handleException(ex, context, null);
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(backgroundColor: Colors.white,
|
||||
appBar: AppBarWidget(
|
||||
context,
|
||||
title: LocaleKeys.worklistSettings.tr(),
|
||||
),
|
||||
body:Column(
|
||||
children: [
|
||||
Expanded(
|
||||
child: Container(
|
||||
margin: const EdgeInsets.only(top: 21, left: 21, right: 21),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Container(
|
||||
child: LocaleKeys.TurnNotificationsFor.tr().toText22(color: MyColors.blackColor),
|
||||
).paddingOnly(top: 10, bottom: 50),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Container(
|
||||
child: LocaleKeys.itemType.tr().toText14(color: MyColors.blackColor) ,
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||
children: [
|
||||
Container(
|
||||
child: "FYA".tr().toText14(color: MyColors.blackColor) ,
|
||||
),
|
||||
Container(
|
||||
child: "FYI".tr().toText14(color: MyColors.blackColor) ,
|
||||
).paddingOnly(left: 30, right: 30),
|
||||
],
|
||||
)
|
||||
],
|
||||
),
|
||||
Divider(color: MyColors.greyA5Color,),
|
||||
SingleChildScrollView(
|
||||
scrollDirection: Axis.vertical,
|
||||
child: ListView.builder(
|
||||
scrollDirection: Axis.vertical,
|
||||
shrinkWrap: true,
|
||||
physics: ScrollPhysics(),
|
||||
itemCount: getUserItemTypesList == null ? 0 : getUserItemTypesList.length,
|
||||
itemBuilder: (BuildContext context,int index) {
|
||||
return Column(
|
||||
children:[
|
||||
customSwitch(getUserItemTypesList[index]),
|
||||
Divider(
|
||||
color: MyColors.greyC4Color,
|
||||
thickness: 0.5,),
|
||||
]);
|
||||
}
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
DefaultButton(
|
||||
LocaleKeys.save.tr(), () async {
|
||||
updateUserItem();
|
||||
}).insideContainer,
|
||||
],
|
||||
)
|
||||
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Widget customSwitch(GetUserItemTypesList list){
|
||||
return Padding(
|
||||
padding: const EdgeInsets.only(top: 21),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(list.iTEMTYPE.toString(), style: TextStyle(
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.w600,
|
||||
color: MyColors.blackColor
|
||||
),),
|
||||
const Spacer(),
|
||||
Row(
|
||||
children: [
|
||||
CupertinoSwitch(
|
||||
trackColor: Colors.grey,
|
||||
activeColor: MyColors.gradiantEndColor,
|
||||
value: list?.fYAENABLEDFALG =='Y' ?true : false,
|
||||
onChanged: (value){
|
||||
setState(() {
|
||||
list?.fYAENABLEDFALG = value == true ? 'Y': 'N';
|
||||
});
|
||||
}
|
||||
),
|
||||
CupertinoSwitch(
|
||||
trackColor: Colors.grey,
|
||||
activeColor: MyColors.gradiantEndColor,
|
||||
value: list?.fYIENABLEDFLAG =='Y' ?true : false,
|
||||
onChanged: (value){
|
||||
setState(() {
|
||||
// list.isFYI = value;
|
||||
list?.fYIENABLEDFLAG = value ==true ? 'Y': 'N';
|
||||
});
|
||||
}
|
||||
),
|
||||
],
|
||||
)
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
Reference in New Issue