my invoice updated

dev_sultan
Sultan khan 19 hours ago
parent 6d647d75be
commit 3d1c415e2c

@ -826,8 +826,8 @@ var FILTERED_PRODUCTS = 'products?categoryids=';
var GET_DOCTOR_LIST_CALCULATION = "Services/Doctors.svc/REST/GetCallculationDoctors"; var GET_DOCTOR_LIST_CALCULATION = "Services/Doctors.svc/REST/GetCallculationDoctors";
var GET_ALL_APPOINTMENTS_FOR_DENTAL_CLINIC = "Services/Patients.svc/REST/GetDentalAppointments"; // var GET_ALL_APPOINTMENTS_FOR_DENTAL_CLINIC = "Services/Patients.svc/REST/GetDentalAppointments";
var GET_ALL_APPOINTMENTS_FOR_DENTAL_CLINIC ='Services/Patients.svc/REST/GetAllInvoices';
var GET_DENTAL_APPOINTMENT_INVOICE = "Services/Patients.svc/REST/HIS_eInvoiceForDentalByAppointmentNo"; var GET_DENTAL_APPOINTMENT_INVOICE = "Services/Patients.svc/REST/HIS_eInvoiceForDentalByAppointmentNo";
var SEND_DENTAL_APPOINTMENT_INVOICE_EMAIL = "Services/Notifications.svc/REST/SendInvoiceForDental"; var SEND_DENTAL_APPOINTMENT_INVOICE_EMAIL = "Services/Notifications.svc/REST/SendInvoiceForDental";

