Esempio n. 1
0
 private void FormCreditCardEdit_Load(object sender, EventArgs e)
 {
     CreditCardOld = CreditCardCur.Clone();
     FillData();
     if (IsXCharge)             //Get recurring payment plan information if using X-Charge.
     {
         List <PayPlanCharge> chargeList = PayPlanCharges.Refresh(PatCur.PatNum);
         PayPlanList = PayPlans.GetValidPlansNoIns(PatCur.PatNum);
         comboPaymentPlans.Items.Add("None");
         comboPaymentPlans.SelectedIndex = 0;
         for (int i = 0; i < PayPlanList.Count; i++)
         {
             comboPaymentPlans.Items.Add(PayPlans.GetTotalPrinc(PayPlanList[i].PayPlanNum, chargeList).ToString("F")
                                         + "  " + Patients.GetPat(PayPlanList[i].PatNum).GetNameFL());
             if (PayPlanList[i].PayPlanNum == CreditCardCur.PayPlanNum)
             {
                 comboPaymentPlans.SelectedIndex = i + 1;
             }
         }
     }
     else              //This will hide the recurring section and change the window size.
     {
         groupRecurringCharges.Visible = false;
         this.ClientSize = new System.Drawing.Size(this.ClientSize.Width, this.ClientSize.Height - 215);
     }
 }
Esempio n. 2
0
        ///<summary>Retrieves data and uses them to create new PayPlanExtended objects.
        ///Heavy lifting (db calls and double loops) done here once upon load.  This also gets called if the user clicks "Refresh Data".</summary>
        private bool LoadData()
        {
            List <PayPlan>       listPayPlans;
            List <PayPlanCharge> listPayPlanCharges;
            List <ClaimProc>     listPayPlanClaimProcs;
            List <Patient>       listPatients;
            List <InsPlan>       listInsPlans;

            listPayPlans = PayPlans.GetAllOpenInsPayPlans();
            if (listPayPlans.Count == 0)
            {
                MsgBox.Show(this, "There are no insurance payment plans past due.");
                return(false);
            }
            listPayPlanCharges    = PayPlanCharges.GetForPayPlans(listPayPlans.Select(x => x.PayPlanNum).ToList()).Where(x => x.ChargeType == PayPlanChargeType.Debit).ToList();
            listPayPlanClaimProcs = ClaimProcs.GetForPayPlans(listPayPlans.Select(x => x.PayPlanNum).ToList()
                                                              , new List <ClaimProcStatus>()
            {
                ClaimProcStatus.Received, ClaimProcStatus.Supplemental
            });
            listPatients         = Patients.GetLimForPats(listPayPlans.Select(x => x.PatNum).ToList());
            listInsPlans         = InsPlans.GetPlans(listPayPlans.Select(x => x.PlanNum).ToList());
            _listPayPlanExtended = new List <PayPlanExtended>();
            foreach (PayPlan plan in listPayPlans)
            {
                //for each payplan, create a PayPlanExtended object which contains all of the payment plan's information and it's charges.
                //pass in the plan, the list of associated charges, and the list of associated claimprocs (payments).
                _listPayPlanExtended.Add(new PayPlanExtended(plan,
                                                             listPatients.FirstOrDefault(x => x.PatNum == plan.PatNum),
                                                             listPayPlanCharges.Where(x => x.PayPlanNum == plan.PayPlanNum).ToList(),
                                                             listPayPlanClaimProcs.Where(x => x.PayPlanNum == plan.PayPlanNum).ToList(),
                                                             listInsPlans.FirstOrDefault(x => x.PlanNum == plan.PlanNum)));
            }
            return(true);
        }
