From a32501f3dc36eb9cd3a725b1ca3cf6f9979a2687 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Wed, 11 Aug 2021 17:29:52 +0300 Subject: [PATCH] My invoices implementation continued --- assets/images/medical/Invoice.png | Bin 0 -> 1748 bytes assets/images/new-design/ViewDetailsIco.png | Bin 0 -> 1314 bytes lib/config/config.dart | 5 +- lib/config/localized_values.dart | 8 + .../GetDentalAppointmentsResponse.dart | 100 ++++++++ lib/pages/BookAppointment/BookConfirm.dart | 2 +- .../BookAppointment/widgets/DoctorView.dart | 8 +- .../widgets/AppointmentActions.dart | 4 +- .../my_invoices/invoice_detail_page.dart | 51 ++++ .../medical/my_invoices/my_invoice_page.dart | 234 ++++++++++++++++++ .../my_invoice_services.dart | 53 ++++ lib/uitl/translations_delegate_base.dart | 6 + lib/uitl/utils.dart | 12 + 13 files changed, 476 insertions(+), 7 deletions(-) create mode 100644 assets/images/medical/Invoice.png create mode 100644 assets/images/new-design/ViewDetailsIco.png create mode 100644 lib/models/MyInvoices/GetDentalAppointmentsResponse.dart create mode 100644 lib/pages/medical/my_invoices/invoice_detail_page.dart create mode 100644 lib/pages/medical/my_invoices/my_invoice_page.dart create mode 100644 lib/services/my_invoice_service/my_invoice_services.dart diff --git a/assets/images/medical/Invoice.png b/assets/images/medical/Invoice.png new file mode 100644 index 0000000000000000000000000000000000000000..1e3b6f250398cd114afa63e6b05e842ca4eaacd6 GIT binary patch literal 1748 zcmb_d={wsC8Vwb$+(c_@VvB0H#au*eV;RAZkXuC)%fzHn)o??jxUrPd+9K5|9aOcA zB~i82Ry9?rmb9@{Bd#cJsaje~ZIhc)`{;a{KVUw*=RD_mpL3q`>3y&Hc)7zMnh+2O z1jBo{5)SzM_xVBo0HdZ0eGf?HH-fths9vbO00PP1#Jf8CCde$agIKqvRBLux)N&!~Q_7_Ad$V4%@X7XFWb* zVJQ(Nq&b6|Uv@-M6)AF&OQd7JhY#K17f=b^&J^^k)cMMv()E6d z)t&_d+N{WM4C37XcTuwJ4Q)5C;QKbK)}_2hxw*qnhf=a*inG5(vK+6}zsxPhjj_`Q zD(_B2#l+V{P_C~M-ytT}JE7GZ>X&Qa*8F(DAN@`B0z`zHcu0r~*7{^`ytrKuYs5{2 zQ)G5kM*Z%)@NJw+mz53z1y}GHbQ50HX@rc2jP5>?1*kFZK)R9f^({ii@7qWs?V3$n-<>+`4uJaVeGkVIn;D(c5@HJQLd;*UmHQ z@Fsooa|}M;nI{)aHc$Y_Mx~-iw7xSUptti#K;MZLEhzqoz%K^CE4T`5wg|*my=+eYHZ-;5Ot6F9ZI&03gz!f4AUg8#^+rUQ{? zsr#?IFx5?>N#E@4GwW8at2;7?3}dM?R(u>c>XmA9Iu4N1X0{u_f_qi%>lqE*N(L(Uu85QZ}WXylJl20 z8`Y#X8T(forjGUWTYS_WRSmFT`s41Ojk>&R9F1n#PtsEY_(vKdQy|iKp~QFNYFINP9igYD3B->?kP#5)=WfQ^N%t282Xa^eh@7cT`ob{rm3%EMwq_HSF! zxQu~jOgKXt#a1usJaNi+yRhX^qZ)%-oFtttFt~MM%H=6S%GyI;J~WvoR0$ibWs1Qg z+&d+ZAx%PQLlRBvT^{H8ZfrHY3w3bxk;Ucpa)5)yY)}rJdmL#)`2N2@csDQCdY7|l F{{bntGY9|x literal 0 HcmV?d00001 diff --git a/assets/images/new-design/ViewDetailsIco.png b/assets/images/new-design/ViewDetailsIco.png new file mode 100644 index 0000000000000000000000000000000000000000..cd58bddb8718ec93d9343daf41a7e8500639b297 GIT binary patch literal 1314 zcmV+-1>O3IP)mg5$ZTqG7` z2jKi7>&{q?yAtPQWk`PC=*f=6xnV*rGVDE-%k-%nY@0?Nz;a4};P-utA9Q3zvLts; zat0Iarcls%%W?Bj4iAN7z?G0;AT3?99GAR$OSSB-T@FZk$2N^n&)XET2LPoA^irz> zT3NEt1AtPW*rt(f_G2KVZ5lZZkxQpluuWq$5~OV!Cjcz;7$7((34A{rysK>*E2=}q zSndKw&c2nfjrH39YX|FdAE3HfRy}pr9|qPza*%yh<%%O`r!khBQ*B5jJ=ojB>eMTE zuvb+%?LL6f+NdbwJD{bP3eu5@m&9Ibko(z1)dmG>;MkaWaGCyoJpR-e?*6)_a{3_0 z)E=hb6B;@6kOtXk|3k9t?WVX?hdfBxU7HT1 zsv4d=gF{D$mCo9~vyJT=i@G5v$at3HZfS=cn#|(K@#mDzxx4;LJ0QV1rhtj{QLzBy;`4$pf0>V z_r8`{O&_l)rKa)AUp4@e=)Hd7%2n|YdK!|tqjXY#e)ly>uUS|+{UXZw%VOWav8OTm z=5*5A+)EYm$jO(*=gyCdxc%)F?BCfD-LrE2d+e5$#cxkM`+TB%(DGlZkePvpU6J7Y z+AS@KJ*vZzPqg%hzPQU_I`j{FPV%gN(Rd4XKnWxkapgF6PW<_Evri!UUl4vZfT>qhNA7%bz#6uZ7 z8cJe-F3Pl|fTR=wui|!G|9M35k$#=0@0wN5O&EL(Sp@4{zt*Zg;ws$lVAXKX) zx%4IN%8&{>naBmdN_kf<*c(r=`+h-dH>wrQu`8E(xjNsWpn)d!mpWF|TPv==o8jQ0 z9W}6t;G}dG+Gjc9$R@PzEv~F8a`cs0?fT0Et$C71rca86X$!Kn%q@|n=snxe1?CCB YfA3QFMu-0^N&o-=07*qoM6N<$g0RShVgLXD literal 0 HcmV?d00001 diff --git a/lib/config/config.dart b/lib/config/config.dart index f8bca863..acdc5c40 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -13,7 +13,7 @@ const PACKAGES_CUSTOMER = '/api/customers'; const PACKAGES_SHOPPING_CART = '/api/shopping_cart_items'; const PACKAGES_ORDERS = '/api/orders'; -//const BASE_URL = 'https://uat.hmgwebservices.com/'; +// const BASE_URL = 'https://uat.hmgwebservices.com/'; const BASE_URL = 'https://hmgwebservices.com/'; // Pharmacy UAT URLs @@ -605,6 +605,9 @@ const FILTERED_PRODUCTS = 'products?categoryids='; const GET_DOCTOR_LIST_CALCULATION = "Services/Doctors.svc/REST/GetCallculationDoctors"; +const GET_ALL_APPOINTMENTS_FOR_DENTAL_CLINIC = + "Services/Patients.svc/REST/GetDentalAppointments"; + class AppGlobal { static var context; diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 1feb206a..cdcbb2fb 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -2101,4 +2101,12 @@ const Map localizedValues = { "ar": "تتيح لك هذه الخدمة إجراء استشارة عبر مكالمة فيديو مباشرة مع الطبيب من أي مكان وفي أي وقت" }, + "my-invoice": { + "en": "My Invoice", + "ar": "فواتيري" + }, + "invoice-list": { + "en": "Invoices List", + "ar": "فائمة الفواتير" + }, }; diff --git a/lib/models/MyInvoices/GetDentalAppointmentsResponse.dart b/lib/models/MyInvoices/GetDentalAppointmentsResponse.dart new file mode 100644 index 00000000..a5a43cef --- /dev/null +++ b/lib/models/MyInvoices/GetDentalAppointmentsResponse.dart @@ -0,0 +1,100 @@ +class GetDentalAppointmentsResponse { + List listDentalAppointments; + + GetDentalAppointmentsResponse({this.listDentalAppointments}); + + GetDentalAppointmentsResponse.fromJson(Map json) { + if (json['List_DentalAppointments'] != null) { + listDentalAppointments = new List(); + json['List_DentalAppointments'].forEach((v) { + listDentalAppointments.add(new ListDentalAppointments.fromJson(v)); + }); + } + } + + Map toJson() { + final Map data = new Map(); + if (this.listDentalAppointments != null) { + data['List_DentalAppointments'] = + this.listDentalAppointments.map((v) => v.toJson()).toList(); + } + return data; + } +} + +class ListDentalAppointments { + String setupId; + int projectID; + int patientID; + int appointmentNo; + String appointmentDate; + dynamic appointmentDateN; + int clinicID; + int doctorID; + int invoiceNo; + int status; + String arrivedOn; + String doctorName; + dynamic doctorNameN; + String clinicName; + String doctorImageURL; + String projectName; + + ListDentalAppointments( + {this.setupId, + this.projectID, + this.patientID, + this.appointmentNo, + this.appointmentDate, + this.appointmentDateN, + this.clinicID, + this.doctorID, + this.invoiceNo, + this.status, + this.arrivedOn, + this.doctorName, + this.doctorNameN, + this.clinicName, + this.doctorImageURL, + this.projectName}); + + ListDentalAppointments.fromJson(Map json) { + setupId = json['SetupId']; + projectID = json['ProjectID']; + patientID = json['PatientID']; + appointmentNo = json['AppointmentNo']; + appointmentDate = json['AppointmentDate']; + appointmentDateN = json['AppointmentDateN']; + clinicID = json['ClinicID']; + doctorID = json['DoctorID']; + invoiceNo = json['InvoiceNo']; + status = json['Status']; + arrivedOn = json['ArrivedOn']; + doctorName = json['DoctorName']; + doctorNameN = json['DoctorNameN']; + clinicName = json['ClinicName']; + doctorImageURL = json['DoctorImageURL']; + projectName = json['ProjectName']; + } + + Map toJson() { + final Map data = new Map(); + data['SetupId'] = this.setupId; + data['ProjectID'] = this.projectID; + data['PatientID'] = this.patientID; + data['AppointmentNo'] = this.appointmentNo; + data['AppointmentDate'] = this.appointmentDate; + data['AppointmentDateN'] = this.appointmentDateN; + data['ClinicID'] = this.clinicID; + data['DoctorID'] = this.doctorID; + data['InvoiceNo'] = this.invoiceNo; + data['Status'] = this.status; + data['ArrivedOn'] = this.arrivedOn; + data['DoctorName'] = this.doctorName; + data['DoctorNameN'] = this.doctorNameN; + data['ClinicName'] = this.clinicName; + data['DoctorImageURL'] = this.doctorImageURL; + data['ProjectName'] = this.projectName; + return data; + } +} diff --git a/lib/pages/BookAppointment/BookConfirm.dart b/lib/pages/BookAppointment/BookConfirm.dart index 966dc4d4..fe9113cb 100644 --- a/lib/pages/BookAppointment/BookConfirm.dart +++ b/lib/pages/BookAppointment/BookConfirm.dart @@ -544,7 +544,7 @@ class _BookConfirmState extends State { navigateToBookSuccess(context, docObject, widget.patientShareResponse); }).catchError((err) { GifLoaderDialogUtils.hideDialog(context); - AppToast.showErrorToast(message: err); + // AppToast.showErrorToast(message: err); navigateToHome(context); print(err); }); diff --git a/lib/pages/BookAppointment/widgets/DoctorView.dart b/lib/pages/BookAppointment/widgets/DoctorView.dart index bb6fccab..7cdf7ed0 100644 --- a/lib/pages/BookAppointment/widgets/DoctorView.dart +++ b/lib/pages/BookAppointment/widgets/DoctorView.dart @@ -13,13 +13,15 @@ import '../DoctorProfile.dart'; class DoctorView extends StatelessWidget { final DoctorList doctor; bool isLiveCareAppointment; + bool isShowFlag; - DoctorView({@required this.doctor, @required this.isLiveCareAppointment}); + DoctorView({@required this.doctor, @required this.isLiveCareAppointment, this.isShowFlag = true}); @override Widget build(BuildContext context) { return InkWell( onTap: () { + if(isShowFlag) getDoctorsProfile(context, doctor); }, child: Card( @@ -113,10 +115,10 @@ class DoctorView extends StatelessWidget { filledIcon: Icons.star, emptyIcon: Icons.star, ), - Container( + isShowFlag ? Container( child: Image.network(this.doctor.nationalityFlagURL, width: 25.0, height: 25.0), - ), + ) : Container(), ], ), ], diff --git a/lib/pages/MyAppointments/widgets/AppointmentActions.dart b/lib/pages/MyAppointments/widgets/AppointmentActions.dart index 4658f83b..c37cf6ee 100644 --- a/lib/pages/MyAppointments/widgets/AppointmentActions.dart +++ b/lib/pages/MyAppointments/widgets/AppointmentActions.dart @@ -112,7 +112,7 @@ class _AppointmentActionsState extends State { e.title, color: Color(0xffB8382C), variant: "overline", - fontSize: SizeConfig.textMultiplier * 2.1, + fontSize: SizeConfig.textMultiplier * 1.8, ), ), Container( @@ -122,7 +122,7 @@ class _AppointmentActionsState extends State { e.subtitle, color: Colors.black, variant: "overline", - fontSize: SizeConfig.textMultiplier * 1.9, + fontSize: SizeConfig.textMultiplier * 1.6, ), ), ], diff --git a/lib/pages/medical/my_invoices/invoice_detail_page.dart b/lib/pages/medical/my_invoices/invoice_detail_page.dart new file mode 100644 index 00000000..33df8fc3 --- /dev/null +++ b/lib/pages/medical/my_invoices/invoice_detail_page.dart @@ -0,0 +1,51 @@ +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; +import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart'; +import 'package:diplomaticquarterapp/models/MyInvoices/GetDentalAppointmentsResponse.dart'; +import 'package:diplomaticquarterapp/pages/BookAppointment/widgets/DoctorView.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; + +class InvoiceDetail extends StatelessWidget { + final DoctorList doctor; + final ListDentalAppointments listDentalAppointments; + + InvoiceDetail(this.doctor, this.listDentalAppointments); + + @override + Widget build(BuildContext context) { + ProjectViewModel projectViewModel = Provider.of(context); + return AppScaffold( + appBarTitle: TranslationBase.of(context).myInvoice, + isShowAppBar: true, + isShowDecPage: false, + body: Container( + child: Column( + children: [ + DoctorView(doctor: doctor, isLiveCareAppointment: false, isShowFlag: false), + Container( + margin: EdgeInsets.only(top: 10.0, left: 10.0, right: 10.0), + padding: EdgeInsets.only(top: 10.0, left: 10.0, right: 10.0, bottom: 10.0), + decoration: BoxDecoration( + color: Colors.grey[800], + borderRadius: BorderRadius.only( + topLeft: Radius.circular(8), + topRight: Radius.circular(8), + ), + ), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text("Description", style: TextStyle(color: Colors.white, fontWeight: FontWeight.bold)), + Text("Quantity", style: TextStyle(color: Colors.white, fontWeight: FontWeight.bold)), + Text("Price", style: TextStyle(color: Colors.white, fontWeight: FontWeight.bold)), + Text("Total", style: TextStyle(color: Colors.white, fontWeight: FontWeight.bold)), + ], + ), + ), + ], + ), + )); + } +} diff --git a/lib/pages/medical/my_invoices/my_invoice_page.dart b/lib/pages/medical/my_invoices/my_invoice_page.dart new file mode 100644 index 00000000..898d374a --- /dev/null +++ b/lib/pages/medical/my_invoices/my_invoice_page.dart @@ -0,0 +1,234 @@ +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; +import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart' + as DoctorListResponse; +import 'package:diplomaticquarterapp/models/MyInvoices/GetDentalAppointmentsResponse.dart'; +import 'package:diplomaticquarterapp/pages/medical/my_invoices/invoice_detail_page.dart'; +import 'package:diplomaticquarterapp/services/my_invoice_service/my_invoice_services.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/translations_delegate_base.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:provider/provider.dart'; + +class MyInvoices extends StatefulWidget { + @override + _MyInvoicesState createState() => _MyInvoicesState(); +} + +class _MyInvoicesState extends State { + bool isDataLoaded = false; + GetDentalAppointmentsResponse getDentalAppointmentsResponse; + + @override + void initState() { + WidgetsBinding.instance.addPostFrameCallback((_) { + getDentalAppointments(); + }); + super.initState(); + } + + @override + Widget build(BuildContext context) { + ProjectViewModel projectViewModel = Provider.of(context); + return AppScaffold( + appBarTitle: TranslationBase.of(context).myInvoice, + isShowAppBar: true, + isShowDecPage: false, + body: Container( + child: SingleChildScrollView( + physics: BouncingScrollPhysics(), + child: isDataLoaded + ? Column( + children: [ + ...List.generate( + getDentalAppointmentsResponse + .listDentalAppointments.length, + (index) => InkWell( + onTap: () { + openInvoiceDetailsPage(getDentalAppointmentsResponse + .listDentalAppointments[index]); + }, + child: Container( + decoration: BoxDecoration( + color: Colors.white, + borderRadius: + BorderRadius.all(Radius.circular(8.0)), + ), + margin: EdgeInsets.all(10.0), + width: MediaQuery.of(context).size.width, + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Container( + child: Container( + margin: EdgeInsets.fromLTRB( + 20.0, 10.0, 20.0, 10.0), + child: ClipRRect( + borderRadius: + BorderRadius.circular(100.0), + child: Image.asset( + "assets/images/new-design/ViewDetailsIco.png", + fit: BoxFit.fill, + height: 60.0, + width: 60.0), + ), + ), + ), + Column( + mainAxisSize: MainAxisSize.min, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + margin: EdgeInsets.only(top: 10.0), + child: Text("Appointment No: ", + style: TextStyle( + fontSize: 14.0, + color: Colors.black, + letterSpacing: 0.5)), + ), + Container( + margin: EdgeInsets.only(top: 10.0), + child: Text("Appointment Date: ", + style: TextStyle( + fontSize: 14.0, + color: Colors.black, + letterSpacing: 0.5)), + ), + Container( + margin: EdgeInsets.only( + top: 10.0, bottom: 10.0), + child: Text("Clinic: ", + style: TextStyle( + fontSize: 14.0, + color: Colors.black, + letterSpacing: 0.5)), + ), + ], + ), + Column( + mainAxisSize: MainAxisSize.min, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + margin: EdgeInsets.only(top: 10.0), + child: Text( + getDentalAppointmentsResponse + .listDentalAppointments[index] + .appointmentNo + .toString(), + style: TextStyle( + fontSize: 14.0, + color: Colors.black, + fontWeight: FontWeight.bold, + letterSpacing: 0.5)), + ), + Container( + margin: EdgeInsets.only(top: 10.0), + child: Text( + DateUtil.getMonthDayYearDateFormatted( + DateUtil.convertStringToDate( + getDentalAppointmentsResponse + .listDentalAppointments[ + index] + .appointmentDate)), + style: TextStyle( + fontSize: 14.0, + color: Colors.black, + fontWeight: FontWeight.bold, + letterSpacing: 0.5)), + ), + Container( + margin: EdgeInsets.only( + top: 10.0, bottom: 10.0), + child: Text( + getDentalAppointmentsResponse + .listDentalAppointments[index] + .clinicName, + style: TextStyle( + fontSize: 14.0, + color: Colors.black, + fontWeight: FontWeight.bold, + letterSpacing: 0.5)), + ), + ], + ), + projectViewModel.isArabic + ? Container( + margin: EdgeInsets.only(left: 15.0), + child: Image.asset( + "assets/images/new-design/arrow_menu_black-ar.png", + fit: BoxFit.fill, + height: 20.0, + width: 12.0), + ) + : Container( + margin: EdgeInsets.only(right: 15.0), + child: Image.asset( + "assets/images/new-design/arrow_menu_black-en.png", + fit: BoxFit.fill, + height: 20.0, + width: 12.0), + ), + ], + ), + ), + ), + ), + ], + ) + : Container(), + ), + )); + } + + openInvoiceDetailsPage(ListDentalAppointments listDentalAppointments) { + DoctorListResponse.DoctorList doctor = new DoctorListResponse.DoctorList(); + + doctor.name = listDentalAppointments.doctorName; + doctor.projectName = listDentalAppointments.projectName; + doctor.date = listDentalAppointments.appointmentDate; + doctor.actualDoctorRate = 0; + doctor.doctorImageURL = listDentalAppointments.doctorImageURL; + doctor.dayName = listDentalAppointments.invoiceNo; + doctor.doctorTitle = "Dr."; + doctor.clinicName = "InvoiceNo: " + listDentalAppointments.invoiceNo.toString(); + + Navigator.push( + context, + FadePage( + page: InvoiceDetail( + doctor, + listDentalAppointments, + ))); + } + + getDentalAppointments() { + GifLoaderDialogUtils.showMyDialog(context); + MyInvoicesService myInvoicesService = new MyInvoicesService(); + + myInvoicesService.getAllDentalAppointments(12, context).then((res) { + GifLoaderDialogUtils.hideDialog(context); + setState(() { + if (res['MessageStatus'] == 1) { + getDentalAppointmentsResponse = + GetDentalAppointmentsResponse.fromJson(res); + print(getDentalAppointmentsResponse.listDentalAppointments.length); + print(getDentalAppointmentsResponse + .listDentalAppointments[0].appointmentNo); + } else { + AppToast.showErrorToast(message: res['ErrorEndUserMessage']); + } + isDataLoaded = true; + }); + }).catchError((err) { + GifLoaderDialogUtils.hideDialog(context); + print(err); + AppToast.showErrorToast(message: err); + Navigator.of(context).pop(); + }); + } +} diff --git a/lib/services/my_invoice_service/my_invoice_services.dart b/lib/services/my_invoice_service/my_invoice_services.dart new file mode 100644 index 00000000..fc401c39 --- /dev/null +++ b/lib/services/my_invoice_service/my_invoice_services.dart @@ -0,0 +1,53 @@ +import 'package:diplomaticquarterapp/config/config.dart'; +import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; +import 'package:diplomaticquarterapp/core/service/base_service.dart'; +import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart'; +import 'package:diplomaticquarterapp/models/Request.dart'; +import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart'; +import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; + +class MyInvoicesService extends BaseService { + AppSharedPreferences sharedPref = AppSharedPreferences(); + AppGlobal appGlobal = new AppGlobal(); + + AuthenticatedUser authUser = new AuthenticatedUser(); + AuthProvider authProvider = new AuthProvider(); + + Future getAllDentalAppointments(int projectID, + context) async { + Map request; + var languageID = + await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); + Request req = appGlobal.getPublicRequest(); + request = { + "LanguageID": languageID == 'ar' ? 1 : 2, + "IPAdress": "10.20.10.20", + "VersionID": req.VersionID, + "Channel": req.Channel, + "generalid": 'Cs2020@2016\$2958', + "PatientOutSA": authUser.outSA, + "DeviceTypeID": req.DeviceTypeID, + "SessionID": null, + "PatientID": authUser.patientID, + "License": true, + "IsRegistered": true, + "ProjectID": projectID, + "PatientTypeID":authUser.patientIdentificationType, + "PatientType":authUser.patientType, + "isDentalAllowedBackend": false + }; + + dynamic localRes; + + await baseAppClient.post(GET_ALL_APPOINTMENTS_FOR_DENTAL_CLINIC, + onSuccess: (response, statusCode) async { + localRes = response; + }, onFailure: (String error, int statusCode) { + throw error; + }, body: request); + return Future.value( + localRes + ); + } + +} \ No newline at end of file diff --git a/lib/uitl/translations_delegate_base.dart b/lib/uitl/translations_delegate_base.dart index 0a0e9b7c..bc88fea2 100644 --- a/lib/uitl/translations_delegate_base.dart +++ b/lib/uitl/translations_delegate_base.dart @@ -1673,6 +1673,12 @@ class TranslationBase { localizedValues["info-ereferral"][locale.languageCode]; String get erConsultation => localizedValues["er-consultation"][locale.languageCode]; + + String get myInvoice => + localizedValues["my-invoice"][locale.languageCode]; + + String get invoicesList => + localizedValues["invoice-list"][locale.languageCode]; } class TranslationBaseDelegate extends LocalizationsDelegate { diff --git a/lib/uitl/utils.dart b/lib/uitl/utils.dart index 06aeca9d..5c7eecde 100644 --- a/lib/uitl/utils.dart +++ b/lib/uitl/utils.dart @@ -21,6 +21,7 @@ import 'package:diplomaticquarterapp/pages/medical/doctor/doctor_home_page.dart' import 'package:diplomaticquarterapp/pages/medical/eye/EyeMeasurementsPage.dart'; import 'package:diplomaticquarterapp/pages/medical/labs/labs_home_page.dart'; import 'package:diplomaticquarterapp/pages/medical/medical_profile_page.dart'; +import 'package:diplomaticquarterapp/pages/medical/my_invoices/my_invoice_page.dart'; import 'package:diplomaticquarterapp/pages/medical/my_trackers/my_trackers.dart'; import 'package:diplomaticquarterapp/pages/medical/patient_sick_leave_page.dart'; import 'package:diplomaticquarterapp/pages/medical/prescriptions/prescriptions_home_page.dart'; @@ -302,6 +303,17 @@ class Utils { isEnable: projectViewModel.havePrivilege(6)), )); + medical.add(InkWell( + onTap: () => + projectViewModel.havePrivilege(14) ? Navigator.push(context, FadePage(page: MyInvoices())) : null, + child: MedicalProfileItem( + title: TranslationBase.of(context).myInvoice, + imagePath: 'Invoice.png', + subTitle: TranslationBase.of(context).invoicesList, + isEnable: projectViewModel.havePrivilege(14), + ), + )); + medical.add(InkWell( onTap: () => projectViewModel.havePrivilege(14) ? Navigator.push(context, FadePage(page: EyeMeasurementsPage())) : null,