|
|
|
|
@ -20,6 +20,8 @@ import 'package:hmg_patient_app_new/widgets/common_bottom_sheet.dart';
|
|
|
|
|
import 'package:hmg_patient_app_new/widgets/loader/bottomsheet_loader.dart';
|
|
|
|
|
import 'package:provider/provider.dart';
|
|
|
|
|
|
|
|
|
|
import 'dart:ui' as ui;
|
|
|
|
|
|
|
|
|
|
class MyInvoicesDetailsPage extends StatefulWidget {
|
|
|
|
|
GetInvoiceDetailsResponseModel getInvoiceDetailsResponseModel;
|
|
|
|
|
GetInvoicesListResponseModel getInvoicesListResponseModel;
|
|
|
|
|
@ -147,7 +149,7 @@ class _MyInvoicesDetailsPageState extends State<MyInvoicesDetailsPage> {
|
|
|
|
|
child: Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
(getIt<AppState>().isArabic() ? widget.getInvoiceDetailsResponseModel.doctorNameN! : widget.getInvoiceDetailsResponseModel.doctorName!).toText16(isBold: true),
|
|
|
|
|
(getIt<AppState>().isArabic() ? widget.getInvoiceDetailsResponseModel.doctorNameN ?? LocaleKeys.doctor.tr(context: context) : widget.getInvoiceDetailsResponseModel.doctorName!).toText16(isBold: true),
|
|
|
|
|
SizedBox(height: 8.h),
|
|
|
|
|
Wrap(
|
|
|
|
|
direction: Axis.horizontal,
|
|
|
|
|
@ -155,23 +157,28 @@ class _MyInvoicesDetailsPageState extends State<MyInvoicesDetailsPage> {
|
|
|
|
|
runSpacing: 6.h,
|
|
|
|
|
children: [
|
|
|
|
|
AppCustomChipWidget(
|
|
|
|
|
labelText: "${LocaleKeys.invoiceNo}: ${widget.getInvoiceDetailsResponseModel.invoiceNo!}",
|
|
|
|
|
labelText: "${LocaleKeys.invoiceNo.tr(context: context)}: ${widget.getInvoiceDetailsResponseModel.invoiceNo!}",
|
|
|
|
|
labelPadding: EdgeInsetsDirectional.only(start: 6.w, end: 6.w),
|
|
|
|
|
isEnglishOnly: true,
|
|
|
|
|
),
|
|
|
|
|
AppCustomChipWidget(
|
|
|
|
|
labelText: (widget.getInvoiceDetailsResponseModel.clinicDescription!.length > 15
|
|
|
|
|
labelText: ((getIt<AppState>().isArabic() ? widget.getInvoiceDetailsResponseModel.clinicDescriptionN : widget.getInvoiceDetailsResponseModel.clinicDescription ?? "")!.length > 15
|
|
|
|
|
? '${widget.getInvoiceDetailsResponseModel.clinicDescription!.substring(0, 12)}...'
|
|
|
|
|
: widget.getInvoiceDetailsResponseModel.clinicDescription!),
|
|
|
|
|
: getIt<AppState>().isArabic() ? widget.getInvoiceDetailsResponseModel.clinicDescriptionN : widget.getInvoiceDetailsResponseModel.clinicDescription ?? ""),
|
|
|
|
|
labelPadding: EdgeInsetsDirectional.only(start: 4.w, end: 4.w),
|
|
|
|
|
),
|
|
|
|
|
AppCustomChipWidget(
|
|
|
|
|
labelText: widget.getInvoiceDetailsResponseModel.projectName!,
|
|
|
|
|
labelPadding: EdgeInsetsDirectional.only(start: 6.w, end: 6.w),
|
|
|
|
|
),
|
|
|
|
|
AppCustomChipWidget(
|
|
|
|
|
labelPadding: EdgeInsetsDirectional.only(start: -4.w, end: 6.w),
|
|
|
|
|
icon: AppAssets.doctor_calendar_icon,
|
|
|
|
|
labelText: DateUtil.formatDateToDate(DateUtil.convertStringToDate(widget.getInvoiceDetailsResponseModel.appointmentDate), false),
|
|
|
|
|
Directionality(
|
|
|
|
|
textDirection: ui.TextDirection.ltr,
|
|
|
|
|
child: AppCustomChipWidget(
|
|
|
|
|
labelPadding: EdgeInsetsDirectional.only(start: -4.w, end: 6.w),
|
|
|
|
|
icon: AppAssets.doctor_calendar_icon,
|
|
|
|
|
labelText: DateUtil.formatDateToDate(DateUtil.convertStringToDate(widget.getInvoiceDetailsResponseModel.appointmentDate), false),
|
|
|
|
|
isEnglishOnly: true,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
@ -196,12 +203,12 @@ class _MyInvoicesDetailsPageState extends State<MyInvoicesDetailsPage> {
|
|
|
|
|
child: Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
"Insurance Details".toText16(isBold: true),
|
|
|
|
|
LocaleKeys.insurance.tr(context: context).toText16(isBold: true),
|
|
|
|
|
SizedBox(height: 16.h),
|
|
|
|
|
widget.getInvoiceDetailsResponseModel.groupName!.toText14(isBold: true),
|
|
|
|
|
(getIt<AppState>().isArabic() ? widget.getInvoiceDetailsResponseModel.groupNameN : widget.getInvoiceDetailsResponseModel.groupName)!.toText14(isBold: true),
|
|
|
|
|
Row(
|
|
|
|
|
children: [
|
|
|
|
|
Expanded(child: widget.getInvoiceDetailsResponseModel.companyName!.toText14(isBold: true)),
|
|
|
|
|
Expanded(child: (widget.getInvoiceDetailsResponseModel.companyName ?? "").toText14(isBold: true)),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
SizedBox(height: 12.h),
|
|
|
|
|
@ -210,6 +217,7 @@ class _MyInvoicesDetailsPageState extends State<MyInvoicesDetailsPage> {
|
|
|
|
|
AppCustomChipWidget(
|
|
|
|
|
labelText: "Insurance ID: ${widget.getInvoiceDetailsResponseModel.insuranceID ?? "-"}",
|
|
|
|
|
labelPadding: EdgeInsetsDirectional.only(start: 6.w, end: 6.w),
|
|
|
|
|
isEnglishOnly: true,
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
@ -254,9 +262,9 @@ class _MyInvoicesDetailsPageState extends State<MyInvoicesDetailsPage> {
|
|
|
|
|
child: Row(
|
|
|
|
|
children: [
|
|
|
|
|
Expanded(flex: 3, child: (consultation.procedureName ?? '-').toText12(fontWeight: FontWeight.w500)),
|
|
|
|
|
Expanded(flex: 1, child: '${consultation.quantity ?? '-'}'.toText12(fontWeight: FontWeight.w500, isCenter: true)),
|
|
|
|
|
Expanded(flex: 2, child: '${consultation.price ?? '-'}'.toText12(fontWeight: FontWeight.w500, isCenter: true)),
|
|
|
|
|
Expanded(flex: 2, child: '${consultation.total ?? '-'}'.toText12(fontWeight: FontWeight.w500, isCenter: true)),
|
|
|
|
|
Expanded(flex: 1, child: '${consultation.quantity ?? '-'}'.toText12(fontWeight: FontWeight.w500, isCenter: true, isEnglishOnly: true)),
|
|
|
|
|
Expanded(flex: 2, child: (NumberFormat.decimalPattern().format(consultation.price) ?? '-').toText12(fontWeight: FontWeight.w500, isCenter: true, isEnglishOnly: true)),
|
|
|
|
|
Expanded(flex: 2, child: (NumberFormat.decimalPattern().format(consultation.total) ?? '-').toText12(fontWeight: FontWeight.w500, isCenter: true, isEnglishOnly: true)),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
@ -290,7 +298,8 @@ class _MyInvoicesDetailsPageState extends State<MyInvoicesDetailsPage> {
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
|
children: [
|
|
|
|
|
LocaleKeys.amountBeforeTax.tr(context: context).toText14(isBold: true),
|
|
|
|
|
Utils.getPaymentAmountWithSymbol(widget.getInvoiceDetailsResponseModel.listConsultation!.first.totalShare.toString().toText16(isBold: true), AppColors.blackColor, 13,
|
|
|
|
|
Utils.getPaymentAmountWithSymbol(
|
|
|
|
|
NumberFormat.decimalPattern().format(widget.getInvoiceDetailsResponseModel.listConsultation!.first.totalShare).toString().toText16(isBold: true, isEnglishOnly: true), AppColors.blackColor, 13,
|
|
|
|
|
isSaudiCurrency: true),
|
|
|
|
|
],
|
|
|
|
|
).paddingSymmetrical(24.h, 0.h),
|
|
|
|
|
@ -299,7 +308,12 @@ class _MyInvoicesDetailsPageState extends State<MyInvoicesDetailsPage> {
|
|
|
|
|
children: [
|
|
|
|
|
LocaleKeys.vat15.tr(context: context).toText14(isBold: true, color: AppColors.greyTextColor),
|
|
|
|
|
Utils.getPaymentAmountWithSymbol(
|
|
|
|
|
widget.getInvoiceDetailsResponseModel.listConsultation!.first.totalVATAmount!.toString().toText14(isBold: true, color: AppColors.greyTextColor), AppColors.greyTextColor, 13,
|
|
|
|
|
NumberFormat.decimalPattern()
|
|
|
|
|
.format(widget.getInvoiceDetailsResponseModel.listConsultation!.first.totalVATAmount!)
|
|
|
|
|
.toString()
|
|
|
|
|
.toText14(isBold: true, color: AppColors.greyTextColor, isEnglishOnly: true),
|
|
|
|
|
AppColors.greyTextColor,
|
|
|
|
|
13,
|
|
|
|
|
isSaudiCurrency: true),
|
|
|
|
|
],
|
|
|
|
|
).paddingSymmetrical(24.h, 0.h),
|
|
|
|
|
@ -308,7 +322,11 @@ class _MyInvoicesDetailsPageState extends State<MyInvoicesDetailsPage> {
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
|
children: [
|
|
|
|
|
LocaleKeys.discount.tr(context: context).toText14(isBold: true),
|
|
|
|
|
Utils.getPaymentAmountWithSymbol(widget.getInvoiceDetailsResponseModel.listConsultation!.first.discountAmount!.toString().toText14(isBold: true, color: AppColors.primaryRedColor),
|
|
|
|
|
Utils.getPaymentAmountWithSymbol(
|
|
|
|
|
NumberFormat.decimalPattern()
|
|
|
|
|
.format(widget.getInvoiceDetailsResponseModel.listConsultation!.first.discountAmount!)
|
|
|
|
|
.toString()
|
|
|
|
|
.toText14(isBold: true, color: AppColors.primaryRedColor, isEnglishOnly: true),
|
|
|
|
|
AppColors.primaryRedColor, 13,
|
|
|
|
|
isSaudiCurrency: true),
|
|
|
|
|
],
|
|
|
|
|
@ -318,7 +336,9 @@ class _MyInvoicesDetailsPageState extends State<MyInvoicesDetailsPage> {
|
|
|
|
|
children: [
|
|
|
|
|
LocaleKeys.paid.tr(context: context).toText14(isBold: true),
|
|
|
|
|
Utils.getPaymentAmountWithSymbol(
|
|
|
|
|
widget.getInvoiceDetailsResponseModel.listConsultation!.first.grandTotal!.toString().toText14(isBold: true, color: AppColors.textColor), AppColors.textColor, 13,
|
|
|
|
|
NumberFormat.decimalPattern().format(widget.getInvoiceDetailsResponseModel.listConsultation!.first.grandTotal!).toString().toText14(isBold: true, color: AppColors.textColor, isEnglishOnly: true),
|
|
|
|
|
AppColors.textColor,
|
|
|
|
|
13,
|
|
|
|
|
isSaudiCurrency: true),
|
|
|
|
|
],
|
|
|
|
|
).paddingSymmetrical(24.h, 0.h),
|
|
|
|
|
|