From a0bca9219541072cae3b7e0c16c7948584fee96e Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Sun, 26 Nov 2023 14:56:32 +0300 Subject: [PATCH 1/6] CR Implemented --- lib/config/config.dart | 6 +- lib/config/localized_values.dart | 5 +- .../AmbulanceRequestIndex.dart | 22 ++- .../PickupLocation.dart | 165 ++++++++++++------ .../SelectTransportationMethod.dart | 129 +++++++++----- .../AmbulanceRequestIndexPages/Summary.dart | 122 ++++++++++--- lib/pages/ErService/OrderLogPage.dart | 9 +- .../rapid-response-team/rrt-request-page.dart | 130 ++++++++++++-- lib/pages/ErService/widgets/StepsWidget.dart | 30 ++-- lib/uitl/translations_delegate_base.dart | 1 + 10 files changed, 443 insertions(+), 176 deletions(-) diff --git a/lib/config/config.dart b/lib/config/config.dart index 5ab2c668..d47f8bd5 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -20,8 +20,8 @@ var PACKAGES_ORDERS = '/api/orders'; var PACKAGES_ORDER_HISTORY = '/api/orders/items'; var PACKAGES_TAMARA_OPT = '/api/orders/paymentoptions/tamara'; // var BASE_URL = 'http://10.50.100.198:2018/'; - var BASE_URL = 'https://uat.hmgwebservices.com/'; -// var BASE_URL = 'https://hmgwebservices.com/'; + // var BASE_URL = 'https://uat.hmgwebservices.com/'; +var BASE_URL = 'https://hmgwebservices.com/'; // var BASE_URL = 'https://orash.cloudsolutions.com.sa/'; // var BASE_URL = 'https://vidauat.cloudsolutions.com.sa/'; // var BASE_URL = 'https://vidamergeuat.cloudsolutions.com.sa/'; @@ -337,7 +337,7 @@ var UPDATE_COVID_QUESTIONNAIRE = 'Services/Doctors.svc/REST/COVID19_Questionnari var CHANNEL = 3; var GENERAL_ID = 'Cs2020@2016\$2958'; var IP_ADDRESS = '10.20.10.20'; -var VERSION_ID = 11.1; +var VERSION_ID = 11.3; var SETUP_ID = '91877'; var LANGUAGE = 2; // var PATIENT_OUT_SA = 0; diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 63619f59..6278d2b7 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": "رجوع"}, @@ -1901,4 +1901,5 @@ 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": "تواصل مع فريق الاستجابة السريعة"}, }; \ No newline at end of file diff --git a/lib/pages/ErService/AmbulanceRequestIndexPages/AmbulanceRequestIndex.dart b/lib/pages/ErService/AmbulanceRequestIndexPages/AmbulanceRequestIndex.dart index 9f461c7b..2262b396 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 057cb5c2..c9e6fca2 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 1cd6c6c4..7168f5b3 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 4b59a8fa..7e352585 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 changeCurrentTab; @@ -86,48 +88,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), ], ), ), @@ -135,9 +178,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); - }), + 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 dda26e28..1566b910 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 8541b859..40ef7413 100644 --- a/lib/pages/ErService/rapid-response-team/rrt-request-page.dart +++ b/lib/pages/ErService/rapid-response-team/rrt-request-page.dart @@ -168,22 +168,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.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), - ], + 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 219cfd60..c89e27ba 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/uitl/translations_delegate_base.dart b/lib/uitl/translations_delegate_base.dart index 7af2010a..e08b1394 100644 --- a/lib/uitl/translations_delegate_base.dart +++ b/lib/uitl/translations_delegate_base.dart @@ -2910,6 +2910,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]; } From c65d668c920d95f807459900abc6e4ace7d09e78 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Tue, 23 Jan 2024 10:54:06 +0300 Subject: [PATCH 2/6] updates --- android/gradle.properties | 2 +- lib/config/config.dart | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/android/gradle.properties b/android/gradle.properties index c5ccb9b6..73fec6d1 100644 --- a/android/gradle.properties +++ b/android/gradle.properties @@ -1,4 +1,4 @@ -org.gradle.jvmargs=-Xmx2048m +org.gradle.jvmargs=-Xmx4096m android.enableR8=true android.useAndroidX=true android.enableJetifier=true \ No newline at end of file diff --git a/lib/config/config.dart b/lib/config/config.dart index d47f8bd5..1f1bc4c1 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -20,8 +20,8 @@ var PACKAGES_ORDERS = '/api/orders'; var PACKAGES_ORDER_HISTORY = '/api/orders/items'; var PACKAGES_TAMARA_OPT = '/api/orders/paymentoptions/tamara'; // var BASE_URL = 'http://10.50.100.198:2018/'; - // var BASE_URL = 'https://uat.hmgwebservices.com/'; -var BASE_URL = 'https://hmgwebservices.com/'; + var BASE_URL = 'https://uat.hmgwebservices.com/'; +// var BASE_URL = 'https://hmgwebservices.com/'; // var BASE_URL = 'https://orash.cloudsolutions.com.sa/'; // var BASE_URL = 'https://vidauat.cloudsolutions.com.sa/'; // var BASE_URL = 'https://vidamergeuat.cloudsolutions.com.sa/'; @@ -47,7 +47,9 @@ var PHARMACY_BASE_URL = 'https://mdlaboratories.com/exacartapi/api/'; // var PHARMACY_BASE_URL = 'https://mdlaboratories.com/exacartapitest/api/'; // RC API URL -var RC_BASE_URL = 'https://rc.hmg.com/'; +// 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/'; From 32757c85f8af592841b6abbea20fdf08ba6e90ee Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Wed, 31 Jan 2024 09:53:56 +0300 Subject: [PATCH 3/6] updates --- .../new_Home_health_care_step_three_page.dart | 8 -------- lib/pages/BookAppointment/BookSuccess.dart | 2 +- lib/pages/Covid-DriveThru/covid-payment-summary.dart | 12 +++++++----- lib/pages/ToDoList/ToDo.dart | 4 ++-- 4 files changed, 10 insertions(+), 16 deletions(-) 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 d580f2bb..61a51d1b 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 { onBrowserExit(AppoitmentAllHistoryResultList appo, bool isPaymentMade) { try { 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 { diff --git a/lib/pages/Covid-DriveThru/covid-payment-summary.dart b/lib/pages/Covid-DriveThru/covid-payment-summary.dart index e1f00173..5ba533da 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, this.selectedPaymentMethod}); @@ -44,6 +43,8 @@ class _CovidPaymentSummaryState extends State { String tamaraPaymentStatus; String tamaraOrderID; + String transID = ""; + @override Widget build(BuildContext context) { projectViewModel = Provider.of(context); @@ -216,7 +217,7 @@ 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", @@ -276,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 { @@ -299,7 +301,7 @@ class _CovidPaymentSummaryState extends State { if (res["status"].toString().toLowerCase() == "success") { updateTamaraRequestStatus("success", "14", orderID, tamaraOrderID, num.parse(widget.selectedInstallmentPlan), appo); } else { - updateTamaraRequestStatus("Failed", "00", Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo), tamaraOrderID != null ? tamaraOrderID : "", + updateTamaraRequestStatus("Failed", "00", transID, tamaraOrderID != null ? tamaraOrderID : "", num.parse(widget.selectedInstallmentPlan), appo); } }).catchError((err) { @@ -376,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/ToDoList/ToDo.dart b/lib/pages/ToDoList/ToDo.dart index d16c6579..00c5b25b 100644 --- a/lib/pages/ToDoList/ToDo.dart +++ b/lib/pages/ToDoList/ToDo.dart @@ -1126,7 +1126,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 { @@ -1146,7 +1146,7 @@ class _ToDoState extends State with SingleTickerProviderStateMixin { updateTamaraRequestStatus("success", "14", orderID, res["tamara_order_id"], num.parse(selectedInstallments), appo); } else { updateTamaraRequestStatus( - "Failed", "00", Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo), tamaraOrderID != null ? tamaraOrderID : "", num.parse(selectedInstallments), appo); + "Failed", "00", transID, tamaraOrderID != null ? tamaraOrderID : "", num.parse(selectedInstallments), appo); } }).catchError((err) { GifLoaderDialogUtils.hideDialog(context); From 6e558bf5a61245b0e1216dda3b5fd5b0f975d109 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Wed, 31 Jan 2024 10:37:48 +0300 Subject: [PATCH 4/6] Splash fix --- lib/splashPage.dart | 18 +++++++++--------- lib/widgets/in_app_browser/InAppBrowser.dart | 4 ++-- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/lib/splashPage.dart b/lib/splashPage.dart index 290bbac0..778ab6ff 100644 --- a/lib/splashPage.dart +++ b/lib/splashPage.dart @@ -1,6 +1,7 @@ import 'dart:async'; import 'dart:convert'; +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'; @@ -30,16 +31,19 @@ class _SplashScreenState extends State { @override void initState() { + AppGlobal.context = context; super.initState(); 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 {} }); }, ); @@ -58,10 +62,6 @@ class _SplashScreenState extends State { var themeNotifier = Provider.of(context, listen: false); themeNotifier.setTheme(defaultTheme(fontName: projectProvider.isArabic ? 'Cairo' : 'Poppins')); PushNotificationHandler(context).init(); // Asyncronously - AppSharedPreferences().getAll().then((value) { - // debugPrint("ALL SHARED PREFERENCES!!!!!"); - // debugPrint(jsonEncode(value)); - }); } @override diff --git a/lib/widgets/in_app_browser/InAppBrowser.dart b/lib/widgets/in_app_browser/InAppBrowser.dart index c71b206b..c9fecbf9 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 From 46ad67264983d655546d48f17c05c7265f90982a Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Wed, 31 Jan 2024 19:09:22 +0300 Subject: [PATCH 5/6] Apple Pay fixes --- .../ancillaryOrdersDetails.dart | 28 +++++++------- lib/pages/BookAppointment/BookSuccess.dart | 38 +++++++++---------- lib/pages/DrawerPages/family/my-family.dart | 1 + lib/pages/ToDoList/ToDo.dart | 34 ++++++++--------- lib/pages/livecare/widgets/clinic_list.dart | 27 +++++++------ .../medical/balance/confirm_payment_page.dart | 29 ++++++++------ .../payfort_services/payfort_service.dart | 3 +- .../payfort_services/payfort_view_model.dart | 4 +- lib/widgets/drawer/app_drawer_widget.dart | 2 + 9 files changed, 86 insertions(+), 80 deletions(-) diff --git a/lib/pages/AlHabibMedicalService/ancillary-orders/ancillaryOrdersDetails.dart b/lib/pages/AlHabibMedicalService/ancillary-orders/ancillaryOrdersDetails.dart index 66008a86..4352b264 100644 --- a/lib/pages/AlHabibMedicalService/ancillary-orders/ancillaryOrdersDetails.dart +++ b/lib/pages/AlHabibMedicalService/ancillary-orders/ancillaryOrdersDetails.dart @@ -547,23 +547,23 @@ class _AnicllaryOrdersState 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"; @@ -571,7 +571,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"; @@ -588,21 +588,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 b959abd1..068d0ec6 100644 --- a/lib/pages/BookAppointment/BookSuccess.dart +++ b/lib/pages/BookAppointment/BookSuccess.dart @@ -661,20 +661,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"; @@ -685,7 +685,7 @@ 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.userName = projectViewModel.user.patientID; applePayInsertRequest.responseContinueURL = "http://hmg.com/Documents/success.html"; applePayInsertRequest.backClickUrl = "http://hmg.com/Documents/success.html"; applePayInsertRequest.paymentOption = "ApplePay"; @@ -702,21 +702,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, @@ -792,12 +792,12 @@ class _BookSuccessState extends State { try { if (selectedPaymentMethod == "TAMARA") { 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); - // } + 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); } diff --git a/lib/pages/DrawerPages/family/my-family.dart b/lib/pages/DrawerPages/family/my-family.dart index 9d80ee83..04d8b396 100644 --- a/lib/pages/DrawerPages/family/my-family.dart +++ b/lib/pages/DrawerPages/family/my-family.dart @@ -493,6 +493,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/ToDoList/ToDo.dart b/lib/pages/ToDoList/ToDo.dart index 00c5b25b..75889850 100644 --- a/lib/pages/ToDoList/ToDo.dart +++ b/lib/pages/ToDoList/ToDo.dart @@ -1145,8 +1145,7 @@ class _ToDoState extends State with SingleTickerProviderStateMixin { if (res["status"].toString().toLowerCase() == "success") { updateTamaraRequestStatus("success", "14", orderID, res["tamara_order_id"], num.parse(selectedInstallments), appo); } else { - updateTamaraRequestStatus( - "Failed", "00", transID, tamaraOrderID != null ? tamaraOrderID : "", num.parse(selectedInstallments), appo); + updateTamaraRequestStatus("Failed", "00", transID, tamaraOrderID != null ? tamaraOrderID : "", num.parse(selectedInstallments), appo); } }).catchError((err) { GifLoaderDialogUtils.hideDialog(context); @@ -1280,10 +1279,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) { @@ -1338,20 +1334,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"; @@ -1362,7 +1358,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"; @@ -1379,21 +1375,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 1dbf72e4..917b7488 100644 --- a/lib/pages/livecare/widgets/clinic_list.dart +++ b/lib/pages/livecare/widgets/clinic_list.dart @@ -369,20 +369,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"; @@ -393,7 +393,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"; @@ -410,14 +410,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); @@ -426,7 +426,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, @@ -514,8 +514,7 @@ class _clinic_listState extends State { if (res["status"].toString().toLowerCase() == "success") { updateTamaraRequestStatus("success", "14", orderID, tamaraOrderID, num.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 e63264a4..aeaa4e75 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), null); - // } + // openPayment(widget.selectedPaymentMethod, widget.authenticatedUser, double.parse(widget.advanceModel.amount), null); }); } @@ -265,8 +272,8 @@ 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.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); @@ -274,7 +281,7 @@ class _ConfirmPaymentPageState extends State { 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; @@ -287,7 +294,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 = num.parse(widget.advanceModel.fileNumber); applePayInsertRequest.responseContinueURL = "http://hmg.com/Documents/success.html"; applePayInsertRequest.backClickUrl = "http://hmg.com/Documents/success.html"; applePayInsertRequest.paymentOption = "ApplePay"; @@ -306,7 +313,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, @@ -318,7 +325,7 @@ class _ConfirmPaymentPageState extends State { }, onSuccess: (successResult) async { log("Payfort: ${successResult.responseMessage}"); - await context.read().addPayfortApplePayResponse(result: successResult); + await context.read().addPayfortApplePayResponse(num.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 308d5818..655ce673 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 5bef18a8..553169ba 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/widgets/drawer/app_drawer_widget.dart b/lib/widgets/drawer/app_drawer_widget.dart index 0ca93570..bbc1e55f 100644 --- a/lib/widgets/drawer/app_drawer_widget.dart +++ b/lib/widgets/drawer/app_drawer_widget.dart @@ -702,6 +702,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 = ""; From 357f0f8c24f0eaf49bbb6e1abd265c3851c64863 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Wed, 31 Jan 2024 19:44:17 +0300 Subject: [PATCH 6/6] updates --- lib/config/config.dart | 9 +++------ pubspec.yaml | 2 +- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/lib/config/config.dart b/lib/config/config.dart index c28f26d6..f5933549 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -24,7 +24,7 @@ var PACKAGES_TAMARA_OPT = '/api/orders/paymentoptions/tamara'; // var BASE_URL = 'https://uat.hmgwebservices.com/'; var BASE_URL = 'https://hmgwebservices.com/'; // var BASE_URL = 'http://10.20.200.111:1010/'; - // var BASE_URL = 'https://uat.hmgwebservices.com/'; +// var BASE_URL = 'https://uat.hmgwebservices.com/'; // var BASE_URL = 'https://hmgwebservices.com/'; // var BASE_URL = 'https://orash.cloudsolutions.com.sa/'; // var BASE_URL = 'https://vidauat.cloudsolutions.com.sa/'; @@ -53,9 +53,9 @@ var PHARMACY_REDIRECT_URL = 'https://bit.ly/AlhabibPharmacy'; // var PHARMACY_BASE_URL = 'https://mdlaboratories.com/exacartapitest/api/'; // RC API URL -// var RC_BASE_URL = 'https://rc.hmg.com/'; +var RC_BASE_URL = 'https://rc.hmg.com/'; -var RC_BASE_URL = 'https://rc.hmg.com/test/'; +// var RC_BASE_URL = 'https://rc.hmg.com/test/'; // var RC_BASE_URL = 'https://ms.hmg.com/rc/'; @@ -626,8 +626,6 @@ var PAYFORT_PROD_URL = 'https://paymentservices.payfort.com/FortAPI/paymentApi'; 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"; @@ -636,7 +634,6 @@ var applePayMerchantId = "merchant.com.hmgwebservices"; // var payFortEnvironment = FortEnvironment.test; // var applePayMerchantId = "merchant.com.hmgwebservices.uat"; - class AppGlobal { static var context; diff --git a/pubspec.yaml b/pubspec.yaml index addd6356..5b1da571 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,7 +1,7 @@ name: diplomaticquarterapp description: A new Flutter application. -version: 4.5.84+1 +version: 4.5.85+1 environment: sdk: ">=2.7.0 <3.0.0"