updates & fixes

fatima
haroon amjad 2 years ago
parent 4ff3a5093b
commit c436908d25

@ -403,6 +403,24 @@ class WorkListApiClient {
}, url, postParams);
}
Future<ITGRequest?> grantITGRequest(String requestType, int taskId, int itemId, String employeeNumber, String newUserEMPId, String comments) async {
String url = "${ApiConsts.cocRest}ITGGrantAccess";
Map<String, dynamic> postParams = {
"RequestType": requestType,
"TaskID": taskId,
"ItemID": itemId,
"EmployeeNumber": employeeNumber,
"Comments": "",
"AdditionalFields": null,
"NewUserEMPId":newUserEMPId
};
postParams.addAll(AppState().postParamsJson);
return await ApiClient().postJsonForObject((json) {
ItgFormsModel responseData = ItgFormsModel.fromJson(json);
return responseData.itgRequest;
}, url, postParams);
}
Future<ITGRequest?> informationITGRequest(String requestType, int taskId, int itemId, String employeeNumber, String newUserEMPId, String comments) async {
String url = "${ApiConsts.cocRest}ITGRequestInformation";
Map<String, dynamic> postParams = {

@ -431,7 +431,7 @@ class _MonthlyAttendanceScreenState extends State<MonthlyAttendanceScreen> {
expand: false,
builder: (_, controller) {
dynamic dmyString = getScheduleShiftsDetailsList!.sCHEDULEDATE;
DateTime dateTime1 = DateFormat("MM/dd/yyyy hh:mm:ss a").parse(dmyString);
DateTime dateTime1 = DateFormat("MM/dd/yyyy hh:mm:ss").parse(dmyString);
return Column(
children: [
Container(

@ -86,7 +86,7 @@ class _TodayAttendanceScreenState extends State<TodayAttendanceScreen2> {
child: CircularStepProgressBar(
totalSteps: 16 * 4,
currentStep: (model.progress * 100).toInt(),
selectedColor: MyColors.gradiantEndColor,
selectedColor: MyColors.gradiantStartColor,
unselectedColor: MyColors.grey70Color,
child: Center(
child: Padding(

@ -74,7 +74,7 @@ class ServicesWidget extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.end,
children: [
Expanded(
child: data.homeMenus![parentIndex].menuEntiesList[index].prompt!.toText10(isBold: true),
child: data.homeMenus![parentIndex].menuEntiesList[index].prompt!.toText11(isBold: true),
),
RotatedBox(quarterTurns: AppState().isArabic(context) ? 2 : 4, child: SvgPicture.asset("assets/images/arrow_next.svg").paddingOnly(bottom: 4)),
],

@ -142,7 +142,7 @@ class MarathonBanner extends StatelessWidget {
bottom: 0,
child: RotatedBox(
quarterTurns: 4,
child: SvgPicture.asset("assets/images/arrow_next.svg", color: MyColors.darkDigitColor),
child: SvgPicture.asset("assets/images/arrow_next.svg", color: MyColors.whiteColor),
).paddingAll(15),
)
: Positioned(
@ -150,7 +150,7 @@ class MarathonBanner extends StatelessWidget {
left: 0,
child: RotatedBox(
quarterTurns: 2,
child: SvgPicture.asset("assets/images/arrow_next.svg", color: MyColors.darkDigitColor),
child: SvgPicture.asset("assets/images/arrow_next.svg", color: MyColors.whiteColor),
).paddingAll(15),
),
],

@ -68,7 +68,7 @@ class _DynamicInputScreenState extends State<DynamicInputScreen> {
}
void validateTransaction() async {
// try {
try {
Utils.showLoading(context);
List<Map<String, dynamic>> values = getEitDffStructureList!.map((e) {
String tempVar = e.eSERVICESDV?.pIDCOLUMNNAME ?? "";
@ -114,10 +114,10 @@ class _DynamicInputScreenState extends State<DynamicInputScreen> {
Utils.showLoading(context);
await LeaveBalanceApiClient().cancelHrTransaction(submitEITTransactionList.pTRANSACTIONID!);
Utils.hideLoading(context);
// } catch (ex) {
// Utils.hideLoading(context);
// Utils.handleException(ex, context, null);
// }
} catch (ex) {
Utils.hideLoading(context);
Utils.handleException(ex, context, null);
}
}
String dESCFLEXCONTEXTCODE = "";

@ -439,7 +439,7 @@ class _ViewAttendanceState extends State<ViewAttendance> {
expand: false,
builder: (_, controller) {
dynamic dmyString = getScheduleShiftsDetailsList!.sCHEDULEDATE;
DateTime dateTime1 = DateFormat("MM/dd/yyyy hh:mm:ss a").parse(dmyString);
DateTime dateTime1 = DateFormat("MM/dd/yyyy hh:mm:ss").parse(dmyString);
return Column(
children: [
Container(

@ -383,7 +383,7 @@ class _AddUpdateFamilyMemberState extends State<AddUpdateFamilyMember> {
),
);
} else {
DateTime? picked = await showDatePicker(context: context, initialDate: selectedDate, initialEntryMode: DatePickerEntryMode.calendarOnly, firstDate: DateTime(2015, 8), lastDate: DateTime(2101));
DateTime? picked = await showDatePicker(context: context, initialDate: selectedDate, initialEntryMode: DatePickerEntryMode.calendarOnly, firstDate: DateTime(1920, 1), lastDate: DateTime.now());
if (picked != null && picked != selectedDate) {
time = picked;
}

@ -128,7 +128,8 @@ class _FamilyMembersState extends State<FamilyMembers> {
),
DefaultButton(LocaleKeys.addNewFamilyMember.tr(),
menuEntries.updateButton == 'Y'
? () async {
?
() async {
Navigator.pushNamed(context, AppRoutes.addUpdateFamilyMember, arguments: {"relationID": relationId, "flag": 1, "actionType": "ADD"});
// ProfileScreen();
} : null).insideContainer,

@ -76,9 +76,7 @@ class _MyRequestsState extends State<MyRequests> {
}),
),
12.height,
Expanded(
// todo list don't have data, need to confirm later , because have issues, need fixes
getCCPTransactionsList.isNotEmpty ? Expanded(
child: ListView.separated(
physics: const BouncingScrollPhysics(),
shrinkWrap: true,
@ -141,7 +139,7 @@ class _MyRequestsState extends State<MyRequests> {
},
separatorBuilder: (BuildContext context, int index) => 12.height,
itemCount: getCCPTransactionsList.length),
),
) : Container(),
],
).expanded,
1.divider,

@ -176,8 +176,8 @@ class _OffersAndDiscountsDetailsState extends State<OffersAndDiscountsDetails> {
// // launchUrl(Uri.parse(url!));
// // }
// ),
getOffersList.description!.toText12(maxLine: 2, color: const Color(0xff535353)),
16.height,
// getOffersList.description!.toText12(maxLine: 2, color: const Color(0xff535353)),
// 16.height,
getOffersList.discount!.toText14(isBold: true, maxlines: 1),
8.height,
Row(

@ -367,6 +367,12 @@ class _ItgDetailScreenState extends State<ItgDetailScreen> {
case "Answer":
performAction("Answer");
break;
case "ReportGenerated":
performDataCorrectionORReportGeneratedAction(requestDetails!.requestType!, requestDetails!.iD!, requestDetails!.itemID!, AppState().memberInformationList?.eMPLOYEENUMBER ?? "");
break;
case "DataCorrected":
performDataCorrectionORReportGeneratedAction(requestDetails!.requestType!, requestDetails!.iD!, requestDetails!.itemID!, AppState().memberInformationList?.eMPLOYEENUMBER ?? "");
break;
}
setState(() {
showFabOptions = false;
@ -525,6 +531,29 @@ class _ItgDetailScreenState extends State<ItgDetailScreen> {
}
}
void performDataCorrectionORReportGeneratedAction(String requestType, int taskId, int itemId, String employeeNumber) async {
try {
Utils.showLoading(context);
ITGRequest? itgRequest = await WorkListApiClient().grantITGRequest(requestType, taskId, itemId, employeeNumber, "", "");
Utils.hideLoading(context);
Utils.showToast(LocaleKeys.yourChangeHasBeenSavedSuccessfully.tr());
AppState().requestAllList!.removeAt(AppState().itgWorkListIndex!);
if (AppState().requestAllList!.isEmpty) {
Navigator.pop(context, "delegate_reload");
} else {
if (AppState().requestAllList!.length <= AppState().itgWorkListIndex!) {
Navigator.pop(context, "delegate_reload");
} else {
requestDetails = null;
getDataFromState();
}
}
} catch (ex) {
Utils.hideLoading(context);
Utils.handleException(ex, context, null);
}
}
void reloadITG() {
AppState().requestAllList!.removeAt(AppState().itgWorkListIndex!);
if (AppState().requestAllList!.isEmpty) {

@ -226,7 +226,6 @@ class _WorkListScreenState extends State<WorkListScreen> {
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(width: double.infinity, height: 1, color: MyColors.lightGreyEFColor),
SizedBox(
height: 40,
child: ListView.separated(

@ -476,6 +476,17 @@ class _WorkListDetailScreenState extends State<WorkListDetailScreen> {
isUpdate: true, collectionNotificationList: getEitCollectionNotificationBodyList![0].collectionNotification)),
);
break;
case "CONTINUE_ACTION":
showMyBottomSheet(
context,
callBackFunc: reloadWorkList,
child: UpdateContinueSheet(
workListData: workListData,
getEitCollectionNotificationBodyList: getEitCollectionNotificationBodyList,
dynamicParams: DynamicListViewParams(workListData!.sUBJECT!, workListData!.fUNCTIONNAME!,
isUpdate: true, collectionNotificationList: getEitCollectionNotificationBodyList![0].collectionNotification)),
);
break;
case "APPROVE_AND_FORWARD":
showMyBottomSheet(context,
callBackFunc: reloadWorkList,

@ -140,8 +140,6 @@ class ActionsFragment extends StatelessWidget {
DateTime dateTimeTo = DateUtil.convertSimpleStringDateToDate(actionHistoryList[index].nOTIFICATIONDATE!);
DateTime dateTimeFrom = DateUtil.convertSimpleStringDateToDate(actionHistoryList[++index].nOTIFICATIONDATE!);
Duration duration = dateTimeTo.difference(dateTimeFrom);
print(dateTimeTo);
print(dateTimeFrom);
return "Action duration: " + DateUtil.formatDuration(duration);
}
}

@ -6,65 +6,73 @@ 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';
AppBar AppBarWidget(BuildContext context,
PreferredSize AppBarWidget(BuildContext context,
{required String title,
bool showHomeButton = true,
bool showNotificationButton = false,
bool showMemberButton = false,
String? image}) {
return AppBar(
leadingWidth: 0,
// leading: GestureDetector(
// behavior: HitTestBehavior.opaque,
// onTap: Feedback.wrapForTap(() => Navigator.maybePop(context), context),
// child: const Icon(Icons.arrow_back_ios, color: MyColors.darkIconColor),
// ),
//titleSpacing: -1.44,
title: Row(
return PreferredSize(
preferredSize: const Size.fromHeight(57.0),
child: Column(
children: [
GestureDetector(
behavior: HitTestBehavior.opaque,
onTap:
Feedback.wrapForTap(() => Navigator.maybePop(context), context),
child:
const Icon(Icons.arrow_back_ios, color: MyColors.darkIconColor),
AppBar(
leadingWidth: 0,
// leading: GestureDetector(
// behavior: HitTestBehavior.opaque,
// onTap: Feedback.wrapForTap(() => Navigator.maybePop(context), context),
// child: const Icon(Icons.arrow_back_ios, color: MyColors.darkIconColor),
// ),
//titleSpacing: -1.44,
title: Row(
children: [
GestureDetector(
behavior: HitTestBehavior.opaque,
onTap:
Feedback.wrapForTap(() => Navigator.maybePop(context), context),
child:
const Icon(Icons.arrow_back_ios, color: MyColors.darkIconColor),
),
4.width,
if (image != null) SvgPicture.asset(
image,
height: 40,
width: 40,
),
if (image != null) 14.width,
title.toText24(color: MyColors.darkTextColor, isBold: true).expanded,
],
),
centerTitle: false,
elevation: 0,
backgroundColor: Colors.white,
actions: [
if (showHomeButton)
IconButton(
onPressed: () {
Navigator.popUntil(
context, ModalRoute.withName(AppRoutes.dashboard));
},
icon: const Icon(Icons.home, color: MyColors.darkIconColor),
),
if (showNotificationButton)
IconButton(
onPressed: () {
Navigator.pushNamed(context, AppRoutes.worklistSettings);
},
icon: const Icon(Icons.notifications, color: MyColors.textMixColor),
),
if (showMemberButton)
IconButton(
onPressed: () {
Navigator.pushNamed(context, AppRoutes.subordinateLeave);
},
icon: const Icon(Icons.people, color: MyColors.textMixColor),
),
],
),
4.width,
if (image != null) SvgPicture.asset(
image,
height: 40,
width: 40,
),
if (image != null) 14.width,
title.toText24(color: MyColors.darkTextColor, isBold: true).expanded,
Container(width: double.infinity, height: 1, color: MyColors.lightGreyEFColor),
],
),
centerTitle: false,
elevation: 0,
backgroundColor: Colors.white,
actions: [
if (showHomeButton)
IconButton(
onPressed: () {
Navigator.popUntil(
context, ModalRoute.withName(AppRoutes.dashboard));
},
icon: const Icon(Icons.home, color: MyColors.darkIconColor),
),
if (showNotificationButton)
IconButton(
onPressed: () {
Navigator.pushNamed(context, AppRoutes.worklistSettings);
},
icon: const Icon(Icons.notifications, color: MyColors.textMixColor),
),
if (showMemberButton)
IconButton(
onPressed: () {
Navigator.pushNamed(context, AppRoutes.subordinateLeave);
},
icon: const Icon(Icons.people, color: MyColors.textMixColor),
),
],
);
}

Loading…
Cancel
Save