|
|
|
@ -17,13 +17,11 @@ class LeaveBalanceApiClient {
|
|
|
|
|
|
|
|
|
|
|
|
factory LeaveBalanceApiClient() => _instance;
|
|
|
|
factory LeaveBalanceApiClient() => _instance;
|
|
|
|
|
|
|
|
|
|
|
|
Future<List<GetAbsenceTransactionList>> getAbsenceTransactions(int pSelectedResopID, {String? empID}) async {
|
|
|
|
Future<List<GetAbsenceTransactionList>> getAbsenceTransactions(int pSelectedResopID, String? empID) async {
|
|
|
|
String url = "${ApiConsts.erpRest}GET_ABSENCE_TRANSACTIONS";
|
|
|
|
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};
|
|
|
|
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);
|
|
|
|
postParams.addAll(AppState().postParamsJson);
|
|
|
|
if (empID!.isNotEmpty) {
|
|
|
|
if (empID != null) postParams["P_SELECTED_EMPLOYEE_NUMBER"] = empID;
|
|
|
|
postParams['P_SELECTED_EMPLOYEE_NUMBER'] = empID;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return await ApiClient().postJsonForObject((json) {
|
|
|
|
return await ApiClient().postJsonForObject((json) {
|
|
|
|
GenericResponseModel? responseData = GenericResponseModel.fromJson(json);
|
|
|
|
GenericResponseModel? responseData = GenericResponseModel.fromJson(json);
|
|
|
|
return responseData.getAbsenceTransactionList ?? [];
|
|
|
|
return responseData.getAbsenceTransactionList ?? [];
|
|
|
|
@ -34,16 +32,15 @@ class LeaveBalanceApiClient {
|
|
|
|
String url = "${ApiConsts.erpRest}GET_ABSENCE_ATTENDANCE_TYPES";
|
|
|
|
String url = "${ApiConsts.erpRest}GET_ABSENCE_ATTENDANCE_TYPES";
|
|
|
|
Map<String, dynamic> postParams = {};
|
|
|
|
Map<String, dynamic> postParams = {};
|
|
|
|
postParams.addAll(AppState().postParamsJson);
|
|
|
|
postParams.addAll(AppState().postParamsJson);
|
|
|
|
if (empID!.isNotEmpty) {
|
|
|
|
if (empID != null) postParams["P_SELECTED_EMPLOYEE_NUMBER"] = empID;
|
|
|
|
postParams['P_SELECTED_EMPLOYEE_NUMBER'] = empID;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return await ApiClient().postJsonForObject((json) {
|
|
|
|
return await ApiClient().postJsonForObject((json) {
|
|
|
|
GenericResponseModel? responseData = GenericResponseModel.fromJson(json);
|
|
|
|
GenericResponseModel? responseData = GenericResponseModel.fromJson(json);
|
|
|
|
return responseData.getAbsenceAttendanceTypesList ?? [];
|
|
|
|
return responseData.getAbsenceAttendanceTypesList ?? [];
|
|
|
|
}, url, postParams);
|
|
|
|
}, url, postParams);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
Future<CalculateAbsenceDuration> calculateAbsenceDuration(int pAbsenceAttendanceTypeID, String pDateStart, String pDateEnd, int pSelectedResopID, {String? empID}) async {
|
|
|
|
Future<CalculateAbsenceDuration> calculateAbsenceDuration(int pAbsenceAttendanceTypeID, String pDateStart, String pDateEnd, int pSelectedResopID, {String? empID}) async {
|
|
|
|
String url = "${ApiConsts.erpRest}CALCULATE_ABSENCE_DURATION";
|
|
|
|
String url = "${ApiConsts.erpRest}CALCULATE_ABSENCE_DURATION";
|
|
|
|
Map<String, dynamic> postParams = {
|
|
|
|
Map<String, dynamic> postParams = {
|
|
|
|
"P_ABSENCE_ATTENDANCE_TYPE_ID": pAbsenceAttendanceTypeID,
|
|
|
|
"P_ABSENCE_ATTENDANCE_TYPE_ID": pAbsenceAttendanceTypeID,
|
|
|
|
@ -52,25 +49,26 @@ class LeaveBalanceApiClient {
|
|
|
|
"P_SELECTED_RESP_ID": pSelectedResopID,
|
|
|
|
"P_SELECTED_RESP_ID": pSelectedResopID,
|
|
|
|
"P_MENU_TYPE": "E",
|
|
|
|
"P_MENU_TYPE": "E",
|
|
|
|
"P_TIME_END": null,
|
|
|
|
"P_TIME_END": null,
|
|
|
|
"P_TIME_START": null,
|
|
|
|
"P_TIME_START": null
|
|
|
|
};
|
|
|
|
};
|
|
|
|
postParams.addAll(AppState().postParamsJson);
|
|
|
|
postParams.addAll(AppState().postParamsJson);
|
|
|
|
if (empID!.isNotEmpty) {
|
|
|
|
if (empID != null) postParams["P_SELECTED_EMPLOYEE_NUMBER"] = empID;
|
|
|
|
postParams['P_SELECTED_EMPLOYEE_NUMBER'] = empID;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return await ApiClient().postJsonForObject((json) {
|
|
|
|
return await ApiClient().postJsonForObject((json) {
|
|
|
|
GenericResponseModel? responseData = GenericResponseModel.fromJson(json);
|
|
|
|
GenericResponseModel? responseData = GenericResponseModel.fromJson(json);
|
|
|
|
return responseData.calculateAbsenceDuration!;
|
|
|
|
return responseData.calculateAbsenceDuration!;
|
|
|
|
}, url, postParams);
|
|
|
|
}, url, postParams);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
Future<List<GetAbsenceDffStructureList>> getAbsenceDffStructure(String pDescFlexContextCode, String pFunctionName, int pSelectedResopID, {String? empID}) async {
|
|
|
|
Future<List<GetAbsenceDffStructureList>> getAbsenceDffStructure(String pDescFlexContextCode, String pFunctionName, int pSelectedResopID, {String? empID}) async {
|
|
|
|
String url = "${ApiConsts.erpRest}GET_ABSENCE_DFF_STRUCTURE";
|
|
|
|
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};
|
|
|
|
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);
|
|
|
|
postParams.addAll(AppState().postParamsJson);
|
|
|
|
if (empID!.isNotEmpty) {
|
|
|
|
if (empID != null) postParams["P_SELECTED_EMPLOYEE_NUMBER"] = empID;
|
|
|
|
postParams['P_SELECTED_EMPLOYEE_NUMBER'] = empID;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return await ApiClient().postJsonForObject((json) {
|
|
|
|
return await ApiClient().postJsonForObject((json) {
|
|
|
|
GenericResponseModel? responseData = GenericResponseModel.fromJson(json);
|
|
|
|
GenericResponseModel? responseData = GenericResponseModel.fromJson(json);
|
|
|
|
return responseData.getAbsenceDffStructureList ?? [];
|
|
|
|
return responseData.getAbsenceDffStructureList ?? [];
|
|
|
|
@ -79,7 +77,7 @@ class LeaveBalanceApiClient {
|
|
|
|
|
|
|
|
|
|
|
|
Future<GenericResponseModel> validateAbsenceTransaction(
|
|
|
|
Future<GenericResponseModel> validateAbsenceTransaction(
|
|
|
|
String pDescFlexContextCode, String pFunctionName, int pAbsenceAttendanceTypeID, String pReplacementUserName, String pDateStart, String pDateEnd, int pSelectedResopID, Map<String, String?> data,
|
|
|
|
String pDescFlexContextCode, String pFunctionName, int pAbsenceAttendanceTypeID, String pReplacementUserName, String pDateStart, String pDateEnd, int pSelectedResopID, Map<String, String?> data,
|
|
|
|
{String comments = "", String? empID}) async {
|
|
|
|
{String comments = "", String? empID}) async {
|
|
|
|
String url = "${ApiConsts.erpRest}VALIDATE_ABSENCE_TRANSACTION";
|
|
|
|
String url = "${ApiConsts.erpRest}VALIDATE_ABSENCE_TRANSACTION";
|
|
|
|
Map<String, dynamic> postParams = {
|
|
|
|
Map<String, dynamic> postParams = {
|
|
|
|
"P_DESC_FLEX_CONTEXT_CODE": pDescFlexContextCode,
|
|
|
|
"P_DESC_FLEX_CONTEXT_CODE": pDescFlexContextCode,
|
|
|
|
@ -94,13 +92,11 @@ class LeaveBalanceApiClient {
|
|
|
|
"P_SELECTED_RESP_ID": pSelectedResopID,
|
|
|
|
"P_SELECTED_RESP_ID": pSelectedResopID,
|
|
|
|
"P_MENU_TYPE": "E",
|
|
|
|
"P_MENU_TYPE": "E",
|
|
|
|
"P_TIME_END": null,
|
|
|
|
"P_TIME_END": null,
|
|
|
|
"P_TIME_START": null,
|
|
|
|
"P_TIME_START": null
|
|
|
|
};
|
|
|
|
};
|
|
|
|
postParams.addAll(data);
|
|
|
|
postParams.addAll(data);
|
|
|
|
postParams.addAll(AppState().postParamsJson);
|
|
|
|
postParams.addAll(AppState().postParamsJson);
|
|
|
|
if (empID!.isNotEmpty) {
|
|
|
|
if (empID != null) postParams["P_SELECTED_EMPLOYEE_NUMBER"] = empID;
|
|
|
|
postParams['P_SELECTED_EMPLOYEE_NUMBER'] = empID;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return await ApiClient().postJsonForObject((json) {
|
|
|
|
return await ApiClient().postJsonForObject((json) {
|
|
|
|
GenericResponseModel? responseData = GenericResponseModel.fromJson(json);
|
|
|
|
GenericResponseModel? responseData = GenericResponseModel.fromJson(json);
|
|
|
|
return responseData;
|
|
|
|
return responseData;
|
|
|
|
@ -109,7 +105,7 @@ class LeaveBalanceApiClient {
|
|
|
|
|
|
|
|
|
|
|
|
Future<SumbitAbsenceTransactionList> submitAbsenceTransaction(
|
|
|
|
Future<SumbitAbsenceTransactionList> submitAbsenceTransaction(
|
|
|
|
String pDescFlexContextCode, String pFunctionName, int pAbsenceAttendanceTypeID, String pReplacementUserName, String pDateStart, String pDateEnd, int pSelectedResopID, Map<String, String?> data,
|
|
|
|
String pDescFlexContextCode, String pFunctionName, int pAbsenceAttendanceTypeID, String pReplacementUserName, String pDateStart, String pDateEnd, int pSelectedResopID, Map<String, String?> data,
|
|
|
|
{String comments = "", String? empID}) async {
|
|
|
|
{String comments = "", String? empID}) async {
|
|
|
|
String url = "${ApiConsts.erpRest}SUBMIT_ABSENCE_TRANSACTION";
|
|
|
|
String url = "${ApiConsts.erpRest}SUBMIT_ABSENCE_TRANSACTION";
|
|
|
|
Map<String, dynamic> postParams = {
|
|
|
|
Map<String, dynamic> postParams = {
|
|
|
|
"P_DESC_FLEX_CONTEXT_CODE": pDescFlexContextCode,
|
|
|
|
"P_DESC_FLEX_CONTEXT_CODE": pDescFlexContextCode,
|
|
|
|
@ -124,13 +120,11 @@ class LeaveBalanceApiClient {
|
|
|
|
"P_SELECTED_RESP_ID": pSelectedResopID,
|
|
|
|
"P_SELECTED_RESP_ID": pSelectedResopID,
|
|
|
|
"P_MENU_TYPE": "E",
|
|
|
|
"P_MENU_TYPE": "E",
|
|
|
|
"P_TIME_END": null,
|
|
|
|
"P_TIME_END": null,
|
|
|
|
"P_TIME_START": null,
|
|
|
|
"P_TIME_START": null
|
|
|
|
};
|
|
|
|
};
|
|
|
|
postParams.addAll(data);
|
|
|
|
postParams.addAll(data);
|
|
|
|
postParams.addAll(AppState().postParamsJson);
|
|
|
|
postParams.addAll(AppState().postParamsJson);
|
|
|
|
if (empID!.isNotEmpty) {
|
|
|
|
if (empID != null) postParams["P_SELECTED_EMPLOYEE_NUMBER"] = empID;
|
|
|
|
postParams['P_SELECTED_EMPLOYEE_NUMBER'] = empID;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return await ApiClient().postJsonForObject((json) {
|
|
|
|
return await ApiClient().postJsonForObject((json) {
|
|
|
|
GenericResponseModel? responseData = GenericResponseModel.fromJson(json);
|
|
|
|
GenericResponseModel? responseData = GenericResponseModel.fromJson(json);
|
|
|
|
return responseData.sumbitAbsenceTransactionList!;
|
|
|
|
return responseData.sumbitAbsenceTransactionList!;
|
|
|
|
@ -147,18 +141,11 @@ class LeaveBalanceApiClient {
|
|
|
|
}, url, postParams);
|
|
|
|
}, url, postParams);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
Future<StartAbsenceApprovalProccess> startAbsenceApprovalProcess(int pTransactionID, String comments, int pSelectedResopID,{String? empID}) async {
|
|
|
|
Future<StartAbsenceApprovalProccess> startAbsenceApprovalProcess(int pTransactionID, String comments, int pSelectedResopID, {String? empID}) async {
|
|
|
|
String url = "${ApiConsts.erpRest}START_ABSENCE_APPROVAL_PROCESS";
|
|
|
|
String url = "${ApiConsts.erpRest}START_ABSENCE_APPROVAL_PROCESS";
|
|
|
|
Map<String, dynamic> postParams = {
|
|
|
|
Map<String, dynamic> postParams = {"P_TRANSACTION_ID": pTransactionID, "P_SELECTED_RESP_ID": pSelectedResopID, "P_COMMENTS": comments, "P_MENU_TYPE": "E", 'P_SELECTED_EMPLOYEE_NUMBER': empID};
|
|
|
|
"P_TRANSACTION_ID": pTransactionID,
|
|
|
|
|
|
|
|
"P_SELECTED_RESP_ID": pSelectedResopID,
|
|
|
|
|
|
|
|
"P_COMMENTS": comments,
|
|
|
|
|
|
|
|
"P_MENU_TYPE": "E",
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
postParams.addAll(AppState().postParamsJson);
|
|
|
|
postParams.addAll(AppState().postParamsJson);
|
|
|
|
if (empID!.isNotEmpty) {
|
|
|
|
|
|
|
|
postParams['P_SELECTED_EMPLOYEE_NUMBER'] = empID;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return await ApiClient().postJsonForObject((json) {
|
|
|
|
return await ApiClient().postJsonForObject((json) {
|
|
|
|
GenericResponseModel? responseData = GenericResponseModel.fromJson(json);
|
|
|
|
GenericResponseModel? responseData = GenericResponseModel.fromJson(json);
|
|
|
|
return responseData.startAbsenceApprovalProccess!;
|
|
|
|
return responseData.startAbsenceApprovalProccess!;
|
|
|
|
|