Leave balance fix, Items for sale fix

merge-requests/18/head
haroon amjad 3 years ago
parent 847b9df6fc
commit f07167e734

@ -109,14 +109,14 @@ class _AddLeaveBalanceScreenState extends State<AddLeaveBalanceScreen> {
} }
} }
await LeaveBalanceApiClient().validateAbsenceTransaction(selectedAbsenceType!.dESCFLEXCONTEXTCODE!, "HR_LOA_SS", selectedAbsenceType!.aBSENCEATTENDANCETYPEID!, 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, selectedReplacementEmployee != null ? selectedReplacementEmployee!.userName! : "", DateUtil.getFormattedDate(startDateTime!, "MM/dd/yyyy"), DateUtil.getFormattedDate(endDateTime!, "MM/dd/yyyy"), -999, dffDataMap,
comments: comment); comments: comment);
SumbitAbsenceTransactionList submit = await LeaveBalanceApiClient().submitAbsenceTransaction( SumbitAbsenceTransactionList submit = await LeaveBalanceApiClient().submitAbsenceTransaction(
selectedAbsenceType!.dESCFLEXCONTEXTCODE!, selectedAbsenceType!.dESCFLEXCONTEXTCODE!,
"HR_LOA_SS", "HR_LOA_SS",
selectedAbsenceType!.aBSENCEATTENDANCETYPEID!, selectedAbsenceType!.aBSENCEATTENDANCETYPEID!,
selectedReplacementEmployee!.userName!, selectedReplacementEmployee != null ? selectedReplacementEmployee!.userName! : "",
DateUtil.getFormattedDate(startDateTime!, "MM/dd/yyyy"), DateUtil.getFormattedDate(startDateTime!, "MM/dd/yyyy"),
DateUtil.getFormattedDate(endDateTime!, "MM/dd/yyyy"), DateUtil.getFormattedDate(endDateTime!, "MM/dd/yyyy"),
-999, -999,
@ -126,9 +126,9 @@ class _AddLeaveBalanceScreenState extends State<AddLeaveBalanceScreen> {
Utils.hideLoading(context); Utils.hideLoading(context);
await Navigator.pushNamed(context, AppRoutes.requestSubmitScreen, arguments: RequestSubmitScreenParams(LocaleKeys.submit.tr(), submit.pTRANSACTIONID!, "", "add_leave_balance")); await Navigator.pushNamed(context, AppRoutes.requestSubmitScreen, arguments: RequestSubmitScreenParams(LocaleKeys.submit.tr(), submit.pTRANSACTIONID!, "", "add_leave_balance"));
Utils.showLoading(context); // Utils.showLoading(context);
await LeaveBalanceApiClient().cancelHrTransaction(submit.pTRANSACTIONID!); await LeaveBalanceApiClient().cancelHrTransaction(submit.pTRANSACTIONID!);
Utils.hideLoading(context); // Utils.hideLoading(context);
} catch (ex) { } catch (ex) {
Utils.hideLoading(context); Utils.hideLoading(context);
Utils.handleException(ex, context, null); Utils.handleException(ex, context, null);

@ -189,7 +189,7 @@ class _AddItemDetailsFragmentState extends State<AddItemDetailsFragment> {
title.toText16().expanded, title.toText16().expanded,
6.width, 6.width,
SimpleButton(LocaleKeys.add.tr(), () { SimpleButton(LocaleKeys.add.tr(), () {
ImageOptions.showImageOptionsNew(context, (String image, File file) { ImageOptions.showImageOptionsNew(context, false, (String image, File file) {
setState(() { setState(() {
images.add(image); images.add(image);
Navigator.of(context).pop(); Navigator.of(context).pop();
@ -272,15 +272,15 @@ class _AddItemDetailsFragmentState extends State<AddItemDetailsFragment> {
} }
void getRegions() async { void getRegions() async {
// try { try {
Utils.showLoading(context); Utils.showLoading(context);
getRegionsList = await ItemsForSaleApiClient().getRegions(); getRegionsList = await ItemsForSaleApiClient().getRegions();
await getAdDetails(); await getAdDetails();
Utils.hideLoading(context); Utils.hideLoading(context);
setState(() {}); setState(() {});
// } catch (ex) { } catch (ex) {
// Utils.hideLoading(context); Utils.hideLoading(context);
// Utils.handleException(ex, context, null); Utils.handleException(ex, context, null);
// } }
} }
} }

@ -182,6 +182,7 @@ class _WorkListScreenState extends State<WorkListScreen> {
getWorkList(showLoading: false), getWorkList(showLoading: false),
]); ]);
calculateCounter(); calculateCounter();
Utils.hideLoading(context);
setState(() {}); setState(() {});
} catch (ex) { } catch (ex) {
Utils.hideLoading(context); Utils.hideLoading(context);

@ -8,8 +8,9 @@ class AttachmentOptions extends StatelessWidget {
VoidCallback onCameraTap; VoidCallback onCameraTap;
VoidCallback onGalleryTap; VoidCallback onGalleryTap;
VoidCallback onFilesTap; VoidCallback onFilesTap;
bool showFilesOption;
AttachmentOptions({Key? key, required this.onCameraTap, required this.onGalleryTap, required this.onFilesTap}) : super(key: key); AttachmentOptions({Key? key, required this.onCameraTap, required this.onGalleryTap, required this.onFilesTap, this.showFilesOption = true}) : super(key: key);
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -28,7 +29,7 @@ class AttachmentOptions extends StatelessWidget {
children: [ children: [
itemView("open_camera.svg", "Open\nCamera", onCameraTap), itemView("open_camera.svg", "Open\nCamera", onCameraTap),
itemView("gallery.svg", "Upload from\nGallery", onGalleryTap), itemView("gallery.svg", "Upload from\nGallery", onGalleryTap),
itemView("files.svg", "Upload from\nFiles", onFilesTap), if (showFilesOption) itemView("files.svg", "Upload from\nFiles", onFilesTap),
], ],
) )
], ],

@ -10,10 +10,11 @@ import 'package:mohem_flutter_app/widgets/bottom_sheet.dart';
import 'package:mohem_flutter_app/widgets/bottom_sheets/attachment_options.dart'; import 'package:mohem_flutter_app/widgets/bottom_sheets/attachment_options.dart';
class ImageOptions { class ImageOptions {
static void showImageOptionsNew(BuildContext context, Function(String, File) image) { static void showImageOptionsNew(BuildContext context, bool showFilesOption, Function(String, File) image) {
showMyBottomSheet( showMyBottomSheet(
context, context,
child: AttachmentOptions( child: AttachmentOptions(
showFilesOption: showFilesOption,
onCameraTap: () async { onCameraTap: () async {
if (Platform.isAndroid) { if (Platform.isAndroid) {
cameraImageAndroid(image); cameraImageAndroid(image);

Loading…
Cancel
Save