@ -1,88 +1,93 @@
import 'dart:convert';
class GetInvoicesListResponseModel { class GetInvoicesListResponseModel {
String? setupId; String? setupId;
int? projectID; int? projectId;
int? patientID; int? patientId;
int? appointmentNo; int? appointmentNo;
String? appointmentDate; String? appointmentDate;
String? appointmentDateN; dynamic appointmentDateN;
int? clinicID; int? clinicId;
int? doctorID; int? doctorId;
int? invoiceNo; int? invoiceNo;
int? status; int? status;
String? arrivedOn; String? arrivedOn;
String? doctorName; String? doctorName;
String? doctorNameN; String? doctorNameN;
String? clinicName; String? clinicName;
num? decimalDoctorRate; double? decimalDoctorRate;
String? doctorImageURL; String? doctorImageUrl;
num? doctorRate; int? doctorRate;
num? patientNumber; int? patientNumber;
String? projectName; String? projectName;
GetInvoicesListResponseModel( GetInvoicesListResponseModel({
{this.setupId, this.setupId,
this.projectID, this.projectId,
this.patientID, this.patientId,
this.appointmentNo, this.appointmentNo,
this.appointmentDate, this.appointmentDate,
this.appointmentDateN, this.appointmentDateN,
this.clinicID, this.clinicId,
this.doctorID, this.doctorId,
this.invoiceNo, this.invoiceNo,
this.status, this.status,
this.arrivedOn, this.arrivedOn,
this.doctorName, this.doctorName,
this.doctorNameN, this.doctorNameN,
this.clinicName, this.clinicName,
this.decimalDoctorRate, this.decimalDoctorRate,
this.doctorImageURL, this.doctorImageUrl,
this.doctorRate, this.doctorRate,
this.patientNumber, this.patientNumber,
this.projectName}); this.projectName,
});
factory GetInvoicesListResponseModel.fromRawJson(String str) => GetInvoicesListResponseModel.fromJson(json.decode(str));
String toRawJson() => json.encode(toJson());
GetInvoicesListResponseModel.fromJson(Map<String, dynamic> json) { factory GetInvoicesListResponseModel.fromJson(Map<String, dynamic> json) => GetInvoicesListResponseModel(
setupId = json['SetupId']; setupId: json["SetupId"],
projectID = json['ProjectID']; projectId: json["ProjectID"],
patientID = json['PatientID']; patientId: json["PatientID"],
appointmentNo = json['AppointmentNo']; appointmentNo: json["AppointmentNo"],
appointmentDate = json['AppointmentDate']; appointmentDate: json["AppointmentDate"],
appointmentDateN = json['AppointmentDateN']; appointmentDateN: json["AppointmentDateN"],
clinicID = json['ClinicID']; clinicId: json["ClinicID"],
doctorID = json['DoctorID']; doctorId: json["DoctorID"],
invoiceNo = json['InvoiceNo']; invoiceNo: json["InvoiceNo"],
status = json['Status']; status: json["Status"],
arrivedOn = json['ArrivedOn']; arrivedOn: json["ArrivedOn"],
doctorName = json['DoctorName']; doctorName: json["DoctorName"],
doctorNameN = json['DoctorNameN']; doctorNameN: json["DoctorNameN"],
clinicName = json['ClinicName']; clinicName: json["ClinicName"],
decimalDoctorRate = json['DecimalDoctorRate']; decimalDoctorRate: json["DecimalDoctorRate"]?.toDouble(),
doctorImageURL = json['DoctorImageURL']; doctorImageUrl: json["DoctorImageURL"],
doctorRate = json['DoctorRate']; doctorRate: json["DoctorRate"],
patientNumber = json['PatientNumber']; patientNumber: json["PatientNumber"],
projectName = json['ProjectName']; projectName: json["ProjectName"],
} );
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() => {
final Map<String, dynamic> data = <String, dynamic>{}; "SetupId": setupId,
data['SetupId'] = this.setupId; "ProjectID": projectId,
data['ProjectID'] = this.projectID; "PatientID": patientId,
data['PatientID'] = this.patientID; "AppointmentNo": appointmentNo,
data['AppointmentNo'] = this.appointmentNo; "AppointmentDate": appointmentDate,
data['AppointmentDate'] = this.appointmentDate; "AppointmentDateN": appointmentDateN,
data['AppointmentDateN'] = this.appointmentDateN; "ClinicID": clinicId,
data['ClinicID'] = this.clinicID; "DoctorID": doctorId,
data['DoctorID'] = this.doctorID; "InvoiceNo": invoiceNo,
data['InvoiceNo'] = this.invoiceNo; "Status": status,
data['Status'] = this.status; "ArrivedOn": arrivedOn,
data['ArrivedOn'] = this.arrivedOn; "DoctorName": doctorName,
data['DoctorName'] = this.doctorName; "DoctorNameN": doctorNameN,
data['DoctorNameN'] = this.doctorNameN; "ClinicName": clinicName,
data['ClinicName'] = this.clinicName; "DecimalDoctorRate": decimalDoctorRate,
data['DecimalDoctorRate'] = this.decimalDoctorRate; "DoctorImageURL": doctorImageUrl,
data['DoctorImageURL'] = this.doctorImageURL; "DoctorRate": doctorRate,
data['DoctorRate'] = this.doctorRate; "PatientNumber": patientNumber,
data['PatientNumber'] = this.patientNumber; "ProjectName": projectName,
data['ProjectName'] = this.projectName; };
return data;
}
} }

@ -38,7 +38,7 @@ class MyInvoicesRepoImp implements MyInvoicesRepo {
}, },
onSuccess: (response, statusCode, {messageStatus, errorMessage}) { onSuccess: (response, statusCode, {messageStatus, errorMessage}) {
try { try {
final list = response['List_DentalAppointments']; final list = response['List_AllInvoices'];
final invoicesList = list.map((item) => GetInvoicesListResponseModel.fromJson(item as Map<String, dynamic>)).toList().cast<GetInvoicesListResponseModel>(); final invoicesList = list.map((item) => GetInvoicesListResponseModel.fromJson(item as Map<String, dynamic>)).toList().cast<GetInvoicesListResponseModel>();

@ -330,6 +330,7 @@ class _LandingPageState extends State<LandingPage> {
isFullScreen: false, isFullScreen: false,
); );
}), }),
// Utils.buildSvgWithAssets(icon: AppAssets.contact_icon, height: 24.h, width: 24.h).onPress(() { // Utils.buildSvgWithAssets(icon: AppAssets.contact_icon, height: 24.h, width: 24.h).onPress(() {
// showCommonBottomSheetWithoutHeight( // showCommonBottomSheetWithoutHeight(
// context, // context,
@ -340,10 +341,10 @@ class _LandingPageState extends State<LandingPage> {
// ); // );
// }), // }),
!appState.isAuthenticated !appState.isAuthenticated
? Utils.buildSvgWithAssets(icon: appState.isArabic() ? AppAssets.enLangIcon : AppAssets.arLangIcon, height: 24.h, width: 24.h).onPress(() { ?Row(children: [ SizedBox(width: 24.w,), Utils.buildSvgWithAssets(icon: appState.isArabic() ? AppAssets.enLangIcon : AppAssets.arLangIcon, height: 24.h, width: 24.h).onPress(() {
context.setLocale(appState.isArabic() ? Locale('en', 'US') : Locale('ar', 'SA')); context.setLocale(appState.isArabic() ? Locale('en', 'US') : Locale('ar', 'SA'));
}) })])
: SizedBox.shrink() : SizedBox()
], ],
); );
}), }),

