diff --git a/lib/config/config.dart b/lib/config/config.dart index df616d52..91de1019 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -56,6 +56,8 @@ var PHARMACY_REDIRECT_URL = 'https://bit.ly/AlhabibPharmacy'; // RC API URL var RC_BASE_URL = 'https://rc.hmg.com/'; +// var RC_BASE_URL = 'https://rc.hmg.com/test/'; + // var RC_BASE_URL = 'https://ms.hmg.com/rc/'; var PING_SERVICE = 'Services/Weather.svc/REST/CheckConnectivity'; @@ -659,8 +661,6 @@ var PLACE_MEAL_PLAN_ORDER = 'Services/MOP.svc/REST/UpdateOrMakeNewOrder'; var CHECK_PATIENT_NPHIES_ELIGIBILITY = 'Services/Doctors.svc/REST/checkPatientInsuranceCompanyValidity'; var CONVERT_PATIENT_TO_CASH = 'Services/Doctors.svc/REST/deActivateInsuranceCompany'; - - //PAYFORT var getPayFortProjectDetails = "Services/PayFort_Serv.svc/REST/GetPayFortProjectDetails"; var addPayFortApplePayResponse = "Services/PayFort_Serv.svc/REST/AddResponse"; @@ -669,7 +669,6 @@ var addPayFortApplePayResponse = "Services/PayFort_Serv.svc/REST/AddResponse"; var payFortEnvironment = FortEnvironment.test; var applePayMerchantId = "merchant.com.hmgwebservices.uat"; - class AppGlobal { static var context; diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 248ea851..2c46e0b1 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -326,7 +326,7 @@ const Map localizedValues = { "nearester": {"en": "Nearest ER", "ar": "أقرب طوارى"}, "locationa": {"en": "Location", "ar": "الموقع"}, "call_now": {"en": "Call now", "ar": "اتصل الان"}, - "ambulancerequest": {"en": "Ambulance", "ar": "خدمات النقل "}, + "ambulancerequest": {"en": "Ambulance", "ar": "طلب النقل "}, "requestA": {"en": "Request", "ar": "الاسعافي"}, "NoBookedAppointments": {"en": "No Booked Appointments", "ar": "لا توجد مواعيد محجوزة"}, "NoConfirmedAppointments": {"en": "No Confirmed Appointments", "ar": "لا توجد مواعيد مؤكدة"}, @@ -1338,7 +1338,7 @@ const Map localizedValues = { "covid-alert-header": {"en": "Pay With-in 15 mins to confirm the appointment", "ar": "الرجاء اتمام عملية الدفع خلال 15 دقيقه لتاكيد الموعد"}, "covid-alert-info": { "en": "Payment for Covid-19 Test should Be made with-in 15 mins otherwise The system will Cancel the Scheduled appointment automatically​", - "ar": "سيتم الغاء الموعد عن طريق النظام بشكل الي في حال عدم اتمام عمليه الدفع خلال 15 دقيقة​" + "ar": "سيتم الغاء الموعد عن طريق النظام بشكل الي في حال عدم اتمام عمليه الدفع خلال 15 دقيقة" }, "covid-alert-mins": {"en": "Pay With-in 15 mins", "ar": "ادفع خلال 15 دقيقة"}, "back": {"en": "Back", "ar": "رجوع"}, @@ -1942,6 +1942,7 @@ const Map localizedValues = { "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": "يرجى ملاحظة أن هذا هو المبلغ النقدي، إذا كنت ترغب في تحديث التأمين الخاص بك، يرجى النقر أدناه:"}, "validInsurance": {"en": "Do you have a valid insurance?", "ar": "هل لديك تأمين صالح؟"}, + "contactRRT": {"en": "Contact RRT", "ar": "تواصل مع فريق الاستجابة السريعة"}, "checkInViaLocation": {"en": "Check-In Via Location", "ar": "تسجيل الوصول عبر الموقع"}, "locationCheckInError": {"en": "Please make sure that you're within the hospital location to perform online check-in.", "ar": "يرجى التأكد من تواجدك داخل موقع المستشفى لإجراء تسجيل الوصول عبر الإنترنت."}, "onlyAdmitted": {"en": "This service is only available for admitted patients", "ar": "هذه الخدمة متاحة فقط للمرضى المقبولين"}, diff --git a/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/new_Home_health_care_step_three_page.dart b/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/new_Home_health_care_step_three_page.dart index 0c1abc3f..3ff391ca 100644 --- a/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/new_Home_health_care_step_three_page.dart +++ b/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/new_Home_health_care_step_three_page.dart @@ -104,14 +104,6 @@ class _NewHomeHealthCareStepThreePageState extends State with SingleTic applePayInsertRequest.clientRequestID = transID; applePayInsertRequest.clinicID = 0; - applePayInsertRequest.currency = projectViewModel.authenticatedUserObject.user.outSA == 1 ? "AED" : "SAR"; + applePayInsertRequest.currency = projectViewModel.user.outSA == 1 ? "AED" : "SAR"; // applePayInsertRequest.customerEmail = projectViewModel.authenticatedUserObject.user.emailAddress; - applePayInsertRequest.customerEmail = "CustID_${projectViewModel.authenticatedUserObject.user.patientID}@HMG.com"; - applePayInsertRequest.customerID = projectViewModel.authenticatedUserObject.user.patientID; - applePayInsertRequest.customerName = projectViewModel.authenticatedUserObject.user.firstName! + " " + projectViewModel.authenticatedUserObject.user.lastName!; + applePayInsertRequest.customerEmail = "CustID_${projectViewModel.user.patientID}@HMG.com"; + applePayInsertRequest.customerID = projectViewModel.user.patientID; + applePayInsertRequest.customerName = projectViewModel.user.firstName! + " " + projectViewModel.user.lastName!; applePayInsertRequest.deviceToken = await AppSharedPreferences().getString(PUSH_TOKEN); applePayInsertRequest.voipToken = await AppSharedPreferences().getString(ONESIGNAL_APNS_TOKEN); applePayInsertRequest.doctorID = 0; applePayInsertRequest.projectID = widget.projectID.toString(); applePayInsertRequest.serviceID = ServiceTypeEnum.advancePayment.getIdFromServiceEnum().toString(); applePayInsertRequest.channelID = 3; - applePayInsertRequest.patientID = projectViewModel.authenticatedUserObject.user.patientID; - applePayInsertRequest.patientTypeID = projectViewModel.authenticatedUserObject.user.patientType; - applePayInsertRequest.patientOutSA = projectViewModel.authenticatedUserObject.user.outSA; + applePayInsertRequest.patientID = projectViewModel.user.patientID; + applePayInsertRequest.patientTypeID = projectViewModel.user.patientType; + applePayInsertRequest.patientOutSA = projectViewModel.user.outSA; applePayInsertRequest.appointmentDate = null; - applePayInsertRequest.appointmentNo = 0; - applePayInsertRequest.orderDescription = "Advance Payment"; + applePayInsertRequest.appointmentNo = widget.appoNo; + applePayInsertRequest.orderDescription = "Ancillary Order Payment"; applePayInsertRequest.liveServiceID = "0"; applePayInsertRequest.latitude = "0.0"; applePayInsertRequest.longitude = "0.0"; @@ -642,7 +642,7 @@ class _AnicllaryOrdersState extends State with SingleTic applePayInsertRequest.isSchedule = "0"; applePayInsertRequest.language = projectViewModel.isArabic ? 'ar' : 'en'; applePayInsertRequest.languageID = projectViewModel.isArabic ? 1 : 2; - applePayInsertRequest.userName = projectViewModel.authenticatedUserObject.user.patientID; + applePayInsertRequest.userName = projectViewModel.user.patientID; applePayInsertRequest.responseContinueURL = "http://hmg.com/Documents/success.html"; applePayInsertRequest.backClickUrl = "http://hmg.com/Documents/success.html"; applePayInsertRequest.paymentOption = "ApplePay"; @@ -659,21 +659,21 @@ class _AnicllaryOrdersState extends State with SingleTic service.applePayInsertRequest(applePayInsertRequest, context).then((res) async { await context.read().initiateApplePayWithPayfort( - customerName: projectViewModel.authenticatedUserObject.user.firstName! + " " + projectViewModel.authenticatedUserObject.user!.lastName!, + customerName: projectViewModel.user.firstName! + " " + projectViewModel.user.lastName!, // customerEmail: projectViewModel.authenticatedUserObject.user.emailAddress, - customerEmail: "CustID_${projectViewModel.authenticatedUserObject.user.patientID}@HMG.com", + customerEmail: "CustID_${projectViewModel.user.patientID}@HMG.com", orderDescription: "Ancillary Order Payment", orderAmount: double.parse(getTotalValue()), merchantReference: transID, payfortProjectDetailsRespModel: payfortProjectDetailsRespModel, - currency: projectViewModel.authenticatedUserObject.user.outSA == 1 ? "AED" : "SAR", + currency: projectViewModel.user.outSA == 1 ? "AED" : "SAR", onFailed: (failureResult) async { log("failureResult: ${failureResult.toString()}"); AppToast.showErrorToast(message: failureResult.toString()); }, onSuccess: (successResult) async { log("Payfort: ${successResult.responseMessage}"); - await context.read().addPayfortApplePayResponse(result: successResult); + await context.read().addPayfortApplePayResponse(projectViewModel.user.patientID!, result: successResult); checkPaymentStatus(AppoitmentAllHistoryResultList()); }, projectId: widget.projectID, diff --git a/lib/pages/BookAppointment/BookSuccess.dart b/lib/pages/BookAppointment/BookSuccess.dart index 054b0610..c33c345e 100644 --- a/lib/pages/BookAppointment/BookSuccess.dart +++ b/lib/pages/BookAppointment/BookSuccess.dart @@ -768,24 +768,20 @@ class _BookSuccessState extends State { applePayInsertRequest.clientRequestID = transID; applePayInsertRequest.clinicID = appo.clinicID; - applePayInsertRequest.currency = projectViewModel.authenticatedUserObject.user.outSA == 1 ? "AED" : "SAR"; + applePayInsertRequest.currency = projectViewModel.user.outSA == 1 ? "AED" : "SAR"; // applePayInsertRequest.customerEmail = projectViewModel.authenticatedUserObject.user.emailAddress; - applePayInsertRequest.customerEmail = "CustID_${projectViewModel.authenticatedUserObject.user.patientID}@HMG.com"; - applePayInsertRequest.customerID = projectViewModel.authenticatedUserObject.user.patientID; - applePayInsertRequest.customerName = projectViewModel.authenticatedUserObject.user.firstName! + " " + projectViewModel!.authenticatedUserObject.user!.lastName!; + applePayInsertRequest.customerEmail = "CustID_${projectViewModel.user.patientID}@HMG.com"; + applePayInsertRequest.customerID = projectViewModel.user.patientID; + applePayInsertRequest.customerName = projectViewModel.user.firstName! + " " + projectViewModel.user.lastName!; applePayInsertRequest.deviceToken = await AppSharedPreferences().getString(PUSH_TOKEN); applePayInsertRequest.voipToken = await AppSharedPreferences().getString(ONESIGNAL_APNS_TOKEN); applePayInsertRequest.doctorID = appo.doctorID; applePayInsertRequest.projectID = appo.projectID.toString(); - applePayInsertRequest.serviceID = - ServiceTypeEnum.advancePayment.getIdFromServiceEnum().toString(); + applePayInsertRequest.serviceID = ServiceTypeEnum.appointmentPayment.getIdFromServiceEnum().toString(); applePayInsertRequest.channelID = 3; - applePayInsertRequest.patientID = - projectViewModel.authenticatedUserObject.user.patientID; - applePayInsertRequest.patientTypeID = - projectViewModel.authenticatedUserObject.user.patientType; - applePayInsertRequest.patientOutSA = - projectViewModel.authenticatedUserObject.user.outSA; + applePayInsertRequest.patientID = projectViewModel.user.patientID; + applePayInsertRequest.patientTypeID = projectViewModel.user.patientType; + applePayInsertRequest.patientOutSA = projectViewModel.user.outSA; applePayInsertRequest.appointmentDate = appo.appointmentDate; applePayInsertRequest.appointmentNo = appo.appointmentNo; applePayInsertRequest.orderDescription = "Appointment Payment"; @@ -797,12 +793,9 @@ class _BookSuccessState extends State { applePayInsertRequest.isSchedule = appo.isLiveCareAppointment! ? "1" : "0"; applePayInsertRequest.language = projectViewModel.isArabic ? 'ar' : 'en'; applePayInsertRequest.languageID = projectViewModel.isArabic ? 1 : 2; - applePayInsertRequest.userName = - projectViewModel.authenticatedUserObject.user.patientID; - applePayInsertRequest.responseContinueURL = - "http://hmg.com/Documents/success.html"; - applePayInsertRequest.backClickUrl = - "http://hmg.com/Documents/success.html"; + applePayInsertRequest.userName = projectViewModel.user.patientID; + applePayInsertRequest.responseContinueURL = "http://hmg.com/Documents/success.html"; + applePayInsertRequest.backClickUrl = "http://hmg.com/Documents/success.html"; applePayInsertRequest.paymentOption = "ApplePay"; applePayInsertRequest.isMobSDK = true; @@ -822,21 +815,21 @@ class _BookSuccessState extends State { service.applePayInsertRequest(applePayInsertRequest, context).then(( res) async { await context.read().initiateApplePayWithPayfort( - customerName: projectViewModel.authenticatedUserObject.user.firstName! + " " + projectViewModel!.authenticatedUserObject.user!.lastName!, + customerName: projectViewModel.user.firstName! + " " + projectViewModel.user.lastName!, // customerEmail: projectViewModel.authenticatedUserObject.user.emailAddress, - customerEmail: "CustID_${projectViewModel.authenticatedUserObject.user.patientID}@HMG.com", + customerEmail: "CustID_${projectViewModel.user.patientID}@HMG.com", orderDescription: "Appointment Payment", orderAmount: double.parse(patientShareResponse.patientShareWithTax.toString()), merchantReference: transID, payfortProjectDetailsRespModel: payfortProjectDetailsRespModel, - currency: projectViewModel.authenticatedUserObject.user.outSA == 1 ? "AED" : "SAR", + currency: projectViewModel.user.outSA == 1 ? "AED" : "SAR", onFailed: (failureResult) async { log("failureResult: ${failureResult.toString()}"); AppToast.showErrorToast(message: failureResult.toString()); }, onSuccess: (successResult) async { log("Payfort: ${successResult.responseMessage}"); - await context.read().addPayfortApplePayResponse(result: successResult); + await context.read().addPayfortApplePayResponse(projectViewModel.user.patientID!, result: successResult); checkPaymentStatus(appo); }, projectId: appo.projectID, @@ -912,13 +905,13 @@ class _BookSuccessState extends State { onBrowserExit(AppoitmentAllHistoryResultList appo, bool isPaymentMade) { try { if (selectedPaymentMethod == "TAMARA") { - checkTamaraPaymentStatus(Utils.getAppointmentTransID(appo.projectID!, appo.clinicID!, appo.appointmentNo!), appo); - // if (tamaraPaymentStatus != null && tamaraPaymentStatus.toLowerCase() == "approved") { - // updateTamaraRequestStatus("success", "14", Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo), tamaraOrderID, num.parse(selectedInstallments), appo); - // } else { - // updateTamaraRequestStatus( - // "Failed", "00", Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo), tamaraOrderID != null ? tamaraOrderID : "", num.parse(selectedInstallments), appo); - // } + checkTamaraPaymentStatus(transID!, appo); + if (tamaraPaymentStatus != null && tamaraPaymentStatus!.toLowerCase() == "approved") { + updateTamaraRequestStatus("success", "14", Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo), tamaraOrderID!, num.parse(selectedInstallments!), appo); + } else { + updateTamaraRequestStatus( + "Failed", "00", Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo), tamaraOrderID! != null ? tamaraOrderID! : "", num.parse(selectedInstallments!), appo); + } } else { checkPaymentStatus(appo); } @@ -954,7 +947,7 @@ class _BookSuccessState extends State { }); } - updateTamaraRequestStatus(String responseMessage, String status, String clientRequestID, String tamaraOrderID, int selectedInstallments, AppoitmentAllHistoryResultList appo) { + updateTamaraRequestStatus(String responseMessage, String status, String clientRequestID, String tamaraOrderID, num selectedInstallments, AppoitmentAllHistoryResultList appo) { GifLoaderDialogUtils.showMyDialog(context); try { DoctorsListService service = new DoctorsListService(); diff --git a/lib/pages/Covid-DriveThru/covid-payment-summary.dart b/lib/pages/Covid-DriveThru/covid-payment-summary.dart index 07e26627..a9a2af78 100644 --- a/lib/pages/Covid-DriveThru/covid-payment-summary.dart +++ b/lib/pages/Covid-DriveThru/covid-payment-summary.dart @@ -31,7 +31,6 @@ class CovidPaymentSummary extends StatefulWidget { MyInAppBrowser? browser; AuthenticatedUser? authenticatedUser; AppSharedPreferences sharedPref = AppSharedPreferences(); - String transID = ""; CovidPaymentSummary({required this.patientShareResponse, required this.selectedPaymentMethod}); @@ -44,6 +43,8 @@ class _CovidPaymentSummaryState extends State { late String tamaraPaymentStatus; late String tamaraOrderID; + String transID = ""; + @override Widget build(BuildContext context) { projectViewModel = Provider.of(context); @@ -216,29 +217,27 @@ class _CovidPaymentSummaryState extends State { openPayment(String paymentMethod, AuthenticatedUser authenticatedUser, num amount, PatientShareResponse patientShareResponse, AppoitmentAllHistoryResultList appo) async { widget.browser = new MyInAppBrowser(onExitCallback: onBrowserExit, appo: appo, onLoadStartCallback: onBrowserLoadStart, context: context); - + transID = Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo); widget.browser!.openPaymentBrowser( - amount, - "Covid appointment payment", - Utils.getAppointmentTransID(appo.projectID!, appo.clinicID!, appo.appointmentNo!), - appo.projectID.toString(), - authenticatedUser.emailAddress!, - paymentMethod, - authenticatedUser.patientType, - authenticatedUser.firstName!, - authenticatedUser.patientID, - authenticatedUser, - widget.browser!, - widget.patientShareResponse!.isLiveCareAppointment!, - "2", - "", - AppGlobal.context, - widget.patientShareResponse!.appointmentDate, - widget.patientShareResponse!.appointmentNo!, - widget.patientShareResponse!.clinicID!, - widget.patientShareResponse!.doctorID!, - widget.selectedInstallmentPlan, - ); + amount, + "Covid appointment payment", + Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo), + appo.projectID.toString(), + authenticatedUser.emailAddress!, + paymentMethod, + authenticatedUser.patientType, + authenticatedUser.firstName!, + authenticatedUser.patientID, + authenticatedUser, + widget.browser!, + widget.patientShareResponse!.isLiveCareAppointment!, + "2", + "", + widget.patientShareResponse!.appointmentDate, + widget.patientShareResponse!.appointmentNo, + widget.patientShareResponse!.clinicID, + widget.patientShareResponse!.doctorID, + widget.selectedInstallmentPlan); } onBrowserLoadStart(String url) { @@ -278,7 +277,8 @@ class _CovidPaymentSummaryState extends State { print("onBrowserExit Called!!!!"); try { if (widget.selectedPaymentMethod == "TAMARA") { - checkTamaraPaymentStatus(Utils.getAppointmentTransID(appo.projectID!!, appo.clinicID!, appo.appointmentNo!), appo); + // checkTamaraPaymentStatus(Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo), appo); + checkTamaraPaymentStatus(transID, appo); // if (tamaraPaymentStatus != null && tamaraPaymentStatus.toLowerCase() == "approved") { // updateTamaraRequestStatus("success", "14", Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo), tamaraOrderID, num.parse(widget.selectedInstallmentPlan), appo); // } else { @@ -301,8 +301,8 @@ class _CovidPaymentSummaryState extends State { if (res["status"].toString().toLowerCase() == "success") { updateTamaraRequestStatus("success", "14", orderID, tamaraOrderID, int.parse(widget.selectedInstallmentPlan!), appo); } else { - updateTamaraRequestStatus("Failed", "00", Utils.getAppointmentTransID(appo.projectID!, appo.clinicID!, appo.appointmentNo!), tamaraOrderID != null ? tamaraOrderID : "", - int.parse(widget.selectedInstallmentPlan!), appo); + updateTamaraRequestStatus("Failed", "00", transID, tamaraOrderID != null ? tamaraOrderID : "", + num.parse(widget.selectedInstallmentPlan!), appo); } }).catchError((err) { GifLoaderDialogUtils.hideDialog(context); @@ -320,7 +320,7 @@ class _CovidPaymentSummaryState extends State { }); } - updateTamaraRequestStatus(String responseMessage, String status, String clientRequestID, String tamaraOrderID, int selectedInstallments, AppoitmentAllHistoryResultList appo) { + updateTamaraRequestStatus(String responseMessage, String status, String clientRequestID, String tamaraOrderID, num selectedInstallments, AppoitmentAllHistoryResultList appo) { GifLoaderDialogUtils.showMyDialog(context); try { DoctorsListService service = new DoctorsListService(); @@ -378,7 +378,7 @@ class _CovidPaymentSummaryState extends State { checkPaymentStatus(AppoitmentAllHistoryResultList appo) { GifLoaderDialogUtils.showMyDialog(context); DoctorsListService service = new DoctorsListService(); - service.checkPaymentStatus(Utils.getAppointmentTransID(appo.projectID!, appo.clinicID!, appo.appointmentNo!), false, context).then((res) { + service.checkPaymentStatus(transID, false, context).then((res) { print("Printing Payment Status Reponse!!!!"); print(res); String paymentInfo = res['Response_Message']; diff --git a/lib/pages/DrawerPages/family/my-family.dart b/lib/pages/DrawerPages/family/my-family.dart index d21315f3..c27928d4 100644 --- a/lib/pages/DrawerPages/family/my-family.dart +++ b/lib/pages/DrawerPages/family/my-family.dart @@ -495,6 +495,7 @@ class _MyFamily extends State with TickerProviderStateMixin { _vitalSignService.weightKg = ""; Provider.of(context, listen: false).user = result.list; Provider.of(context, listen: false).setUser(result.list); + Provider.of(context, listen: false).authenticatedUserObject.user = result.list; try { // await appointmentRateViewModel.getIsLastAppointmentRatedList(); diff --git a/lib/pages/ErService/AmbulanceRequestIndexPages/AmbulanceRequestIndex.dart b/lib/pages/ErService/AmbulanceRequestIndexPages/AmbulanceRequestIndex.dart index 23a79403..fc4155ca 100644 --- a/lib/pages/ErService/AmbulanceRequestIndexPages/AmbulanceRequestIndex.dart +++ b/lib/pages/ErService/AmbulanceRequestIndexPages/AmbulanceRequestIndex.dart @@ -219,9 +219,12 @@ class _AmbulanceRequestIndexPageState extends State { TranslationBase.of(context).pickupLocation + ": ", style: TextStyle(fontSize: 10, fontWeight: FontWeight.w600, color: Color(0xff575757), letterSpacing: -0.4, height: 16 / 10), ), - Text( - order.pickupLocation!.trim().toString(), - style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.48), + Container( + width: MediaQuery.of(context).size.width * 0.7, + child: Text( + order.pickupLocation!.trim().toString(), + style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.48), + ), ), ], ), @@ -352,12 +355,13 @@ class _AmbulanceRequestIndexPageState extends State { patientER_RC: _patientER_RC, amRequestViewModel: widget.amRequestViewModel, ), - BillAmount( - changeCurrentTab: _changeCurrentTab, - patientER: _patientER, - patientER_RC: _patientER_RC, - amRequestViewModel: widget.amRequestViewModel, - ), + Container(), + // BillAmount( + // changeCurrentTab: _changeCurrentTab, + // patientER: _patientER, + // patientER_RC: _patientER_RC, + // amRequestViewModel: widget.amRequestViewModel, + // ), Summary( changeCurrentTab: _changeCurrentTab, patientER: _patientER, diff --git a/lib/pages/ErService/AmbulanceRequestIndexPages/PickupLocation.dart b/lib/pages/ErService/AmbulanceRequestIndexPages/PickupLocation.dart index 47ca16b6..7dec3944 100644 --- a/lib/pages/ErService/AmbulanceRequestIndexPages/PickupLocation.dart +++ b/lib/pages/ErService/AmbulanceRequestIndexPages/PickupLocation.dart @@ -6,12 +6,14 @@ import 'package:diplomaticquarterapp/core/viewModels/er/am_request_view_model.da import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart'; import 'package:diplomaticquarterapp/models/ambulanceRequest/locationDetails.dart'; +import 'package:diplomaticquarterapp/theme/colors.dart'; import 'package:diplomaticquarterapp/uitl/ProgressDialog.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/location_util.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/uitl/utils_new.dart'; import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart'; import 'package:diplomaticquarterapp/widgets/data_display/medical/doctor_card.dart'; import 'package:diplomaticquarterapp/widgets/dialogs/radio_selection_dialog.dart'; @@ -496,13 +498,39 @@ class _PickupLocationState extends State { ), ], ), + // SizedBox( + // height: 45, + // ), + // if (myAppointment != null) + // SizedBox( + // height: 100, + // ), + Container( + margin: EdgeInsets.only(top: 12), + decoration: cardRadius(12), + padding: EdgeInsets.all(16.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text(TranslationBase.of(context).billAmount + " : ", style: TextStyle(fontSize: 16.0, letterSpacing: -0.64, fontWeight: FontWeight.w600)), + SizedBox(height: 16.0), + Row( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text(TranslationBase.of(context).patientShareTotalToDo, style: TextStyle(fontSize: 13.0, letterSpacing: -0.64, fontWeight: FontWeight.w600)), + Text( + TranslationBase.of(context).sar + (widget.patientER_RC.transportationDetails!.tripType == 1 ? ' ${widget.patientER_RC.patientERTransportationMethod!.priceTotal}' : ' ${(widget.patientER_RC.patientERTransportationMethod!.priceTotal * 2)}'), + style: TextStyle(fontSize: 16.0, letterSpacing: -0.64, fontWeight: FontWeight.bold), + ), + ], + ) + ], + ), + ), SizedBox( - height: 45, + height: 100, ), - if (myAppointment != null) - SizedBox( - height: 100, - ), ], ), ), @@ -510,62 +538,85 @@ class _PickupLocationState extends State { bottomSheet: Container( color: Theme.of(context).scaffoldBackgroundColor, padding: EdgeInsets.all(12.0), - child: DefaultButton( - TranslationBase.of(context).next, - () { - if (_result == null || _selectedHospital == null) - AppToast.showErrorToast(message: TranslationBase.of(context).selectAll); - else - setState(() { - widget.patientER_RC.transportationDetails!.pickupSpot = _isInsideHome ? 1 : 0; - if (widget.patientER_RC.transportationDetails!.direction == 0) { - // To Hospital - widget.patientER_RC.transportationDetails!.dropoffLatitude = _result!.lat.toStringAsFixed(6); - widget.patientER_RC.transportationDetails!.dropoffLongitude = _result!.long.toStringAsFixed(6); - widget.patientER_RC.transportationDetails!.pickupLatitude = _selectedHospital!.latitude; - widget.patientER_RC.transportationDetails!.pickupLongitude = _selectedHospital!.longitude; - } else { - // From Hospital - widget.patientER_RC.transportationDetails!.pickupLatitude = _selectedHospital!.latitude; - widget.patientER_RC.transportationDetails!.pickupLongitude = _selectedHospital!.longitude; - widget.patientER_RC.transportationDetails!.dropoffLatitude = _result!.lat.toStringAsFixed(6); - widget.patientER_RC.transportationDetails!.dropoffLongitude = _result!.long.toStringAsFixed(6); - } + child: Row( + children: [ + Expanded( + flex: 1, + child: DefaultButton( + TranslationBase.of(context).back, + () { + widget.changeCurrentTab(0); + }, + ), + ), + SizedBox(width: 12.0), + Expanded( + flex: 1, + child: DefaultButton( + TranslationBase.of(context).next, + () { + if (_result == null || _selectedHospital == null) + AppToast.showErrorToast(message: TranslationBase.of(context).selectAll); + else + setState(() { + widget.patientER_RC.transportationDetails!.pickupSpot = _isInsideHome ? 1 : 0; + if (widget.patientER_RC.transportationDetails!.direction == 0) { + // To Hospital + widget.patientER_RC.transportationDetails!.dropoffLatitude = _result!.lat.toStringAsFixed(6); + widget.patientER_RC.transportationDetails!.dropoffLongitude = _result!.long.toStringAsFixed(6); + widget.patientER_RC.transportationDetails!.pickupLatitude = _selectedHospital!.latitude; + widget.patientER_RC.transportationDetails!.pickupLongitude = _selectedHospital!.longitude; + } else { + // From Hospital + widget.patientER_RC.transportationDetails!.pickupLatitude = _selectedHospital!.latitude; + widget.patientER_RC.transportationDetails!.pickupLongitude = _selectedHospital!.longitude; + widget.patientER_RC.transportationDetails!.dropoffLatitude = _result!.lat.toStringAsFixed(6); + widget.patientER_RC.transportationDetails!.dropoffLongitude = _result!.long.toStringAsFixed(6); + } - widget.patientER_RC.transportationDetails!.dropoffLocationName = widget.patientER_RC.transportationDetails!.direction == 1 ? _result!.formattedAddress : _selectedHospital!.name; + widget.patientER_RC.transportationDetails!.dropoffLocationName = widget.patientER_RC.transportationDetails!.direction == 1 ? _result!.formattedAddress : _selectedHospital!.name; - widget.patientER_RC.patientIdentificationID = widget.amRequestViewModel.user.patientIdentificationNo; - widget.patientER_RC.transportationDetails!.pickupDateTime = DateUtil.convertDateToStringLocation(DateTime.now()); - widget.patientER_RC.transportationDetails!.pickupLocationName = widget.patientER_RC.transportationDetails!.direction == 1 ? _selectedHospital!.name : _result!.formattedAddress; - widget.patientER_RC.projectID = widget.amRequestViewModel.user.projectID; - widget.patientER_RC.patientID = widget.amRequestViewModel.user.patientID; - widget.patientER_RC.transportationDetails!.requesterIsOutSA = false; - widget.patientER_RC.transportationDetails!.requesterMobileNo = widget.amRequestViewModel.user.mobileNumber; - widget.patientER_RC.transportationDetails!.requesterFileNo = widget.amRequestViewModel.user.patientID; + widget.patientER_RC.patientIdentificationID = widget.amRequestViewModel.user.patientIdentificationNo; + widget.patientER_RC.transportationDetails!.pickupDateTime = DateUtil.convertDateToStringLocation(DateTime.now()); + widget.patientER_RC.transportationDetails!.pickupLocationName = widget.patientER_RC.transportationDetails!.direction == 1 ? _selectedHospital!.name : _result!.formattedAddress; + widget.patientER_RC.projectID = widget.amRequestViewModel.user.projectID; + widget.patientER_RC.patientID = widget.amRequestViewModel.user.patientID; + widget.patientER_RC.transportationDetails!.requesterIsOutSA = false; + widget.patientER_RC.transportationDetails!.requesterMobileNo = widget.amRequestViewModel.user.mobileNumber; + widget.patientER_RC.transportationDetails!.requesterFileNo = widget.amRequestViewModel.user.patientID; - if (_haveAppointment == HaveAppointment.YES) { - widget.patientER_RC.transportationDetails!.appointmentNo = myAppointment!.appointmentNo.toString(); - widget.patientER_RC.transportationDetails!.appointmentClinicName = myAppointment!.clinicName; - widget.patientER_RC.transportationDetails!.appointmentDoctorName = myAppointment!.doctorNameObj; - widget.patientER_RC.transportationDetails!.appointmentBranch = myAppointment!.projectName; - widget.patientER_RC.transportationDetails!.appointmentTime = myAppointment!.appointmentDate; - widget.patientER_RC.transportationDetails!.haveAppointment = 1; - widget.patientER_RC.transportationDetails!.dropoffLatitude = myAppointment!.latitude; - widget.patientER_RC.transportationDetails!.dropoffLongitude = myAppointment!.longitude; - widget.patientER_RC.transportationDetails!.dropoffLocationName = myAppointment!.projectName; - } else { - widget.patientER_RC.transportationDetails!.appointmentNo = "0"; - widget.patientER_RC.transportationDetails!.appointmentClinicName = ""; - widget.patientER_RC.transportationDetails!.appointmentDoctorName = ""; - widget.patientER_RC.transportationDetails!.appointmentBranch = ""; - widget.patientER_RC.transportationDetails!.appointmentTime = ""; - widget.patientER_RC.transportationDetails!.haveAppointment = 0; - } + if (_haveAppointment == HaveAppointment.YES) { + widget.patientER_RC.transportationDetails!.appointmentNo = myAppointment!.appointmentNo.toString(); + widget.patientER_RC.transportationDetails!.appointmentClinicName = myAppointment!.clinicName; + widget.patientER_RC.transportationDetails!.appointmentDoctorName = myAppointment!.doctorNameObj; + widget.patientER_RC.transportationDetails!.appointmentBranch = myAppointment!.projectName; + widget.patientER_RC.transportationDetails!.appointmentTime = myAppointment!.appointmentDate; + widget.patientER_RC.transportationDetails!.haveAppointment = 1; + widget.patientER_RC.transportationDetails!.dropoffLatitude = myAppointment!.latitude; + widget.patientER_RC.transportationDetails!.dropoffLongitude = myAppointment!.longitude; + widget.patientER_RC.transportationDetails!.dropoffLocationName = myAppointment!.projectName; + } else { + widget.patientER_RC.transportationDetails!.appointmentNo = "0"; + widget.patientER_RC.transportationDetails!.appointmentClinicName = ""; + widget.patientER_RC.transportationDetails!.appointmentDoctorName = ""; + widget.patientER_RC.transportationDetails!.appointmentBranch = ""; + widget.patientER_RC.transportationDetails!.appointmentTime = ""; + widget.patientER_RC.transportationDetails!.haveAppointment = 0; + } - widget.patientER_RC.transportationDetails!.pickupSpot = _isInsideHome ? 1 : 0; - widget.changeCurrentTab(2); - }); - }, + widget.patientER_RC.transportationDetails!.pickupSpot = _isInsideHome ? 1 : 0; + + widget.patientER_RC.transportationDetails!.ambulate = 3; + widget.patientER_RC.transportationDetails!.ambulateTitle = "none"; + widget.patientER_RC.transportationDetails!.notes = ""; + + widget.changeCurrentTab(3); + }); + }, + color: CustomColors.green, + ), + ), + ], ), ), ); diff --git a/lib/pages/ErService/AmbulanceRequestIndexPages/SelectTransportationMethod.dart b/lib/pages/ErService/AmbulanceRequestIndexPages/SelectTransportationMethod.dart index 1d2058b0..d994d31b 100644 --- a/lib/pages/ErService/AmbulanceRequestIndexPages/SelectTransportationMethod.dart +++ b/lib/pages/ErService/AmbulanceRequestIndexPages/SelectTransportationMethod.dart @@ -4,6 +4,7 @@ import 'package:diplomaticquarterapp/core/model/er/PatientER_RC.dart'; import 'package:diplomaticquarterapp/core/model/er/get_all_transportation_method_list_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/er/am_request_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; +import 'package:diplomaticquarterapp/theme/colors.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/utils_new.dart'; import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart'; @@ -13,6 +14,7 @@ import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; enum Direction { ToHospital, FromHospital } + enum Way { OneWay, TwoWays } class SelectTransportationMethod extends StatefulWidget { @@ -122,7 +124,7 @@ class _SelectTransportationMethodState extends State Expanded( flex: 1, child: Text( - TranslationBase.of(context).sar + ' ${widget.amRequestViewModel.amRequestModeList[index].price}', + TranslationBase.of(context).sar + ' ${widget.amRequestViewModel.amRequestModeList[index].priceTotal}', style: TextStyle( fontSize: 12.0, letterSpacing: -0.48, @@ -231,7 +233,6 @@ class _SelectTransportationMethodState extends State height: 5, ), Container( - margin: EdgeInsets.only(bottom: 65), child: Row( children: [ Expanded( @@ -288,12 +289,14 @@ class _SelectTransportationMethodState extends State }); }, ), - Text(TranslationBase.of(context).twoDirec, - style: TextStyle( - fontSize: 12.0, - letterSpacing: -0.48, - fontWeight: FontWeight.w600, - )), + Text( + TranslationBase.of(context).twoDirec, + style: TextStyle( + fontSize: 12.0, + letterSpacing: -0.48, + fontWeight: FontWeight.w600, + ), + ), ], ), ), @@ -303,13 +306,36 @@ class _SelectTransportationMethodState extends State ], ), ), - SizedBox( - height: 30, - ), + // SizedBox( + // height: 30, + // ), ], ), + Container( + margin: EdgeInsets.only(top: 12), + decoration: cardRadius(12), + padding: EdgeInsets.all(16.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text(TranslationBase.of(context).billAmount + " : ", style: TextStyle(fontSize: 16.0, letterSpacing: -0.64, fontWeight: FontWeight.w600)), + SizedBox(height: 16.0), + Row( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text(TranslationBase.of(context).patientShareTotalToDo, style: TextStyle(fontSize: 13.0, letterSpacing: -0.64, fontWeight: FontWeight.w600)), + Text( + TranslationBase.of(context).sar + (_way == Way.OneWay ? ' ${_erTransportationMethod.priceTotal}' : ' ${(_erTransportationMethod.priceTotal * 2)}'), + style: TextStyle(fontSize: 16.0, letterSpacing: -0.64, fontWeight: FontWeight.bold), + ), + ], + ) + ], + ), + ), SizedBox( - height: 15, + height: 100, ), ], ), @@ -318,38 +344,55 @@ class _SelectTransportationMethodState extends State bottomSheet: Container( color: Theme.of(context).scaffoldBackgroundColor, padding: EdgeInsets.all(12.0), - child: DefaultButton( - TranslationBase.of(context).next, - () { - setState(() { - // widget.patientER.transportationMethodId = (widget.amRequestViewModel.amRequestModeList.indexOf(_erTransportationMethod) + 1); - // widget.patientER.direction = _direction == Direction.ToHospital ? 1 : 0; - // widget.patientER.tripType = _way == Way.TwoWays ? 0 : 1; - // widget.patientER.selectedAmbulate = (widget.amRequestViewModel.amRequestModeList.indexOf(_erTransportationMethod) + 1); - // widget.patientER.patientERTransportationMethod = _erTransportationMethod; - // widget.patientER.orderServiceID = _orderService.getIdOrderService(); - // widget.patientER.pickupUrgency = 1; - // widget.patientER.lineItemNo = 1; - // widget.patientER.cost = _erTransportationMethod.price.toDouble(); - // widget.patientER.vAT = _erTransportationMethod.priceVAT ?? 0; - // widget.patientER.totalPrice = _erTransportationMethod.priceTotal.toDouble(); - // widget.changeCurrentTab(1); + child: Row( + children: [ + Expanded( + flex: 1, + child: DefaultButton( + TranslationBase.of(context).back, + () { + Navigator.pop(context); + }, + )), + SizedBox(width: 12.0), + Expanded( + flex: 1, + child: DefaultButton( + TranslationBase.of(context).next, + () { + setState(() { + // widget.patientER.transportationMethodId = (widget.amRequestViewModel.amRequestModeList.indexOf(_erTransportationMethod) + 1); + // widget.patientER.direction = _direction == Direction.ToHospital ? 1 : 0; + // widget.patientER.tripType = _way == Way.TwoWays ? 0 : 1; + // widget.patientER.selectedAmbulate = (widget.amRequestViewModel.amRequestModeList.indexOf(_erTransportationMethod) + 1); + // widget.patientER.patientERTransportationMethod = _erTransportationMethod; + // widget.patientER.orderServiceID = _orderService.getIdOrderService(); + // widget.patientER.pickupUrgency = 1; + // widget.patientER.lineItemNo = 1; + // widget.patientER.cost = _erTransportationMethod.price.toDouble(); + // widget.patientER.vAT = _erTransportationMethod.priceVAT ?? 0; + // widget.patientER.totalPrice = _erTransportationMethod.priceTotal.toDouble(); + // widget.changeCurrentTab(1); - // widget.patientER_RC.transportationDetails.id = (widget.amRequestViewModel.amRequestModeList.indexOf(_erTransportationMethod) + 1); - widget.patientER_RC.transportationDetails!.direction = _direction == Direction.ToHospital ? 0 : 1; - widget.patientER_RC.transportationDetails!.tripType = _way == Way.TwoWays ? 0 : 1; - widget.patientER_RC.transportationDetails!.ambulate = (widget.amRequestViewModel.amRequestModeList.indexOf(_erTransportationMethod) + 1); - widget.patientER_RC.transportationDetails!.transportationType = _erTransportationMethod.iD.toString(); - widget.patientER_RC.patientERTransportationMethod = _erTransportationMethod; - widget.patientER_RC.transportationDetails!.pickupUrgency = 1; - // widget.patientER.orderServiceID = _orderService.getIdOrderService(); - // widget.patientER.lineItemNo = 1; - // widget.patientER.cost = _erTransportationMethod.price.toDouble(); - // widget.patientER.vAT = _erTransportationMethod.priceVAT ?? 0; - // widget.patientER.totalPrice = _erTransportationMethod.priceTotal.toDouble(); - widget.changeCurrentTab(1); - }); - }, + // widget.patientER_RC.transportationDetails.id = (widget.amRequestViewModel.amRequestModeList.indexOf(_erTransportationMethod) + 1); + widget.patientER_RC.transportationDetails!.direction = _direction == Direction.ToHospital ? 0 : 1; + widget.patientER_RC.transportationDetails!.tripType = _way == Way.TwoWays ? 0 : 1; + widget.patientER_RC.transportationDetails!.ambulate = (widget.amRequestViewModel.amRequestModeList.indexOf(_erTransportationMethod) + 1); + widget.patientER_RC.transportationDetails!.transportationType = _erTransportationMethod.iD.toString(); + widget.patientER_RC.patientERTransportationMethod = _erTransportationMethod; + widget.patientER_RC.transportationDetails!.pickupUrgency = 1; + // widget.patientER.orderServiceID = _orderService.getIdOrderService(); + // widget.patientER.lineItemNo = 1; + // widget.patientER.cost = _erTransportationMethod.price.toDouble(); + // widget.patientER.vAT = _erTransportationMethod.priceVAT ?? 0; + // widget.patientER.totalPrice = _erTransportationMethod.priceTotal.toDouble(); + widget.changeCurrentTab(1); + }); + }, + color: CustomColors.green, + ), + ), + ], ), ), ); diff --git a/lib/pages/ErService/AmbulanceRequestIndexPages/Summary.dart b/lib/pages/ErService/AmbulanceRequestIndexPages/Summary.dart index b566474e..85e88d7e 100644 --- a/lib/pages/ErService/AmbulanceRequestIndexPages/Summary.dart +++ b/lib/pages/ErService/AmbulanceRequestIndexPages/Summary.dart @@ -2,6 +2,7 @@ import 'package:diplomaticquarterapp/core/model/er/PatientER.dart'; import 'package:diplomaticquarterapp/core/model/er/PatientER_RC.dart'; import 'package:diplomaticquarterapp/core/viewModels/er/am_request_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; +import 'package:diplomaticquarterapp/theme/colors.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/utils_new.dart'; import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart'; @@ -9,6 +10,7 @@ import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; +import 'package:url_launcher/url_launcher.dart'; class Summary extends StatefulWidget { final Function(int)? changeCurrentTab; @@ -87,48 +89,89 @@ class _SummaryState extends State { SizedBox( height: 8, ), - _getNormalText(TranslationBase.of(context).selectAmbulate), + _getNormalText(TranslationBase.of(context).way), _getNormalText( - '${widget.patientER_RC.transportationDetails!.ambulateTitle}', - isBold: true, - ), - SizedBox( - height: 8, - ), - _getNormalText(TranslationBase.of(context).notes), - _getNormalText( - '${widget.patientER_RC.transportationDetails!.notes ?? '---'}', + widget.patientER_RC.transportationDetails!.tripType == 0 ? TranslationBase.of(context).twoDirec : TranslationBase.of(context).oneDirec, isBold: true, ), SizedBox( height: 8, ), + // // _getNormalText(TranslationBase.of(context).notes), + // // _getNormalText( + // // '${widget.patientER_RC.transportationDetails.notes ?? '---'}', + // // isBold: true, + // // ), + // SizedBox( + // height: 8, + // ), ], ), ), - SizedBox( - height: 20, - ), - Text(TranslationBase.of(context).billAmount, style: TextStyle(fontSize: 16.0, letterSpacing: -0.64, fontWeight: FontWeight.w600)), - SizedBox( - height: 5, + // SizedBox( + // height: 20, + // ), + // Text(TranslationBase.of(context).billAmount, style: TextStyle(fontSize: 16.0, letterSpacing: -0.64, fontWeight: FontWeight.w600)), + // SizedBox( + // height: 5, + // ), + Container( + margin: EdgeInsets.only(top: 12), + decoration: cardRadius(12), + padding: EdgeInsets.all(16.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text(TranslationBase.of(context).billAmount + " : ", style: TextStyle(fontSize: 16.0, letterSpacing: -0.64, fontWeight: FontWeight.w600)), + SizedBox(height: 16.0), + Row( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text(TranslationBase.of(context).patientShareTotalToDo, style: TextStyle(fontSize: 13.0, letterSpacing: -0.64, fontWeight: FontWeight.w600)), + Text( + TranslationBase.of(context).sar + + (widget.patientER_RC.transportationDetails!.tripType == 1 + ? ' ${widget.patientER_RC.patientERTransportationMethod!.priceTotal}' + : ' ${(widget.patientER_RC.patientERTransportationMethod!.priceTotal * 2)}'), + style: TextStyle(fontSize: 16.0, letterSpacing: -0.64, fontWeight: FontWeight.bold), + ), + ], + ) + ], + ), ), Container( - height: 55, - padding: EdgeInsets.all(10), + margin: EdgeInsets.only(top: 12), decoration: cardRadius(12), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, + padding: EdgeInsets.all(16.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, children: [ - _getNormalText(TranslationBase.of(context).patientShareTotal + ':'), - Container( - padding: EdgeInsets.only(left: 20.0, right: 20.0), - child: _getNormalText(TranslationBase.of(context).sar + ' ${widget.patientER_RC.patientERTransportationMethod!.priceTotal}', isBold: true, isTotal: true) - ), + Text(TranslationBase.of(context).contactRRT + " : ", style: TextStyle(fontSize: 16.0, letterSpacing: -0.64, fontWeight: FontWeight.w600)), + SizedBox(height: 16.0), + InkWell( + onTap: () { + launchUrl( + Uri.parse("tel://0115259555"), + ); + }, + child: Row( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text("0115259555", style: TextStyle(fontSize: 16.0, letterSpacing: -0.64, fontWeight: FontWeight.bold)), + Icon( + Icons.headset_mic_rounded, + size: 30.0, + ) + ], + ), + ) ], ), ), - SizedBox(height: 50), + SizedBox(height: 80), ], ), ), @@ -136,11 +179,30 @@ class _SummaryState extends State { bottomSheet: Container( color: Theme.of(context).scaffoldBackgroundColor, padding: EdgeInsets.all(12.0), - child: DefaultButton(TranslationBase.of(context).send, () async { - await widget.amRequestViewModel.insertERPressOrder(patientER: widget.patientER_RC); - widget.tabController.animateTo(1); - - }), + child: Row( + children: [ + Expanded( + flex: 1, + child: DefaultButton( + TranslationBase.of(context).back, + () { + widget.changeCurrentTab!(1); + }, + ), + ), + SizedBox(width: 12.0), + Expanded( + flex: 1, + child: DefaultButton( + TranslationBase.of(context).submit, + () async { + await widget.amRequestViewModel.insertERPressOrder(patientER: widget.patientER_RC); + }, + color: CustomColors.green, + ), + ), + ], + ), ), ); } diff --git a/lib/pages/ErService/OrderLogPage.dart b/lib/pages/ErService/OrderLogPage.dart index ff5066cf..a551bda6 100644 --- a/lib/pages/ErService/OrderLogPage.dart +++ b/lib/pages/ErService/OrderLogPage.dart @@ -202,9 +202,12 @@ class OrderLogPage extends StatelessWidget { TranslationBase.of(context).pickupLocation + ": ", style: TextStyle(fontSize: 10, fontWeight: FontWeight.w600, color: Color(0xff575757), letterSpacing: -0.4, height: 16 / 10), ), - Text( - order.pickupLocation!.trim().toString(), - style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.48), + Container( + width: MediaQuery.of(context).size.width * 0.7, + child: Text( + order.pickupLocation!.trim().toString(), + style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.48, overflow: TextOverflow.clip), + ), ), ], ), diff --git a/lib/pages/ErService/rapid-response-team/rrt-request-page.dart b/lib/pages/ErService/rapid-response-team/rrt-request-page.dart index a473fd50..cb7229ad 100644 --- a/lib/pages/ErService/rapid-response-team/rrt-request-page.dart +++ b/lib/pages/ErService/rapid-response-team/rrt-request-page.dart @@ -173,22 +173,122 @@ class RRTRequestPageState extends State { String amount = selectedProcedure.patientShare.toString(); String vat = selectedProcedure.patientTaxAmount.toString(); String total = selectedProcedure.patientShareWithTax.toString(); - return Column( - crossAxisAlignment: CrossAxisAlignment.stretch, - children: [ - Container( - height: 30, - decoration: BoxDecoration(color: Theme.of(context).appBarTheme.backgroundColor, borderRadius: BorderRadius.only(topLeft: radius, topRight: radius)), - child: Center(child: Text(TranslationBase.of(context).approximateServiceFee, style: TextStyle(color: Colors.white, fontSize: 12, fontWeight: FontWeight.w500, letterSpacing: 1))), - ), - pricingRow(label: TranslationBase.of(context).patientShare, value: '$amount ${TranslationBase.of(context).sar}'), - Container(height: 0.5, color: Theme.of(context).appBarTheme.backgroundColor), - pricingRow(label: TranslationBase.of(context).patientTaxToDo, value: '$vat ${TranslationBase.of(context).sar}'), - Container(height: 0.5, color: Theme.of(context).appBarTheme.backgroundColor), - pricingRow(label: TranslationBase.of(context).patientShareWithTax, value: '$total ${TranslationBase.of(context).sar}', labelBold: true), - Container(height: 0.5, color: Theme.of(context).appBarTheme.backgroundColor), - ], + return Container( + decoration: cardRadius(12), + padding: EdgeInsets.all(12), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + TranslationBase.of(context).billAmount, + textAlign: TextAlign.center, + style: TextStyle( + fontSize: 16.0, + fontWeight: FontWeight.w600, + letterSpacing: -0.64, + ), + ), + mHeight(10), + Row( + children: [ + Expanded( + child: Text( + TranslationBase.of(context).patientShareToDo, + style: TextStyle( + fontSize: 10, + letterSpacing: -0.4, + color: CustomColors.textColor, + fontWeight: FontWeight.w600, + ), + ), + ), + Expanded( + child: Text( + '$amount ${TranslationBase.of(context).sar}', + style: TextStyle( + fontSize: 12, + letterSpacing: -0.48, + fontWeight: FontWeight.w600, + ), + ), + ), + ], + ), + mHeight(4), + mDivider(CustomColors.lightGreyColor), + mHeight(4), + Row( + children: [ + Expanded( + child: Text( + TranslationBase.of(context).patientTaxToDo, + style: TextStyle( + fontSize: 10, + letterSpacing: -0.4, + color: CustomColors.textColor, + fontWeight: FontWeight.w600, + ), + ), + ), + Expanded( + child: Text( + '$vat ${TranslationBase.of(context).sar}', + style: TextStyle( + fontSize: 12, + letterSpacing: -0.48, + fontWeight: FontWeight.w600, + ), + ), + ), + ], + ), + mHeight(4), + mDivider(CustomColors.lightGreyColor), + mHeight(4), + Row( + children: [ + Expanded( + child: Text( + TranslationBase.of(context).patientShareTotalToDo, + style: TextStyle( + fontSize: 14, + letterSpacing: -0.4, + color: CustomColors.textColor, + fontWeight: FontWeight.bold, + ), + ), + ), + Expanded( + child: Text( + '$total ${TranslationBase.of(context).sar}', + style: TextStyle( + fontSize: 14, + letterSpacing: -0.48, + fontWeight: FontWeight.bold, + ), + ), + ), + ], + ), + ], + ), ); + // Column( + // crossAxisAlignment: CrossAxisAlignment.stretch, + // children: [ + // Container( + // height: 30, + // decoration: BoxDecoration(color: Theme.of(context).appBarTheme.color, borderRadius: BorderRadius.only(topLeft: radius, topRight: radius)), + // child: Center(child: Text(TranslationBase.of(context).approximateServiceFee, style: TextStyle(color: Colors.white, fontSize: 12, fontWeight: FontWeight.w500, letterSpacing: 1))), + // ), + // pricingRow(label: TranslationBase.of(context).patientShare, value: '$amount ${TranslationBase.of(context).sar}'), + // Container(height: 0.5, color: Theme.of(context).appBarTheme.color), + // pricingRow(label: TranslationBase.of(context).patientTaxToDo, value: '$vat ${TranslationBase.of(context).sar}'), + // Container(height: 0.5, color: Theme.of(context).appBarTheme.color), + // pricingRow(label: TranslationBase.of(context).patientShareWithTax, value: '$total ${TranslationBase.of(context).sar}', labelBold: true), + // Container(height: 0.5, color: Theme.of(context).appBarTheme.color), + // ], + // ); } Widget pricingRow({required String label, required String value, bool labelBold = false, bool valueBold = false}) { diff --git a/lib/pages/ErService/widgets/StepsWidget.dart b/lib/pages/ErService/widgets/StepsWidget.dart index 631f0a2f..97acd38f 100644 --- a/lib/pages/ErService/widgets/StepsWidget.dart +++ b/lib/pages/ErService/widgets/StepsWidget.dart @@ -45,21 +45,21 @@ class StepsWidget extends StatelessWidget { : CustomColors.grey2, ), ), - Expanded( - child: showProgress( - title: TranslationBase.of(context).otherInfo, - status: index == 2 - ? TranslationBase.of(context).inPrgress - : index > 2 - ? TranslationBase.of(context).completed - : TranslationBase.of(context).locked, - color: index == 2 - ? CustomColors.orange - : index > 2 - ? CustomColors.green - : CustomColors.grey2, - ), - ), + // Expanded( + // child: showProgress( + // title: TranslationBase.of(context).otherInfo, + // status: index == 2 + // ? TranslationBase.of(context).inPrgress + // : index > 2 + // ? TranslationBase.of(context).completed + // : TranslationBase.of(context).locked, + // color: index == 2 + // ? CustomColors.orange + // : index > 2 + // ? CustomColors.green + // : CustomColors.grey2, + // ), + // ), showProgress( title: TranslationBase.of(context).RRTSummary, status: index == 3 ? TranslationBase.of(context).inPrgress : TranslationBase.of(context).locked, diff --git a/lib/pages/ToDoList/ToDo.dart b/lib/pages/ToDoList/ToDo.dart index af47cc14..9224ae1f 100644 --- a/lib/pages/ToDoList/ToDo.dart +++ b/lib/pages/ToDoList/ToDo.dart @@ -1155,7 +1155,7 @@ class _ToDoState extends State with SingleTickerProviderStateMixin { onBrowserExit(AppoitmentAllHistoryResultList appo, bool isPaymentMade) { print("onBrowserExit Called!!!!"); if (selectedPaymentMethod == "TAMARA") { - checkTamaraPaymentStatus(Utils.getAppointmentTransID(appo.projectID!, appo.clinicID!, appo.appointmentNo!), appo); + checkTamaraPaymentStatus(transID!, appo); // if (tamaraPaymentStatus != null && tamaraPaymentStatus.toLowerCase() == "approved") { // updateTamaraRequestStatus("success", "14", Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo), tamaraOrderID, num.parse(selectedInstallments), appo); // } else { @@ -1174,8 +1174,7 @@ class _ToDoState extends State with SingleTickerProviderStateMixin { if (res["status"].toString().toLowerCase() == "success") { updateTamaraRequestStatus("success", "14", orderID, res["tamara_order_id"], int.parse(selectedInstallments!), appo); } else { - updateTamaraRequestStatus( - "Failed", "00", Utils.getAppointmentTransID(appo.projectID!, appo.clinicID!, appo.appointmentNo!), tamaraOrderID != null ? tamaraOrderID : "", int.parse(selectedInstallments!), appo); + updateTamaraRequestStatus("Failed", "00", transID!, tamaraOrderID != null ? tamaraOrderID : "", int.parse(selectedInstallments), appo); } }).catchError((err) { GifLoaderDialogUtils.hideDialog(context); @@ -1309,10 +1308,7 @@ class _ToDoState extends State with SingleTickerProviderStateMixin { addVIDARequestInsert(String advanceNumber, String paymentReference, AppoitmentAllHistoryResultList appo) { GifLoaderDialogUtils.showMyDialog(context); DoctorsListService service = new DoctorsListService(); - service - .insertVIDARequest(appo.appointmentNo, appo.clinicID, appo.projectID, appo.serviceID, appo.doctorID, appo.appointmentDate!, - transID!, projectViewModel.isArabic ? 1 : 2, context) - .then((res) { + service.insertVIDARequest(appo.appointmentNo, appo.clinicID, appo.projectID, appo.serviceID, appo.doctorID, appo.appointmentDate!, transID!, projectViewModel.isArabic ? 1 : 2, context).then((res) { GifLoaderDialogUtils.hideDialog(context); getPatientAppointmentHistory(); }).catchError((err) { @@ -1367,20 +1363,20 @@ class _ToDoState extends State with SingleTickerProviderStateMixin { applePayInsertRequest.clientRequestID = transID; applePayInsertRequest.clinicID = appo.clinicID; - applePayInsertRequest.currency = projectViewModel.authenticatedUserObject.user.outSA == 1 ? "AED" : "SAR"; + applePayInsertRequest.currency = projectViewModel.user.outSA == 1 ? "AED" : "SAR"; // applePayInsertRequest.customerEmail = projectViewModel.authenticatedUserObject.user.emailAddress; - applePayInsertRequest.customerEmail = "CustID_${projectViewModel.authenticatedUserObject.user.patientID}@HMG.com"; - applePayInsertRequest.customerID = projectViewModel.authenticatedUserObject.user.patientID; - applePayInsertRequest.customerName = projectViewModel.authenticatedUserObject.user.firstName! + " " + projectViewModel.authenticatedUserObject.user!.lastName!; + applePayInsertRequest.customerEmail = "CustID_${projectViewModel.user.patientID}@HMG.com"; + applePayInsertRequest.customerID = projectViewModel.user.patientID; + applePayInsertRequest.customerName = projectViewModel.user.firstName! + " " + projectViewModel.user.lastName!; applePayInsertRequest.deviceToken = await AppSharedPreferences().getString(PUSH_TOKEN); applePayInsertRequest.voipToken = await AppSharedPreferences().getString(ONESIGNAL_APNS_TOKEN); applePayInsertRequest.doctorID = appo.doctorID; applePayInsertRequest.projectID = appo.projectID.toString(); - applePayInsertRequest.serviceID = ServiceTypeEnum.advancePayment.getIdFromServiceEnum().toString(); + applePayInsertRequest.serviceID = ServiceTypeEnum.appointmentPayment.getIdFromServiceEnum().toString(); applePayInsertRequest.channelID = 3; - applePayInsertRequest.patientID = projectViewModel.authenticatedUserObject.user.patientID; - applePayInsertRequest.patientTypeID = projectViewModel.authenticatedUserObject.user.patientType; - applePayInsertRequest.patientOutSA = projectViewModel.authenticatedUserObject.user.outSA; + applePayInsertRequest.patientID = projectViewModel.user.patientID; + applePayInsertRequest.patientTypeID = projectViewModel.user.patientType; + applePayInsertRequest.patientOutSA = projectViewModel.user.outSA; applePayInsertRequest.appointmentDate = appo.appointmentDate; applePayInsertRequest.appointmentNo = appo.appointmentNo; applePayInsertRequest.orderDescription = "Appointment Payment"; @@ -1391,7 +1387,7 @@ class _ToDoState extends State with SingleTickerProviderStateMixin { applePayInsertRequest.isSchedule = appo.isLiveCareAppointment! ? "1" : "0"; applePayInsertRequest.language = projectViewModel.isArabic ? 'ar' : 'en'; applePayInsertRequest.languageID = projectViewModel.isArabic ? 1 : 2; - applePayInsertRequest.userName = projectViewModel.authenticatedUserObject.user.patientID; + applePayInsertRequest.userName = projectViewModel.user.patientID; applePayInsertRequest.responseContinueURL = "http://hmg.com/Documents/success.html"; applePayInsertRequest.backClickUrl = "http://hmg.com/Documents/success.html"; applePayInsertRequest.paymentOption = "ApplePay"; @@ -1408,21 +1404,21 @@ class _ToDoState extends State with SingleTickerProviderStateMixin { service.applePayInsertRequest(applePayInsertRequest, context).then((res) async { await context.read().initiateApplePayWithPayfort( - customerName: projectViewModel.authenticatedUserObject.user.firstName! + " " + projectViewModel.authenticatedUserObject.user.lastName!, + customerName: projectViewModel.user.firstName! + " " + projectViewModel.user.lastName!, // customerEmail: projectViewModel.authenticatedUserObject.user.emailAddress, - customerEmail: "CustID_${projectViewModel.authenticatedUserObject.user.patientID}@HMG.com", + customerEmail: "CustID_${projectViewModel.user.patientID}@HMG.com", orderDescription: "Appointment Payment", orderAmount: double.parse(patientShareResponse.patientShareWithTax.toString()), merchantReference: transID, payfortProjectDetailsRespModel: payfortProjectDetailsRespModel, - currency: projectViewModel.authenticatedUserObject.user.outSA == 1 ? "AED" : "SAR", + currency: projectViewModel.user.outSA == 1 ? "AED" : "SAR", onFailed: (failureResult) async { log("failureResult: ${failureResult.toString()}"); AppToast.showErrorToast(message: failureResult.toString()); }, onSuccess: (successResult) async { log("Payfort: ${successResult.responseMessage}"); - await context.read().addPayfortApplePayResponse(result: successResult); + await context.read().addPayfortApplePayResponse(projectViewModel.user.patientID!, result: successResult); checkPaymentStatus(appo); }, projectId: appo.projectID, diff --git a/lib/pages/livecare/widgets/clinic_list.dart b/lib/pages/livecare/widgets/clinic_list.dart index b1e33040..e6d805d2 100644 --- a/lib/pages/livecare/widgets/clinic_list.dart +++ b/lib/pages/livecare/widgets/clinic_list.dart @@ -370,20 +370,20 @@ class _clinic_listState extends State { applePayInsertRequest.clientRequestID = transID; applePayInsertRequest.clinicID = appo.clinicID; - applePayInsertRequest.currency = projectViewModel.authenticatedUserObject.user.outSA == 1 ? "AED" : "SAR"; + applePayInsertRequest.currency = projectViewModel.user.outSA == 1 ? "AED" : "SAR"; // applePayInsertRequest.customerEmail = projectViewModel.authenticatedUserObject.user.emailAddress; - applePayInsertRequest.customerEmail = "CustID_${projectViewModel.authenticatedUserObject.user.patientID}@HMG.com"; - applePayInsertRequest.customerID = projectViewModel.authenticatedUserObject.user.patientID; - applePayInsertRequest.customerName = projectViewModel.authenticatedUserObject.user.firstName! + " " + projectViewModel.authenticatedUserObject.user.lastName!; + applePayInsertRequest.customerEmail = "CustID_${projectViewModel.user.patientID}@HMG.com"; + applePayInsertRequest.customerID = projectViewModel.user.patientID; + applePayInsertRequest.customerName = projectViewModel.user.firstName! + " " + projectViewModel.user.lastName!; applePayInsertRequest.deviceToken = await AppSharedPreferences().getString(PUSH_TOKEN); applePayInsertRequest.voipToken = await AppSharedPreferences().getString(ONESIGNAL_APNS_TOKEN); applePayInsertRequest.doctorID = appo.doctorID; applePayInsertRequest.projectID = appo.projectID.toString(); applePayInsertRequest.serviceID = ServiceTypeEnum.liveCareAppointment.getIdFromServiceEnum().toString(); applePayInsertRequest.channelID = 3; - applePayInsertRequest.patientID = projectViewModel.authenticatedUserObject.user.patientID; - applePayInsertRequest.patientTypeID = projectViewModel.authenticatedUserObject.user.patientType; - applePayInsertRequest.patientOutSA = projectViewModel.authenticatedUserObject.user.outSA; + applePayInsertRequest.patientID = projectViewModel.user.patientID; + applePayInsertRequest.patientTypeID = projectViewModel.user.patientType; + applePayInsertRequest.patientOutSA = projectViewModel.user.outSA; applePayInsertRequest.appointmentDate = appo.appointmentDate; applePayInsertRequest.appointmentNo = appo.appointmentNo; applePayInsertRequest.orderDescription = "LiveCare Payment"; @@ -394,7 +394,7 @@ class _clinic_listState extends State { applePayInsertRequest.isSchedule = appo.isLiveCareAppointment! ? "1" : "0"; applePayInsertRequest.language = projectViewModel.isArabic ? 'ar' : 'en'; applePayInsertRequest.languageID = projectViewModel.isArabic ? 1 : 2; - applePayInsertRequest.userName = projectViewModel.authenticatedUserObject.user.patientID; + applePayInsertRequest.userName = projectViewModel.user.patientID; applePayInsertRequest.responseContinueURL = "http://hmg.com/Documents/success.html"; applePayInsertRequest.backClickUrl = "http://hmg.com/Documents/success.html"; applePayInsertRequest.paymentOption = "ApplePay"; @@ -411,14 +411,14 @@ class _clinic_listState extends State { service.applePayInsertRequest(applePayInsertRequest, localContext!).then((res) async { await localContext!.read().initiateApplePayWithPayfort( - customerName: projectViewModel.authenticatedUserObject.user.firstName! + " " + projectViewModel.authenticatedUserObject!.user.lastName!, + customerName: projectViewModel.user.firstName! + " " + projectViewModel.user.lastName!, // customerEmail: projectViewModel.authenticatedUserObject.user.emailAddress, - customerEmail: "CustID_${projectViewModel.authenticatedUserObject.user.patientID}@HMG.com", + customerEmail: "CustID_${projectViewModel.user.patientID}@HMG.com", orderDescription: "LiveCare Payment", orderAmount: double.parse(amount), merchantReference: transID, payfortProjectDetailsRespModel: payfortProjectDetailsRespModel, - currency: projectViewModel.authenticatedUserObject.user.outSA == 1 ? "AED" : "SAR", + currency: projectViewModel.user.outSA == 1 ? "AED" : "SAR", onFailed: (failureResult) async { log("failureResult: ${failureResult.toString()}"); GifLoaderDialogUtils.hideDialog(localContext!); @@ -427,7 +427,7 @@ class _clinic_listState extends State { onSuccess: (successResult) async { GifLoaderDialogUtils.hideDialog(localContext!); log("Payfort: ${successResult.responseMessage}"); - await localContext!.read().addPayfortApplePayResponse(result: successResult); + await localContext!.read().addPayfortApplePayResponse(projectViewModel.user.patientID!, result: successResult); checkPaymentStatus(appo); }, projectId: appo.projectID, @@ -515,8 +515,7 @@ class _clinic_listState extends State { if (res["status"].toString().toLowerCase() == "success") { updateTamaraRequestStatus("success", "14", orderID, tamaraOrderID, int.parse(selectedInstallmentPlan), appo); } else { - updateTamaraRequestStatus( - "Failed", "00", transID!, tamaraOrderID != null ? tamaraOrderID : "", num.parse(selectedInstallmentPlan), appo); + updateTamaraRequestStatus("Failed", "00", transID!, tamaraOrderID != null ? tamaraOrderID : "", num.parse(selectedInstallmentPlan), appo); } }).catchError((err) { GifLoaderDialogUtils.hideDialog(context); diff --git a/lib/pages/medical/balance/confirm_payment_page.dart b/lib/pages/medical/balance/confirm_payment_page.dart index 2eb4430f..1384251d 100644 --- a/lib/pages/medical/balance/confirm_payment_page.dart +++ b/lib/pages/medical/balance/confirm_payment_page.dart @@ -76,12 +76,19 @@ class _ConfirmPaymentPageState extends State { Navigator.pop(context, true); AppoitmentAllHistoryResultList appo = new AppoitmentAllHistoryResultList(); appo.projectID = widget.patientInfoAndMobileNumber!.projectID; - // if (widget.selectedPaymentMethod == "ApplePay") { - // startApplePay(); - // } else { + + if (widget.selectedPaymentMethod == "ApplePay") { + if (projectViewModel.havePrivilege(103)) { + startApplePay(); + } else { + openPayment(widget.selectedPaymentMethod!, widget.authenticatedUser!, double.parse(widget.advanceModel!.amount!), AppoitmentAllHistoryResultList()); + } + } else { + openPayment(widget.selectedPaymentMethod!, widget.authenticatedUser!, double.parse(widget.advanceModel!.amount!), AppoitmentAllHistoryResultList()); + } + projectViewModel.analytics.advancePayments.payment_otp_confirmation(method: widget.selectedPaymentMethod!.toLowerCase(), type: 'wallet'); - openPayment(widget.selectedPaymentMethod!, widget.authenticatedUser!, double.parse(widget.advanceModel!.amount!), AppoitmentAllHistoryResultList()); - // } + // openPayment(widget.selectedPaymentMethod, widget.authenticatedUser, double.parse(widget.advanceModel.amount), null); }); } @@ -273,16 +280,16 @@ class _ConfirmPaymentPageState extends State { applePayInsertRequest.clinicID = 0; applePayInsertRequest.currency = projectViewModel.authenticatedUserObject.user.outSA == 1 ? "AED" : "SAR"; // applePayInsertRequest.customerEmail = projectViewModel.authenticatedUserObject.user.emailAddress; - applePayInsertRequest.customerEmail = "CustID_${projectViewModel.authenticatedUserObject.user.patientID}@HMG.com"; - applePayInsertRequest.customerID = projectViewModel.authenticatedUserObject.user.patientID; - applePayInsertRequest.customerName = projectViewModel.authenticatedUserObject.user.firstName! + " " + projectViewModel.authenticatedUserObject!.user.lastName!; + applePayInsertRequest.customerEmail = "CustID_${widget.advanceModel!.fileNumber}@HMG.com"; + applePayInsertRequest.customerID = widget.advanceModel!.fileNumber; + applePayInsertRequest.customerName = projectViewModel.authenticatedUserObject.user.firstName! + " " + projectViewModel.authenticatedUserObject.user.lastName!; applePayInsertRequest.deviceToken = await AppSharedPreferences().getString(PUSH_TOKEN); applePayInsertRequest.voipToken = await AppSharedPreferences().getString(ONESIGNAL_APNS_TOKEN); applePayInsertRequest.doctorID = 0; applePayInsertRequest.projectID = widget.advanceModel!.hospitalsModel!.iD.toString(); applePayInsertRequest.serviceID = ServiceTypeEnum.advancePayment.getIdFromServiceEnum().toString(); applePayInsertRequest.channelID = 3; - applePayInsertRequest.patientID = projectViewModel.authenticatedUserObject.user.patientID; + applePayInsertRequest.patientID = widget.advanceModel!.fileNumber; applePayInsertRequest.patientTypeID = projectViewModel.authenticatedUserObject.user.patientType; applePayInsertRequest.patientOutSA = projectViewModel.authenticatedUserObject.user.outSA; applePayInsertRequest.appointmentDate = null; @@ -295,7 +302,7 @@ class _ConfirmPaymentPageState extends State { applePayInsertRequest.isSchedule = "0"; applePayInsertRequest.language = projectViewModel.isArabic ? 'ar' : 'en'; applePayInsertRequest.languageID = projectViewModel.isArabic ? 1 : 2; - applePayInsertRequest.userName = projectViewModel.authenticatedUserObject.user.patientID; + applePayInsertRequest.userName = int.parse(widget.advanceModel!.fileNumber!); applePayInsertRequest.responseContinueURL = "http://hmg.com/Documents/success.html"; applePayInsertRequest.backClickUrl = "http://hmg.com/Documents/success.html"; applePayInsertRequest.paymentOption = "ApplePay"; @@ -314,7 +321,7 @@ class _ConfirmPaymentPageState extends State { await context.read().initiateApplePayWithPayfort( customerName: projectViewModel.authenticatedUserObject.user.firstName! + " " + projectViewModel.authenticatedUserObject.user!.lastName!, // customerEmail: projectViewModel.authenticatedUserObject.user.emailAddress, - customerEmail: "CustID_${projectViewModel.authenticatedUserObject.user.patientID}@HMG.com", + customerEmail: "CustID_${widget.advanceModel!.fileNumber}@HMG.com", orderDescription: "Advance Payment", orderAmount: double.parse(widget.advanceModel!.amount!), merchantReference: transID, @@ -326,7 +333,7 @@ class _ConfirmPaymentPageState extends State { }, onSuccess: (successResult) async { log("Payfort: ${successResult.responseMessage}"); - await context.read().addPayfortApplePayResponse(result: successResult); + await context.read().addPayfortApplePayResponse(int.parse(widget.advanceModel!.fileNumber!), result: successResult); checkPaymentStatus(AppoitmentAllHistoryResultList()); }, projectId: widget.advanceModel!.hospitalsModel!.iD, diff --git a/lib/services/payfort_services/payfort_service.dart b/lib/services/payfort_services/payfort_service.dart index 835a2627..4cc203e2 100644 --- a/lib/services/payfort_services/payfort_service.dart +++ b/lib/services/payfort_services/payfort_service.dart @@ -39,7 +39,7 @@ class PayfortService extends BaseService { return payfortProjectDetailsRespModel; } - Future addPayfortApplePayResponse({PayFortResult? result}) async { + Future addPayfortApplePayResponse(num patientID, {PayFortResult? result}) async { Map body = { "Fort_id": result!.fortId, "CommandType": result!.command, @@ -56,6 +56,7 @@ class PayfortService extends BaseService { "RemmeberMe": false, "Reconciliation_Reference": result.reconciliationReference, "LanguageID": 1, + "PatientID": patientID }; await baseAppClient.post( diff --git a/lib/services/payfort_services/payfort_view_model.dart b/lib/services/payfort_services/payfort_view_model.dart index 5d2ef302..17f739db 100644 --- a/lib/services/payfort_services/payfort_view_model.dart +++ b/lib/services/payfort_services/payfort_view_model.dart @@ -31,9 +31,9 @@ class PayfortViewModel extends ChangeNotifier { } } - Future addPayfortApplePayResponse({PayFortResult? result}) async { + Future addPayfortApplePayResponse(num patientID, {PayFortResult? result}) async { try { - await _payfortService.addPayfortApplePayResponse(result: result); + await _payfortService.addPayfortApplePayResponse(patientID, result: result); } on Exception catch (e, s) { print(s); return null; diff --git a/lib/splashPage.dart b/lib/splashPage.dart index cce92feb..b9e265ff 100644 --- a/lib/splashPage.dart +++ b/lib/splashPage.dart @@ -2,6 +2,7 @@ import 'dart:async'; import 'dart:convert'; import 'dart:io'; +import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/pages/landing/landing_page.dart'; import 'package:diplomaticquarterapp/theme/theme_notifier.dart'; @@ -31,17 +32,20 @@ class _SplashScreenState extends State { @override void initState() { + AppGlobal.context = context; super.initState(); print("Splash init called............."); Timer( Duration(seconds: 1, milliseconds: 500), () async { await loadPrivilege().then((value) { - Navigator.of(context).pushReplacement( - MaterialPageRoute( - builder: (BuildContext context) => LandingPage(), - ), - ); + if(!_privilegeService.hasError) { + Navigator.of(context).pushReplacement( + MaterialPageRoute( + builder: (BuildContext context) => LandingPage(), + ), + ); + } else {} }); }, ); @@ -69,6 +73,7 @@ class _SplashScreenState extends State { // debugPrint("ALL SHARED PREFERENCES!!!!!"); // debugPrint(jsonEncode(value)); }); + // PushNotificationHandler(context).init(); // Asyncronously } @override diff --git a/lib/uitl/translations_delegate_base.dart b/lib/uitl/translations_delegate_base.dart index 16a03340..0ec49e9f 100644 --- a/lib/uitl/translations_delegate_base.dart +++ b/lib/uitl/translations_delegate_base.dart @@ -2953,6 +2953,7 @@ class TranslationBase { String get habibCallCenter => localizedValues["habibCallCenter"][locale.languageCode]; String get cashAmountUpdateInsurance => localizedValues["cashAmountUpdateInsurance"][locale.languageCode]; String get validInsurance => localizedValues["validInsurance"][locale.languageCode]; + String get contactRRT => localizedValues["contactRRT"][locale.languageCode]; String get checkInViaLocation => localizedValues["checkInViaLocation"][locale.languageCode]; String get locationCheckInError => localizedValues["locationCheckInError"][locale.languageCode]; String get upcoming => localizedValues["upcoming"][locale.languageCode]; diff --git a/lib/widgets/drawer/app_drawer_widget.dart b/lib/widgets/drawer/app_drawer_widget.dart index 8c4af667..d6cabbf0 100644 --- a/lib/widgets/drawer/app_drawer_widget.dart +++ b/lib/widgets/drawer/app_drawer_widget.dart @@ -709,6 +709,8 @@ class _AppDrawerState extends State { // Navigator.of(context).pop(); Provider.of(context, listen: false).user = result.list; Provider.of(context, listen: false).setUser(result.list); + + Provider.of(context, listen: false).authenticatedUserObject.user = result.list; // await pharmacyModuleViewModel.generatePharmacyToken(); _vitalSignService.heightCm = ""; _vitalSignService.weightKg = ""; diff --git a/lib/widgets/in_app_browser/InAppBrowser.dart b/lib/widgets/in_app_browser/InAppBrowser.dart index 6205e7e8..fe68467e 100644 --- a/lib/widgets/in_app_browser/InAppBrowser.dart +++ b/lib/widgets/in_app_browser/InAppBrowser.dart @@ -40,9 +40,9 @@ class MyInAppBrowser extends InAppBrowser { static String APPLE_PAY_PAYFORT_URL = 'https://hmgwebservices.com/PayFortWebLive/PayFortApi/MakeApplePayRequest'; // Payfort Payment Gateway URL LIVE // static String APPLE_PAY_PAYFORT_URL = 'https://hmgwebservices.com/PayFortWebLive/PayFortApi/MakeApplePayRequest'; // Payfort Payment Gateway URL UAT - static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort Payment Gateway URL UAT + // static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort Payment Gateway URL UAT - // static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort Payment Gateway URL LIVE + static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort Payment Gateway URL LIVE // static String SERVICE_URL = 'https://uat.hmgwebservices.com/payfortforvidaplus/pages/SendPayFortRequest.aspx'; //Payfort Payment Gateway URL UAT VIDA PLUS