From d554d01875d620f90819c25c1afe019efb7d38bc Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Tue, 10 Nov 2026 09:33:29 +0300 Subject: [PATCH] updates --- .../get_invoices_list_response_model.dart | 3 + .../home/widgets/occasion_banner_widget.dart | 5 +- .../my_invoices/my_invoices_list.dart | 56 ++++++++++--------- .../widgets/invoice_list_card.dart | 10 ++-- 4 files changed, 42 insertions(+), 32 deletions(-) diff --git a/lib/features/my_invoices/models/get_invoices_list_response_model.dart b/lib/features/my_invoices/models/get_invoices_list_response_model.dart index a3c9858c..64f82e69 100644 --- a/lib/features/my_invoices/models/get_invoices_list_response_model.dart +++ b/lib/features/my_invoices/models/get_invoices_list_response_model.dart @@ -10,6 +10,7 @@ class GetInvoicesListResponseModel { int? clinicId; int? doctorId; int? invoiceNo; + int? invoiceNoVP; int? status; String? arrivedOn; String? doctorName; @@ -32,6 +33,7 @@ class GetInvoicesListResponseModel { this.clinicId, this.doctorId, this.invoiceNo, + this.invoiceNoVP, this.status, this.arrivedOn, this.doctorName, @@ -59,6 +61,7 @@ class GetInvoicesListResponseModel { clinicId: json["ClinicID"], doctorId: json["DoctorID"], invoiceNo: json["InvoiceNo"], + invoiceNoVP: json["InvoiceNo_VP"], status: json["Status"], arrivedOn: json["ArrivedOn"], doctorName: json["DoctorName"], diff --git a/lib/presentation/home/widgets/occasion_banner_widget.dart b/lib/presentation/home/widgets/occasion_banner_widget.dart index 89429d35..c85221e1 100644 --- a/lib/presentation/home/widgets/occasion_banner_widget.dart +++ b/lib/presentation/home/widgets/occasion_banner_widget.dart @@ -39,7 +39,10 @@ class OccasionBannerWidget extends StatelessWidget { } return GestureDetector( - onTap: (headerLinkUrl?.isNotEmpty ?? false) ? () => Utils.openWebView(url: headerLinkUrl!) : null, + onTap: (headerLinkUrl?.isNotEmpty ?? false) ? () { + + Utils.openWebView(url: headerLinkUrl!); + } : null, child: buildOccasionImage(headerImageUrl!).paddingOnly(bottom: 16.h), ); }, diff --git a/lib/presentation/my_invoices/my_invoices_list.dart b/lib/presentation/my_invoices/my_invoices_list.dart index 95ff3e16..0e910a05 100644 --- a/lib/presentation/my_invoices/my_invoices_list.dart +++ b/lib/presentation/my_invoices/my_invoices_list.dart @@ -233,35 +233,37 @@ class _MyInvoicesListState extends State { 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 { } }, ); - } + // } }, ), ), diff --git a/lib/presentation/my_invoices/widgets/invoice_list_card.dart b/lib/presentation/my_invoices/widgets/invoice_list_card.dart index 8fea72fc..d5d222c7 100644 --- a/lib/presentation/my_invoices/widgets/invoice_list_card.dart +++ b/lib/presentation/my_invoices/widgets/invoice_list_card.dart @@ -154,7 +154,7 @@ class InvoiceListCard extends StatelessWidget { runSpacing: 6.h, children: [ AppCustomChipWidget( - labelText: "${LocaleKeys.invoiceNo.tr(context: context)}: ${getInvoicesListResponseModel.invoiceNo ?? '-'}", + labelText: "${LocaleKeys.invoiceNo.tr(context: context)}: ${ Utils.isVidaPlusProject(getInvoicesListResponseModel.projectId ?? 0) ? getInvoicesListResponseModel.invoiceNoVP : getInvoicesListResponseModel.invoiceNo ?? '-'}", labelPadding: EdgeInsetsDirectional.only(start: 6.w, end: 6.w), isEnglishOnly: true, ), @@ -193,9 +193,11 @@ class InvoiceListCard extends StatelessWidget { Expanded( child: CustomButton( // text: LocaleKeys.viewInvoiceDetails.tr(context: context), - text: Utils.isVidaPlusProject(getInvoicesListResponseModel.projectId ?? 0) - ? LocaleKeys.sendEmail.tr(context: context) - : LocaleKeys.downloadInvoice.tr(context: context), + text: + // Utils.isVidaPlusProject(getInvoicesListResponseModel.projectId ?? 0) + // ? LocaleKeys.sendEmail.tr(context: context) + // : + LocaleKeys.downloadInvoice.tr(context: context), onPressed: () { if (onTap != null) { onTap!();