Esempio n. 3
0
 private void FormProcSelect_Load(object sender, System.EventArgs e)
 {
     if (_isMultiSelect)
     {
         gridMain.SelectionMode = OpenDental.UI.GridSelectionMode.MultiExtended;
     }
     _listSelectedProcs = new List <Procedure>();
     _listProcedures    = Procedures.GetCompleteForPats(new List <long> {
         _patNumCur
     });
     _listAdjustments = Adjustments.GetAdjustForPats(new List <long> {
         _patNumCur
     });
     _listPayPlanCharges = PayPlanCharges.GetDueForPayPlans(PayPlans.GetForPats(null, _patNumCur), _patNumCur).ToList();        //Does not get charges for the future.
     _listPaySplits      = PaySplits.GetForPats(new List <long> {
         _patNumCur
     });                                                                            //Might contain payplan payments.
     _listInsPayAsTotal = ClaimProcs.GetByTotForPats(new List <long> {
         _patNumCur
     });
     _listClaimProcs          = ClaimProcs.GetForProcs(_listProcedures.Select(x => x.ProcNum).ToList());
     labelUnallocated.Visible = _doShowUnallocatedLabel;
     if (PrefC.GetInt(PrefName.RigorousAdjustments) == (int)RigorousAdjustments.DontEnforce)
     {
         radioIncludeAllCredits.Checked = true;
     }
     else
     {
         radioOnlyAllocatedCredits.Checked = true;
     }
     FillGrid();
 }
Esempio n. 4
0
        private void FormPayPlanCredits_Load(object sender, EventArgs e)
        {
            _listPatNums = new List <long>();
            _listPatNums.Add(_patCur.PatNum);
            _listAdjustments = Adjustments.GetAdjustForPats(_listPatNums);
            _listProcs       = Procedures.GetCompAndTpForPats(_listPatNums);
            List <PayPlan> listPayPlans = PayPlans.GetForPats(_listPatNums, _patCur.PatNum);        //Used to figure out how much we need to pay off procs with, also contains insurance payplans.

            _listPayPlanCharges = new List <PayPlanCharge>();
            if (listPayPlans.Count > 0)
            {
                //get all current payplan charges for plans already on the patient, excluding the current one.
                _listPayPlanCharges = PayPlanCharges.GetDueForPayPlans(listPayPlans, _patCur.PatNum)                                               //Does not get charges for the future.
                                      .Where(x => !(x.PayPlanNum == _payPlanCur.PayPlanNum && x.ChargeType == PayPlanChargeType.Credit)).ToList(); //do not get credits for current payplan
            }
            List <PaySplit> tempListPaySplits = PaySplits.GetForPats(_listPatNums).Where(x => x.UnearnedType == 0).ToList();                       //Might contain payplan payments. Do not include unearned.

            _listPaySplits     = tempListPaySplits.FindAll(x => x.PayPlanNum == 0 || listPayPlans.Exists(y => y.PayPlanNum == x.PayPlanNum));
            _listPayments      = Payments.GetNonSplitForPats(_listPatNums);
            _listInsPayAsTotal = ClaimProcs.GetByTotForPats(_listPatNums);          //Claimprocs paid as total, might contain ins payplan payments.
            _listClaimProcs    = ClaimProcs.GetForProcs(_listProcs.Select(x => x.ProcNum).ToList());
            textCode.Text      = Lan.g(this, "None");
            FillGrid();
            if (!Security.IsAuthorized(Permissions.PayPlanEdit, true))
            {
                this.DisableForm(butCancel, checkHideUnattached, checkShowImplicit, butPrint, gridMain);
            }
        }
Esempio n. 5
0
 private void FormPayPlanSelect_Load(object sender, System.EventArgs e)
 {
     for (int i = 0; i < ValidPlans.Count; i++)
     {
         listPayPlans.Items.Add(ValidPlans[i].PayPlanDate.ToShortDateString()
                                + "  " + PayPlans.GetTotalPrinc(ValidPlans[i].PayPlanNum, ChargeList).ToString("F")
                                + "  " + Patients.GetPat(ValidPlans[i].PatNum).GetNameFL());
     }
 }
