Update insurance for cash patient in ToDo List

merge-update-with-lab-changes
haroon amjad 2 years ago
parent 4fcc698f50
commit cb2bacf539

@ -1899,4 +1899,5 @@ const Map localizedValues = {
"updateInsurance": {"en": "Update insurance", "ar": "تحديث التأمين"}, "updateInsurance": {"en": "Update insurance", "ar": "تحديث التأمين"},
"downloadReport": {"en": "Download Report", "ar": "تحميل تقرير المختبر"}, "downloadReport": {"en": "Download Report", "ar": "تحميل تقرير المختبر"},
"habibCallCenter": {"en": "Please contact AlHabib call center to update your insurance manually.", "ar": "يرجى الاتصال بمركز اتصال الحبيب لتحديث التأمين الخاص بك يدوياً."}, "habibCallCenter": {"en": "Please contact AlHabib call center to update your insurance manually.", "ar": "يرجى الاتصال بمركز اتصال الحبيب لتحديث التأمين الخاص بك يدوياً."},
"cashAmountUpdateInsurance": {"en": "Please note that this is the cash amount, If you want to update your insurance, Please tap below:", "ar": "يرجى ملاحظة أن هذا هو المبلغ النقدي، إذا كنت ترغب في تحديث التأمين الخاص بك، يرجى النقر أدناه:"},
}; };

@ -835,7 +835,7 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
}); });
} }
dataLoaded = true; dataLoaded = true;
if(widget.isFromMyAppointments) { if (widget.isFromMyAppointments) {
getPatientShare(context, widget.appointment); getPatientShare(context, widget.appointment);
} }
}); });
@ -906,7 +906,7 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
service.getPatientShare(appo.appointmentNo.toString(), appo.clinicID, appo.projectID, context).then((res) { service.getPatientShare(appo.appointmentNo.toString(), appo.clinicID, appo.projectID, context).then((res) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
if(res['OnlineCheckInAppointments'].length != 0) { if (res['OnlineCheckInAppointments'].length != 0) {
widget.patientShareResponse = new PatientShareResponse.fromJson(res['OnlineCheckInAppointments'][0]); widget.patientShareResponse = new PatientShareResponse.fromJson(res['OnlineCheckInAppointments'][0]);
} }
isInsured = res["IsInsured"]; isInsured = res["IsInsured"];
@ -1009,7 +1009,7 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
transform: Matrix4.translationValues(0.0, curvedValue * 200, 0.0), transform: Matrix4.translationValues(0.0, curvedValue * 200, 0.0),
child: Opacity( child: Opacity(
opacity: a1.value, opacity: a1.value,
child: PaymentDialog(appo: appo, patientShareResponse: patientShareResponse), child: PaymentDialog(appo: appo, patientShareResponse: patientShareResponse, isCashPatient: isCash),
), ),
); );
}, },

