Example #1
0
		private void tbPay_CellDoubleClicked(object sender, OpenDental.CellEventArgs e) {
			Payment PaymentCur=Payments.GetFromList(((PaySplit)PaySplitsForProc[e.Row]).PayNum,PaymentsForProc);
			FormPayment FormP=new FormPayment(PatCur,FamCur,PaymentCur);
			FormP.InitialPaySplit=((PaySplit)PaySplitsForProc[e.Row]).SplitNum;
			FormP.ShowDialog();
			FillPayments();
		}
		private void butOK_Click(object sender, System.EventArgs e) {
			if(!ClaimIsValid()){
				return;
			}
			//if status is received, all claimprocs must also be received.
			if(comboClaimStatus.SelectedIndex==5){
				bool allReceived=true;
				for(int i=0;i<ClaimProcsForClaim.Count;i++){
					if(((ClaimProc)ClaimProcsForClaim[i]).Status==ClaimProcStatus.NotReceived){
						allReceived=false;
					}
				}
				if(!allReceived){
					if(!MsgBox.Show(this,true,"All items will be marked received.  Continue?")){
						return;
					}
					for(int i=0;i<ClaimProcsForClaim.Count;i++){
						if(ClaimProcsForClaim[i].Status==ClaimProcStatus.NotReceived){
							//ClaimProcs.Cur=(ClaimProc)ClaimProcs.ForClaim[i];
							ClaimProcsForClaim[i].Status=ClaimProcStatus.Received;
							ClaimProcsForClaim[i].DateEntry=DateTime.Now;//date it was set rec'd
							ClaimProcs.Update(ClaimProcsForClaim[i]);
						}
					}
				}
			}
			else{//claim is any status except received
				bool anyReceived=false;
				for(int i=0;i<ClaimProcsForClaim.Count;i++){
					if(((ClaimProc)ClaimProcsForClaim[i]).Status==ClaimProcStatus.Received){
						anyReceived=true;
					}
				}
				if(anyReceived){
					//Too dangerous to automatically set items not received because I would have to check for attachments to checks, etc.
					//Also too annoying to block user.
					//So just warn user.
					if(!MsgBox.Show(this,true,"Some of the items are marked received.  This is not a good idea since it will cause them to show in the Account as a 'payment'.  Continue anyway?")){
						return;
					}
				}
			}
			//if status is received and there is no received date
			if(comboClaimStatus.SelectedIndex==5 && textDateRec.Text==""){
				textDateRec.Text=DateTime.Today.ToShortDateString();
			}
			UpdateClaim();
			if(comboClaimStatus.SelectedIndex==2){//waiting to send
				ClaimSendQueueItem[] listQueue=Claims.GetQueueList(ClaimCur.ClaimNum,ClaimCur.ClinicNum,0);
				if(listQueue[0].NoSendElect) {
					DialogResult=DialogResult.OK;
					return;
				}
				//string warnings;
				//string missingData=
				Eclaims.Eclaims.GetMissingData(listQueue[0]);//,out warnings);
				if(listQueue[0].MissingData!="") {
					if(MessageBox.Show(Lan.g(this,"Cannot send claim until missing data is fixed:")+"\r\n"+listQueue[0].MissingData+"\r\n\r\nContinue anyway?",
						"",MessageBoxButtons.OKCancel)==DialogResult.OK)
					{
						DialogResult=DialogResult.OK;
					}
					return;
				}
				//if(MsgBox.Show(this,true,"Send electronic claim immediately?")){
				//	List<ClaimSendQueueItem> queueItems=new List<ClaimSendQueueItem>();
				//	queueItems.Add(listQueue[0]);
				//	Eclaims.Eclaims.SendBatches(queueItems);//this also calls SetClaimSentOrPrinted which creates the etrans entry.
				//}
			}
			if(comboClaimStatus.SelectedIndex==5){//Received
				if(PrefC.GetBool(PrefName.ProviderIncomeTransferShows)){
					Payment PaymentCur=new Payment();
					PaymentCur.PayDate=DateTimeOD.Today;
					PaymentCur.PatNum=PatCur.PatNum;
					PaymentCur.ClinicNum=PatCur.ClinicNum;
					PaymentCur.PayType=0;//txfr
					PaymentCur.DateEntry=DateTimeOD.Today;//So that it will show properly in the new window.
					Payments.Insert(PaymentCur);
					FormPayment Formp=new FormPayment(PatCur,FamCur,PaymentCur);
					Formp.IsNew=true;
					Formp.ShowDialog();
				}
			}
			DialogResult=DialogResult.OK;
		}
