fixed er 'pickFiles' can't be acc

pull/323/head
faizatflutter 3 weeks ago
parent 05730d3774
commit 6b4ad35217

@ -1892,5 +1892,6 @@
"requestNo": "رقم الطلب.",
"referenceNo": "رقم المرجع",
"advanceNumber": "رقم الدفعة المقدمة",
"amountOnly": "المبلغ"
"amountOnly": "المبلغ",
"invoiceHistory": "سجل الفواتير"
}

@ -1885,7 +1885,8 @@
"referenceNo": "Reference No.",
"refund": "Refund",
"advanceNumber": "Advance Number",
"amountOnly": "Amount"
"amountOnly": "Amount",
"invoiceHistory": "Invoice History"
}

@ -209,7 +209,7 @@ class ApiClientImp implements ApiClient {
}
// body['TokenID'] = "@dm!n";
// body['PatientID'] = 4770714;
// body['PatientID'] = 4774167;
// body['PatientID'] = 89754444;
// body['PatientTypeID'] = 1;
// body['PatientOutSA'] = 0;

@ -273,6 +273,8 @@ class HabibWalletViewModel extends ChangeNotifier {
final request = SubmitRefundRequestModel(
projectId: projectId,
isRefundFastTrack: true,
// in case of wallet refund, skip ITG approval
refundType: '2',
// wallet withdrawal
refundProject: projectName,
@ -287,7 +289,8 @@ class HabibWalletViewModel extends ChangeNotifier {
refundDoctorName: '',
refundClinicId: 0,
refundClinicName: '',
refundDestination: '2', // only bank transfer
refundDestination: '2',
// only bank transfer
refundIban: iban,
refundRemarks: remarks,
refundTotalAmount: totalAdvancesBalance,

@ -73,7 +73,9 @@ class SubmitRefundRequestModel {
final String refundIban;
final String refundRemarks;
final double refundTotalAmount;
final bool isRefundFastTrack;
final List<SubmitRefundProcedureItem> refundProceduresList;
/// Populated only for wallet withdrawal refunds (refundType == '2').
final List<SubmitRefundAdvanceItem> refundAdvancesList;
@ -96,6 +98,7 @@ class SubmitRefundRequestModel {
required this.refundIban,
required this.refundRemarks,
required this.refundTotalAmount,
required this.isRefundFastTrack,
required this.refundProceduresList,
this.refundAdvancesList = const [],
});
@ -118,6 +121,7 @@ class SubmitRefundRequestModel {
"Refund_IBAN": refundIban,
"Refund_Remarks": refundRemarks,
"Refund_TotalRefundAmount": refundTotalAmount,
"Refund_IsFastTrack": isRefundFastTrack,
};
if (refundType == '2') {

@ -115,6 +115,7 @@ class RefundableInvoicesDetailsObject {
final int? projectId;
final List<RefundableInvoiceDetailsItem> refundableInvoiceDetailsItems;
final int? statusCode;
final bool? needITGApproval;
RefundableInvoicesDetailsObject({
this.errorCode,
@ -123,6 +124,7 @@ class RefundableInvoicesDetailsObject {
this.projectId,
this.refundableInvoiceDetailsItems = const [],
this.statusCode,
this.needITGApproval,
});
factory RefundableInvoicesDetailsObject.fromJson(Map<String, dynamic> json) {
@ -137,6 +139,7 @@ class RefundableInvoicesDetailsObject {
.toList()
: [],
statusCode: json['StatusCode'] as int?,
needITGApproval: json['NeedITGApproval'] as bool?,
);
}
}

@ -108,6 +108,7 @@ class RefundRequestViewModel extends ChangeNotifier {
void resetState() {
currentStep = 0;
procedures.clear();
needITGApproval = false;
selectedPaymentMethod = null;
selectedRefundReason = null;
isProceduresLoading = false;
@ -141,6 +142,7 @@ class RefundRequestViewModel extends ChangeNotifier {
}
}
void clearHospital() {
selectedHospital = null;
selectedInvoice = null;
@ -205,9 +207,11 @@ class RefundRequestViewModel extends ChangeNotifier {
// Procedures
List<RefundableProcedure> procedures = [];
bool isProceduresLoading = false;
bool needITGApproval = false;
void setProcedures(List<RefundableProcedure> list) {
void setProcedures(List<RefundableProcedure> list, {bool needsITGApproval = false}) {
procedures = list;
needITGApproval = needsITGApproval;
isProceduresLoading = false;
notifyListeners();
}

@ -1879,4 +1879,5 @@ abstract class LocaleKeys {
static const refund = 'refund';
static const advanceNumber = 'advanceNumber';
static const amountOnly = 'amountOnly';
static const invoiceHistory = 'invoiceHistory';
}

@ -2,6 +2,7 @@ import 'dart:async';
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:flutter_staggered_animations/flutter_staggered_animations.dart';
import 'package:hmg_patient_app_new/core/app_assets.dart';
import 'package:hmg_patient_app_new/core/app_export.dart';
import 'package:hmg_patient_app_new/core/app_state.dart';
@ -10,13 +11,19 @@ import 'package:hmg_patient_app_new/core/utils/utils.dart';
import 'package:hmg_patient_app_new/extensions/string_extensions.dart';
import 'package:hmg_patient_app_new/extensions/widget_extensions.dart';
import 'package:hmg_patient_app_new/features/habib_wallet/habib_wallet_view_model.dart';
import 'package:hmg_patient_app_new/features/my_invoices/my_invoices_view_model.dart';
import 'package:hmg_patient_app_new/generated/locale_keys.g.dart';
import 'package:hmg_patient_app_new/presentation/habib_wallet/recharge_wallet_page.dart';
import 'package:hmg_patient_app_new/presentation/habib_wallet/withdraw_request_create_page.dart';
import 'package:hmg_patient_app_new/presentation/lab/lab_result_item_view.dart';
import 'package:hmg_patient_app_new/presentation/my_invoices/widgets/invoice_list_card.dart';
import 'package:hmg_patient_app_new/theme/colors.dart';
import 'package:hmg_patient_app_new/widgets/appbar/collapsing_list_view.dart';
import 'package:hmg_patient_app_new/widgets/buttons/custom_button.dart';
import 'package:hmg_patient_app_new/widgets/common_bottom_sheet.dart';
import 'package:hmg_patient_app_new/widgets/loader/bottomsheet_loader.dart';
import 'package:hmg_patient_app_new/widgets/routes/custom_page_route.dart';
import 'package:open_filex/open_filex.dart';
import 'package:provider/provider.dart';
class HabibWalletPage extends StatefulWidget {
@ -28,6 +35,7 @@ class HabibWalletPage extends StatefulWidget {
class _HabibWalletState extends State<HabibWalletPage> {
late HabibWalletViewModel habibWalletVM;
late MyInvoicesViewModel myInvoicesViewModel;
@override
void initState() {
@ -35,6 +43,8 @@ class _HabibWalletState extends State<HabibWalletPage> {
habibWalletVM.initHabibWalletProvider();
habibWalletVM.getPatientBalanceAmount();
habibWalletVM.getLakumAccountInformation();
myInvoicesViewModel.setInvoicesListLoading();
myInvoicesViewModel.getAllInvoicesList();
});
super.initState();
@ -43,6 +53,7 @@ class _HabibWalletState extends State<HabibWalletPage> {
@override
Widget build(BuildContext context) {
habibWalletVM = Provider.of<HabibWalletViewModel>(context, listen: false);
myInvoicesViewModel = Provider.of<MyInvoicesViewModel>(context, listen: false);
AppState appState = getIt.get<AppState>();
return Scaffold(
backgroundColor: AppColors.bgScaffoldColor,
@ -144,45 +155,150 @@ class _HabibWalletState extends State<HabibWalletPage> {
),
],
),
SizedBox(height: 16.h),
Container(
decoration: RoundedRectangleBorder().toSmoothCornerDecoration(
color: AppColors.whiteColor,
borderRadius: 24.r,
hasShadow: false,
),
child: Consumer<HabibWalletViewModel>(builder: (context, habibWalletVM, child) {
return ListView.separated(
itemCount: habibWalletVM.habibWalletBalanceList.length,
physics: NeverScrollableScrollPhysics(),
padding: EdgeInsets.only(top: 8, bottom: 8),
shrinkWrap: true,
itemBuilder: (context, index) {
return Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Expanded(
child: habibWalletVM.habibWalletBalanceList[index].projectDescription!
.toText16(isBold: true, color: AppColors.textColor)),
Utils.getPaymentAmountWithSymbol2(
habibWalletVM.habibWalletBalanceList[index].patientAdvanceBalanceAmount!, //did the changes because of negative value
textColor: AppColors.textColor,
iconColor: AppColors.textColor,
iconSize: 18.h,
isExpanded: false,
fontSize: 28.f,
fontWeight: FontWeight.w600,
letterSpacing: -1),
],
).paddingSymmetrical(0, 12.h);
},
separatorBuilder: (BuildContext context, int index) {
return Divider(height: 1, color: AppColors.textColor.withAlpha(20));
},
).paddingSymmetrical(16.h, 24.h).toShimmer2(isShow: habibWalletVM.isWalletAmountLoading);
}),
),
SizedBox(height: 24.h),
// Container(
// decoration: RoundedRectangleBorder().toSmoothCornerDecoration(
// color: AppColors.whiteColor,
// borderRadius: 24.r,
// hasShadow: false,
// ),
// child: Consumer<HabibWalletViewModel>(builder: (context, habibWalletVM, child) {
// return ListView.separated(
// itemCount: habibWalletVM.habibWalletBalanceList.length,
// physics: NeverScrollableScrollPhysics(),
// padding: EdgeInsets.only(top: 8, bottom: 8),
// shrinkWrap: true,
// itemBuilder: (context, index) {
// return Row(
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
// children: [
// Expanded(
// child: habibWalletVM.habibWalletBalanceList[index].projectDescription!
// .toText16(isBold: true, color: AppColors.textColor)),
// Utils.getPaymentAmountWithSymbol2(
// habibWalletVM.habibWalletBalanceList[index].patientAdvanceBalanceAmount!, //did the changes because of negative value
// textColor: AppColors.textColor,
// iconColor: AppColors.textColor,
// iconSize: 18.h,
// isExpanded: false,
// fontSize: 28.f,
// fontWeight: FontWeight.w600,
// letterSpacing: -1),
// ],
// ).paddingSymmetrical(0, 12.h);
// },
// separatorBuilder: (BuildContext context, int index) {
// return Divider(height: 1, color: AppColors.textColor.withAlpha(20));
// },
// ).paddingSymmetrical(16.h, 24.h).toShimmer2(isShow: habibWalletVM.isWalletAmountLoading);
// }),
// ),
// SizedBox(height: 16.h),
// Invoices Section
Consumer<MyInvoicesViewModel>(builder: (context, myInvoicesVM, child) {
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
LocaleKeys.invoiceHistory.tr(context: context).toText18(isBold: true, color: context.textColor),
SizedBox(height: 12.h),
ListView.builder(
itemCount: myInvoicesVM.isInvoicesListLoading
? 4
: myInvoicesVM.allInvoicesList.isEmpty
? 1
: myInvoicesVM.allInvoicesList.length,
physics: NeverScrollableScrollPhysics(),
shrinkWrap: true,
padding: EdgeInsetsGeometry.zero,
itemBuilder: (context, index) {
return myInvoicesVM.isInvoicesListLoading
? LabResultItemView(onTap: () {}, labOrder: null, index: index, isLoading: true)
: myInvoicesVM.allInvoicesList.isNotEmpty
? AnimationConfiguration.staggeredList(
position: index,
duration: const Duration(milliseconds: 500),
child: SlideAnimation(
verticalOffset: 100.0,
child: FadeInAnimation(
child: AnimatedContainer(
duration: Duration(milliseconds: 300),
curve: Curves.easeInOut,
child: InvoiceListCard(
getInvoicesListResponseModel: myInvoicesVM.allInvoicesList[index],
onTap: () async {
if (Utils.isVidaPlusProject(myInvoicesVM.allInvoicesList[index].projectId ?? 0)) {
LoaderBottomSheet.showLoader(loadingText: LocaleKeys.sendingEmailPleaseWait.tr(context: context));
await myInvoicesViewModel.sendInvoiceEmail(
appointmentNo: myInvoicesVM.allInvoicesList[index].appointmentNo!,
projectID: myInvoicesVM.allInvoicesList[index].projectId!,
onSuccess: (val) {
LoaderBottomSheet.hideLoader();
showCommonBottomSheetWithoutHeight(context,
child: Utils.getSuccessWidget(
loadingText: LocaleKeys.emailSentSuccessfullyMessage.tr(context: context)),
callBackFunc: () {},
isFullScreen: false,
isCloseButtonVisible: true,
isAutoDismiss: true);
},
onError: (err) {
LoaderBottomSheet.hideLoader();
showCommonBottomSheetWithoutHeight(
context,
child: Utils.getErrorWidget(loadingText: err),
callBackFunc: () {},
isFullScreen: false,
isCloseButtonVisible: true,
);
});
} else {
LoaderBottomSheet.showLoader(loadingText: LocaleKeys.loadingText.tr(context: context));
myInvoicesViewModel.downloadInvoicePDF(
setupId: myInvoicesVM.allInvoicesList[index].setupId!,
invoiceNo: myInvoicesVM.allInvoicesList[index].invoiceNo!,
projectID: myInvoicesVM.allInvoicesList[index].projectId!,
onError: (err) {
LoaderBottomSheet.hideLoader();
showCommonBottomSheetWithoutHeight(
context,
child: Utils.getErrorWidget(loadingText: err),
callBackFunc: () {},
isFullScreen: false,
isCloseButtonVisible: true,
);
},
onSuccess: (value) async {
LoaderBottomSheet.hideLoader();
if (myInvoicesViewModel.downloadInvoicePDFBase64!.isNotEmpty) {
String path =
await Utils.createFileFromString(myInvoicesViewModel.downloadInvoicePDFBase64!, "pdf");
try {
OpenFilex.open(path);
} catch (ex) {
showCommonBottomSheetWithoutHeight(
context,
child: Utils.getErrorWidget(loadingText: LocaleKeys.cannotOpenThisFile.tr()),
callBackFunc: () {},
isFullScreen: false,
isCloseButtonVisible: true,
);
}
}
},
);
}
},
),
),
),
),
)
: Utils.getNoDataWidget(context);
},
),
],
);
}),
],
),
),
@ -191,3 +307,5 @@ class _HabibWalletState extends State<HabibWalletPage> {
);
}
}

@ -9,7 +9,6 @@ import 'package:hmg_patient_app_new/core/utils/utils.dart';
import 'package:hmg_patient_app_new/extensions/route_extensions.dart';
import 'package:hmg_patient_app_new/extensions/string_extensions.dart';
import 'package:hmg_patient_app_new/extensions/widget_extensions.dart';
import 'package:hmg_patient_app_new/features/habib_wallet/habib_wallet_view_model.dart';
import 'package:hmg_patient_app_new/features/my_invoices/models/get_invoices_list_response_model.dart';
import 'package:hmg_patient_app_new/features/refund_request/models/req_models/submit_refund_request_model.dart';
import 'package:hmg_patient_app_new/features/refund_request/refund_request_view_model.dart';
@ -46,7 +45,6 @@ class RefundRequestCreatePage extends StatefulWidget {
class _RefundRequestCreatePageState extends State<RefundRequestCreatePage> {
late RefundRequestViewModel _refundRequestViewModel;
late HabibWalletViewModel _habibWalletViewModel;
late AppState _appState;
final TextEditingController _ibanController = TextEditingController();
@ -94,7 +92,7 @@ class _RefundRequestCreatePageState extends State<RefundRequestCreatePage> {
apiProcedureId: item.procedureId,
))
.toList();
_refundRequestViewModel.setProcedures(procedures);
_refundRequestViewModel.setProcedures(procedures, needsITGApproval: details.needITGApproval ?? false);
},
);
}
@ -534,7 +532,7 @@ class _RefundRequestCreatePageState extends State<RefundRequestCreatePage> {
final request = SubmitRefundRequestModel(
projectId: invoice.projectId ?? 0,
refundType: '1',
// 1 = invoice refund
isRefundFastTrack: vm.needITGApproval,
refundProject: invoice.projectName ?? '',
refundProjectId: invoice.projectId ?? 0,
refundPatientId: patientId.toString(),
@ -643,7 +641,6 @@ class _RefundRequestCreatePageState extends State<RefundRequestCreatePage> {
@override
Widget build(BuildContext context) {
_habibWalletViewModel = context.read<HabibWalletViewModel>();
return Consumer<RefundRequestViewModel>(
builder: (context, vm, _) {
return Scaffold(

@ -688,6 +688,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "3.6.1"
flutter_paytabs_bridge:
dependency: "direct main"
description:
name: flutter_paytabs_bridge
sha256: fc48e68848147a8edf41b27f9068b988c4fb28ff9778bf20560a90be0b4dddfb
url: "https://pub.dev"
source: hosted
version: "2.7.13"
flutter_plugin_android_lifecycle:
dependency: transitive
description:

@ -175,3 +175,5 @@ flutter:
- asset: assets/fonts/gess_two/GE_SS_Two_Light.otf
weight: 400

Loading…
Cancel
Save