| 
						
						
							
								
							
						
						
					 | 
					 | 
					@ -278,7 +278,7 @@ class _AnicllaryOrdersState extends State<AnicllaryOrdersDetails> with SingleTic
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                        ),
 | 
					 | 
					 | 
					 | 
					                        ),
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                        mWidth(3),
 | 
					 | 
					 | 
					 | 
					                        mWidth(3),
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                        Text(
 | 
					 | 
					 | 
					 | 
					                        Text(
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                          projectViewModel.user!.patientIdentificationNo!,
 | 
					 | 
					 | 
					 | 
					                          projectViewModel.user.patientIdentificationNo!,
 | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                          style: TextStyle(
 | 
					 | 
					 | 
					 | 
					                          style: TextStyle(
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                            fontWeight: FontWeight.w600,
 | 
					 | 
					 | 
					 | 
					                            fontWeight: FontWeight.w600,
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                            fontSize: 12,
 | 
					 | 
					 | 
					 | 
					                            fontSize: 12,
 | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
					 | 
					@ -596,12 +596,15 @@ class _AnicllaryOrdersState extends State<AnicllaryOrdersDetails> with SingleTic
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					              } else {
 | 
					 | 
					 | 
					 | 
					              } else {
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                openPayment(selectedPaymentMethod, projectViewModel.user, double.parse(getTotalValue()), null, selectedInstallmentPlan);
 | 
					 | 
					 | 
					 | 
					                openPayment(selectedPaymentMethod, projectViewModel.user, double.parse(getTotalValue()), null, selectedInstallmentPlan);
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					              }
 | 
					 | 
					 | 
					 | 
					              }
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					            } else {
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					              openPayment(selectedPaymentMethod, projectViewModel.user, double.parse(getTotalValue()), null, selectedInstallmentPlan);
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            }
 | 
					 | 
					 | 
					 | 
					            }
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					          },
 | 
					 | 
					 | 
					 | 
					          },
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					          patientShare: double.parse(getTotalValue()),
 | 
					 | 
					 | 
					 | 
					          patientShare: double.parse(getTotalValue()),
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					          isFromAdvancePayment: !projectViewModel.havePrivilege(94),
 | 
					 | 
					 | 
					 | 
					          isFromAdvancePayment: !projectViewModel.havePrivilege(94),
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        ));
 | 
					 | 
					 | 
					 | 
					        ));
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					  }
 | 
					 | 
					 | 
					 | 
					  }
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					  void startApplePay() async {
 | 
					 | 
					 | 
					 | 
					  void startApplePay() async {
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    transID = Utils.getAdvancePaymentTransID(widget.projectID, projectViewModel.user.patientID!);
 | 
					 | 
					 | 
					 | 
					    transID = Utils.getAdvancePaymentTransID(widget.projectID, projectViewModel.user.patientID!);
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
					 | 
					@ -764,8 +767,7 @@ class _AnicllaryOrdersState extends State<AnicllaryOrdersDetails> with SingleTic
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					      if (res["status"].toString().toLowerCase() == "success") {
 | 
					 | 
					 | 
					 | 
					      if (res["status"].toString().toLowerCase() == "success") {
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        updateTamaraRequestStatus("success", "14", orderID, tamaraOrderID!, int.parse(this.selectedInstallmentPlan!), appo);
 | 
					 | 
					 | 
					 | 
					        updateTamaraRequestStatus("success", "14", orderID, tamaraOrderID!, int.parse(this.selectedInstallmentPlan!), appo);
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					      } else {
 | 
					 | 
					 | 
					 | 
					      } else {
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        updateTamaraRequestStatus("Failed", "00", Utils.getAppointmentTransID(appo.projectID!, appo.clinicID!, appo.appointmentNo!), tamaraOrderID != null ? tamaraOrderID! : "",
 | 
					 | 
					 | 
					 | 
					        updateTamaraRequestStatus("Failed", "00", transID, tamaraOrderID != null ? tamaraOrderID! : "", int.parse(this.selectedInstallmentPlan!), appo);
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            int.parse(this.selectedInstallmentPlan!), appo);
 | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					      }
 | 
					 | 
					 | 
					 | 
					      }
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    }).catchError((err) {
 | 
					 | 
					 | 
					 | 
					    }).catchError((err) {
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					      GifLoaderDialogUtils.hideDialog(context);
 | 
					 | 
					 | 
					 | 
					      GifLoaderDialogUtils.hideDialog(context);
 | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
					 | 
					@ -815,10 +817,6 @@ class _AnicllaryOrdersState extends State<AnicllaryOrdersDetails> with SingleTic
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					  createAdvancePayment(res, AppoitmentAllHistoryResultList appo) {
 | 
					 | 
					 | 
					 | 
					  createAdvancePayment(res, AppoitmentAllHistoryResultList appo) {
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    DoctorsListService service = new DoctorsListService();
 | 
					 | 
					 | 
					 | 
					    DoctorsListService service = new DoctorsListService();
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    String paymentReference = res['Fort_id'].toString();
 | 
					 | 
					 | 
					 | 
					    String paymentReference = res['Fort_id'].toString();
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    // List<AncillaryOrdersProcedureList> ancillaryOrdersProcedureList = [];
 | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    // selectedProcList.forEach((element) {
 | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    //   ancillaryOrdersProcedureList.add(new AncillaryOrdersProcedureList(procedureID: num.parse(element.procedureID), procedureDescription: element.procedureName));
 | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    // });
 | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    service.HIS_createAdvancePayment(appo, widget.projectID.toString(), res['Amount'], res['Fort_id'], res['PaymentMethod'], projectViewModel.user.patientType,
 | 
					 | 
					 | 
					 | 
					    service.HIS_createAdvancePayment(appo, widget.projectID.toString(), res['Amount'], res['Fort_id'], res['PaymentMethod'], projectViewModel.user.patientType,
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            projectViewModel.user.firstName! + " " + projectViewModel.user.lastName!, projectViewModel.user.patientID, localContext,
 | 
					 | 
					 | 
					 | 
					            projectViewModel.user.firstName! + " " + projectViewModel.user.lastName!, projectViewModel.user.patientID, localContext,
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            isAncillaryOrder: true)
 | 
					 | 
					 | 
					 | 
					            isAncillaryOrder: true)
 | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					 | 
					@ -837,6 +835,17 @@ 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();
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					    }).catchError((err) {
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					      GifLoaderDialogUtils.hideDialog(localContext);
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					      AppToast.showErrorToast(message: err.toString());
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					      print(err);
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					    });
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					  }
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					  autoGenerateInvoice() {
 | 
					 | 
					 | 
					 | 
					  autoGenerateInvoice() {
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    List<dynamic> selectedProcListAPI = [];
 | 
					 | 
					 | 
					 | 
					    List<dynamic> selectedProcListAPI = [];
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					 | 
					@ -861,17 +870,6 @@ 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();
 | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    }).catchError((err) {
 | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					      GifLoaderDialogUtils.hideDialog(localContext);
 | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					      AppToast.showErrorToast(message: err.toString());
 | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					      print(err);
 | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    });
 | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					  }
 | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					  showAlertDialog(dynamic invoiceNo, dynamic projectID) {
 | 
					 | 
					 | 
					 | 
					  showAlertDialog(dynamic invoiceNo, dynamic projectID) {
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    AlertDialogBox(
 | 
					 | 
					 | 
					 | 
					    AlertDialogBox(
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        context: context,
 | 
					 | 
					 | 
					 | 
					        context: context,
 | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
						
					 | 
					 | 
					
 
 |