Merge branch 'development_haroon' into 'master'

Development haroon

See merge request Cloud_Solution/mohemm-flutter-app!60
merge-requests/54/merge
haroon amjad 3 years ago
commit 9d81a220b2

@ -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 = {

@ -120,6 +120,12 @@ class AppState {
set setItgWorkListIndex(int? _itgWorkListIndex) => itgWorkListIndex = _itgWorkListIndex;
String? itgRequestType;
set setItgRequestType(String? _itgRequestType) => itgRequestType = _itgRequestType;
String? get getItgRequestType => itgRequestType;
UserAutoLoginModel? chatDetails;
set setchatUserDetails(UserAutoLoginModel details) => chatDetails = details;

@ -1,7 +1,7 @@
class ApiConsts {
//static String baseUrl = "http://10.200.204.20:2801/"; // Local server
//static String baseUrl = "https://uat.hmgwebservices.com"; // UAT server
static String baseUrl = "https://hmgwebservices.com"; // Live server
static String baseUrl = "https://uat.hmgwebservices.com"; // UAT server
//static String baseUrl = "https://hmgwebservices.com"; // Live server
static String baseUrlServices = baseUrl + "/Services/"; // server
// static String baseUrlServices = "https://api.cssynapses.com/tangheem/"; // Live server
static String utilitiesRest = baseUrlServices + "Utilities.svc/REST/";

@ -381,6 +381,30 @@ class DateUtil {
return "";
}
static String formatDuration(Duration d) {
var seconds = d.inSeconds;
var days = seconds ~/ Duration.secondsPerDay;
seconds -= days * Duration.secondsPerDay;
var hours = seconds ~/ Duration.secondsPerHour;
seconds -= hours * Duration.secondsPerHour;
var minutes = seconds ~/ Duration.secondsPerMinute;
seconds -= minutes * Duration.secondsPerMinute;
List<String> tokens = [];
if (days != 0) {
tokens.add('$days days');
}
if (tokens.isNotEmpty || hours != 0) {
tokens.add('$hours hours');
}
if (tokens.isNotEmpty || minutes != 0) {
tokens.add('$minutes mins');
}
tokens.add('$seconds secs');
return tokens.join(' ');
}
/// get data formatted like 26/4/2020
/// [dateTime] convert DateTime to data formatted according to language
static String getDayMonthYearDateFormattedLang(DateTime dateTime, bool isArabic) {
@ -431,30 +455,30 @@ class DateUtil {
return "/Date(" + DateFormat('mm-dd-yyy').parse(isoDate).millisecondsSinceEpoch.toString() + ")/";
}
// static String getDay(DayOfWeek dayOfWeek) {
// switch (dayOfWeek) {
// case DayOfWeek.Monday:
// return "Monday";
// break;
// case DayOfWeek.Tuesday:
// return "Tuesday";
// break;
// case DayOfWeek.Wednesday:
// return "Wednesday";
// break;
// case DayOfWeek.Thursday:
// return "Thursday";
// break;
// case DayOfWeek.Friday:
// return "Friday";
// break;
// case DayOfWeek.Saturday:
// return "Saturday";
// break;
// case DayOfWeek.Sunday:
// return "Sunday";
// break;
// }
// return "";
// }
// static String getDay(DayOfWeek dayOfWeek) {
// switch (dayOfWeek) {
// case DayOfWeek.Monday:
// return "Monday";
// break;
// case DayOfWeek.Tuesday:
// return "Tuesday";
// break;
// case DayOfWeek.Wednesday:
// return "Wednesday";
// break;
// case DayOfWeek.Thursday:
// return "Thursday";
// break;
// case DayOfWeek.Friday:
// return "Friday";
// break;
// case DayOfWeek.Saturday:
// return "Saturday";
// break;
// case DayOfWeek.Sunday:
// return "Sunday";
// break;
// }
// return "";
// }
}

@ -22,8 +22,9 @@ extension EmailValidator on String {
style: TextStyle(fontSize: 10, fontStyle: fontStyle ?? FontStyle.normal, fontWeight: isBold ? FontWeight.bold : FontWeight.w600, color: color ?? MyColors.darkTextColor, letterSpacing: -0.4),
);
Widget toText11({Color? color, FontWeight? weight, bool isUnderLine = false, bool isBold = false}) => Text(
Widget toText11({Color? color, FontWeight? weight, bool isUnderLine = false, bool isBold = false, int maxLine = 0}) => Text(
this,
maxLines: (maxLine > 0) ? maxLine : null,
style: TextStyle(
fontSize: 11,
fontWeight: weight ?? (isBold ? FontWeight.bold : FontWeight.w600),

@ -0,0 +1,37 @@
//
// Generated file. Do not edit.
//
// ignore_for_file: directives_ordering
// ignore_for_file: lines_longer_than_80_chars
// ignore_for_file: depend_on_referenced_packages
import 'package:file_picker/_internal/file_picker_web.dart';
import 'package:firebase_core_web/firebase_core_web.dart';
import 'package:firebase_messaging_web/firebase_messaging_web.dart';
import 'package:fluttertoast/fluttertoast_web.dart';
import 'package:geolocator_web/geolocator_web.dart';
import 'package:google_maps_flutter_web/google_maps_flutter_web.dart';
import 'package:image_picker_for_web/image_picker_for_web.dart';
import 'package:shared_preferences_web/shared_preferences_web.dart';
import 'package:url_launcher_web/url_launcher_web.dart';
import 'package:video_player_web/video_player_web.dart';
import 'package:wakelock_web/wakelock_web.dart';
import 'package:flutter_web_plugins/flutter_web_plugins.dart';
// ignore: public_member_api_docs
void registerPlugins(Registrar registrar) {
FilePickerWeb.registerWith(registrar);
FirebaseCoreWeb.registerWith(registrar);
FirebaseMessagingWeb.registerWith(registrar);
FluttertoastWebPlugin.registerWith(registrar);
GeolocatorPlugin.registerWith(registrar);
GoogleMapsPlugin.registerWith(registrar);
ImagePickerPlugin.registerWith(registrar);
SharedPreferencesPlugin.registerWith(registrar);
UrlLauncherPlugin.registerWith(registrar);
VideoPlayerPlugin.registerWith(registrar);
WakelockWeb.registerWith(registrar);
registrar.registerMessageHandler();
}

@ -92,6 +92,12 @@ class MyApp extends StatelessWidget {
MonthYearPickerLocalizations.delegate,
);
return MaterialApp(
builder: (BuildContext context, Widget? child) {
return MediaQuery(
data: MediaQuery.of(context).copyWith(textScaleFactor: 1.0),
child: child!,
);
},
theme: AppTheme.getTheme(
EasyLocalization.of(context)?.locale.languageCode == "ar",
),

@ -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(

@ -1,10 +1,7 @@
import 'dart:convert';
import 'dart:ui';
import 'package:camera/camera.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:just_audio/just_audio.dart';
import 'package:mohem_flutter_app/classes/colors.dart';
import 'package:mohem_flutter_app/classes/utils.dart';
import 'package:mohem_flutter_app/models/chat/call.dart';

@ -53,8 +53,8 @@ class _SuccessDialogState extends State<SuccessDialog> with TickerProviderStateM
repeat: false,
reverse: false,
controller: _controller,
frameRate: FrameRate(60.0),
onLoaded: (LottieComposition v) async {
print("calling_lottie " + v.seconds.toString());
await playSuccessSound();
_controller
..duration = v.duration

@ -258,7 +258,7 @@ class _DashboardScreenState extends State<DashboardScreen> {
margin: EdgeInsets.only(top: AppState().isArabic(context) ? 6 : 0),
width: 45,
height: 45,
padding: const EdgeInsets.only(left: 14, right: 14),
padding: const EdgeInsets.only(left: 10, right: 10),
decoration: BoxDecoration(
color: Color(0xff259EA4),
borderRadius: BorderRadius.only(
@ -298,7 +298,7 @@ class _DashboardScreenState extends State<DashboardScreen> {
),
],
).paddingOnly(left: 21, right: 21, top: 7),
MarathonBanner().paddingAll(20),
const MarathonBanner().paddingAll(20),
ServicesWidget(),
// 8.height,
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(

@ -39,7 +39,7 @@ class ServicesWidget extends StatelessWidget {
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: [
children: [
data.homeMenus![parentIndex].menuEntry.prompt!.toSectionHeading().paddingOnly(left: 21, right: 21),
SizedBox(
height: 105 + 26,
@ -69,12 +69,12 @@ class ServicesWidget extends StatelessWidget {
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SvgPicture.asset(iconT[index]),
SvgPicture.asset(AppState().isArabic(context) ? getMenuIconAr(data.homeMenus![parentIndex].menuEntiesList[index].prompt!) : getMenuIconEn(data.homeMenus![parentIndex].menuEntiesList[index].prompt!)),
Row(
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)),
],
@ -102,6 +102,92 @@ class ServicesWidget extends StatelessWidget {
);
}
String getMenuIconAr(String name) {
String returnImage = "";
switch (name) {
case "الحضور الشهري":
returnImage = "assets/images/services_icons/monthly_attendance.svg";
break;
case "كشف الراتب":
returnImage = "assets/images/services_icons/payslips.svg";
break;
case "تغيير معلومات البنك":
returnImage = "assets/images/services_icons/change_bank_details.svg";
break;
case "طلب بدل السكن مقدما":
returnImage = "assets/images/services_icons/housing_allowance.svg";
break;
case "شهادات تعريف الموظف":
returnImage = "assets/images/services_icons/employee_certificates.svg";
break;
case "البيانات الشخصية":
returnImage = "assets/images/personal-info.svg";
break;
case "الحضور":
returnImage = "assets/images/services_icons/my_attendance.svg";
break;
case "طلبات أخرى":
returnImage = "assets/images/services_icons/other_requests.svg";
break;
case "الإجازات":
returnImage = "assets/images/services_icons/my_leaves.svg";
break;
case "طلب تذكرة":
returnImage = "assets/images/services_icons/ticket_bal.svg";
break;
case "قاعدة الاجازات":
returnImage = "assets/images/services_icons/vacation_rule.svg";
break;
default:
returnImage = "assets/images/monthly_attendance.svg";
break;
}
return returnImage;
}
String getMenuIconEn(String name) {
String returnImage = "";
switch (name) {
case "Monthly Attendance":
returnImage = "assets/images/services_icons/monthly_attendance.svg";
break;
case "Payslip":
returnImage = "assets/images/services_icons/payslips.svg";
break;
case "Change Bank Details":
returnImage = "assets/images/services_icons/change_bank_details.svg";
break;
case "Housing Advance":
returnImage = "assets/images/services_icons/housing_allowance.svg";
break;
case "Employee Certificate":
returnImage = "assets/images/services_icons/employee_certificates.svg";
break;
case "Personal Information":
returnImage = "assets/images/personal-info.svg";
break;
case "My Attendance":
returnImage = "assets/images/services_icons/my_attendance.svg";
break;
case "Other Requests":
returnImage = "assets/images/services_icons/other_requests.svg";
break;
case "My Leave":
returnImage = "assets/images/services_icons/my_leaves.svg";
break;
case "Ticket Request":
returnImage = "assets/images/services_icons/ticket_bal.svg";
break;
case "Vacation Rule":
returnImage = "assets/images/services_icons/vacation_rule.svg";
break;
default:
returnImage = "assets/images/monthly_attendance.svg";
break;
}
return returnImage;
}
void handleOnPress(context, GetMenuEntriesList menuEntry) {
var pro = Provider.of<DashboardProviderModel>(context, listen: false);
if (menuEntry.requestType == "MONTHLY_ATTENDANCE") {

@ -142,8 +142,8 @@ class _LoginScreenState extends State<LoginScreen> {
isAppOpenBySystem = (ModalRoute.of(context)!.settings.arguments ?? true) as bool;
if (!kReleaseMode) {
// username.text = "15444"; // Maha User
username.text = "15153"; // Tamer User
password.text = "Abcd@12345";
// username.text = "15153"; // Tamer User
// password.text = "Abcd@12345";
// username.text = "206535"; // Hashim User
// password.text = "Namira786";

@ -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,

@ -25,8 +25,9 @@ class AddItemDetailsFragment extends StatefulWidget {
final Function changePageViewIndex;
final GetSaleCategoriesList selectedSaleCategory;
static late ItemReviewModel itemReviewModel;
static late bool isUpdate;
const AddItemDetailsFragment({Key? key, required this.changePageViewIndex, required this.selectedSaleCategory}) : super(key: key);
AddItemDetailsFragment({Key? key, required this.changePageViewIndex, required this.selectedSaleCategory}) : super(key: key);
@override
State<AddItemDetailsFragment> createState() => _AddItemDetailsFragmentState();
@ -246,6 +247,7 @@ class _AddItemDetailsFragmentState extends State<AddItemDetailsFragment> {
String details = await Utils.getStringFromPrefs(SharedPrefsConsts.editItemForSale);
if(details.isNotEmpty) {
var body = json.decode(details);
AddItemDetailsFragment.isUpdate = true;
GetRegionsList selectedRegionAd = GetRegionsList();
@ -268,6 +270,8 @@ class _AddItemDetailsFragmentState extends State<AddItemDetailsFragment> {
AddItemDetailsFragment.itemReviewModel = itemReviewModel;
SelectCategoryFragment.selectedSaleCategory = selectedSaleCategoryAd;
} else {
AddItemDetailsFragment.isUpdate = false;
}
}

@ -26,11 +26,13 @@ class ItemReviewFragment extends StatefulWidget {
class _ItemReviewFragmentState extends State<ItemReviewFragment> {
ItemReviewModel? itemReviewModel;
late bool isUpdate;
@override
void initState() {
itemReviewModel = AddItemDetailsFragment.itemReviewModel;
itemReviewModel!.selectedSaleCategory = SelectCategoryFragment.selectedSaleCategory;
isUpdate = AddItemDetailsFragment.isUpdate;
super.initState();
}

@ -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(

@ -173,7 +173,7 @@ class _OffersAndDiscountsHomeState extends State<OffersAndDiscountsHome> {
tag: "ItemImage" + getOffersList.rowID!,
transitionOnUserGestures: true,
child: AspectRatio(
aspectRatio: 148 / 127,
aspectRatio: 118 / 127,
child: ClipRRect(
borderRadius: BorderRadius.circular(6),
child: Image.network(
@ -192,10 +192,10 @@ class _OffersAndDiscountsHomeState extends State<OffersAndDiscountsHome> {
// // launchUrl(Uri.parse(url!));
// // }
// ),
getOffersList.description!.toText12(maxLine: 2, color: const Color(0xff535353)),
// getOffersList.description!.toText12(maxLine: 2, color: const Color(0xff535353)),
// 8.height,
getOffersList.discount!.toText14(isBold: true, maxlines: 1),
10.height,
20.height,
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [checkDate(getOffersList.endDate!), SvgPicture.asset("assets/images/arrow_next.svg").paddingOnly(bottom: 4)],
@ -211,7 +211,7 @@ class _OffersAndDiscountsHomeState extends State<OffersAndDiscountsHome> {
if (enteredKeyword.isEmpty) {
results = getOffersList;
} else {
if(AppState().isArabic(context)) {
if (AppState().isArabic(context)) {
results = getOffersList.where((offer) => offer.titleAR!.toLowerCase().contains(enteredKeyword.toLowerCase())).toList();
} else {
results = getOffersList.where((offer) => offer.title!.toLowerCase().contains(enteredKeyword.toLowerCase())).toList();

@ -102,21 +102,39 @@ class _ItemHistoryScreenState extends State<ItemHistoryScreen> {
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: [
ItemDetailView(LocaleKeys.requestNumber.tr(), moItemHistoryList[index].rEQUESTNUMBER ?? ""),
ItemDetailView(LocaleKeys.uom.tr(), moItemHistoryList[index].uNITOFMEASURE ?? ""),
ItemDetailView(LocaleKeys.quantity.tr(), moItemHistoryList[index].qUANTITY?.toString() ?? ""),
ItemDetailView(LocaleKeys.dateRequired.tr(), moItemHistoryList[index].dATEREQUIRED ?? ""),
ItemDetailView(LocaleKeys.lineStatus.tr(), moItemHistoryList[index].lINESTATUSDIS ?? ""),
ItemDetailView(LocaleKeys.statusDate.tr(), moItemHistoryList[index].sTATUSDATE ?? ""),
ItemDetailView(LocaleKeys.transactionType.tr(), moItemHistoryList[index].tRANSACTIONTYPENAME ?? ""),
ItemDetailView(LocaleKeys.organization.tr(), moItemHistoryList[index].oRGANIZATIONNAME ?? ""),
ItemDetailView(LocaleKeys.operatingCode.tr(), moItemHistoryList[index].oRGANIZATIONCODE ?? ""),
ItemDetailView(LocaleKeys.operatingUnit.tr(), moItemHistoryList[index].oPERATINGUNITNAME ?? ""),
ItemDetailView(LocaleKeys.fromSubInventory.tr(), moItemHistoryList[index].fROMSUBINVENTORYCODE ?? ""),
ItemDetailView(LocaleKeys.fromLocator.tr(), moItemHistoryList[index].fROMLOCATOR ?? ""),
ItemDetailView(LocaleKeys.toSubInventory.tr(), moItemHistoryList[index].tOSUBINVENTORYCODE ?? ""),
ItemDetailView(LocaleKeys.toLocator.tr(), moItemHistoryList[index].tOLOCATOR ?? ""),
ItemDetailView(LocaleKeys.shipToLocation.tr(), moItemHistoryList[index].sHIPTOLOCATION ?? ""),
ItemDetailGrid(
ItemDetailViewCol(LocaleKeys.requestNumber.tr(), moItemHistoryList[index].rEQUESTNUMBER ?? ""),
ItemDetailViewCol(LocaleKeys.uom.tr(), moItemHistoryList[index].uNITOFMEASURE ?? ""),
),
ItemDetailGrid(
ItemDetailViewCol(LocaleKeys.quantity.tr(), moItemHistoryList[index].qUANTITY?.toString() ?? ""),
ItemDetailViewCol(LocaleKeys.dateRequired.tr(), moItemHistoryList[index].dATEREQUIRED ?? ""),
),
ItemDetailGrid(
ItemDetailViewCol(LocaleKeys.lineStatus.tr(), moItemHistoryList[index].lINESTATUSDIS ?? ""),
ItemDetailViewCol(LocaleKeys.statusDate.tr(), moItemHistoryList[index].sTATUSDATE ?? ""),
),
ItemDetailGrid(
ItemDetailViewCol(LocaleKeys.transactionType.tr(), moItemHistoryList[index].tRANSACTIONTYPENAME ?? ""),
ItemDetailViewCol(LocaleKeys.organization.tr(), moItemHistoryList[index].oRGANIZATIONNAME ?? ""),
),
ItemDetailGrid(
ItemDetailViewCol(LocaleKeys.operatingCode.tr(), moItemHistoryList[index].oRGANIZATIONCODE ?? ""),
ItemDetailViewCol(LocaleKeys.operatingUnit.tr(), moItemHistoryList[index].oPERATINGUNITNAME ?? ""),
),
ItemDetailGrid(
ItemDetailViewCol(LocaleKeys.fromSubInventory.tr(), moItemHistoryList[index].fROMSUBINVENTORYCODE ?? ""),
ItemDetailViewCol(LocaleKeys.fromLocator.tr(), moItemHistoryList[index].fROMLOCATOR ?? ""),
),
ItemDetailGrid(
ItemDetailViewCol(LocaleKeys.toSubInventory.tr(), moItemHistoryList[index].tOSUBINVENTORYCODE ?? ""),
ItemDetailViewCol(LocaleKeys.toLocator.tr(), moItemHistoryList[index].tOLOCATOR ?? ""),
),
ItemDetailGrid(
ItemDetailViewCol(LocaleKeys.shipToLocation.tr(), moItemHistoryList[index].sHIPTOLOCATION ?? ""),
Container(),
isItLast: true,
),
],
).objectContainerView(),
separatorBuilder: (cxt, index) => 12.height,
@ -131,21 +149,39 @@ class _ItemHistoryScreenState extends State<ItemHistoryScreen> {
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: [
ItemDetailView(LocaleKeys.operatingUnit.tr(), poItemHistoryList[index].oUNAME ?? ""),
ItemDetailView(LocaleKeys.poNumber.tr(), poItemHistoryList[index].pONUMBER ?? ""),
ItemDetailView(LocaleKeys.revision.tr(), poItemHistoryList[index].rEVISIONNUM?.toString() ?? ""),
ItemDetailView(LocaleKeys.creationDate.tr(), poItemHistoryList[index].cREATIONDATE ?? ""),
ItemDetailView(LocaleKeys.supplier.tr(), poItemHistoryList[index].sUPPLIER ?? ""),
ItemDetailView(LocaleKeys.buyer.tr(), poItemHistoryList[index].bUYER ?? ""),
ItemDetailView(LocaleKeys.uom.tr(), poItemHistoryList[index].uOM ?? ""),
ItemDetailView(LocaleKeys.quantityOrdered.tr(), poItemHistoryList[index].qUANTITYORDERED?.toString() ?? ""),
ItemDetailView(LocaleKeys.quantityReceived.tr(), poItemHistoryList[index].qUANTITYRECEIVED?.toString() ?? ""),
ItemDetailView(LocaleKeys.bonusQuantity.tr(), poItemHistoryList[index].bONUSQUANTITY?.toString() ?? ""),
ItemDetailView(LocaleKeys.purchasePrice.tr(), poItemHistoryList[index].pURCHASEPRICE?.toString() ?? ""),
ItemDetailView(LocaleKeys.discountPer.tr(), poItemHistoryList[index].dISCOUNTPERCENTAGE?.toString() ?? ""),
ItemDetailView(LocaleKeys.balanceQuantity.tr(), poItemHistoryList[index].bALANCEQUANTITY?.toString() ?? ""),
ItemDetailView(LocaleKeys.netPrice.tr(), poItemHistoryList[index].nETPRICE?.toString() ?? ""),
ItemDetailView(LocaleKeys.closureStatus.tr(), poItemHistoryList[index].cLOSEDCODE ?? ""),
ItemDetailGrid(
ItemDetailViewCol(LocaleKeys.operatingUnit.tr(), poItemHistoryList[index].oUNAME ?? ""),
ItemDetailViewCol(LocaleKeys.poNumber.tr(), poItemHistoryList[index].pONUMBER ?? ""),
),
ItemDetailGrid(
ItemDetailViewCol(LocaleKeys.revision.tr(), poItemHistoryList[index].rEVISIONNUM?.toString() ?? ""),
ItemDetailViewCol(LocaleKeys.creationDate.tr(), poItemHistoryList[index].cREATIONDATE ?? ""),
),
ItemDetailGrid(
ItemDetailViewCol(LocaleKeys.supplier.tr(), poItemHistoryList[index].sUPPLIER ?? ""),
ItemDetailViewCol(LocaleKeys.buyer.tr(), poItemHistoryList[index].bUYER ?? ""),
),
ItemDetailGrid(
ItemDetailViewCol(LocaleKeys.uom.tr(), poItemHistoryList[index].uOM ?? ""),
ItemDetailViewCol(LocaleKeys.quantityOrdered.tr(), poItemHistoryList[index].qUANTITYORDERED?.toString() ?? ""),
),
ItemDetailGrid(
ItemDetailViewCol(LocaleKeys.quantityReceived.tr(), poItemHistoryList[index].qUANTITYRECEIVED?.toString() ?? ""),
ItemDetailViewCol(LocaleKeys.bonusQuantity.tr(), poItemHistoryList[index].bONUSQUANTITY?.toString() ?? ""),
),
ItemDetailGrid(
ItemDetailViewCol(LocaleKeys.purchasePrice.tr(), poItemHistoryList[index].pURCHASEPRICE?.toString() ?? ""),
ItemDetailViewCol(LocaleKeys.discountPer.tr(), poItemHistoryList[index].dISCOUNTPERCENTAGE?.toString() ?? ""),
),
ItemDetailGrid(
ItemDetailViewCol(LocaleKeys.balanceQuantity.tr(), poItemHistoryList[index].bALANCEQUANTITY?.toString() ?? ""),
ItemDetailViewCol(LocaleKeys.netPrice.tr(), poItemHistoryList[index].nETPRICE?.toString() ?? ""),
),
ItemDetailGrid(
ItemDetailViewCol(LocaleKeys.closureStatus.tr(), poItemHistoryList[index].cLOSEDCODE ?? ""),
Container(),
isItLast: true,
)
],
).objectContainerView(),
separatorBuilder: (cxt, index) => 12.height,
@ -160,20 +196,35 @@ class _ItemHistoryScreenState extends State<ItemHistoryScreen> {
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: [
ItemDetailView(LocaleKeys.quotationNumber.tr(), quotationAnalysisList[index].qUOTNUM ?? ""),
ItemDetailView(LocaleKeys.vendorName.tr(), quotationAnalysisList[index].vENDORNAME ?? ""),
ItemDetailView(LocaleKeys.itemCode.tr(), quotationAnalysisList[index].iTEMCODE ?? ""),
ItemDetailView(LocaleKeys.description.tr(), quotationAnalysisList[index].iTEMDESC ?? ""),
ItemDetailView(LocaleKeys.quotationQty.tr(), quotationAnalysisList[index].qUOTQTY?.toString() ?? ""),
ItemDetailView(LocaleKeys.quotationUOM.tr(), quotationAnalysisList[index].qUOTUOM ?? ""),
ItemDetailView(LocaleKeys.quotationNetPrice.tr(), quotationAnalysisList[index].qUOTUNITPRICE?.toString() ?? ""),
ItemDetailView(LocaleKeys.quotationLineTotal.tr(), quotationAnalysisList[index].qUOTLINETOTAL?.toString() ?? ""),
ItemDetailView(LocaleKeys.quotationBonusQuantity.tr(), quotationAnalysisList[index].qUOTBONUSQTY ?? ""),
ItemDetailView(LocaleKeys.quotationDeliveryDate.tr(), quotationAnalysisList[index].qUOTDELIVERYDATE ?? ""),
ItemDetailView(LocaleKeys.quotationMFGPartNumber.tr(), quotationAnalysisList[index].qUOTMFGPARTNUM ?? ""),
ItemDetailView(LocaleKeys.rfqNumber.tr(), quotationAnalysisList[index].rFQNUM ?? ""),
ItemDetailView(LocaleKeys.rfqQty.tr(), quotationAnalysisList[index].rFQQTY?.toString() ?? ""),
ItemDetailView(LocaleKeys.rfqUOM.tr(), quotationAnalysisList[index].rFQUOM ?? ""),
ItemDetailGrid(
ItemDetailViewCol(LocaleKeys.quotationNumber.tr(), quotationAnalysisList[index].qUOTNUM ?? ""),
ItemDetailViewCol(LocaleKeys.vendorName.tr(), quotationAnalysisList[index].vENDORNAME ?? ""),
),
ItemDetailGrid(
ItemDetailViewCol(LocaleKeys.itemCode.tr(), quotationAnalysisList[index].iTEMCODE ?? ""),
ItemDetailViewCol(LocaleKeys.description.tr(), quotationAnalysisList[index].iTEMDESC ?? ""),
),
ItemDetailGrid(
ItemDetailViewCol(LocaleKeys.quotationQty.tr(), quotationAnalysisList[index].qUOTQTY?.toString() ?? ""),
ItemDetailViewCol(LocaleKeys.quotationUOM.tr(), quotationAnalysisList[index].qUOTUOM ?? ""),
),
ItemDetailGrid(
ItemDetailViewCol(LocaleKeys.quotationNetPrice.tr(), quotationAnalysisList[index].qUOTUNITPRICE?.toString() ?? ""),
ItemDetailViewCol(LocaleKeys.quotationLineTotal.tr(), quotationAnalysisList[index].qUOTLINETOTAL?.toString() ?? ""),
),
ItemDetailGrid(
ItemDetailViewCol(LocaleKeys.quotationBonusQuantity.tr(), quotationAnalysisList[index].qUOTBONUSQTY ?? ""),
ItemDetailViewCol(LocaleKeys.quotationDeliveryDate.tr(), quotationAnalysisList[index].qUOTDELIVERYDATE ?? ""),
),
ItemDetailGrid(
ItemDetailViewCol(LocaleKeys.quotationMFGPartNumber.tr(), quotationAnalysisList[index].qUOTMFGPARTNUM ?? ""),
ItemDetailViewCol(LocaleKeys.rfqNumber.tr(), quotationAnalysisList[index].rFQNUM ?? ""),
),
ItemDetailGrid(
ItemDetailViewCol(LocaleKeys.rfqQty.tr(), quotationAnalysisList[index].rFQQTY?.toString() ?? ""),
ItemDetailViewCol(LocaleKeys.rfqUOM.tr(), quotationAnalysisList[index].rFQUOM ?? ""),
isItLast: true,
)
],
).objectContainerView(title: "${quotationAnalysisList[index].iTEMCODE}-${quotationAnalysisList[index].iTEMDESC}"),
separatorBuilder: (cxt, index) => 12.height,

@ -14,6 +14,7 @@ import 'package:mohem_flutter_app/generated/locale_keys.g.dart';
import 'package:mohem_flutter_app/models/itg_forms_models/allowed_actions_model.dart';
import 'package:mohem_flutter_app/models/itg_forms_models/itg_request_model.dart';
import 'package:mohem_flutter_app/models/itg_forms_models/request_detail_model.dart';
import 'package:mohem_flutter_app/provider/dashboard_provider_model.dart';
import 'package:mohem_flutter_app/ui/work_list/itg_fragments/approval_level_fragment.dart';
import 'package:mohem_flutter_app/ui/work_list/itg_fragments/request_detail_fragment.dart';
import 'package:mohem_flutter_app/ui/work_list/sheets/delegate_sheet.dart';
@ -21,6 +22,7 @@ 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/button/default_button.dart';
import 'package:mohem_flutter_app/widgets/dialogs/itg_comments_dialog.dart';
import 'package:provider/provider.dart';
class ItgDetailScreen extends StatefulWidget {
ItgDetailScreen({Key? key}) : super(key: key);
@ -42,8 +44,11 @@ class _ItgDetailScreenState extends State<ItgDetailScreen> {
List<AllowedActions> allowedActionList = [];
late DashboardProviderModel providerData;
@override
void initState() {
providerData = Provider.of<DashboardProviderModel>(context, listen: false);
super.initState();
}
@ -78,6 +83,7 @@ class _ItgDetailScreenState extends State<ItgDetailScreen> {
void getDataFromState() {
if (requestDetails == null) {
requestDetails = AppState().requestAllList![AppState().itgWorkListIndex!]; // ModalRoute.of(context)!.settings.arguments as WorkListResponseModel;
providerData.itgFormsModel!.totalCount = providerData.itgFormsModel!.totalCount! - 1;
getItgData();
}
}
@ -274,16 +280,19 @@ class _ItgDetailScreenState extends State<ItgDetailScreen> {
returnActionImage = "assets/images/request_info.svg";
break;
case "ReportGenerated":
returnActionImage = "assets/images/request_info.svg";
returnActionImage = "assets/images/worklist/report_generated.svg";
break;
case "DataCorrected":
returnActionImage = "assets/images/request_info.svg";
returnActionImage = "assets/images/worklist/report_generated.svg";
break;
case "Doable":
returnActionImage = "assets/images/request_info.svg";
returnActionImage = "assets/images/worklist/doable.svg";
break;
case "NotDoable":
returnActionImage = "assets/images/request_info.svg";
returnActionImage = "assets/images/worklist/not_doable.svg";
break;
case "Answer":
returnActionImage = "assets/images/worklist/answer_hr.svg";
break;
default:
returnActionImage = "assets/images/request_info.svg";
@ -358,12 +367,11 @@ class _ItgDetailScreenState extends State<ItgDetailScreen> {
case "Answer":
performAction("Answer");
break;
case "RFC":
// do something else
case "ReportGenerated":
performDataCorrectionORReportGeneratedAction(requestDetails!.requestType!, requestDetails!.iD!, requestDetails!.itemID!, AppState().memberInformationList?.eMPLOYEENUMBER ?? "");
break;
case "UPDATE_ACTION":
// do something else
case "DataCorrected":
performDataCorrectionORReportGeneratedAction(requestDetails!.requestType!, requestDetails!.iD!, requestDetails!.itemID!, AppState().memberInformationList?.eMPLOYEENUMBER ?? "");
break;
}
setState(() {
@ -523,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) {

@ -140,7 +140,7 @@ class SelectedItemSheet extends StatelessWidget {
Future<void> performNetworkCall(BuildContext context, {String? email, String? userId}) async {
Utils.showLoading(context);
try {
await WorkListApiClient().submitComment(comment: comment, email: email, userId: userId, notificationId: notificationID, apiMode: apiMode, approverIndex: actionHistoryList!.sEQUENCE);
await WorkListApiClient().submitComment(comment: comment, email: email, userId: userId, notificationId: notificationID, apiMode: apiMode, approverIndex: actionHistoryList != null ? actionHistoryList!.sEQUENCE : null);
Utils.hideLoading(context);
// Navigator.pop(context);
// Navigator.pop(context);
@ -212,7 +212,7 @@ class SelectedItemSheet extends StatelessWidget {
: CircularAvatar(
height: 40,
width: 40,
).toShimmer()
)
: (actionHistoryList != null && actionHistoryList!.eMPLOYEEIMAGE != null)
? CircularAvatar(
height: 40,
@ -223,7 +223,7 @@ class SelectedItemSheet extends StatelessWidget {
: CircularAvatar(
height: 40,
width: 40,
).toShimmer(),
),
16.width,
Expanded(
child: (name ?? "").toText12(),

@ -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(
@ -347,6 +346,7 @@ class _WorkListScreenState extends State<WorkListScreen> {
return InkWell(
onTap: () async {
AppState().setItgWorkListIndex = index;
AppState().setItgRequestType = requestDetails.requestType;
var shouldReloadData = await Navigator.pushNamed(context, AppRoutes.itgDetail);
if (shouldReloadData != null) {
if (shouldReloadData.toString() == "delegate_reload") {

@ -404,6 +404,15 @@ class _WorkListDetailScreenState extends State<WorkListDetailScreen> {
case "UPDATE_ACTION":
returnActionImage = "assets/images/worklist/update_action.svg";
break;
case "APPROVE_AND_FORWARD":
returnActionImage = "assets/images/worklist/approve_and_forward.svg";
break;
case "FORWARD":
returnActionImage = "assets/images/worklist/forward.svg";
break;
default:
returnActionImage = "assets/images/request_info.svg";
break;
}
return returnActionImage;
@ -467,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,

@ -27,7 +27,7 @@ class ActionsFragment extends StatelessWidget {
itemCount: actionHistoryList.length,
padding: EdgeInsets.all(21),
itemBuilder: (context, index) {
return showItem(context, actionHistoryList[index]);
return showItem(context, actionHistoryList[index], index);
},
separatorBuilder: (BuildContext context, int index) {
return 12.height;
@ -36,7 +36,7 @@ class ActionsFragment extends StatelessWidget {
);
}
Widget showItem(BuildContext context, GetActionHistoryList actionHistory) {
Widget showItem(BuildContext context, GetActionHistoryList actionHistory, int index) {
return Container(
width: double.infinity,
decoration: BoxDecoration(
@ -89,7 +89,9 @@ class ActionsFragment extends StatelessWidget {
if (actionHistory.nOTIFICATIONDATE!.isNotEmpty)
DateUtil.formatDateToDate(DateUtil.convertSimpleStringDateToDateddMMyyyy(actionHistory.nOTIFICATIONDATE!), false).toText12(color: MyColors.lightTextColor),
],
)
),
10.height,
getActionDuration(index).toText11(maxLine: 1, color: const Color(0xff1FA269))
],
),
)
@ -127,8 +129,22 @@ class ActionsFragment extends StatelessWidget {
);
}
String getActionDuration(int index) {
if (actionHistoryList[index].aCTIONCODE == "SUBMIT") {
return "";
} else if(actionHistoryList[index].aCTIONCODE == "PENDING") {
DateTime dateTimeFrom = DateUtil.convertSimpleStringDateToDate(actionHistoryList[++index].nOTIFICATIONDATE!);
Duration duration = DateTime.now().difference(dateTimeFrom);
return "Action duration: " + DateUtil.formatDuration(duration);
} else {
DateTime dateTimeTo = DateUtil.convertSimpleStringDateToDate(actionHistoryList[index].nOTIFICATIONDATE!);
DateTime dateTimeFrom = DateUtil.convertSimpleStringDateToDate(actionHistoryList[++index].nOTIFICATIONDATE!);
Duration duration = dateTimeTo.difference(dateTimeFrom);
return "Action duration: " + DateUtil.formatDuration(duration);
}
}
Color getStatusColor(String code) {
print("code:$code");
if (code == "SUBMIT") {
return const Color(0xff2E303A);
} else if (code == "REJECTED") {
@ -139,7 +155,7 @@ class ActionsFragment extends StatelessWidget {
return MyColors.orange;
} else if (code == "APPROVED" || code == "APPROVE" || code == "ANSWER_INFO") {
return const Color(0xff1FA269);
} else if (code == "REQUEST_INFO"|| code == "FORWARD") {
} else if (code == "REQUEST_INFO" || code == "FORWARD") {
return const Color(0xff2E303A);
} else if (code != "SUBMIT" && code != "REJECT" && code != "PENDING") {
return MyColors.orange;

@ -7,7 +7,7 @@ import 'package:mohem_flutter_app/extensions/string_extensions.dart';
import 'package:mohem_flutter_app/extensions/widget_extensions.dart';
AppBar AppBarWidget(BuildContext context,
{required String title, bool showHomeButton = true, bool showNotificationButton = false, bool showMemberButton = false, String? image, bool, List<Widget>? actions}) {
{required String title, bool showHomeButton = true, bool showNotificationButton = false, bool showMemberButton = false, String? image, List<Widget>? actions}) {
return AppBar(
leadingWidth: 0,
// leading: GestureDetector(
@ -59,8 +59,6 @@ AppBar AppBarWidget(BuildContext context,
},
icon: const Icon(Icons.people, color: MyColors.textMixColor),
),
...actions??[]
],
);

@ -134,6 +134,7 @@ flutter:
- assets/audio/
- assets/images/
- assets/images/worklist/
- assets/images/services_icons/
- assets/images/login/
- assets/icons/chat/
- assets/images/logos/

Loading…
Cancel
Save