Example #3
0
		private void toolBarButPay_Click() {
			Payment PaymentCur=new Payment();
			PaymentCur.PayDate=DateTimeOD.Today;
			PaymentCur.PatNum=PatCur.PatNum;
			PaymentCur.ClinicNum=PatCur.ClinicNum;
			PaymentCur.DateEntry=DateTimeOD.Today;//So that it will show properly in the new window.
			if(DefC.Short[(int)DefCat.PaymentTypes].Length>0){
				PaymentCur.PayType=DefC.Short[(int)DefCat.PaymentTypes][0].DefNum;
			}
			Payments.Insert(PaymentCur);
			FormPayment FormPayment2=new FormPayment(PatCur,FamCur,PaymentCur);
			FormPayment2.IsNew=true;
			FormPayment2.ShowDialog();
			ModuleSelected(PatCur.PatNum);
		}
Example #4
0
		private void gridAccount_CellDoubleClick(object sender, OpenDental.UI.ODGridClickEventArgs e) {
			if(ViewingInRecall) return;
			Actscrollval=gridAccount.ScrollValue;
			DataTable table=DataSetMain.Tables["account"];
			if(table.Rows[e.Row]["ProcNum"].ToString()!="0"){
				Procedure proc=Procedures.GetOneProc(PIn.Long(table.Rows[e.Row]["ProcNum"].ToString()),true);
				Patient pat=FamCur.GetPatient(proc.PatNum);
				FormProcEdit FormPE=new FormProcEdit(proc,pat,FamCur);
				FormPE.ShowDialog();
			}
			else if(table.Rows[e.Row]["AdjNum"].ToString()!="0"){
				Adjustment adj=Adjustments.GetOne(PIn.Long(table.Rows[e.Row]["AdjNum"].ToString()));
				FormAdjust FormAdj=new FormAdjust(PatCur,adj);
				FormAdj.ShowDialog();
			}
			else if(table.Rows[e.Row]["PayNum"].ToString()!="0"){
				Payment PaymentCur=Payments.GetPayment(PIn.Long(table.Rows[e.Row]["PayNum"].ToString()));
				/*
				if(PaymentCur.PayType==0){//provider income transfer
					FormProviderIncTrans FormPIT=new FormProviderIncTrans();
					FormPIT.PatNum=PatCur.PatNum;
					FormPIT.PaymentCur=PaymentCur;
					FormPIT.IsNew=false;
					FormPIT.ShowDialog();
				}
				else{*/
				FormPayment FormPayment2=new FormPayment(PatCur,FamCur,PaymentCur);
				FormPayment2.IsNew=false;
				FormPayment2.ShowDialog();
				//}
			}
			else if(table.Rows[e.Row]["ClaimNum"].ToString()!="0"){//claims and claimpayments
				Claim claim=Claims.GetClaim(PIn.Long(table.Rows[e.Row]["ClaimNum"].ToString()));
				Patient pat=FamCur.GetPatient(claim.PatNum);
				FormClaimEdit FormClaimEdit2=new FormClaimEdit(claim,pat,FamCur);
				FormClaimEdit2.IsNew=false;
				FormClaimEdit2.ShowDialog();
			}
			else if(table.Rows[e.Row]["StatementNum"].ToString()!="0"){
				Statement stmt=Statements.CreateObject(PIn.Long(table.Rows[e.Row]["StatementNum"].ToString()));
				FormStatementOptions FormS=new FormStatementOptions();
				FormS.StmtCur=stmt;
				FormS.ShowDialog();
			}
			else if(table.Rows[e.Row]["PayPlanNum"].ToString()!="0"){
				PayPlan payplan=PayPlans.GetOne(PIn.Long(table.Rows[e.Row]["PayPlanNum"].ToString()));
				FormPayPlan2=new FormPayPlan(PatCur,payplan);
				FormPayPlan2.ShowDialog();
				if(FormPayPlan2.GotoPatNum!=0){
					ModuleSelected(FormPayPlan2.GotoPatNum,false);
					return;
				}
			}
			bool isSelectingFamily=gridAcctPat.GetSelectedIndex()==this.DataSetMain.Tables["patient"].Rows.Count-1;
			ModuleSelected(PatCur.PatNum,isSelectingFamily);
		}
