示例#1
0
        public RepaymentEvent CopyAsRepaymentEvent()
        {
            RepaymentEvent rPe;

            if (Code == "PRLR")
                rPe = new RescheduledLoanRepaymentEvent();
            else if (Code == "PBLR")
                rPe = new BadLoanRepaymentEvent();
            else if (Code == "PRWO")
                rPe = new RepaymentOverWriteOffEvent();
            else
                rPe = new RepaymentEvent();

            rPe.AccruedInterest = this.AccruedInterest;
            rPe.Cancelable = this.Cancelable;
            rPe.ClientType = this.ClientType;
            rPe.Commissions = this.Commissions;
            rPe.Date = this.Date;
            rPe.InstallmentNumber = this.InstallmentNumber;
            rPe.InterestPrepayment = this.InterestPrepayment;
            rPe.Interests = this.Interests;
            rPe.PastDueDays = this.PastDueDays;
            rPe.Penalties = this.Penalties;
            rPe.Principal = this.Principal;
            rPe.RepaymentType = this.RepaymentType;

            return rPe;
        }
        public RepaymentEvent CopyAsRepaymentEvent()
        {
            RepaymentEvent rPe;

            if (Code == "PBLR")
            {
                rPe = new BadLoanRepaymentEvent();
            }
            else if (Code == "PRWO")
            {
                rPe = new RepaymentOverWriteOffEvent();
            }
            else
            {
                rPe = new RepaymentEvent();
            }

            rPe.AccruedInterest    = this.AccruedInterest;
            rPe.Cancelable         = this.Cancelable;
            rPe.ClientType         = this.ClientType;
            rPe.Commissions        = this.Commissions;
            rPe.Date               = this.Date;
            rPe.InstallmentNumber  = this.InstallmentNumber;
            rPe.InterestPrepayment = this.InterestPrepayment;
            rPe.Interests          = this.Interests;
            rPe.PastDueDays        = this.PastDueDays;
            rPe.Penalties          = this.Penalties;
            rPe.Principal          = this.Principal;
            rPe.RepaymentType      = this.RepaymentType;

            return(rPe);
        }
示例#3
0
        private RepaymentEvent GetRepaymentEvent(OpenCbsReader r)
        {
            RepaymentEvent e = new RepaymentEvent {Id = r.GetInt("rpe_id")};
            switch (r.GetString("event_type"))
            {
                case "RBLE":
                    {
                        e = new BadLoanRepaymentEvent {Id = r.GetInt("rpe_id")};
                        break;
                    }
                case "RRLE":
                    {
                        e = new RescheduledLoanRepaymentEvent {Id = r.GetInt("rpe_id")};
                        break;
                    }
                case "ROWO":
                    {
                        e = new RepaymentOverWriteOffEvent { Id = r.GetInt("rpe_id") };
                        break;
                    }
                case "PRLR":
                    {
                        e = new PendingRepaymentEvent(r.GetString("event_type"))
                                {Id = r.GetInt("rpe_id")};
                        break;
                    }
                case "PBLR":
                    {
                        e = new PendingRepaymentEvent(r.GetString("event_type"))
                                {Id = r.GetInt("rpe_id")};
                        break;
                    }
                case "PRWO":
                    {
                        e = new PendingRepaymentEvent(r.GetString("event_type"))
                                {Id = r.GetInt("rpe_id")};
                        break;
                    }
                case "PERE":
                    {
                        e = new PendingRepaymentEvent(r.GetString("event_type"))
                                {Id = r.GetInt("rpe_id")};
                        break;
                    }
            }

            e.Principal = r.GetMoney("rpe_principal");
            e.Interests = r.GetMoney("rpe_interests");
            e.Penalties = r.GetMoney("rpe_penalties");
            e.Commissions = r.GetMoney("rpe_commissions");
            e.PastDueDays = r.GetInt("rpe_past_due_days");
            e.InstallmentNumber = r.GetInt("rpe_installment_number");
            e.PaymentMethodId = r.GetNullInt("rpe_pm");
            e.PaymentMethod = e.PaymentMethodId == null ? null :
                _paymentMethodManager.SelectPaymentMethodById(e.PaymentMethodId.Value);

            e.CalculatedPenalties = r.GetMoney("rpe_calculated_penalties");
            e.WrittenOffPenalties = r.GetMoney("rpe_written_off_penalties");
            e.UnpaidPenalties = r.GetMoney("rpe_unpaid_penalties");

            e.Code = r.GetString("event_type");

            if (e.Code != "RBLE")
                e.RepaymentType = OPaymentType.StandardPayment;

            // set type of payment
            switch (r.GetString("event_type").Trim())
            {
                case "ATR":
                    {
                        e.RepaymentType = OPaymentType.TotalPayment;
                        break;
                    }
                case "APR":
                    {
                        e.RepaymentType = OPaymentType.PartialPayment;
                        break;
                    }
                case "APTR":
                    {
                        e.RepaymentType = OPaymentType.PersonTotalPayment;
                        break;
                    }
            }

            return e;
        }
示例#4
0
        private static OCurrency GetValue(RepaymentOverWriteOffEvent eventItem, ContractAccountingRule rule)
        {
            OCurrency amount = 0;

            if (rule.EventAttribute.Name.ToLower() == "principal")
            {
                amount = eventItem.Principal;
            }

            if (rule.EventAttribute.Name.ToLower() == "interests")
            {
                amount = eventItem.Interests;
            }

            if (rule.EventAttribute.Name.ToLower() == "penalties")
            {
                amount = eventItem.Penalties;
            }

            if (rule.EventAttribute.Name == "commissions")
            {
                amount = eventItem.Commissions;
            }
            return amount;
        }