@ -3,20 +3,24 @@ import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/locator.dart'; import 'package:diplomaticquarterapp/locator.dart';
import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart'; import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart';
import 'package:diplomaticquarterapp/models/Appointments/PatientShareResposne.dart'; import 'package:diplomaticquarterapp/models/Appointments/PatientShareResposne.dart';
import 'package:diplomaticquarterapp/pages/insurance/insurance_update_screen.dart';
import 'package:diplomaticquarterapp/pages/landing/landing_page.dart';
import 'package:diplomaticquarterapp/theme/colors.dart'; import 'package:diplomaticquarterapp/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils_new.dart'; import 'package:diplomaticquarterapp/uitl/utils_new.dart';
import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart'; import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
class PaymentDialog extends StatefulWidget { class PaymentDialog extends StatefulWidget {
AppoitmentAllHistoryResultList appo; AppoitmentAllHistoryResultList appo;
PatientShareResponse patientShareResponse; PatientShareResponse patientShareResponse;
bool isCashPatient;
final Function onPaymentMethodSelected; final Function onPaymentMethodSelected;
PaymentDialog({@required this.appo, @required this.onPaymentMethodSelected, this.patientShareResponse}); PaymentDialog({@required this.appo, @required this.onPaymentMethodSelected, this.patientShareResponse, this.isCashPatient = false});
@override @override
_PaymentDialogState createState() => _PaymentDialogState(); _PaymentDialogState createState() => _PaymentDialogState();
@ -31,84 +35,118 @@ class _PaymentDialogState extends State<PaymentDialog> {
//height: 550.0, //height: 550.0,
width: 450.0, width: 450.0,
padding: EdgeInsets.all(21), padding: EdgeInsets.all(21),
child: Column(crossAxisAlignment: CrossAxisAlignment.start, mainAxisSize: MainAxisSize.min, children: <Widget>[ child: Column(
Text( crossAxisAlignment: CrossAxisAlignment.start,
TranslationBase.of(context).invoiceDetails, mainAxisSize: MainAxisSize.min,
style: TextStyle( children: <Widget>[
fontSize: 24.0, Text(
fontWeight: FontWeight.w600, TranslationBase.of(context).invoiceDetails,
letterSpacing: -1.14, style: TextStyle(
color: Color(0xff2B353E), fontSize: 24.0,
fontWeight: FontWeight.w600,
letterSpacing: -1.14,
color: Color(0xff2B353E),
),
), ),
), Text(widget.appo.doctorTitle + " " + widget.appo.doctorNameObj, style: TextStyle(color: Color(0xff2E303A), fontSize: 16.0, fontWeight: FontWeight.w600, letterSpacing: -0.64)),
Text(widget.appo.doctorTitle + " " + widget.appo.doctorNameObj, style: TextStyle(color: Color(0xff2E303A), fontSize: 16.0, fontWeight: FontWeight.w600,letterSpacing: -0.64)), Text(getDate(widget.appo.appointmentDate), style: getTextStyle()),
Text(getDate(widget.appo.appointmentDate), style: getTextStyle()), Text(widget.appo.projectName, style: getTextStyle()),
Text(widget.appo.projectName, style: getTextStyle()), Divider(
Divider( color: Colors.grey,
color: Colors.grey,
),
Table(
children: [
TableRow(decoration: BoxDecoration(), children: [
TableCell(child: _getNormalText(TranslationBase.of(context).patientShareToDo)),
TableCell(child: _getNormalText(widget.patientShareResponse.patientShare.toString())),
]),
TableRow(children: [
TableCell(child: _getNormalText(TranslationBase.of(context).patientTaxToDo)),
TableCell(child: _getNormalText(widget.patientShareResponse.patientTaxAmount.toString())),
]),
TableRow(children: [
TableCell(child: _getNormalText(TranslationBase.of(context).patientShareTotalToDo)),
TableCell(child: _getNormalText(widget.patientShareResponse.patientShareWithTax.toString())),
]),
],
),
Divider(color: Colors.grey),
Text(
TranslationBase.of(context).YouCanPayByTheFollowingOptions,
style: TextStyle(
fontSize: 14.0,
fontWeight: FontWeight.w600,
color: Color(0xff2E303A),
), ),
), Table(
getPaymentMethods(), children: [
SizedBox(height: 12), TableRow(decoration: BoxDecoration(), children: [
Text( TableCell(child: _getNormalText(TranslationBase.of(context).patientShareToDo)),
TranslationBase.of(context).appoPaymentConfirm, TableCell(child: _getNormalText(widget.patientShareResponse.patientShare.toString())),
style: TextStyle(fontSize: 14.0, color: CustomColors.accentColor, fontWeight: FontWeight.w600, letterSpacing: -0.56), ]),
), TableRow(children: [
SizedBox(height: 12), TableCell(child: _getNormalText(TranslationBase.of(context).patientTaxToDo)),
Container( TableCell(child: _getNormalText(widget.patientShareResponse.patientTaxAmount.toString())),
alignment: Alignment.center, ]),
child: Row( TableRow(children: [
// direction: Axis.horizontal, TableCell(child: _getNormalText(TranslationBase.of(context).patientShareTotalToDo)),
children: <Widget>[ TableCell(child: _getNormalText(widget.patientShareResponse.patientShareWithTax.toString())),
Expanded( ]),
child: DefaultButton( ],
TranslationBase.of(context).cancel_nocaps, ),
() { Divider(color: Colors.grey),
Navigator.pop(context, null); Text(
}, TranslationBase.of(context).YouCanPayByTheFollowingOptions,
color: CustomColors.accentColor, style: TextStyle(
textColor: Colors.white, fontSize: 14.0,
fontWeight: FontWeight.w600,
color: Color(0xff2E303A),
),
),
getPaymentMethods(),
SizedBox(height: 12),
Text(
TranslationBase.of(context).appoPaymentConfirm,
style: TextStyle(fontSize: 14.0, color: CustomColors.accentColor, fontWeight: FontWeight.w600, letterSpacing: -0.56),
),
SizedBox(height: 12),
Container(
alignment: Alignment.center,
child: Row(
// direction: Axis.horizontal,
children: <Widget>[
Expanded(
child: DefaultButton(
TranslationBase.of(context).cancel_nocaps,
() {
Navigator.pop(context, null);
},
color: CustomColors.accentColor,
textColor: Colors.white,
),
), ),
), mWidth(10.0),
mWidth(10.0), Expanded(
Expanded( child: DefaultButton(
child: DefaultButton( TranslationBase.of(context).confirm,
TranslationBase.of(context).confirm, () {
() { Navigator.pop(context, widget.patientShareResponse);
Navigator.pop(context, widget.patientShareResponse); },
}, color: CustomColors.green,
color: CustomColors.green, textColor: Colors.white,
textColor: Colors.white, ),
), ),
), ],
], ),
), ),
), widget.isCashPatient
]), ? Column(
children: [
mHeight(10.0),
Text(
TranslationBase.of(context).cashAmountUpdateInsurance,
style: TextStyle(
fontSize: 14.0,
fontWeight: FontWeight.w600,
color: Color(0xff2E303A),
),
),
mHeight(5.0),
DefaultButton(
TranslationBase.of(context).updateInsuranceText,
() {
Navigator.pop(context, null);
Navigator.pushAndRemoveUntil(
context,
MaterialPageRoute(builder: (context) => LandingPage()),
(Route<dynamic> route) => false,
);
Navigator.push(context, FadePage(page: InsuranceUpdate()));
},
color: CustomColors.accentColor,
textColor: Colors.white,
),
],
)
: Container(),
],
),
), ),
); );
} }

