|
|
|
|
@ -233,35 +233,37 @@ class _MyInvoicesListState extends State<MyInvoicesList> {
|
|
|
|
|
child: InvoiceListCard(
|
|
|
|
|
getInvoicesListResponseModel: myInvoicesVM.allInvoicesList[index],
|
|
|
|
|
onTap: () async {
|
|
|
|
|
if (Utils.isVidaPlusProject(myInvoicesVM.allInvoicesList[index].projectId ?? 0)) {
|
|
|
|
|
LoaderBottomSheet.showLoader(loadingText: LocaleKeys.sendingEmailPleaseWait.tr(context: context));
|
|
|
|
|
await myInvoicesViewModel.sendInvoiceEmail(
|
|
|
|
|
appointmentNo: myInvoicesVM.allInvoicesList[index].appointmentNo!,
|
|
|
|
|
projectID: myInvoicesVM.allInvoicesList[index].projectId!,
|
|
|
|
|
onSuccess: (val) {
|
|
|
|
|
LoaderBottomSheet.hideLoader();
|
|
|
|
|
showCommonBottomSheetWithoutHeight(context,
|
|
|
|
|
child: Utils.getSuccessWidget(loadingText: LocaleKeys.emailSentSuccessfullyMessage.tr(context: context)),
|
|
|
|
|
callBackFunc: () {},
|
|
|
|
|
isFullScreen: false,
|
|
|
|
|
isCloseButtonVisible: true,
|
|
|
|
|
isAutoDismiss: true);
|
|
|
|
|
},
|
|
|
|
|
onError: (err) {
|
|
|
|
|
LoaderBottomSheet.hideLoader();
|
|
|
|
|
showCommonBottomSheetWithoutHeight(
|
|
|
|
|
context,
|
|
|
|
|
child: Utils.getErrorWidget(loadingText: err),
|
|
|
|
|
callBackFunc: () {},
|
|
|
|
|
isFullScreen: false,
|
|
|
|
|
isCloseButtonVisible: true,
|
|
|
|
|
);
|
|
|
|
|
});
|
|
|
|
|
} else {
|
|
|
|
|
// if (Utils.isVidaPlusProject(myInvoicesVM.allInvoicesList[index].projectId ?? 0)) {
|
|
|
|
|
// LoaderBottomSheet.showLoader(loadingText: LocaleKeys.sendingEmailPleaseWait.tr(context: context));
|
|
|
|
|
// await myInvoicesViewModel.sendInvoiceEmail(
|
|
|
|
|
// appointmentNo: myInvoicesVM.allInvoicesList[index].appointmentNo!,
|
|
|
|
|
// projectID: myInvoicesVM.allInvoicesList[index].projectId!,
|
|
|
|
|
// onSuccess: (val) {
|
|
|
|
|
// LoaderBottomSheet.hideLoader();
|
|
|
|
|
// showCommonBottomSheetWithoutHeight(context,
|
|
|
|
|
// child: Utils.getSuccessWidget(loadingText: LocaleKeys.emailSentSuccessfullyMessage.tr(context: context)),
|
|
|
|
|
// callBackFunc: () {},
|
|
|
|
|
// isFullScreen: false,
|
|
|
|
|
// isCloseButtonVisible: true,
|
|
|
|
|
// isAutoDismiss: true);
|
|
|
|
|
// },
|
|
|
|
|
// onError: (err) {
|
|
|
|
|
// LoaderBottomSheet.hideLoader();
|
|
|
|
|
// showCommonBottomSheetWithoutHeight(
|
|
|
|
|
// context,
|
|
|
|
|
// child: Utils.getErrorWidget(loadingText: err),
|
|
|
|
|
// callBackFunc: () {},
|
|
|
|
|
// isFullScreen: false,
|
|
|
|
|
// isCloseButtonVisible: true,
|
|
|
|
|
// );
|
|
|
|
|
// });
|
|
|
|
|
// } else {
|
|
|
|
|
LoaderBottomSheet.showLoader(loadingText: LocaleKeys.loadingText.tr(context: context));
|
|
|
|
|
myInvoicesViewModel.downloadInvoicePDF(
|
|
|
|
|
setupId: myInvoicesVM.allInvoicesList[index].setupId!,
|
|
|
|
|
invoiceNo: myInvoicesVM.allInvoicesList[index].invoiceNo!,
|
|
|
|
|
invoiceNo: Utils.isVidaPlusProject(myInvoicesVM.allInvoicesList[index].projectId ?? 0)
|
|
|
|
|
? myInvoicesVM.allInvoicesList[index].invoiceNoVP!
|
|
|
|
|
: myInvoicesVM.allInvoicesList[index].invoiceNo!,
|
|
|
|
|
projectID: myInvoicesVM.allInvoicesList[index].projectId!,
|
|
|
|
|
onError: (err) {
|
|
|
|
|
LoaderBottomSheet.hideLoader();
|
|
|
|
|
@ -291,7 +293,7 @@ class _MyInvoicesListState extends State<MyInvoicesList> {
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
// }
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
|