Esempio n. 6
0
 private void FormProcSelect_Load(object sender, System.EventArgs e)
 {
     if (_isMultiSelect)
     {
         gridMain.SelectionMode = OpenDental.UI.GridSelectionMode.MultiExtended;
     }
     _listSelectedProcs = new List <Procedure>();
     _listProcedures    = Procedures.GetCompleteForPats(new List <long> {
         _patNumCur
     });
     if (ShowTpProcs)
     {
         _listProcedures.AddRange(Procedures.GetTpForPats(new List <long> {
             _patNumCur
         }));
     }
     _listAdjustments = Adjustments.GetAdjustForPats(new List <long> {
         _patNumCur
     });
     _listPayPlanCharges = PayPlanCharges.GetDueForPayPlans(PayPlans.GetForPats(null, _patNumCur), _patNumCur).ToList();        //Does not get charges for the future.
     _listPaySplits      = PaySplits.GetForPats(new List <long> {
         _patNumCur
     });                                                                            //Might contain payplan payments.
     foreach (PaySplit split in ListSplitsCur)
     {
         //If this is a new payment, its paysplits will not be in the database yet, so we need to add them manually. We might also need to set the
         //ProcNum on the pay split if it has changed and has not been saved to the database.
         PaySplit splitDb = _listPaySplits.FirstOrDefault(x => x.IsSame(split));
         if (splitDb == null)
         {
             _listPaySplits.Add(split);
         }
         else
         {
             splitDb.ProcNum = split.ProcNum;
         }
     }
     _listInsPayAsTotal = ClaimProcs.GetByTotForPats(new List <long> {
         _patNumCur
     });
     _listClaimProcs          = ClaimProcs.GetForProcs(_listProcedures.Select(x => x.ProcNum).ToList());
     labelUnallocated.Visible = _doShowUnallocatedLabel;
     if (PrefC.GetInt(PrefName.RigorousAdjustments) == (int)RigorousAdjustments.DontEnforce)
     {
         radioIncludeAllCredits.Checked = true;
     }
     else
     {
         radioOnlyAllocatedCredits.Checked = true;
     }
     FillGrid();
 }
Esempio n. 7
0
 private void FormCreditCardEdit_Load(object sender, EventArgs e)
 {
     _creditCardOld = CreditCardCur.Clone();
     FillFrequencyCombos();
     FillData();
     checkExcludeProcSync.Checked = CreditCardCur.ExcludeProcSync;
     if ((_isXChargeEnabled || _isPayConnectEnabled || _isPaySimpleEnabled) &&
         (!CreditCardCur.IsXWeb() && !CreditCardCur.IsPayConnectPortal()))
     {            //Get recurring payment plan information if using X-Charge or PayConnect and the card is not from XWeb or PayConnectPortal.
         PayPlanList = PayPlans.GetValidPlansNoIns(PatCur.PatNum);
         List <PayPlanCharge> chargeList = PayPlanCharges.GetForPayPlans(PayPlanList.Select(x => x.PayPlanNum).ToList());
         comboPaymentPlans.Items.Add("None");
         comboPaymentPlans.SelectedIndex = 0;
         for (int i = 0; i < PayPlanList.Count; i++)
         {
             comboPaymentPlans.Items.Add(PayPlans.GetTotalPrinc(PayPlanList[i].PayPlanNum, chargeList).ToString("F")
                                         + "  " + Patients.GetPat(PayPlanList[i].PatNum).GetNameFL());
             if (PayPlanList[i].PayPlanNum == CreditCardCur.PayPlanNum)
             {
                 comboPaymentPlans.SelectedIndex = i + 1;
             }
         }
         if (PrefC.IsODHQ)
         {
             groupProcedures.Visible = true;
             FillProcs();
         }
         else
         {
             this.ClientSize = new System.Drawing.Size(this.ClientSize.Width, this.ClientSize.Height - 144);
         }
         UpdateFrequencyText();
         EnableFrequencyControls();
     }
     else              //This will hide the recurring section and change the window size.
     {
         groupRecurringCharges.Visible = false;
         groupChargeFrequency.Visible  = false;
         this.ClientSize = new System.Drawing.Size(this.ClientSize.Width, this.ClientSize.Height - 486);
     }
     if (_isPaySimpleEnabled && !CreditCardCur.IsNew)
     {
         labelAcctType.Visible   = true;
         textAccountType.Visible = true;
     }
     checkChrgWithNoBal.Checked = CreditCardCur.CanChargeWhenNoBal;
     //Only visible if preference is on.
     checkChrgWithNoBal.Visible = PrefC.GetBool(PrefName.RecurringChargesAllowedWhenNoPatBal);
     Plugins.HookAddCode(this, "FormCreditCardEdit.Load_end", PatCur);
 }