@ -59,9 +59,9 @@ class _InsuranceUpdateState extends State<InsuranceUpdate> with SingleTickerProv
isScrollable: false, isScrollable: false,
indicatorWeight: 3.0, indicatorWeight: 3.0,
indicatorColor: CustomColors.accentColor, indicatorColor: CustomColors.accentColor,
labelColor: Theme.of(context).primaryColor, labelColor: CustomColors.textDarkColor,
labelPadding: EdgeInsets.symmetric(horizontal: 13.0, vertical: 2.0), labelPadding: EdgeInsets.symmetric(horizontal: 13.0, vertical: 2.0),
unselectedLabelColor: Colors.grey, unselectedLabelColor: CustomColors.textDarkColor,
tabs: <Widget>[ tabs: <Widget>[
Container( Container(
child: Center( child: Center(

@ -2908,6 +2908,7 @@ class TranslationBase {
String get updateInsuranceText => localizedValues["updateInsurance"][locale.languageCode]; String get updateInsuranceText => localizedValues["updateInsurance"][locale.languageCode];
String get downloadReport => localizedValues["downloadReport"][locale.languageCode]; String get downloadReport => localizedValues["downloadReport"][locale.languageCode];
String get habibCallCenter => localizedValues["habibCallCenter"][locale.languageCode]; String get habibCallCenter => localizedValues["habibCallCenter"][locale.languageCode];
String get cashAmountUpdateInsurance => localizedValues["cashAmountUpdateInsurance"][locale.languageCode];
} }

Loading…
Cancel
Save