diff --git a/android/build.gradle b/android/build.gradle
index 69a65d6a..1849765a 100644
--- a/android/build.gradle
+++ b/android/build.gradle
@@ -37,6 +37,7 @@ buildscript {
dependencies {
classpath 'com.android.tools.build:gradle:7.1.3'
+// classpath 'com.android.tools.build:gradle:8.2.1'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.google.gms:google-services:4.3.8'
// classpath 'com.google.firebase:firebase-crashlytics-gradle:2.8.1'
diff --git a/assets/fonts/sar-Regular.otf b/assets/fonts/sar-Regular.otf
new file mode 100644
index 00000000..e906f654
Binary files /dev/null and b/assets/fonts/sar-Regular.otf differ
diff --git a/assets/fonts/saudi_riyal.eot b/assets/fonts/saudi_riyal.eot
new file mode 100644
index 00000000..f85e9aa1
Binary files /dev/null and b/assets/fonts/saudi_riyal.eot differ
diff --git a/assets/fonts/saudi_riyal.ttf b/assets/fonts/saudi_riyal.ttf
new file mode 100644
index 00000000..a0f1b762
Binary files /dev/null and b/assets/fonts/saudi_riyal.ttf differ
diff --git a/assets/fonts/saudi_riyal.woff b/assets/fonts/saudi_riyal.woff
new file mode 100644
index 00000000..7d733e98
Binary files /dev/null and b/assets/fonts/saudi_riyal.woff differ
diff --git a/assets/fonts/saudi_riyal.woff2 b/assets/fonts/saudi_riyal.woff2
new file mode 100644
index 00000000..f8072477
Binary files /dev/null and b/assets/fonts/saudi_riyal.woff2 differ
diff --git a/assets/images/new/Indoor_nav_appo.svg b/assets/images/new/Indoor_nav_appo.svg
new file mode 100644
index 00000000..81bf654d
--- /dev/null
+++ b/assets/images/new/Indoor_nav_appo.svg
@@ -0,0 +1,9 @@
+
diff --git a/assets/images/new/NFC_Hold.svg b/assets/images/new/NFC_Hold.svg
new file mode 100644
index 00000000..fbfa19ea
--- /dev/null
+++ b/assets/images/new/NFC_Hold.svg
@@ -0,0 +1,3 @@
+
diff --git a/assets/images/new/Saudi_Riyal_Symbol.svg b/assets/images/new/Saudi_Riyal_Symbol.svg
new file mode 100644
index 00000000..d57d83a1
--- /dev/null
+++ b/assets/images/new/Saudi_Riyal_Symbol.svg
@@ -0,0 +1,12 @@
+
+
\ No newline at end of file
diff --git a/assets/images/new/download_1.svg b/assets/images/new/download_1.svg
new file mode 100644
index 00000000..6bf54066
--- /dev/null
+++ b/assets/images/new/download_1.svg
@@ -0,0 +1,5 @@
+
diff --git a/assets/images/new/hourglass.svg b/assets/images/new/hourglass.svg
new file mode 100644
index 00000000..564ff289
--- /dev/null
+++ b/assets/images/new/hourglass.svg
@@ -0,0 +1,3 @@
+
diff --git a/assets/images/new/indoor_nav_home.svg b/assets/images/new/indoor_nav_home.svg
new file mode 100644
index 00000000..bfe32eec
--- /dev/null
+++ b/assets/images/new/indoor_nav_home.svg
@@ -0,0 +1,11 @@
+
diff --git a/assets/images/new/tap.svg b/assets/images/new/tap.svg
new file mode 100644
index 00000000..cf73ddde
--- /dev/null
+++ b/assets/images/new/tap.svg
@@ -0,0 +1,3 @@
+
diff --git a/assets/images/new/waitingAppo.svg b/assets/images/new/waitingAppo.svg
new file mode 100644
index 00000000..c9bd0096
--- /dev/null
+++ b/assets/images/new/waitingAppo.svg
@@ -0,0 +1,6 @@
+
diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj
index 318f2f08..63df2a6d 100644
--- a/ios/Runner.xcodeproj/project.pbxproj
+++ b/ios/Runner.xcodeproj/project.pbxproj
@@ -583,7 +583,7 @@
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
- CURRENT_PROJECT_VERSION = 2;
+ CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = 3A359E86ZF;
ENABLE_BITCODE = NO;
FRAMEWORK_SEARCH_PATHS = (
@@ -601,7 +601,7 @@
"$(inherited)",
"$(PROJECT_DIR)/Flutter",
);
- MARKETING_VERSION = 4.5.999;
+ MARKETING_VERSION = 4.6.004;
PRODUCT_BUNDLE_IDENTIFIER = "com.HMG.HMG-Smartphone";
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
@@ -735,7 +735,7 @@
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
- CURRENT_PROJECT_VERSION = 2;
+ CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = 3A359E86ZF;
ENABLE_BITCODE = NO;
FRAMEWORK_SEARCH_PATHS = (
@@ -753,7 +753,7 @@
"$(inherited)",
"$(PROJECT_DIR)/Flutter",
);
- MARKETING_VERSION = 4.5.999;
+ MARKETING_VERSION = 4.6.004;
PRODUCT_BUNDLE_IDENTIFIER = "com.HMG.HMG-Smartphone";
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
@@ -779,7 +779,7 @@
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
- CURRENT_PROJECT_VERSION = 2;
+ CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = 3A359E86ZF;
ENABLE_BITCODE = NO;
FRAMEWORK_SEARCH_PATHS = (
@@ -797,7 +797,7 @@
"$(inherited)",
"$(PROJECT_DIR)/Flutter",
);
- MARKETING_VERSION = 4.5.999;
+ MARKETING_VERSION = 4.6.004;
PRODUCT_BUNDLE_IDENTIFIER = "com.HMG.HMG-Smartphone";
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
diff --git a/lib/config/config.dart b/lib/config/config.dart
index 04f86877..25c4bf73 100644
--- a/lib/config/config.dart
+++ b/lib/config/config.dart
@@ -21,8 +21,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/';
@@ -102,6 +102,7 @@ var GET_Patient_LAB_ORDERS_RESULT = 'Services/Patients.svc/REST/GetPatientLabOrd
var SEND_COVID_LAB_RESULT_EMAIL = 'Services/Notifications.svc/REST/GenerateCOVIDReport';
var COVID_PASSPORT_UPDATE = 'Services/Patients.svc/REST/Covid19_Certificate_PassportUpdate';
var GET_PATIENT_PASSPORT_NUMBER = 'Services/Patients.svc/REST/Covid19_Certificate_GetPassport';
+var SEND_LAB_RESULT_EMAIL_NEW = 'ReportsAPI/api/reports/labReport';
var UPDATE_WORKPLACE_NAME = 'Services/Patients.svc/REST/ActivateSickLeave_FromVida';
var GET_SICKLEAVE_STATUS_ADMISSION_NO = 'Services/ChatBot_Service.svc/REST/GetSickLeaveStatusByAdmissionNo';
@@ -352,7 +353,7 @@ var CAN_PAY_FOR_FOR_WALKIN_APPOINTMENT = 'Services/Doctors.svc/REST/CanPayForWal
var CHANNEL = 3;
var GENERAL_ID = 'Cs2020@2016\$2958';
var IP_ADDRESS = '10.20.10.20';
-var VERSION_ID = 17.4;
+var VERSION_ID = 17.9;
var SETUP_ID = '91877';
var LANGUAGE = 2;
// var PATIENT_OUT_SA = 0;
@@ -699,10 +700,10 @@ var IS_DOCTOR_AVAILABLE_BY_CALENDAR_SCHEDULE = 'Services/OUTPs.svc/REST/HIS_IsDo
//PAYFORT
var getPayFortProjectDetails = "Services/PayFort_Serv.svc/REST/GetPayFortProjectDetails";
var addPayFortApplePayResponse = "Services/PayFort_Serv.svc/REST/AddResponse";
-// var payFortEnvironment = FortEnvironment.production;
-// var applePayMerchantId = "merchant.com.hmgwebservices";
-var payFortEnvironment = FortEnvironment.test;
-var applePayMerchantId = "merchant.com.hmgwebservices.uat";
+var payFortEnvironment = FortEnvironment.production;
+var applePayMerchantId = "merchant.com.hmgwebservices";
+// 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 459b514d..90747ef8 100644
--- a/lib/config/localized_values.dart
+++ b/lib/config/localized_values.dart
@@ -586,6 +586,7 @@ const Map localizedValues = {
"items": {"en": "item(s)", "ar": "عنصر"},
"checkOut": {"en": "CHECK OUT", "ar": "الدفع"},
"sar": {"en": "SAR", "ar": " ر.س "},
+ // "sar": {"en": "", "ar": " "},
"aed": {"en": "AED", "ar": "درهم"},
"payOnline": {"en": "PAY ONLINE", "ar": "اتمام عملية الدفع "},
"cancelOrder": {"en": "CANCEL ORDER", "ar": "الغاء الطلب "},
diff --git a/lib/core/service/client/base_app_client.dart b/lib/core/service/client/base_app_client.dart
index 8faf93bd..d083c422 100644
--- a/lib/core/service/client/base_app_client.dart
+++ b/lib/core/service/client/base_app_client.dart
@@ -187,7 +187,7 @@ class BaseAppClient {
// body['IdentificationNo'] = 1023854217;
// body['MobileNo'] = "531940021"; //0560717232
- // body['PatientID'] = 5185584; //4609100
+ // body['PatientID'] = 2007395; //4609100
// body['TokenID'] = "@dm!n";
// Patient ID: 3027574
diff --git a/lib/core/service/medical/labs_service.dart b/lib/core/service/medical/labs_service.dart
index c03b29f4..3f83a493 100644
--- a/lib/core/service/medical/labs_service.dart
+++ b/lib/core/service/medical/labs_service.dart
@@ -125,7 +125,7 @@ class LabsService extends BaseService {
}
Future updateWorkplaceName(String workplaceName, String workplaceNameAR, String occupation, String occupationAR, int requestNumber, String setupID, int projectID) async {
- // Future updateWorkplaceName(String workplaceName, String workplaceNameAR, int requestNumber, String setupID, int projectID) async {
+ // Future updateWorkplaceName(String workplaceName, String workplaceNameAR, int requestNumber, String setupID, int projectID) async {
hasError = false;
Map body = Map();
@@ -209,7 +209,7 @@ class LabsService extends BaseService {
RequestSendLabReportEmail _requestSendLabReportEmail = RequestSendLabReportEmail();
- Future sendLabReportEmail({PatientLabOrders? patientLabOrder, AuthenticatedUser? userObj, bool isVidaPlus = false, bool isDownload = false}) async {
+ Future sendLabReportEmail({PatientLabOrders? patientLabOrder, AuthenticatedUser? userObj, bool isVidaPlus = false, bool isDownload = false, int languageID = 1}) async {
_requestSendLabReportEmail.projectID = patientLabOrder!.projectID;
_requestSendLabReportEmail.invoiceNo = isVidaPlus ? "0" : patientLabOrder.invoiceNo;
_requestSendLabReportEmail.invoiceNoVP = isVidaPlus ? patientLabOrder.invoiceNo : "0";
@@ -228,11 +228,12 @@ class LabsService extends BaseService {
_requestSendLabReportEmail.orderNo = patientLabOrder.orderNo;
_requestSendLabReportEmail.isDownload = isDownload;
_requestSendLabReportEmail.doctorID = patientLabOrder.doctorID;
- _requestSendLabReportEmail.languageID = 1;
+ _requestSendLabReportEmail.languageID = languageID;
- await baseAppClient.post(SEND_LAB_RESULT_EMAIL, onSuccess: (dynamic response, int statusCode) {
+ // await baseAppClient.post(SEND_LAB_RESULT_EMAIL, onSuccess: (dynamic response, int statusCode) {
+ await baseAppClient.post(isVidaPlus ? SEND_LAB_RESULT_EMAIL : SEND_LAB_RESULT_EMAIL_NEW, onSuccess: (dynamic response, int statusCode) {
if (isDownload) {
- labReportPDF = response['LabReportsPDFContent'];
+ labReportPDF = isVidaPlus ? response['LabReportsPDFContent'] : response['PdfContent'];
}
}, onFailure: (String error, int statusCode) {
hasError = true;
diff --git a/lib/core/viewModels/medical/labs_view_model.dart b/lib/core/viewModels/medical/labs_view_model.dart
index fa67438d..ea45a312 100644
--- a/lib/core/viewModels/medical/labs_view_model.dart
+++ b/lib/core/viewModels/medical/labs_view_model.dart
@@ -1,3 +1,7 @@
+import 'dart:convert';
+import 'dart:io';
+import 'dart:typed_data';
+
import 'package:diplomaticquarterapp/core/enum/filter_type.dart';
import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
import 'package:diplomaticquarterapp/core/model/labs/LabOrderResult.dart';
@@ -9,6 +13,8 @@ import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.da
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
import 'package:diplomaticquarterapp/widgets/charts/app_time_series_chart.dart';
+import 'package:open_filex/open_filex.dart';
+import 'package:path_provider/path_provider.dart';
import '../../../locator.dart';
import '../base_view_model.dart';
@@ -76,13 +82,7 @@ class LabsViewModel extends BaseViewModel {
getLaboratoryResult({String? projectID, int? clinicID, String? invoiceNo, String? invoiceType, String? orderNo, String? setupID, bool? isVidaPlus}) async {
setState(ViewState.Busy);
- await _labsService.getLaboratoryResult(invoiceNo: invoiceNo,
- invoiceType: invoiceType,
- orderNo: orderNo,
- projectID: projectID,
- clinicID: clinicID,
- setupID: setupID,
- isVidaPlus: isVidaPlus);
+ await _labsService.getLaboratoryResult(invoiceNo: invoiceNo, invoiceType: invoiceType, orderNo: orderNo, projectID: projectID, clinicID: clinicID, setupID: setupID, isVidaPlus: isVidaPlus);
if (_labsService.hasError) {
error = _labsService.error!;
setState(ViewState.Error);
@@ -109,7 +109,7 @@ class LabsViewModel extends BaseViewModel {
// })
// .toList();
// if (value.isEmpty)
- labResultLists[labResultLists.indexOf(patientLabOrdersClinic[0])].patientLabResultList!.add(element);
+ labResultLists[labResultLists.indexOf(patientLabOrdersClinic[0])].patientLabResultList!.add(element);
} else {
labResultLists.add(LabResultList(filterName: element.testCode, lab: element));
}
@@ -150,15 +150,31 @@ class LabsViewModel extends BaseViewModel {
}
}
- sendLabReportEmail({PatientLabOrders? patientLabOrder, String? mes, AuthenticatedUser? userObj, required bool isVidaPlus, bool isDownload = false}) async {
- await _labsService.sendLabReportEmail(patientLabOrder: patientLabOrder, userObj: userObj, isVidaPlus: isVidaPlus, isDownload: isDownload);
+ sendLabReportEmail({PatientLabOrders? patientLabOrder, String? mes, AuthenticatedUser? userObj, required bool isVidaPlus, bool isDownload = false, int languageID = 1}) async {
+ await _labsService.sendLabReportEmail(patientLabOrder: patientLabOrder, userObj: userObj, isVidaPlus: isVidaPlus, isDownload: isDownload, languageID: languageID);
if (_labsService.hasError) {
error = _labsService.error!;
} else {
if (isDownload) {
+ if (labReportPDF.isNotEmpty) {
+ String path = await _createFileFromString(labReportPDF, "pdf");
+ try {
+ OpenFilex.open(path);
+ } catch (ex) {
+ AppToast.showErrorToast(message: "Cannot open file.");
+ }
+ }
} else {
AppToast.showSuccessToast(message: mes!);
}
}
}
+
+ Future _createFileFromString(String encodedStr, String ext) async {
+ Uint8List bytes = base64.decode(encodedStr);
+ String dir = (await getApplicationDocumentsDirectory()).path;
+ File file = File("$dir/" + DateTime.now().millisecondsSinceEpoch.toString() + "." + ext);
+ await file.writeAsBytes(bytes);
+ return file.path;
+ }
}
diff --git a/lib/pages/AlHabibMedicalService/ancillary-orders/ancillaryOrdersDetails.dart b/lib/pages/AlHabibMedicalService/ancillary-orders/ancillaryOrdersDetails.dart
index 33a7cbd6..464786df 100644
--- a/lib/pages/AlHabibMedicalService/ancillary-orders/ancillaryOrdersDetails.dart
+++ b/lib/pages/AlHabibMedicalService/ancillary-orders/ancillaryOrdersDetails.dart
@@ -30,6 +30,7 @@ import 'package:diplomaticquarterapp/widgets/dragable_sheet.dart';
import 'package:diplomaticquarterapp/widgets/in_app_browser/InAppBrowser.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/material.dart';
+import 'package:flutter_svg/flutter_svg.dart';
import 'package:provider/provider.dart';
class AnicllaryOrdersDetails extends StatefulWidget {
@@ -151,7 +152,8 @@ class _AnicllaryOrdersState extends State with SingleTic
width: MediaQuery.of(context).size.width * 0.75,
child: getPaymentMethods(),
),
- _amountView(TranslationBase.of(context).patientShareTotalToDo, getTotalValue() + " " + TranslationBase.of(context).sar, isBold: true, isTotal: true),
+ _amountView(TranslationBase.of(context).patientShareTotalToDo, getTotalValue(), isBold: true, isTotal: true),
+ // _amountView(TranslationBase.of(context).patientShareTotalToDo, getTotalValue(), isBold: true, isTotal: true),
SizedBox(height: 12),
DefaultButton(
TranslationBase.of(context).payNow.toUpperCase(),
@@ -177,15 +179,14 @@ class _AnicllaryOrdersState extends State with SingleTic
return Text(
text,
style: TextStyle(
- fontSize: isBold
- ? isTotal
- ? 16
- : 12
- : 11,
- letterSpacing: -0.5,
- color: isBold ? Color(0xff2E303A) : Color(0xff575757),
- fontWeight: isTotal ? FontWeight.bold : FontWeight.w600,
- ),
+ fontSize: isBold
+ ? isTotal
+ ? 16
+ : 12
+ : 11,
+ letterSpacing: -0.5,
+ color: isBold ? Color(0xff2E303A) : Color(0xff575757),
+ fontWeight: isTotal ? FontWeight.bold : FontWeight.w600),
);
}
@@ -197,7 +198,15 @@ class _AnicllaryOrdersState extends State with SingleTic
child: _getNormalText(title),
),
Expanded(
- child: _getNormalText(value, isBold: isBold, isTotal: isTotal),
+ child: Row(
+ children: [
+ projectViewModel.isArabic ? Container() : SvgPicture.asset("assets/images/new/Saudi_Riyal_Symbol.svg", width: 16, height: 16),
+ mWidth(6),
+ _getNormalText(value, isBold: isBold, isTotal: isTotal),
+ mWidth(6),
+ projectViewModel.isArabic ? SvgPicture.asset("assets/images/new/Saudi_Riyal_Symbol.svg", width: 16, height: 16) : Container(),
+ ],
+ ),
),
]),
);
@@ -319,7 +328,8 @@ class _AnicllaryOrdersState extends State with SingleTic
),
mWidth(3),
Text(
- _ancillaryProcLists[0].ancillaryOrderProcDetailsList![0].orderNo.toString(),
+ // _ancillaryProcLists[0].ancillaryOrderProcDetailsList![0].orderNo.toString(),
+ _ancillaryProcLists[0].ancillaryOrderProcDetailsList!.isNotEmpty ? _ancillaryProcLists[0].ancillaryOrderProcDetailsList![0].orderNo.toString() : "0",
style: TextStyle(
fontWeight: FontWeight.w600,
fontSize: 12,
@@ -572,9 +582,9 @@ class _AnicllaryOrdersState extends State with SingleTic
});
}),
Utils.tableColumnValue('${value.procedureName}', isLast: true, isCapitable: false, mProjectViewModel: projectViewModel),
- Utils.tableColumnValue('${value.patientShare.toString() + " " + TranslationBase.of(context).sar.toUpperCase()}', isLast: true, isCapitable: false, mProjectViewModel: projectViewModel),
- Utils.tableColumnValue('${value.patientTaxAmount.toString() + " " + TranslationBase.of(context).sar.toUpperCase()}', isLast: true, isCapitable: false, mProjectViewModel: projectViewModel),
- Utils.tableColumnValue('${value.patientShareWithTax.toString() + " " + TranslationBase.of(context).sar.toUpperCase()}', isLast: true, isCapitable: false, mProjectViewModel: projectViewModel),
+ Utils.tableColumnValue('${value.patientShare.toString()}', isLast: true, isCapitable: false, mProjectViewModel: projectViewModel),
+ Utils.tableColumnValue('${value.patientTaxAmount.toString()}', isLast: true, isCapitable: false, mProjectViewModel: projectViewModel),
+ Utils.tableColumnValue('${value.patientShareWithTax.toString()}', isLast: true, isCapitable: false, mProjectViewModel: projectViewModel),
]),
);
return tableRow;
@@ -660,27 +670,27 @@ class _AnicllaryOrdersState extends State with SingleTic
service.applePayInsertRequest(applePayInsertRequest, context).then((res) async {
if (res["MessageStatus"] == 1) {
await context.read().initiateApplePayWithPayfort(
- customerName: projectViewModel.user.firstName! + " " + projectViewModel.user.lastName!,
- // customerEmail: projectViewModel.authenticatedUserObject.user.emailAddress,
- customerEmail: "CustID_${projectViewModel.user.patientID}@HMG.com",
- orderDescription: "Ancillary Order Payment",
- orderAmount: double.parse(getTotalValue()),
- merchantReference: transID,
- payfortProjectDetailsRespModel: payfortProjectDetailsRespModel,
- currency: projectViewModel.user.outSA == 1 ? "AED" : "SAR",
- onFailed: (failureResult) async {
- GifLoaderDialogUtils.hideDialog(context);
- log("failureResult: ${failureResult.message.toString()}");
- AppToast.showErrorToast(message: failureResult.message.toString());
- },
- onSuccess: (successResult) async {
- log("Payfort: ${successResult.responseMessage}");
- await context.read().addPayfortApplePayResponse(projectViewModel.user.patientID!, result: successResult);
- checkPaymentStatus(AppoitmentAllHistoryResultList());
- },
- projectId: widget.projectID,
- serviceTypeEnum: ServiceTypeEnum.ancillaryOrder,
- );
+ customerName: projectViewModel.user.firstName! + " " + projectViewModel.user.lastName!,
+ // customerEmail: projectViewModel.authenticatedUserObject.user.emailAddress,
+ customerEmail: "CustID_${projectViewModel.user.patientID}@HMG.com",
+ orderDescription: "Ancillary Order Payment",
+ orderAmount: double.parse(getTotalValue()),
+ merchantReference: transID,
+ payfortProjectDetailsRespModel: payfortProjectDetailsRespModel,
+ currency: projectViewModel.user.outSA == 1 ? "AED" : "SAR",
+ onFailed: (failureResult) async {
+ GifLoaderDialogUtils.hideDialog(context);
+ log("failureResult: ${failureResult.message.toString()}");
+ AppToast.showErrorToast(message: failureResult.message.toString());
+ },
+ onSuccess: (successResult) async {
+ log("Payfort: ${successResult.responseMessage}");
+ await context.read().addPayfortApplePayResponse(projectViewModel.user.patientID!, result: successResult);
+ checkPaymentStatus(AppoitmentAllHistoryResultList());
+ },
+ projectId: widget.projectID,
+ serviceTypeEnum: ServiceTypeEnum.ancillaryOrder,
+ );
} else {
GifLoaderDialogUtils.hideDialog(context);
AppToast.showErrorToast(message: "An error occurred while processing your request");
diff --git a/lib/pages/BookAppointment/BookSuccess.dart b/lib/pages/BookAppointment/BookSuccess.dart
index f4df725b..61b0f9d9 100644
--- a/lib/pages/BookAppointment/BookSuccess.dart
+++ b/lib/pages/BookAppointment/BookSuccess.dart
@@ -31,6 +31,7 @@ import 'package:diplomaticquarterapp/widgets/new_design/doctor_header.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/material.dart';
+import 'package:flutter_svg/flutter_svg.dart';
import 'package:provider/provider.dart';
import '../../config/shared_pref_kay.dart';
@@ -41,6 +42,7 @@ class BookSuccess extends StatefulWidget {
DoctorList docObject;
late MyInAppBrowser browser;
+
// final ChromeSafariBrowser chromeBrowser = new MyChromeSafariBrowser(new MyInAppBrowser());
String appoDateFormatted;
@@ -123,8 +125,8 @@ class _BookSuccessState extends State {
),
TableRow(
children: [
- TableCell(child: _getHeadingText("SR " + widget.patientShareResponse.patientShare.toString())),
- TableCell(child: _getHeadingText("SR " + widget.patientShareResponse.patientShareWithTax.toString())),
+ TableCell(child: _getHeadingText(widget.patientShareResponse.patientShare.toString())),
+ TableCell(child: _getHeadingText(widget.patientShareResponse.patientShareWithTax.toString())),
],
),
],
@@ -1094,15 +1096,23 @@ class _BookSuccessState extends State {
_getHeadingText(text) {
return Container(
padding: EdgeInsets.only(bottom: 10.0, left: 20, right: 20),
- child: Text(
- text,
- textAlign: TextAlign.start,
- style: TextStyle(
- fontSize: 16.0,
- letterSpacing: -0.64,
- color: Colors.white,
- fontWeight: FontWeight.w600,
- ),
+ child: Row(
+ children: [
+ projectViewModel.isArabic ? Container() : SvgPicture.asset("assets/images/new/Saudi_Riyal_Symbol.svg", width: 16, height: 16, color: Colors.white),
+ mWidth(6),
+ Text(
+ text,
+ textAlign: TextAlign.start,
+ style: TextStyle(
+ fontSize: 16.0,
+ letterSpacing: -0.64,
+ color: Colors.white,
+ fontWeight: FontWeight.w600,
+ ),
+ ),
+ mWidth(6),
+ projectViewModel.isArabic ? SvgPicture.asset("assets/images/new/Saudi_Riyal_Symbol.svg", width: 16, height: 16, color: Colors.white) : Container(),
+ ],
),
);
}
diff --git a/lib/pages/BookAppointment/components/DocAvailableAppointments.dart b/lib/pages/BookAppointment/components/DocAvailableAppointments.dart
index 6e12c68e..67a795da 100644
--- a/lib/pages/BookAppointment/components/DocAvailableAppointments.dart
+++ b/lib/pages/BookAppointment/components/DocAvailableAppointments.dart
@@ -9,6 +9,7 @@ import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
+import 'package:diplomaticquarterapp/uitl/utils.dart';
import 'package:diplomaticquarterapp/uitl/utils_new.dart';
import 'package:diplomaticquarterapp/widgets/buttons/custom_text_button.dart';
import 'package:flutter/cupertino.dart';
@@ -45,16 +46,18 @@ class _DocAvailableAppointmentsState extends State wit
AppSharedPreferences sharedPref = new AppSharedPreferences();
var selectedDate = "";
+ var selectedNextDate = "";
dynamic selectedDateJSON;
dynamic jsonFreeSlots;
-
+ final DateFormat dateFormatter = DateFormat('yyyy-MM-dd');
List docFreeSlots = [];
List dayEvents = [];
-
+ List nextDayEvents = [];
int selectedButtonIndex = 0;
-
+ int selectedNextDayButtonIndex = -1;
dynamic freeSlotsResponse;
+ // String nextDayAppointmentDate ="";
late ScrollController _scrollController;
var language;
@@ -115,9 +118,11 @@ class _DocAvailableAppointmentsState extends State wit
final DateFormat formatter = DateFormat('yyyy-MM-dd');
setState(() {
this.selectedDate = DateUtil.getWeekDayMonthDayYearDateFormatted(day, language);
+ this.selectedNextDate = DateUtil.getWeekDayMonthDayYearDateFormatted(day.add(Duration(days: 1)), language);
+ _calendarController.selectedDate = day;
openTimeSlotsPickerForDate(day, docFreeSlots);
DocAvailableAppointments.selectedDate = formatter.format(day);
- _calendarController.selectedDate = day;
+ selectedNextDayButtonIndex = -1;
print(_calendarController.selectedDate);
});
}
@@ -139,19 +144,51 @@ class _DocAvailableAppointmentsState extends State wit
child: Text(selectedDate, style: TextStyle(fontSize: 16.0, fontWeight: FontWeight.w600, letterSpacing: -0.64)),
),
DocAvailableAppointments.areSlotsAvailable
- ? Container(
- height: 40,
- child: ListView.builder(
- controller: _scrollController,
- scrollDirection: Axis.horizontal,
- itemCount: dayEvents.length,
- itemBuilder: (context, index) {
- return Container(
- margin: EdgeInsets.only(right: (index == dayEvents.length - 1) ? 16 : 5.0, left: index == 0 ? 16 : 5),
- child: index == selectedButtonIndex ? getSelectedButton(index) : getNormalButton(index),
- );
- },
- ),
+ ? Column(
+ crossAxisAlignment: CrossAxisAlignment.start,
+ children: [
+ Container(
+ height: 40,
+ child: ListView.builder(
+ controller: _scrollController,
+ scrollDirection: Axis.horizontal,
+ itemCount: dayEvents.length,
+ itemBuilder: (context, index) {
+ return Container(
+ margin: EdgeInsets.only(right: (index == dayEvents.length - 1) ? 16 : 5.0, left: index == 0 ? 16 : 5),
+ child: index == selectedButtonIndex ? getSelectedButton(index) : getNormalButton(index),
+ );
+ },
+ ),
+ ),
+ SizedBox(
+ height: 20,
+ ),
+ nextDayEvents.isNotEmpty && projectViewModel.havePrivilege(110)
+ ? Container(
+ padding: EdgeInsets.only(left: 20, right: 20, bottom: 20),
+ child: Text(
+ selectedNextDate,
+ style: TextStyle(fontSize: 14.0, fontWeight: FontWeight.w600, letterSpacing: -0.46, color: CustomColors.black),
+ ),
+ )
+ : SizedBox(),
+ Container(
+ height: 40,
+ padding: EdgeInsets.only(left: 0, right: 0),
+ child: ListView.builder(
+ controller: _scrollController,
+ scrollDirection: Axis.horizontal,
+ itemCount: nextDayEvents.length,
+ itemBuilder: (context, index) {
+ return Container(
+ margin: EdgeInsets.only(right: (index == nextDayEvents.length - 1) ? 16 : 5.0, left: index == 0 ? 16 : 5),
+ child: index == selectedNextDayButtonIndex ? getSelectedNextDayButton(index) : getNormalNextDayButton(index),
+ );
+ },
+ ),
+ )
+ ],
)
: Center(
child: Padding(
@@ -225,7 +262,7 @@ class _DocAvailableAppointmentsState extends State wit
Map timeSlot = {"isoTime": dayEvents[i].isoTime, "start": dayEvents[i].start.toString(), "end": dayEvents[i].end.toString(), "vidaDate": dayEvents[i].vidaDate};
timeList.add(timeSlot);
}
-
+ filterNextDayAppo(freeSlots, timeList.last);
AppSharedPreferences sharedPref = new AppSharedPreferences();
sharedPref.setString('selectedLogSlots', json.encode(timeList));
DocAvailableAppointments.selectedTime = dayEvents[selectedButtonIndex].isoTime;
@@ -234,12 +271,27 @@ class _DocAvailableAppointmentsState extends State wit
});
}
+ filterNextDayAppo(List freeSlots, Map listList) {
+ DateTime dateStart = DateTime.parse(listList['end']).add(Duration(days: 1));
+
+ DateTime dateStartObj = new DateTime(dateStart.year, dateStart.month, dateStart.day, 0, 0, 0, 0, 0);
+ nextDayEvents = [];
+ DateTime beforeHour = new DateTime(dateStart.year, dateStart.month, dateStart.day, 6, 0, 0, 0, 0);
+ if (projectViewModel.havePrivilege(110)) {
+ freeSlots.forEach((v) {
+ if (v.start == dateStartObj && v.end!.isBefore(beforeHour)) nextDayEvents.add(v);
+ });
+ } else {
+ nextDayEvents = [];
+ }
+ // print(nextDayEvents);
+ }
+
Future