Esempio n. 8
0
        private void FillGrid()
        {
            gridMain.BeginUpdate();
            GridColumn col = new GridColumn("Date", 70);

            gridMain.ListGridColumns.Add(col);
            col = new GridColumn("Patient", 100);
            gridMain.ListGridColumns.Add(col);
            col = new GridColumn("Category", 80);
            gridMain.ListGridColumns.Add(col);
            col = new GridColumn("Total Cost", 80);
            gridMain.ListGridColumns.Add(col);
            col = new GridColumn("Balance", 80);
            gridMain.ListGridColumns.Add(col);
            col = new GridColumn("Due Now", 80);
            gridMain.ListGridColumns.Add(col);
            List <long>     listPayPlanNums = _listValidPayPlans.Select(x => x.PayPlanNum).ToList();
            List <PaySplit> listPaySplits   = PaySplits.GetForPayPlans(listPayPlanNums);
            List <Patient>  listPats        = Patients.GetLimForPats(_listValidPayPlans.Select(x => x.PatNum).ToList());

            for (int i = 0; i < _listValidPayPlans.Count; i++)
            {
                //no db calls are made in this loop because we have all the necessary information already.
                PayPlan planCur = _listValidPayPlans[i];
                Patient patCur  = listPats.Where(x => x.PatNum == planCur.PatNum).FirstOrDefault();
                GridRow row     = new GridRow();
                row.Cells.Add(planCur.PayPlanDate.ToShortDateString());       //date
                row.Cells.Add(patCur.LName + ", " + patCur.FName);            //patient
                if (planCur.PlanCategory == 0)
                {
                    row.Cells.Add(Lan.g(this, "None"));
                }
                else
                {
                    row.Cells.Add(Defs.GetDef(DefCat.PayPlanCategories, planCur.PlanCategory).ItemName);
                }
                row.Cells.Add(PayPlans.GetTotalCost(planCur.PayPlanNum, _listPayPlanCharges).ToString("F"));               //total cost
                row.Cells.Add(PayPlans.GetBalance(planCur.PayPlanNum, _listPayPlanCharges, listPaySplits).ToString("F"));  //balance
                row.Cells.Add(PayPlans.GetDueNow(planCur.PayPlanNum, _listPayPlanCharges, listPaySplits).ToString("F"));   //due now
                row.Tag = planCur.PayPlanNum;
                gridMain.ListGridRows.Add(row);
            }
            gridMain.EndUpdate();
        }
