Merge branch 'master' into development_haroon

merge-requests/97/head
haroon amjad 3 years ago
commit af2cbd8c50

@ -424,6 +424,9 @@
"typeCurrentPasswordBelow": "اكتب كلمة المرور الحاليه",
"currentPassword": "كلمة المرور الحاليه",
"concurrentReports": "التقارير المتزامنه",
"EnterNewAddressMoved" : "أدخل عنوان جديد إذا كنت قد انتقلت",
"CorrectAddress": "تصحيح أو تعديل هذا العنوان",
"SelectChangeWantToMake": " حدد نوع التغيير الذي تريد القيام به.",
"profile": {
"reset_password": {
"label": "Reset Password",

@ -424,6 +424,9 @@
"typeCurrentPasswordBelow": "Type Your Current password below",
"currentPassword": "Current password",
"concurrentReports": "Concurrent Reports",
"EnterNewAddressMoved" : "Enter a new address if you have moved",
"CorrectAddress": "Correct or amend this address",
"SelectChangeWantToMake": "Select the type of change you want to make",
"profile": {
"reset_password": {
"label": "Reset Password",

@ -65,10 +65,13 @@ class DashboardApiClient {
}, url, postParams);
}
Future<List<GetAccrualBalancesList>> getAccrualBalances(String effectiveDate) async {
Future<List<GetAccrualBalancesList>> getAccrualBalances(String effectiveDate, {String? empID}) async {
String url = "${ApiConsts.erpRest}GET_ACCRUAL_BALANCES";
Map<String, dynamic> postParams = {"P_EFFECTIVE_DATE": effectiveDate};
postParams.addAll(AppState().postParamsJson);
if (empID!.isNotEmpty) {
postParams['P_SELECTED_EMPLOYEE_NUMBER'] = empID;
}
return await ApiClient().postJsonForObject((json) {
GenericResponseModel responseData = GenericResponseModel.fromJson(json);
return responseData.getAccrualBalancesList ?? [];

@ -17,27 +17,33 @@ class LeaveBalanceApiClient {
factory LeaveBalanceApiClient() => _instance;
Future<List<GetAbsenceTransactionList>> getAbsenceTransactions(int pSelectedResopID) async {
Future<List<GetAbsenceTransactionList>> getAbsenceTransactions(int pSelectedResopID, {String? empID}) 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);
if (empID!.isNotEmpty) {
postParams['P_SELECTED_EMPLOYEE_NUMBER'] = empID;
}
return await ApiClient().postJsonForObject((json) {
GenericResponseModel? responseData = GenericResponseModel.fromJson(json);
return responseData.getAbsenceTransactionList ?? [];
}, url, postParams);
}
Future<List<GetAbsenceAttendanceTypesList>> getAbsenceAttendanceTypes() async {
Future<List<GetAbsenceAttendanceTypesList>> getAbsenceAttendanceTypes({String? empID}) async {
String url = "${ApiConsts.erpRest}GET_ABSENCE_ATTENDANCE_TYPES";
Map<String, dynamic> postParams = {};
postParams.addAll(AppState().postParamsJson);
if (empID!.isNotEmpty) {
postParams['P_SELECTED_EMPLOYEE_NUMBER'] = empID;
}
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 {
Future<CalculateAbsenceDuration> calculateAbsenceDuration(int pAbsenceAttendanceTypeID, String pDateStart, String pDateEnd, int pSelectedResopID, {String? empID}) async {
String url = "${ApiConsts.erpRest}CALCULATE_ABSENCE_DURATION";
Map<String, dynamic> postParams = {
"P_ABSENCE_ATTENDANCE_TYPE_ID": pAbsenceAttendanceTypeID,
@ -49,16 +55,22 @@ class LeaveBalanceApiClient {
"P_TIME_START": null,
};
postParams.addAll(AppState().postParamsJson);
if (empID!.isNotEmpty) {
postParams['P_SELECTED_EMPLOYEE_NUMBER'] = empID;
}
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 {
Future<List<GetAbsenceDffStructureList>> getAbsenceDffStructure(String pDescFlexContextCode, String pFunctionName, int pSelectedResopID, {String? empID}) 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);
if (empID!.isNotEmpty) {
postParams['P_SELECTED_EMPLOYEE_NUMBER'] = empID;
}
return await ApiClient().postJsonForObject((json) {
GenericResponseModel? responseData = GenericResponseModel.fromJson(json);
return responseData.getAbsenceDffStructureList ?? [];
@ -67,7 +79,7 @@ class LeaveBalanceApiClient {
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 comments = "", String? empID}) async {
String url = "${ApiConsts.erpRest}VALIDATE_ABSENCE_TRANSACTION";
Map<String, dynamic> postParams = {
"P_DESC_FLEX_CONTEXT_CODE": pDescFlexContextCode,
@ -86,6 +98,9 @@ class LeaveBalanceApiClient {
};
postParams.addAll(data);
postParams.addAll(AppState().postParamsJson);
if (empID!.isNotEmpty) {
postParams['P_SELECTED_EMPLOYEE_NUMBER'] = empID;
}
return await ApiClient().postJsonForObject((json) {
GenericResponseModel? responseData = GenericResponseModel.fromJson(json);
return responseData;
@ -94,7 +109,7 @@ class LeaveBalanceApiClient {
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 comments = "", String? empID}) async {
String url = "${ApiConsts.erpRest}SUBMIT_ABSENCE_TRANSACTION";
Map<String, dynamic> postParams = {
"P_DESC_FLEX_CONTEXT_CODE": pDescFlexContextCode,
@ -113,6 +128,9 @@ class LeaveBalanceApiClient {
};
postParams.addAll(data);
postParams.addAll(AppState().postParamsJson);
if (empID!.isNotEmpty) {
postParams['P_SELECTED_EMPLOYEE_NUMBER'] = empID;
}
return await ApiClient().postJsonForObject((json) {
GenericResponseModel? responseData = GenericResponseModel.fromJson(json);
return responseData.sumbitAbsenceTransactionList!;
@ -129,7 +147,7 @@ class LeaveBalanceApiClient {
}, url, postParams);
}
Future<StartAbsenceApprovalProccess> startAbsenceApprovalProcess(int pTransactionID, String comments, int pSelectedResopID) async {
Future<StartAbsenceApprovalProccess> startAbsenceApprovalProcess(int pTransactionID, String comments, int pSelectedResopID,{String? empID}) async {
String url = "${ApiConsts.erpRest}START_ABSENCE_APPROVAL_PROCESS";
Map<String, dynamic> postParams = {
"P_TRANSACTION_ID": pTransactionID,
@ -138,6 +156,9 @@ class LeaveBalanceApiClient {
"P_MENU_TYPE": "E",
};
postParams.addAll(AppState().postParamsJson);
if (empID!.isNotEmpty) {
postParams['P_SELECTED_EMPLOYEE_NUMBER'] = empID;
}
return await ApiClient().postJsonForObject((json) {
GenericResponseModel? responseData = GenericResponseModel.fromJson(json);
return responseData.startAbsenceApprovalProccess!;

@ -440,6 +440,9 @@ class CodegenLoader extends AssetLoader{
"typeCurrentPasswordBelow": "اكتب كلمة المرور الحاليه",
"currentPassword": "كلمة المرور الحاليه",
"concurrentReports": "التقارير المتزامنه",
"EnterNewAddressMoved": "أدخل عنوان جديد إذا كنت قد انتقلت",
"CorrectAddress": "تصحيح أو تعديل هذا العنوان",
"SelectChangeWantToMake": " حدد نوع التغيير الذي تريد القيام به.",
"profile": {
"reset_password": {
"label": "Reset Password",
@ -516,7 +519,10 @@ class CodegenLoader extends AssetLoader{
"codeExpire": "انتهت صلاحية رمز التحقق",
"typeheretoreply": "اكتب هنا للرد",
"favorite": "مفضلتي",
"searchfromchat": "البحث من الدردشة"
"searchfromchat": "البحث من الدردشة",
"yourAnswerCorrect": "إجابتك صحيحة",
"youMissedTheQuestion": "فاتك !! أنت خارج اللعبة. لكن يمكنك المتابعة.",
"wrongAnswer": "إجابة خاطئة! أنت خارج اللعبة. لكن يمكنك المتابعة."
};
static const Map<String,dynamic> en_US = {
"mohemm": "Mohemm",
@ -944,6 +950,9 @@ static const Map<String,dynamic> en_US = {
"typeCurrentPasswordBelow": "Type Your Current password below",
"currentPassword": "Current password",
"concurrentReports": "Concurrent Reports",
"EnterNewAddressMoved": "Enter a new address if you have moved",
"CorrectAddress": "Correct or amend this address",
"SelectChangeWantToMake": "Select the type of change you want to make",
"profile": {
"reset_password": {
"label": "Reset Password",
@ -1020,7 +1029,10 @@ static const Map<String,dynamic> en_US = {
"allQuestionsCorrect": "You have answered all questions correct",
"typeheretoreply": "Type here to reply",
"favorite": "My Favorites",
"searchfromchat": "Search from chat"
"searchfromchat": "Search from chat",
"yourAnswerCorrect": "Your answer is correct",
"youMissedTheQuestion": "You Missed !! You are out of the game. But you can follow up.",
"wrongAnswer": "Wrong Answer! You are out of the game. But you can follow up."
};
static const Map<String, Map<String,dynamic>> mapLocales = {"ar_SA": ar_SA, "en_US": en_US};
}

@ -425,6 +425,9 @@ abstract class LocaleKeys {
static const typeCurrentPasswordBelow = 'typeCurrentPasswordBelow';
static const currentPassword = 'currentPassword';
static const concurrentReports = 'concurrentReports';
static const EnterNewAddressMoved = 'EnterNewAddressMoved';
static const CorrectAddress = 'CorrectAddress';
static const SelectChangeWantToMake = 'SelectChangeWantToMake';
static const profile_reset_password_label = 'profile.reset_password.label';
static const profile_reset_password_username = 'profile.reset_password.username';
static const profile_reset_password_password = 'profile.reset_password.password';

@ -4,6 +4,7 @@ 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/app_state/app_state.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';
@ -24,7 +25,8 @@ 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);
final String selectedEmp;
AddLeaveBalanceScreen({this.selectedEmp = '', Key? key}) : super(key: key);
@override
_AddLeaveBalanceScreenState createState() {
@ -42,19 +44,21 @@ class _AddLeaveBalanceScreenState extends State<AddLeaveBalanceScreen> {
int? totalDays;
String comment = "";
ReplacementList? selectedReplacementEmployee;
dynamic dynamicParams;
String selectedEmp = "";
DateTime selectedDate = DateTime(DateTime.now().year, DateTime.now().month, DateTime.now().day);
@override
void initState() {
super.initState();
getAbsenceAttendanceTypes();
//getAbsenceAttendanceTypes();
}
void getAbsenceAttendanceTypes() async {
try {
Utils.showLoading(context);
absenceList = await LeaveBalanceApiClient().getAbsenceAttendanceTypes();
absenceList = await LeaveBalanceApiClient().getAbsenceAttendanceTypes(empID: selectedEmp);
Utils.hideLoading(context);
setState(() {});
} catch (ex) {
@ -67,7 +71,7 @@ class _AddLeaveBalanceScreenState extends State<AddLeaveBalanceScreen> {
try {
Utils.showLoading(context);
getabsenceDffStructureList.clear();
getabsenceDffStructureList = await LeaveBalanceApiClient().getAbsenceDffStructure(selectedAbsenceType!.dESCFLEXCONTEXTCODE!, "HR_LOA_SS", -999);
getabsenceDffStructureList = await LeaveBalanceApiClient().getAbsenceDffStructure(selectedAbsenceType!.dESCFLEXCONTEXTCODE!, "HR_LOA_SS", -999, empID: selectedEmp);
Utils.hideLoading(context);
setState(() {});
} catch (ex) {
@ -80,7 +84,7 @@ class _AddLeaveBalanceScreenState extends State<AddLeaveBalanceScreen> {
try {
Utils.showLoading(context);
CalculateAbsenceDuration duration = await LeaveBalanceApiClient()
.calculateAbsenceDuration(selectedAbsenceType!.aBSENCEATTENDANCETYPEID!, Utils.getMonthNamedFormat(startDateTime!), Utils.getMonthNamedFormat(endDateTime!), -999);
.calculateAbsenceDuration(selectedAbsenceType!.aBSENCEATTENDANCETYPEID!, Utils.getMonthNamedFormat(startDateTime!), Utils.getMonthNamedFormat(endDateTime!), -999, empID: selectedEmp);
totalDays = duration.pABSENCEDAYS?.toInt();
Utils.hideLoading(context);
@ -91,58 +95,60 @@ class _AddLeaveBalanceScreenState extends State<AddLeaveBalanceScreen> {
}
}
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"] =
getabsenceDffStructureList[dffIndex].eSERVICESDV!.pIDCOLUMNNAME != null ? Utils.formatDate(getabsenceDffStructureList[dffIndex].eSERVICESDV!.pIDCOLUMNNAME!) : "";
} else {
dffDataMap["P_ATTRIBUTE$i"] = getabsenceDffStructureList[dffIndex].eSERVICESDV?.pIDCOLUMNNAME;
}
break;
void validateAbsenceTransaction(selectedID) 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"] =
getabsenceDffStructureList[dffIndex].eSERVICESDV!.pIDCOLUMNNAME != null ? 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 != null ? selectedReplacementEmployee!.userName! : "",
DateUtil.getFormattedDate(startDateTime!, "MM/dd/yyyy"),
DateUtil.getFormattedDate(endDateTime!, "MM/dd/yyyy"),
-999,
dffDataMap,
comments: comment);
}
await LeaveBalanceApiClient().validateAbsenceTransaction(
selectedAbsenceType!.dESCFLEXCONTEXTCODE!,
"HR_LOA_SS",
selectedAbsenceType!.aBSENCEATTENDANCETYPEID!,
selectedReplacementEmployee != null ? selectedReplacementEmployee!.userName! : "",
DateUtil.getFormattedDate(startDateTime!, "MM/dd/yyyy"),
DateUtil.getFormattedDate(endDateTime!, "MM/dd/yyyy"),
-999,
dffDataMap,
comments: comment,
empID: selectedEmp);
SumbitAbsenceTransactionList submit = await LeaveBalanceApiClient().submitAbsenceTransaction(
selectedAbsenceType!.dESCFLEXCONTEXTCODE!,
"HR_LOA_SS",
selectedAbsenceType!.aBSENCEATTENDANCETYPEID!,
selectedReplacementEmployee != null ? 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 != null ? selectedReplacementEmployee!.userName! : "",
DateUtil.getFormattedDate(startDateTime!, "MM/dd/yyyy"),
DateUtil.getFormattedDate(endDateTime!, "MM/dd/yyyy"),
-999,
dffDataMap,
comments: comment,
empID: selectedEmp);
Utils.hideLoading(context);
Utils.hideLoading(context);
var res = await Navigator.pushNamed(context, AppRoutes.requestSubmitScreen, arguments: RequestSubmitScreenParams(LocaleKeys.submit.tr(), submit.pTRANSACTIONID!, "", "add_leave_balance"));
if (res != null && res == true) {
Utils.showLoading(context);
}
await LeaveBalanceApiClient().cancelHrTransaction(submit.pTRANSACTIONID!);
Utils.hideLoading(context);
} catch (ex) {
Utils.hideLoading(context);
Utils.handleException(ex, context, null);
var res = await Navigator.pushNamed(context, AppRoutes.requestSubmitScreen, arguments: RequestSubmitScreenParams(LocaleKeys.submit.tr(), submit.pTRANSACTIONID!, "", "add_leave_balance"));
if (res != null && res == true) {
Utils.showLoading(context);
}
await LeaveBalanceApiClient().cancelHrTransaction(submit.pTRANSACTIONID!);
Utils.hideLoading(context);
// } catch (ex) {
// Utils.hideLoading(context);
// Utils.handleException(ex, context, null);
// }
}
@override
@ -152,6 +158,16 @@ class _AddLeaveBalanceScreenState extends State<AddLeaveBalanceScreen> {
@override
Widget build(BuildContext context) {
if (dynamicParams == null) {
dynamicParams = ModalRoute.of(context)!.settings.arguments;
if (dynamicParams.isNotEmpty) {
AppState().postParamsJson['P_SELECTED_EMPLOYEE_NUMBER'] = dynamicParams;
selectedEmp = dynamicParams;
getAbsenceAttendanceTypes();
} else {
getAbsenceAttendanceTypes();
}
}
return Scaffold(
backgroundColor: Colors.white,
appBar: AppBarWidget(
@ -269,7 +285,7 @@ class _AddLeaveBalanceScreenState extends State<AddLeaveBalanceScreen> {
validateFieldData()
? null
: () {
validateAbsenceTransaction();
validateAbsenceTransaction(selectedEmp);
},
).insideContainer
],

@ -1,6 +1,7 @@
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/app_state/app_state.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';
@ -13,7 +14,8 @@ import 'package:mohem_flutter_app/widgets/balances_dashboard_widget.dart';
import 'package:mohem_flutter_app/widgets/item_detail_view_widget.dart';
class LeaveBalance extends StatefulWidget {
LeaveBalance({Key? key}) : super(key: key);
final String selectedEmp;
LeaveBalance({this.selectedEmp = '', Key? key}) : super(key: key);
@override
_LeaveBalanceState createState() {
@ -25,12 +27,13 @@ class _LeaveBalanceState extends State<LeaveBalance> {
List<GetAbsenceTransactionList>? absenceTransList;
DateTime accrualDateTime = DateTime.now();
dynamic dynamicParams;
String selectedEmp = "";
@override
void initState() {
super.initState();
getAbsenceTransactions();
absenceTransList = [];
}
@override
@ -40,9 +43,9 @@ class _LeaveBalanceState extends State<LeaveBalance> {
void getAbsenceTransactions() async {
try {
Utils.showLoading(context);
absenceTransList = await LeaveBalanceApiClient().getAbsenceTransactions(-999);
Utils.hideLoading(context);
// Utils.showLoading(context);
absenceTransList = await LeaveBalanceApiClient().getAbsenceTransactions(-999, empID: selectedEmp);
//Utils.hideLoading(context);
setState(() {});
} catch (ex) {
Utils.hideLoading(context);
@ -52,6 +55,16 @@ class _LeaveBalanceState extends State<LeaveBalance> {
@override
Widget build(BuildContext context) {
if (dynamicParams == null) {
dynamicParams = ModalRoute.of(context)!.settings.arguments;
if (dynamicParams.isNotEmpty) {
AppState().postParamsJson['P_SELECTED_EMPLOYEE_NUMBER'] = dynamicParams;
selectedEmp = dynamicParams;
getAbsenceTransactions();
} else {
getAbsenceTransactions();
}
}
return Scaffold(
backgroundColor: Colors.white,
appBar: AppBarWidget(
@ -111,7 +124,7 @@ class _LeaveBalanceState extends State<LeaveBalance> {
),
child: const Icon(Icons.add, color: Colors.white, size: 30),
).onPress(() {
Navigator.pushNamed(context, AppRoutes.addLeaveBalance);
Navigator.pushNamed(context, AppRoutes.addLeaveBalance, arguments: selectedEmp ?? '');
}),
);
}

@ -8,6 +8,7 @@ import 'package:mohem_flutter_app/api/leave_balance_api_client.dart';
import 'package:mohem_flutter_app/api/my_attendance_api_client.dart';
import 'package:mohem_flutter_app/api/profile_api_client.dart';
import 'package:mohem_flutter_app/api/termination_dff_api_client.dart';
import 'package:mohem_flutter_app/app_state/app_state.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';
@ -35,7 +36,8 @@ class RequestSubmitScreenParams {
}
class RequestSubmitScreen extends StatefulWidget {
RequestSubmitScreen({Key? key}) : super(key: key);
final String selectedEmp;
RequestSubmitScreen({this.selectedEmp ='',Key? key}) : super(key: key);
@override
_RequestSubmitScreenState createState() {
@ -50,6 +52,8 @@ class _RequestSubmitScreenState extends State<RequestSubmitScreen> {
List<GetApprovesList> approverList = [];
List<File> attachmentFiles = [];
List<String> attachments = [];
dynamic dynamicParams;
String selectedEmp ="";
@override
void initState() {
@ -123,6 +127,7 @@ class _RequestSubmitScreenState extends State<RequestSubmitScreen> {
params!.transactionId,
comments.text,
-999,
empID: widget.selectedEmp
);
} else if (params!.approvalFlag == 'eit') {
await MyAttendanceApiClient().startEitApprovalProcess(

@ -102,8 +102,8 @@ class _DynamicListViewScreenState extends State<DynamicListViewScreen> {
itemBuilder: (cxt, int parentIndex) => getEITTransactionList![parentIndex].collectionTransaction!.isEmpty
? const SizedBox()
: GridView(
gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: 2, childAspectRatio: 1.9 / 0.75),
padding: const EdgeInsets.all(12.0),
gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: 2, childAspectRatio: 1.0 / 0.75),
padding: const EdgeInsets.only(left: 12,right: 21,top: 12),
shrinkWrap: true,
primary: false,
physics: const ScrollPhysics(),

@ -54,7 +54,7 @@ class ServicesMenuListScreen extends StatelessWidget {
}
return;
} else if (servicesMenuData.list[index].requestType == "ABSENCE") {
Navigator.pushNamed(context, AppRoutes.leaveBalance);
Navigator.pushNamed(context, AppRoutes.leaveBalance, arguments: servicesMenuData?.selectedEmp ??'');
return;
}
if (servicesMenuData.list[index].requestType == "EIT") {

@ -177,13 +177,13 @@ class _ContactDetailsState extends State<ContactDetails> {
void addUpdateAddress() {
Widget cancelButton = TextButton(
child: Text("Cancel"),
child: Text(LocaleKeys.cancel.tr()),
onPressed: () {
Navigator.pop(context);
},
);
Widget continueButton = TextButton(
child: Text("Next"),
child: Text(LocaleKeys.next.tr()),
onPressed: () {
continueDynamicForms();
},
@ -191,7 +191,7 @@ class _ContactDetailsState extends State<ContactDetails> {
StatefulBuilder alert = StatefulBuilder(builder: (context, setState) {
return AlertDialog(
shape: RoundedRectangleBorder(borderRadius: BorderRadius.all(Radius.circular(10.0))),
title: Text("Confirm"),
title: Text(LocaleKeys.confirm.tr()),
content: Builder(builder: (context) {
// Get available height and width of the build area of this widget. Make a choice depending on the size.
var height = MediaQuery.of(context).size.height * .5;
@ -199,14 +199,14 @@ class _ContactDetailsState extends State<ContactDetails> {
height: height,
child: Column(children: [
Text(
"Select the type of change you want to make.",
LocaleKeys.SelectChangeWantToMake.tr(),
style: TextStyle(fontSize: 16, fontWeight: FontWeight.bold),
),
Divider(),
Column(
children: [
ListTile(
title: Text("Correct or amend this address"),
title: Text(LocaleKeys.CorrectAddress.tr()),
leading: Radio(
value: 1,
groupValue: correctOrNew,
@ -219,7 +219,7 @@ class _ContactDetailsState extends State<ContactDetails> {
),
),
ListTile(
title: Text("Enter a new address if you have moved"),
title: Text(LocaleKeys.EnterNewAddressMoved.tr()),
leading: Radio(
value: 2,
groupValue: correctOrNew,

@ -45,11 +45,14 @@ class _BalancesDashboardWidgetState extends State<BalancesDashboardWidget> {
late DateTime accrualDateTime;
GetAccrualBalancesList? leaveBalanceAccrual;
List<GetAccrualBalancesList>? ticketBalanceAccrualList;
dynamic dynamicParams;
String selectedEmp = "";
@override
void initState() {
super.initState();
accrualDateTime = DateTime.now();
changeAccrualDate();
}
@override
@ -60,7 +63,7 @@ class _BalancesDashboardWidgetState extends State<BalancesDashboardWidget> {
void changeAccrualDate() async {
try {
Utils.showLoading(context);
List<GetAccrualBalancesList> accrualList = await DashboardApiClient().getAccrualBalances(DateFormat("MM/dd/yyyy").format(accrualDateTime));
List<GetAccrualBalancesList> accrualList = await DashboardApiClient().getAccrualBalances(DateFormat("MM/dd/yyyy").format(accrualDateTime), empID: selectedEmp);
if (accrualList.isNotEmpty) {
if (widget.isLeaveBalance) {
leaveBalanceAccrual = accrualList[0];

Loading…
Cancel
Save