Example #5
0
 private void gridCharges_CellDoubleClick(object sender, OpenDental.UI.ODGridClickEventArgs e)
 {
     if(table.Rows[e.Row]["PayPlanChargeNum"].ToString()!="0"){
         PayPlanCharge charge=PayPlanCharges.GetOne(PIn.Long(table.Rows[e.Row]["PayPlanChargeNum"].ToString()));
         FormPayPlanChargeEdit FormP=new FormPayPlanChargeEdit(charge);
         FormP.ShowDialog();
         if(FormP.DialogResult==DialogResult.Cancel){
             return;
         }
     }
     else if(table.Rows[e.Row]["PayNum"].ToString()!="0"){
         Payment pay=Payments.GetPayment(PIn.Long(table.Rows[e.Row]["PayNum"].ToString()));
         /*if(pay.PayType==0){//provider income transfer. I don't think this is possible, but you never know.
             FormProviderIncTrans FormPIT=new FormProviderIncTrans();
             FormPIT.PatNum=PatCur.PatNum;
             FormPIT.PaymentCur=pay;
             FormPIT.IsNew=false;
             FormPIT.ShowDialog();
             if(FormPIT.DialogResult==DialogResult.Cancel){
                 return;
             }
         }
         else{*/
         FormPayment FormPayment2=new FormPayment(PatCur,FamCur,pay);
         FormPayment2.IsNew=false;
         FormPayment2.ShowDialog();
         if(FormPayment2.DialogResult==DialogResult.Cancel){
             return;
         }
         //}
     }
     FillCharges();
 }
Example #6
0
		///<summary>Helper method that shows the payment window if the user has the "Show provider income transfer window after entering insurance payment" preference enabled.
		///This method should always be called after an insurance payment has been made.</summary>
		private void ShowProviderTransferWindow() {
			if(!PrefC.GetBool(PrefName.ProviderIncomeTransferShows)) {
				return;
			}
			Payment PaymentCur=new Payment();
			PaymentCur.PayDate=DateTimeOD.Today;
			PaymentCur.PatNum=PatCur.PatNum;
			PaymentCur.ClinicNum=PatCur.ClinicNum;
			PaymentCur.PayType=0;//txfr
			PaymentCur.DateEntry=DateTimeOD.Today;//So that it will show properly in the new window.
			Payments.Insert(PaymentCur);
			FormPayment Formp=new FormPayment(PatCur,FamCur,PaymentCur);
			Formp.IsNew=true;
			Formp.ShowDialog();
		}
Example #7
0
		private void gridCharges_CellDoubleClick(object sender, OpenDental.UI.ODGridClickEventArgs e) {
			if(gridCharges.Rows[e.Row].Tag==null) {//Prevent double clicking on the "Current Totals" row
				return;
			}
			if(gridCharges.Rows[e.Row].Tag.GetType()==typeof(PayPlanCharge)){
				PayPlanCharge payPlanCharge=(PayPlanCharge)gridCharges.Rows[e.Row].Tag;
				FormPayPlanChargeEdit FormP=new FormPayPlanChargeEdit(payPlanCharge);//This automatically takes care of our in-memory list because the Tag is referencing our list of objects.
				FormP.ShowDialog();
				if(FormP.DialogResult==DialogResult.Cancel){
					return;
				}
				if(FormP.PayPlanChargeCur==null) {//The user deleted the payplancharge.
					_listPayPlanCharges.Remove(payPlanCharge);//We know the payPlanCharge object is inside _listPayPlanCharges.
					gridCharges.BeginUpdate();
					gridCharges.Rows.RemoveAt(e.Row);
					gridCharges.EndUpdate();
					return;
				}
			}
			else if(gridCharges.Rows[e.Row].Tag.GetType()==typeof(PaySplit)){
				PaySplit paySplit=(PaySplit)gridCharges.Rows[e.Row].Tag;
				FormPayment FormPayment2=new FormPayment(PatCur,FamCur,Payments.GetPayment(paySplit.PayNum));//FormPayment may inserts and/or update the paysplits. 
				FormPayment2.IsNew=false;
				FormPayment2.ShowDialog();
				if(FormPayment2.DialogResult==DialogResult.Cancel){
					return;
				}
			}
			else if(gridCharges.Rows[e.Row].Tag.GetType()==typeof(DataRow)){//Claim payment or bundle.
				DataRow bundledClaimProc=(DataRow)gridCharges.Rows[e.Row].Tag;
				Claim claimCur=Claims.GetClaim(PIn.Long(bundledClaimProc["ClaimNum"].ToString()));
				FormClaimEdit FormCE=new FormClaimEdit(claimCur,PatCur,FamCur);//FormClaimEdit inserts and/or updates the claim and/or claimprocs, which could potentially change the bundle.
				FormCE.IsNew=false;
				FormCE.ShowDialog();
				//Cancel from FormClaimEdit does not cancel payment edits, fill grid every time
			}
			FillCharges();
		}