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!,
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);
SumbitAbsenceTransactionList submit = await LeaveBalanceApiClient().submitAbsenceTransaction(
selectedAbsenceType!.dESCFLEXCONTEXTCODE!,
"HR_LOA_SS",
selectedAbsenceType!.aBSENCEATTENDANCETYPEID!,
selectedReplacementEmployee!.userName!,
selectedReplacementEmployee != null ? selectedReplacementEmployee!.userName! : "",
DateUtil.getFormattedDate(startDateTime!, "MM/dd/yyyy"),
DateUtil.getFormattedDate(endDateTime!, "MM/dd/yyyy"),
-999,
@ -126,9 +126,9 @@ class _AddLeaveBalanceScreenState extends State<AddLeaveBalanceScreen> {
Utils.hideLoading(context);
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!);
Utils.hideLoading(context);
// Utils.hideLoading(context);
} catch (ex) {
Utils.hideLoading(context);
Utils.handleException(ex, context, null);

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

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

@ -8,8 +8,9 @@ class AttachmentOptions extends StatelessWidget {
VoidCallback onCameraTap;
VoidCallback onGalleryTap;
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
Widget build(BuildContext context) {
@ -28,7 +29,7 @@ class AttachmentOptions extends StatelessWidget {
children: [
itemView("open_camera.svg", "Open\nCamera", onCameraTap),
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';
class ImageOptions {
static void showImageOptionsNew(BuildContext context, Function(String, File) image) {
static void showImageOptionsNew(BuildContext context, bool showFilesOption, Function(String, File) image) {
showMyBottomSheet(
context,
child: AttachmentOptions(
showFilesOption: showFilesOption,
onCameraTap: () async {
if (Platform.isAndroid) {
cameraImageAndroid(image);

Loading…
Cancel
Save