@ -51,7 +51,7 @@ class _MyInvoicesDetailsPageState extends State<MyInvoicesDetailsPage> {
myInvoicesViewModel.downloadInvoicePDF( myInvoicesViewModel.downloadInvoicePDF(
setupId: widget.getInvoicesListResponseModel.setupId!, setupId: widget.getInvoicesListResponseModel.setupId!,
invoiceNo: widget.getInvoicesListResponseModel.invoiceNo!, invoiceNo: widget.getInvoicesListResponseModel.invoiceNo!,
projectID: widget.getInvoicesListResponseModel.projectID!, projectID: widget.getInvoicesListResponseModel.projectId!,
onError: (err) { onError: (err) {
LoaderBottomSheet.hideLoader(); LoaderBottomSheet.hideLoader();
showCommonBottomSheetWithoutHeight( showCommonBottomSheetWithoutHeight(
@ -150,7 +150,7 @@ class _MyInvoicesDetailsPageState extends State<MyInvoicesDetailsPage> {
Column( Column(
children: [ children: [
Image.network( Image.network(
widget.getInvoiceDetailsResponseModel.doctorImageURL!, widget.getInvoiceDetailsResponseModel.doctorImageURL ?? 'https://hmgwebservices.com/Images/MobileImages/DUBAI/unkown_female.png',
width: 63.h, width: 63.h,
height: 63.h, height: 63.h,
fit: BoxFit.cover, fit: BoxFit.cover,
@ -162,10 +162,10 @@ class _MyInvoicesDetailsPageState extends State<MyInvoicesDetailsPage> {
height: 40.h, height: 40.h,
decoration: BoxDecoration( decoration: BoxDecoration(
color: AppColors.whiteColor, color: AppColors.whiteColor,
shape: BoxShape.circle, // Makes the container circular shape: BoxShape.circle,
border: Border.all( border: Border.all(
color: AppColors.scaffoldBgColor, // Color of the border color: AppColors.scaffoldBgColor,
width: 1.5.w, // Width of the border width: 1.5.w,
), ),
), ),
child: Column( child: Column(
@ -173,7 +173,7 @@ class _MyInvoicesDetailsPageState extends State<MyInvoicesDetailsPage> {
children: [ children: [
Utils.buildSvgWithAssets(icon: AppAssets.rating_icon, width: 15.w, height: 15.h, applyThemeColor: false), Utils.buildSvgWithAssets(icon: AppAssets.rating_icon, width: 15.w, height: 15.h, applyThemeColor: false),
SizedBox(height: 2.h), SizedBox(height: 2.h),
"${widget.getInvoicesListResponseModel.decimalDoctorRate}".toText11(isBold: true, color: AppColors.textColor), "${widget.getInvoicesListResponseModel.decimalDoctorRate ?? '0.0'}".toText11(isBold: true, color: AppColors.textColor),
], ],
), ),
).circle(100), ).circle(100),
@ -185,7 +185,7 @@ class _MyInvoicesDetailsPageState extends State<MyInvoicesDetailsPage> {
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
(getIt<AppState>().isArabic() ? widget.getInvoiceDetailsResponseModel.doctorName ?? LocaleKeys.doctor.tr(context: context) : widget.getInvoiceDetailsResponseModel.doctorName!).toText16(isBold: true), (widget.getInvoiceDetailsResponseModel.doctorName ?? LocaleKeys.doctor.tr(context: context)).toText16(isBold: true),
SizedBox(height: 8.h), SizedBox(height: 8.h),
Wrap( Wrap(
direction: Axis.horizontal, direction: Axis.horizontal,
@ -193,29 +193,33 @@ class _MyInvoicesDetailsPageState extends State<MyInvoicesDetailsPage> {
runSpacing: 6.h, runSpacing: 6.h,
children: [ children: [
AppCustomChipWidget( AppCustomChipWidget(
labelText: "${LocaleKeys.invoiceNo.tr(context: context)}: ${widget.getInvoiceDetailsResponseModel.invoiceNo!}", labelText: "${LocaleKeys.invoiceNo.tr(context: context)}: ${widget.getInvoiceDetailsResponseModel.invoiceNo ?? '-'}",
labelPadding: EdgeInsetsDirectional.only(start: 6.w, end: 6.w), labelPadding: EdgeInsetsDirectional.only(start: 6.w, end: 6.w),
isEnglishOnly: true, isEnglishOnly: true,
), ),
AppCustomChipWidget( AppCustomChipWidget(
labelText: ((getIt<AppState>().isArabic() ? widget.getInvoiceDetailsResponseModel.clinicDescriptionN : widget.getInvoiceDetailsResponseModel.clinicDescription ?? "")!.length > 15 labelText: () {
? '${(getIt<AppState>().isArabic() ? widget.getInvoiceDetailsResponseModel.clinicDescriptionN : widget.getInvoiceDetailsResponseModel.clinicDescription ?? "")!.substring(0, 12)}...' final clinicName = getIt<AppState>().isArabic()
: getIt<AppState>().isArabic() ? widget.getInvoiceDetailsResponseModel.clinicDescriptionN : widget.getInvoiceDetailsResponseModel.clinicDescription ?? ""), ? (widget.getInvoiceDetailsResponseModel.clinicDescriptionN ?? widget.getInvoiceDetailsResponseModel.clinicDescription ?? LocaleKeys.clinic.tr(context: context))
: (widget.getInvoiceDetailsResponseModel.clinicDescription ?? widget.getInvoiceDetailsResponseModel.clinicDescriptionN ?? LocaleKeys.clinic.tr(context: context));
return clinicName.length > 15 ? '${clinicName.substring(0, 12)}...' : clinicName;
}(),
labelPadding: EdgeInsetsDirectional.only(start: 4.w, end: 4.w), labelPadding: EdgeInsetsDirectional.only(start: 4.w, end: 4.w),
), ),
AppCustomChipWidget( AppCustomChipWidget(
labelText: widget.getInvoiceDetailsResponseModel.projectName!, labelText: widget.getInvoiceDetailsResponseModel.projectName ?? LocaleKeys.hospital.tr(context: context),
labelPadding: EdgeInsetsDirectional.only(start: 6.w, end: 6.w), labelPadding: EdgeInsetsDirectional.only(start: 6.w, end: 6.w),
), ),
Directionality( if (widget.getInvoiceDetailsResponseModel.appointmentDate != null)
textDirection: ui.TextDirection.ltr, Directionality(
child: AppCustomChipWidget( textDirection: ui.TextDirection.ltr,
labelPadding: EdgeInsetsDirectional.only(start: -4.w, end: 6.w), child: AppCustomChipWidget(
icon: AppAssets.doctor_calendar_icon, labelPadding: EdgeInsetsDirectional.only(start: -4.w, end: 6.w),
labelText: DateUtil.formatDateToDate(DateUtil.convertStringToDate(widget.getInvoiceDetailsResponseModel.appointmentDate), false), icon: AppAssets.doctor_calendar_icon,
isEnglishOnly: true, labelText: DateUtil.formatDateToDate(DateUtil.convertStringToDate(widget.getInvoiceDetailsResponseModel.appointmentDate), false),
isEnglishOnly: true,
),
), ),
),
], ],
), ),
], ],
@ -241,22 +245,25 @@ class _MyInvoicesDetailsPageState extends State<MyInvoicesDetailsPage> {
children: [ children: [
LocaleKeys.insurance.tr(context: context).toText16(isBold: true), LocaleKeys.insurance.tr(context: context).toText16(isBold: true),
SizedBox(height: 16.h), SizedBox(height: 16.h),
(getIt<AppState>().isArabic() ? widget.getInvoiceDetailsResponseModel.groupNameN : widget.getInvoiceDetailsResponseModel.groupName)!.toText14(isBold: true), (getIt<AppState>().isArabic()
? (widget.getInvoiceDetailsResponseModel.groupNameN ?? widget.getInvoiceDetailsResponseModel.groupName ?? LocaleKeys.insurance.tr(context: context))
: (widget.getInvoiceDetailsResponseModel.groupName ?? widget.getInvoiceDetailsResponseModel.groupNameN ?? LocaleKeys.insurance.tr(context: context))
).toText14(isBold: true),
Row( Row(
children: [ children: [
Expanded(child: (widget.getInvoiceDetailsResponseModel.companyName ?? "").toText14(isBold: true)), Expanded(child: (widget.getInvoiceDetailsResponseModel.companyName ?? "").toText14(isBold: true)),
], ],
), ),
SizedBox(height: 12.h), SizedBox(height: 12.h),
Row( // Row(
children: [ // children: [
AppCustomChipWidget( // AppCustomChipWidget(
labelText: "Insurance ID: ${widget.getInvoiceDetailsResponseModel.insuranceID ?? "-"}", // labelText: "Insurance ID: ${widget.getInvoiceDetailsResponseModel.insuranceID ?? "-"}",
labelPadding: EdgeInsetsDirectional.only(start: 6.w, end: 6.w), // labelPadding: EdgeInsetsDirectional.only(start: 6.w, end: 6.w),
isEnglishOnly: true, // isEnglishOnly: true,
), // ),
], // ],
), // ),
], ],
), ),
), ),
@ -299,8 +306,8 @@ class _MyInvoicesDetailsPageState extends State<MyInvoicesDetailsPage> {
children: [ children: [
Expanded(flex: 3, child: (consultation.procedureName ?? '-').toText12(isBold: true)), Expanded(flex: 3, child: (consultation.procedureName ?? '-').toText12(isBold: true)),
Expanded(flex: 1, child: '${consultation.quantity ?? '-'}'.toText12(isBold: true, isCenter: true, isEnglishOnly: true)), Expanded(flex: 1, child: '${consultation.quantity ?? '-'}'.toText12(isBold: true, isCenter: true, isEnglishOnly: true)),
Expanded(flex: 2, child: (NumberFormat.decimalPattern().format(consultation.price) ?? '-').toText12(isBold: true, isCenter: true, isEnglishOnly: true)), Expanded(flex: 2, child: (NumberFormat.decimalPattern().format(consultation.totalPatientShare) ?? '-').toText12(isBold: true, isCenter: true, isEnglishOnly: true)),
Expanded(flex: 2, child: (NumberFormat.decimalPattern().format(consultation.total) ?? '-').toText12(isBold: true, isCenter: true, isEnglishOnly: true)), Expanded(flex: 2, child: (NumberFormat.decimalPattern().format(consultation.totalPatientShare) ?? '-').toText12(isBold: true, isCenter: true, isEnglishOnly: true)),
], ],
), ),
), ),
@ -335,7 +342,7 @@ class _MyInvoicesDetailsPageState extends State<MyInvoicesDetailsPage> {
children: [ children: [
LocaleKeys.amountBeforeTax.tr(context: context).toText14(isBold: true), LocaleKeys.amountBeforeTax.tr(context: context).toText14(isBold: true),
Utils.getPaymentAmountWithSymbol( Utils.getPaymentAmountWithSymbol(
NumberFormat.decimalPattern().format(widget.getInvoiceDetailsResponseModel.listConsultation!.first.totalShare).toString().toText16(isBold: true, isEnglishOnly: true), AppColors.blackColor, 13, NumberFormat.decimalPattern().format(widget.getInvoiceDetailsResponseModel.listConsultation!.first.patientShare).toString().toText16(isBold: true, isEnglishOnly: true), AppColors.blackColor, 13,
isSaudiCurrency: true), isSaudiCurrency: true),
], ],
).paddingSymmetrical(24.h, 0.h), ).paddingSymmetrical(24.h, 0.h),
@ -345,7 +352,7 @@ class _MyInvoicesDetailsPageState extends State<MyInvoicesDetailsPage> {
LocaleKeys.vat15.tr(context: context).toText14(isBold: true, color: AppColors.greyTextColor), LocaleKeys.vat15.tr(context: context).toText14(isBold: true, color: AppColors.greyTextColor),
Utils.getPaymentAmountWithSymbol( Utils.getPaymentAmountWithSymbol(
NumberFormat.decimalPattern() NumberFormat.decimalPattern()
.format(widget.getInvoiceDetailsResponseModel.listConsultation!.first.totalVATAmount!) .format(widget.getInvoiceDetailsResponseModel.listConsultation!.first.patientVATAmount!)
.toString() .toString()
.toText14(isBold: true, color: AppColors.greyTextColor, isEnglishOnly: true), .toText14(isBold: true, color: AppColors.greyTextColor, isEnglishOnly: true),
AppColors.greyTextColor, AppColors.greyTextColor,
@ -354,25 +361,25 @@ class _MyInvoicesDetailsPageState extends State<MyInvoicesDetailsPage> {
], ],
).paddingSymmetrical(24.h, 0.h), ).paddingSymmetrical(24.h, 0.h),
SizedBox(height: 16.h), SizedBox(height: 16.h),
Row( // Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, // mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ // children: [
LocaleKeys.discount.tr(context: context).toText14(isBold: true), // LocaleKeys.discount.tr(context: context).toText14(isBold: true),
Utils.getPaymentAmountWithSymbol( // Utils.getPaymentAmountWithSymbol(
NumberFormat.decimalPattern() // NumberFormat.decimalPattern()
.format(widget.getInvoiceDetailsResponseModel.listConsultation!.first.discountAmount!) // .format(widget.getInvoiceDetailsResponseModel.listConsultation!.first.discountAmount!)
.toString() // .toString()
.toText14(isBold: true, color: AppColors.primaryRedColor, isEnglishOnly: true), // .toText14(isBold: true, color: AppColors.primaryRedColor, isEnglishOnly: true),
AppColors.primaryRedColor, 13, // AppColors.primaryRedColor, 13,
isSaudiCurrency: true), // isSaudiCurrency: true),
], // ],
).paddingSymmetrical(24.h, 0.h), // ).paddingSymmetrical(24.h, 0.h),
Row( Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
LocaleKeys.paid.tr(context: context).toText14(isBold: true), LocaleKeys.paid.tr(context: context).toText14(isBold: true),
Utils.getPaymentAmountWithSymbol( Utils.getPaymentAmountWithSymbol(
NumberFormat.decimalPattern().format(widget.getInvoiceDetailsResponseModel.listConsultation!.first.grandTotal!).toString().toText14(isBold: true, color: AppColors.textColor, isEnglishOnly: true), NumberFormat.decimalPattern().format(widget.getInvoiceDetailsResponseModel.listConsultation!.first.totalPatientShare!).toString().toText14(isBold: true, color: AppColors.textColor, isEnglishOnly: true),
AppColors.textColor, AppColors.textColor,
13, 13,
isSaudiCurrency: true), isSaudiCurrency: true),

@ -143,7 +143,7 @@ class _MyInvoicesListState extends State<MyInvoicesList> {
CustomButton( CustomButton(
text: LocaleKeys.hospitals.tr(context: context), text: LocaleKeys.hospitals.tr(context: context),
onPressed: () { onPressed: () {
if (myInvoicesVM.allInvoicesList.isEmpty) return; if (myInvoicesVM.getOriginalInvoicesList().isEmpty) return;
_showHospitalFilterBottomSheet(context); _showHospitalFilterBottomSheet(context);
}, },
backgroundColor: myInvoicesVM.currentFilter == InvoiceFilterType.hospital ? AppColors.bgRedLightColor : AppColors.whiteColor, backgroundColor: myInvoicesVM.currentFilter == InvoiceFilterType.hospital ? AppColors.bgRedLightColor : AppColors.whiteColor,
@ -159,7 +159,7 @@ class _MyInvoicesListState extends State<MyInvoicesList> {
CustomButton( CustomButton(
text: LocaleKeys.clinics.tr(context: context), text: LocaleKeys.clinics.tr(context: context),
onPressed: () { onPressed: () {
if (myInvoicesVM.allInvoicesList.isEmpty) return; if (myInvoicesVM.getOriginalInvoicesList().isEmpty) return;
_showClinicFilterBottomSheet(context); _showClinicFilterBottomSheet(context);
}, },
backgroundColor: myInvoicesVM.currentFilter == InvoiceFilterType.clinic ? AppColors.bgRedLightColor : AppColors.whiteColor, backgroundColor: myInvoicesVM.currentFilter == InvoiceFilterType.clinic ? AppColors.bgRedLightColor : AppColors.whiteColor,
@ -175,7 +175,7 @@ class _MyInvoicesListState extends State<MyInvoicesList> {
CustomButton( CustomButton(
text: LocaleKeys.doctors.tr(context: context), text: LocaleKeys.doctors.tr(context: context),
onPressed: () { onPressed: () {
if (myInvoicesVM.allInvoicesList.isEmpty) return; if (myInvoicesVM.getOriginalInvoicesList().isEmpty) return;
_showDoctorFilterBottomSheet(context); _showDoctorFilterBottomSheet(context);
}, },
backgroundColor: myInvoicesVM.currentFilter == InvoiceFilterType.doctor ? AppColors.bgRedLightColor : AppColors.whiteColor, backgroundColor: myInvoicesVM.currentFilter == InvoiceFilterType.doctor ? AppColors.bgRedLightColor : AppColors.whiteColor,
@ -220,7 +220,7 @@ class _MyInvoicesListState extends State<MyInvoicesList> {
await myInvoicesVM.getInvoiceDetails( await myInvoicesVM.getInvoiceDetails(
appointmentNo: myInvoicesVM.allInvoicesList[index].appointmentNo!, appointmentNo: myInvoicesVM.allInvoicesList[index].appointmentNo!,
invoiceNo: myInvoicesVM.allInvoicesList[index].invoiceNo!, invoiceNo: myInvoicesVM.allInvoicesList[index].invoiceNo!,
projectID: myInvoicesVM.allInvoicesList[index].projectID!, projectID: myInvoicesVM.allInvoicesList[index].projectId!,
onSuccess: (val) { onSuccess: (val) {
LoaderBottomSheet.hideLoader(); LoaderBottomSheet.hideLoader();
Navigator.of(context).push( Navigator.of(context).push(

@ -61,7 +61,7 @@ class InvoiceListCard extends StatelessWidget {
Column( Column(
children: [ children: [
Image.network( Image.network(
getInvoicesListResponseModel.doctorImageURL!, getInvoicesListResponseModel.doctorImageUrl ?? 'https://hmgwebservices.com/Images/MobileImages/DUBAI/unkown_female.png',
width: 63.h, width: 63.h,
height: 63.h, height: 63.h,
fit: BoxFit.cover, fit: BoxFit.cover,
@ -73,10 +73,10 @@ class InvoiceListCard extends StatelessWidget {
height: 40.h, height: 40.h,
decoration: BoxDecoration( decoration: BoxDecoration(
color: AppColors.whiteColor, color: AppColors.whiteColor,
shape: BoxShape.circle, // Makes the container circular shape: BoxShape.circle,
border: Border.all( border: Border.all(
color: AppColors.scaffoldBgColor, // Color of the border color: AppColors.scaffoldBgColor,
width: 1.5.w, // Width of the border width: 1.5.w,
), ),
), ),
child: Column( child: Column(
@ -84,7 +84,7 @@ class InvoiceListCard extends StatelessWidget {
children: [ children: [
Utils.buildSvgWithAssets(icon: AppAssets.rating_icon, width: 15.w, height: 15.h, applyThemeColor: false), Utils.buildSvgWithAssets(icon: AppAssets.rating_icon, width: 15.w, height: 15.h, applyThemeColor: false),
SizedBox(height: 2.h), SizedBox(height: 2.h),
"${getInvoicesListResponseModel.decimalDoctorRate}".toText11(isBold: true, color: AppColors.textColor), "${getInvoicesListResponseModel.decimalDoctorRate ?? '0.0'}".toText11(isBold: true, color: AppColors.textColor),
], ],
), ),
).circle(100), ).circle(100),
@ -96,7 +96,10 @@ class InvoiceListCard extends StatelessWidget {
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
(getIt<AppState>().isArabic() ? getInvoicesListResponseModel.doctorNameN! : getInvoicesListResponseModel.doctorName ?? "HMG Doctor").toText16(isBold: true), (getIt<AppState>().isArabic()
? (getInvoicesListResponseModel.doctorNameN ?? getInvoicesListResponseModel.doctorName ?? LocaleKeys.doctor.tr(context: context))
: (getInvoicesListResponseModel.doctorName ?? getInvoicesListResponseModel.doctorNameN ?? LocaleKeys.doctor.tr(context: context))
).toText16(isBold: true),
SizedBox(height: 8.h), SizedBox(height: 8.h),
Wrap( Wrap(
direction: Axis.horizontal, direction: Axis.horizontal,
@ -104,28 +107,30 @@ class InvoiceListCard extends StatelessWidget {
runSpacing: 6.h, runSpacing: 6.h,
children: [ children: [
AppCustomChipWidget( AppCustomChipWidget(
labelText: "${LocaleKeys.invoiceNo.tr(context: context)}: ${getInvoicesListResponseModel.invoiceNo!}", labelText: "${LocaleKeys.invoiceNo.tr(context: context)}: ${getInvoicesListResponseModel.invoiceNo ?? '-'}",
labelPadding: EdgeInsetsDirectional.only(start: 6.w, end: 6.w), labelPadding: EdgeInsetsDirectional.only(start: 6.w, end: 6.w),
isEnglishOnly: true, isEnglishOnly: true,
), ),
AppCustomChipWidget( AppCustomChipWidget(
labelText: labelText: ((getInvoicesListResponseModel.clinicName ?? LocaleKeys.clinic.tr(context: context)).length > 15
(getInvoicesListResponseModel.clinicName!.length > 15 ? '${getInvoicesListResponseModel.clinicName!.substring(0, 12)}...' : getInvoicesListResponseModel.clinicName!), ? '${(getInvoicesListResponseModel.clinicName ?? LocaleKeys.clinic.tr(context: context)).substring(0, 12)}...'
: (getInvoicesListResponseModel.clinicName ?? LocaleKeys.clinic.tr(context: context))),
labelPadding: EdgeInsetsDirectional.only(start: 4.w, end: 4.w), labelPadding: EdgeInsetsDirectional.only(start: 4.w, end: 4.w),
), ),
AppCustomChipWidget( AppCustomChipWidget(
labelText: getInvoicesListResponseModel.projectName!, labelText: getInvoicesListResponseModel.projectName ?? LocaleKeys.hospital.tr(context: context),
labelPadding: EdgeInsetsDirectional.only(start: 6.w, end: 6.w), labelPadding: EdgeInsetsDirectional.only(start: 6.w, end: 6.w),
), ),
Directionality( if (getInvoicesListResponseModel.appointmentDate != null)
textDirection: ui.TextDirection.ltr, Directionality(
child: AppCustomChipWidget( textDirection: ui.TextDirection.ltr,
labelPadding: EdgeInsetsDirectional.only(start: -4.w, end: 6.w), child: AppCustomChipWidget(
icon: AppAssets.doctor_calendar_icon, labelPadding: EdgeInsetsDirectional.only(start: -4.w, end: 6.w),
labelText: DateUtil.formatDateToDate(DateUtil.convertStringToDate(getInvoicesListResponseModel.appointmentDate), false), icon: AppAssets.doctor_calendar_icon,
isEnglishOnly: true, labelText: DateUtil.formatDateToDate(DateUtil.convertStringToDate(getInvoicesListResponseModel.appointmentDate), false),
isEnglishOnly: true,
),
), ),
),
], ],
), ),
], ],

Loading…
Cancel
Save