Esempio n. 9
0
        ///<summary>Computes balance for a single patient without making any calls to the database. If the balance doesn't match the stored patient balance, then it makes one update to the database and returns true to trigger calculation of aging.</summary>
        public static bool ComputeBalances(Procedure[] procList, ClaimProc[] claimProcList, Patient PatCur, PaySplit[] paySplitList, Adjustment[] AdjustmentList, PayPlan[] payPlanList, PayPlanCharge[] payPlanChargeList)
        {
            //must have refreshed all 5 first
            double calcBal
                = Procedures.ComputeBal(procList)
                  + ClaimProcs.ComputeBal(claimProcList)
                  + Adjustments.ComputeBal(AdjustmentList)
                  - PaySplits.ComputeBal(paySplitList)
                  + PayPlans.ComputeBal(PatCur.PatNum, payPlanList, payPlanChargeList);

            if (calcBal != PatCur.EstBalance)
            {
                Patient PatOld = PatCur.Copy();
                PatCur.EstBalance = calcBal;
                Patients.Update(PatCur, PatOld);
                return(true);
            }
            return(false);
        }
Esempio n. 10
0
 private void FormCreditCardEdit_Load(object sender, EventArgs e)
 {
     _creditCardOld = CreditCardCur.Clone();
     FillData();
     checkExcludeProcSync.Checked = CreditCardCur.ExcludeProcSync;
     if ((_isXChargeEnabled || _isPayConnectEnabled || _isPaySimpleEnabled) &&
         !CreditCardCur.IsXWeb())
     {            //Get recurring payment plan information if using X-Charge or PayConnect and the card is not from XWeb.
         PayPlanList = PayPlans.GetValidPlansNoIns(PatCur.PatNum);
         List <PayPlanCharge> chargeList = PayPlanCharges.GetForPayPlans(PayPlanList.Select(x => x.PayPlanNum).ToList());
         comboPaymentPlans.Items.Add("None");
         comboPaymentPlans.SelectedIndex = 0;
         for (int i = 0; i < PayPlanList.Count; i++)
         {
             comboPaymentPlans.Items.Add(PayPlans.GetTotalPrinc(PayPlanList[i].PayPlanNum, chargeList).ToString("F")
                                         + "  " + Patients.GetPat(PayPlanList[i].PatNum).GetNameFL());
             if (PayPlanList[i].PayPlanNum == CreditCardCur.PayPlanNum)
             {
                 comboPaymentPlans.SelectedIndex = i + 1;
             }
         }
         if (PrefC.IsODHQ)
         {
             groupProcedures.Visible = true;
             FillProcs();
         }
         else
         {
             this.ClientSize = new System.Drawing.Size(this.ClientSize.Width, this.ClientSize.Height - 144);
         }
     }
     else              //This will hide the recurring section and change the window size.
     {
         groupRecurringCharges.Visible = false;
         this.ClientSize = new System.Drawing.Size(this.ClientSize.Width, this.ClientSize.Height - 356);
     }
     if (_isPaySimpleEnabled && !CreditCardCur.IsNew)
     {
         textCardNumber.ReadOnly = true;
     }
     Plugins.HookAddCode(this, "FormCreditCardEdit.Load_end", PatCur);
 }
Esempio n. 11
0
 private void checkPayPlan_Click(object sender, System.EventArgs e)
 {
     if (checkPayPlan.Checked)
     {
         if (checkPatOtherFam.Checked)                //prevents a bug.
         {
             checkPayPlan.Checked = false;
             return;
         }
         PayPlan[] planListAll = PayPlans.Refresh(FamCur.List[listPatient.SelectedIndex].PatNum, 0);
         PayPlan[] payPlanList = PayPlans.GetListOneType(planListAll, false);
         if (payPlanList.Length == 0)              //no valid plans
         {
             MsgBox.Show(this, "The selected patient is not the guarantor for any payment plans.");
             checkPayPlan.Checked = false;
             return;
         }
         if (payPlanList.Length == 1)               //if there is only one valid payplan
         {
             PaySplitCur.PayPlanNum = payPlanList[0].PayPlanNum;
             return;
         }
         //more than one valid PayPlan
         PayPlanCharge[]   chargeList = PayPlanCharges.Refresh(FamCur.List[listPatient.SelectedIndex].PatNum);
         FormPayPlanSelect FormPPS    = new FormPayPlanSelect(payPlanList, chargeList);
         //FormPPS.ValidPlans=payPlanList;
         FormPPS.ShowDialog();
         if (FormPPS.DialogResult == DialogResult.Cancel)
         {
             checkPayPlan.Checked = false;
             return;
         }
         PaySplitCur.PayPlanNum = payPlanList[FormPPS.IndexSelected].PayPlanNum;
     }
     else             //payPlan unchecked
     {
         PaySplitCur.PayPlanNum = 0;
     }
 }
