generate invoice called after payment now

dev_3.16.3_Lab_CheckIn_6718
haroon amjad 12 months ago
parent f14a8af317
commit caa3c75bae

@ -852,8 +852,8 @@ class _AnicllaryOrdersState extends State<AnicllaryOrdersDetails> with SingleTic
addAdvancedNumberRequest(String advanceNumber, String paymentReference, dynamic appointmentID, AppoitmentAllHistoryResultList appo) {
DoctorsListService service = new DoctorsListService();
service.addAdvancedNumberRequest(advanceNumber, paymentReference, appointmentID, localContext).then((res) {
// autoGenerateInvoice();
showAlertDialog("123123123", widget.projectID);
autoGenerateInvoice();
// showAlertDialog("123123123", widget.projectID);
}).catchError((err) {
GifLoaderDialogUtils.hideDialog(localContext);
AppToast.showErrorToast(message: err.toString());

@ -1220,7 +1220,7 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
showNfcReader(context, onNcfScan: (String nfcId) {
Future.delayed(const Duration(milliseconds: 100), () {
print(nfcId);
autoGenerateInvoice(ancillaryOrderList, projectID);
generateQueueNumber(ancillaryOrderList, projectID);
// getProjectIDFromNFC(nfcId, true);
// Navigator.push(context, FadePage(page: EROnlineCheckInPaymentDetails()));
});
@ -1237,7 +1237,7 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
String onlineCheckInQRCode = (await BarcodeScanner.scan().then((value) => value.rawContent));
if (onlineCheckInQRCode != "") {
print(onlineCheckInQRCode);
autoGenerateInvoice(ancillaryOrderList, projectID);
generateQueueNumber(ancillaryOrderList, projectID);
// getProjectIDFromNFC(onlineCheckInQRCode, true);
// sendNfcCheckInRequest(onlineCheckInQRCode, 2);
} else {}
@ -1267,7 +1267,7 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
print(dist);
if (dist <= projectDetailListModel.geofenceRadius!) {
GifLoaderDialogUtils.hideDialog(context);
autoGenerateInvoice(ancillaryOrderList, projectID);
generateQueueNumber(ancillaryOrderList, projectID);
// sendNfcCheckInRequest(projectDetailListModel.checkInQrCode!, 2);
} else {
GifLoaderDialogUtils.hideDialog(context);
@ -1681,23 +1681,16 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
});
}
autoGenerateInvoice(AncillaryOrderList ancillaryOrderList, int projectID) {
List<dynamic> selectedProcListAPI = [];
ancillaryOrderList.ancillaryProcedureListModels!.forEach((element) {
selectedProcListAPI.add({
"ApprovalLineItemNo": element.approvalLineItemNo,
"OrderLineItemNo": element.orderLineItemNo,
"ProcedureID": element.procedureID,
});
});
generateQueueNumber(AncillaryOrderList ancillaryOrderList, int projectID) {
GifLoaderDialogUtils.showMyDialog(context);
DoctorsListService service = new DoctorsListService();
service.autoGenerateAncillaryOrdersInvoice(ancillaryOrderList.orderNo, projectID, ancillaryOrderList.appointmentNo, selectedProcListAPI, projectViewModel.isArabic ? 1 : 2, context).then((res) {
service
.getLabQueueNumber(projectID, projectViewModel.authenticatedUserObject.user.patientID!, Utils.isVidaPlusProject(projectViewModel, projectID), ancillaryOrderList.orderNo.toString(),
ancillaryOrderList.orderNo.toString())
.then((res) {
GifLoaderDialogUtils.hideDialog(context);
showAlertDialog(res['AncillaryOrderInvoiceList'][0]['PatientCallNo']);
showAlertDialog(res['QLineResponse']['PatientCallNo']);
}).catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
AppToast.showErrorToast(message: err);
@ -1705,6 +1698,30 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
});
}
// autoGenerateInvoice(AncillaryOrderList ancillaryOrderList, int projectID) {
// List<dynamic> selectedProcListAPI = [];
//
// ancillaryOrderList.ancillaryProcedureListModels!.forEach((element) {
// selectedProcListAPI.add({
// "ApprovalLineItemNo": element.approvalLineItemNo,
// "OrderLineItemNo": element.orderLineItemNo,
// "ProcedureID": element.procedureID,
// });
// });
//
// GifLoaderDialogUtils.showMyDialog(context);
//
// DoctorsListService service = new DoctorsListService();
// service.autoGenerateAncillaryOrdersInvoice(ancillaryOrderList.orderNo, projectID, ancillaryOrderList.appointmentNo, selectedProcListAPI, projectViewModel.isArabic ? 1 : 2, context).then((res) {
// GifLoaderDialogUtils.hideDialog(context);
// showAlertDialog(res['AncillaryOrderInvoiceList'][0]['PatientCallNo']);
// }).catchError((err) {
// GifLoaderDialogUtils.hideDialog(context);
// AppToast.showErrorToast(message: err);
// print(err);
// });
// }
showAlertDialog(dynamic queueNo) {
AlertDialogBox(
context: context,

@ -2001,4 +2001,23 @@ class DoctorsListService extends BaseService {
return Future.value(localRes);
}
Future<Map> getLabQueueNumber(int projectID, int patientID, bool isVidaPlus, String invoiceNo, String orderNo) async {
Map<String, dynamic> request;
request = {
"LanguageID": 1,
"QLineLabPatientCallNoGetModel": {"projectID": projectID, "patientID": patientID, "isVidaPlus": isVidaPlus, "invoiceNo": invoiceNo, "orderNo": orderNo}
};
hasError = false;
dynamic localRes;
await baseAppClient.post(GET_PATIENT_LAB_QUEUE_NUMBER, onSuccess: (dynamic response, int statusCode) {
localRes = response;
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: request);
return Future.value(localRes);
}
}

Loading…
Cancel
Save