private void addRefundToDeposit(RefundTypeMapping mapping, EaglesoftRefund refund)
        {
            DepositConfiguration depositConfig = Configuration.getDepositConfig(mapping.QuickbooksPaytype);
            Deposit deposit = getDeposit(depositConfig, mapping.QuickbooksPaytype);

            deposit.addRefund(refund);
        }
Пример #2
0
        public void addRefund(EaglesoftRefund refund)
        {
            RefundTypeMapping mapping = UserSettings.getInstance().Configuration.getRefundTypeByEaglesoftAdjustmentType(refund.AdjustmentType);
            DepositLine       line    = new DepositLine();

            line.Customer      = mapping.Customer.Name;
            line.Amount        = -refund.Amount;
            line.IncomeAccount = mapping.IncomeAccount.Name;
            line.PaymentMethod = mapping.QuickbooksPaytype.Name;
            line.Memo          = refund.Description;
            _lines.Add(line);
        }
        public void addRefund(EaglesoftRefund refund)
        {
            EaglesoftAdjustmentType adjustmentType = refund.AdjustmentType;

            RefundTypeMapping mapping = Configuration.getRefundTypeByEaglesoftAdjustmentType(adjustmentType);

            if (mapping.Enabled)
            {
                if (mapping.IssueCheck)
                {
                    writeRefundCheck(mapping, refund);
                }
                else
                {
                    addRefundToDeposit(mapping, refund);
                }
            }
        }
 private void writeRefundCheck(RefundTypeMapping mapping, EaglesoftRefund refund)
 {
     if (mapping.RefundCheckRecipient == RefundCheckRecipient.ResposibleParty)
     {
         ChecksToWrite.Add(new CheckToWrite()
         {
             RecipientId     = refund.PatientId,
             FullName        = refund.FirstName + " " + refund.LastName,
             Address1        = refund.Address1,
             Address2        = refund.Address2,
             Amount          = refund.Amount,
             City            = refund.City,
             State           = refund.State,
             Zip             = refund.Zip,
             Memo            = refund.Description,
             QbBankAccount   = mapping.RefundCheckBankAccount.Name,
             QbIncomeAccount = mapping.IncomeAccount.Name
         });
     }
     else if (mapping.RefundCheckRecipient == RefundCheckRecipient.InsuranceCompany)
     {
         ChecksToWrite.Add(new CheckToWrite()
         {
             FullName        = refund.InsuranceCompany_Name,
             Address1        = refund.InsuranceCompany_Address1,
             Address2        = refund.InsuranceCompany_Address2,
             City            = refund.InsuranceCompany_City,
             State           = refund.InsuranceCompany_State,
             Zip             = refund.InsuranceCompany_Zip,
             Amount          = refund.Amount,
             Memo            = refund.Description,
             QbBankAccount   = mapping.RefundCheckBankAccount.Name,
             QbIncomeAccount = mapping.IncomeAccount.Name
         });
     }
 }
        public void normalizeConfiguration()
        {
            Boolean found = false;

            foreach (EaglesoftAdjustmentType eaglesoftAdjustment in EaglesoftAdjustments)
            {
                found = false;
                foreach (RefundTypeMapping r in RefundTypeMappings)
                {
                    if (eaglesoftAdjustment.Equals(r.EaglesoftAdjustment))
                    {
                        found = true;
                        break;
                    }
                }

                if (found == false)
                {
                    RefundTypeMapping refundMapping = new RefundTypeMapping();
                    refundMapping.EaglesoftAdjustment = eaglesoftAdjustment;
                    RefundTypeMappings.Add(refundMapping);
                }
            }

            foreach (EaglesoftPaymentType eaglesoftPaytype in EaglesoftPaytypes)
            {
                found = false;
                foreach (PaytypeMapping p in PayTypeMappings)
                {
                    if (eaglesoftPaytype.Equals(p.EaglesoftPaytype))
                    {
                        found = true;
                        break;
                    }
                }

                if (found == false)
                {
                    PaytypeMapping t = new PaytypeMapping();
                    t.EaglesoftPaytype = eaglesoftPaytype;
                    PayTypeMappings.Add(t);
                }
            }
        }