Esempio n. 12
0
        ///<summary>This method converts the AccountEntry objects we get back from AccountModules.GetListUnpaidAccountCharges() to MultiAdjEntry objects.
        ///These are used to fill the grid and do all relevant logic in this form. This method will return a fresh list of procedures and will not show
        ///any existing adjustments that may have been made in this form already. Called on load and when checkShowImplicit is clicked.
        ///When called from checkShowImplicit any existing adjustments made will not be shown.(Ask Andrew about this functionality)</summary>
        private List <MultiAdjEntry> FillListGridEntries(CreditCalcType calc)
        {
            List <MultiAdjEntry> retVal = new List <MultiAdjEntry>();

            #region Get required data
            List <Procedure> listProcedures = Procedures.GetCompleteForPats(new List <long> {
                _patCur.PatNum
            });
            //Does not get charges for the future.
            List <PaySplit> listPaySplits = PaySplits.GetForPats(new List <long> {
                _patCur.PatNum
            }).Where(x => x.UnearnedType == 0).ToList();
            List <Adjustment> listAdjustments = Adjustments.GetAdjustForPats(new List <long> {
                _patCur.PatNum
            });
            //Might contain payplan payments. Do not include unearned.
            List <PayPlanCharge> listPayPlanCharges = PayPlanCharges.GetDueForPayPlans(PayPlans.GetForPats(null, _patCur.PatNum), _patCur.PatNum).ToList();
            List <ClaimProc>     listInsPayAsTotal  = ClaimProcs.GetByTotForPats(new List <long> {
                _patCur.PatNum
            });
            List <ClaimProc> listClaimProcs = ClaimProcs.GetForProcs(listProcedures.Select(x => x.ProcNum).ToList());
            #endregion
            List <AccountEntry> listAccountCharges = AccountModules.GetListUnpaidAccountCharges(listProcedures, listAdjustments
                                                                                                , listPaySplits, listClaimProcs, listPayPlanCharges, listInsPayAsTotal, calc, new List <PaySplit>());
            MultiAdjEntry multiEntry = null;
            foreach (AccountEntry entry in listAccountCharges)
            {
                //We only want AccountEntries that are completed procedures.
                if (entry.GetType() != typeof(ProcExtended))
                {
                    continue;
                }
                ProcExtended procEntry = (ProcExtended)entry.Tag;
                if ((_listSelectedProcs != null && _listSelectedProcs.Any(x => x.ProcNum == procEntry.Proc.ProcNum)) ||        //Allow selected procs to show if paid off
                    entry.AmountEnd != 0)                     //All unpaid procedures should always show up per Nathan
                {
                    multiEntry = new MultiAdjEntry(procEntry.Proc, (double)entry.AmountStart, (double)entry.AmountEnd);
                    retVal.Add(multiEntry);
                }
            }
            OrderListGridEntries();
            return(retVal);
        }
Esempio n. 13
0
        ///<summary>This method converts the AccountEntry objects we get back from AccountModules.GetListUnpaidAccountCharges() to MultiAdjEntry objects.
        ///These are used to fill the grid and do all relevant logic in this form. This method will return a fresh list of procedures and will not show
        ///any existing adjustments that may have been made in this form already. Called on load and when checkShowImplicit is clicked.
        ///When called from checkShowImplicit any existing adjustments made will not be shown.(Ask Andrew about this functionality)</summary>
        private List <MultiAdjEntry> FillListGridEntries(CreditCalcType calc)
        {
            //CONSIDER ANY CHANGES MADE HERE MAY ALSO NEED TO BE ADDED TO FormProcSelect.
            List <MultiAdjEntry> retVal = new List <MultiAdjEntry>();

            #region Get required data
            List <Procedure> listProcedures = Procedures.GetCompleteForPats(new List <long> {
                _patCur.PatNum
            });
            //Does not get charges for the future.
            List <PaySplit> listPaySplits = PaySplits.GetForPats(new List <long> {
                _patCur.PatNum
            }).Where(x => x.UnearnedType == 0).ToList();
            List <Adjustment> listAdjustments = Adjustments.GetAdjustForPats(new List <long> {
                _patCur.PatNum
            });
            //Might contain payplan payments. Do not include unearned.
            List <PayPlanCharge> listPayPlanCharges = PayPlanCharges.GetDueForPayPlans(PayPlans.GetForPats(null, _patCur.PatNum), _patCur.PatNum).ToList();
            List <ClaimProc>     listInsPayAsTotal  = ClaimProcs.GetByTotForPats(new List <long> {
                _patCur.PatNum
            });
            List <ClaimProc> listClaimProcs = ClaimProcs.GetForProcs(listProcedures.Select(x => x.ProcNum).ToList());
            #endregion
            List <AccountEntry> listAccountCharges = AccountModules.GetListUnpaidAccountCharges(listProcedures, listAdjustments, listPaySplits, listClaimProcs
                                                                                                , listPayPlanCharges, listInsPayAsTotal, calc, new List <PaySplit>());
            List <AccountEntry> listAccountChargesIncludeAll = null;
            if (calc == CreditCalcType.ExcludeAll)
            {
                //We need to get all credits so that our AmtRemBefore can reflect what has truly been allocated to the procedure.
                listAccountChargesIncludeAll = AccountModules.GetListUnpaidAccountCharges(listProcedures, listAdjustments
                                                                                          , listPaySplits, listClaimProcs, listPayPlanCharges, listInsPayAsTotal, CreditCalcType.IncludeAll, new List <PaySplit>());
            }
            MultiAdjEntry multiEntry = null;
            foreach (AccountEntry entry in listAccountCharges)
            {
                //We only want AccountEntries that are completed procedures.
                if (entry.GetType() != typeof(ProcExtended))
                {
                    continue;
                }
                ProcExtended procEntry = (ProcExtended)entry.Tag;
                bool         isProcSelectedInAccount = false;
                if (_listSelectedProcs != null && _listSelectedProcs.Any(x => x.ProcNum == procEntry.Proc.ProcNum))
                {
                    isProcSelectedInAccount = true;
                }
                if (calc == CreditCalcType.ExcludeAll)               //show everything. Regardless of procs loading window or amount remaining.
                {
                    double amtRemBefore = (double)(listAccountChargesIncludeAll?.FirstOrDefault(x => x.Tag.GetType() == typeof(ProcExtended) &&
                                                                                                ((ProcExtended)x.Tag).Proc.ProcNum == procEntry.Proc.ProcNum) ?? entry).AmountStart;
                    multiEntry = new MultiAdjEntry(procEntry.Proc, (double)entry.AmountStart, (double)entry.AmountEnd, amtRemBefore);
                    retVal.Add(multiEntry);
                }
                else if (calc.In(CreditCalcType.IncludeAll, CreditCalcType.AllocatedOnly) && (entry.AmountEnd != 0 || isProcSelectedInAccount))
                {
                    //Unpaid procedures should always show per Nathan. If proc was specifically selected before entering window, show it anyways.
                    multiEntry = new MultiAdjEntry(procEntry.Proc, (double)entry.AmountStart, (double)entry.AmountEnd, (double)entry.AmountStart);
                    retVal.Add(multiEntry);
                }
            }
            OrderListGridEntries();
            return(retVal);
        }