예제 #1
0
        /// <summary>
        /// 按天计息到期一次性还本息
        /// </summary>
        /// <param name="billModel"></param>
        /// <returns></returns>
        public static List <Model.BillDetailModel> GetDetailsByToEnd(Model.BillModel billModel)
        {
            List <Model.BillDetailModel> details = new List <Model.BillDetailModel>();

            Model.BillDetailModel detail = new Model.BillDetailModel();
            double interest = 0;

            if (billModel.DeadlineType == 1)
            {
                //按天总利息
                interest = Math.Round(billModel.YearRete / 365 * billModel.Deadline * billModel.TotalMoney, 2);
            }
            else
            {
                //按月总利息
                interest = Math.Round(billModel.YearRete / 12 * billModel.Deadline * billModel.TotalMoney, 2);    //总利息
            }

            detail.ReceivableInterest             = interest;
            detail.ReceivablePrincipalAndInterest = billModel.TotalMoney + interest;
            detail.ReceivableDay = billModel.EndDay;
            detail.Periods       = "1/1";
            details.Add(detail);

            return(details);
        }
예제 #2
0
        /// <summary>
        /// 等额本息还款
        /// </summary>
        /// <param name="billModel"></param>
        /// <returns></returns>
        public static List <Model.BillDetailModel> GetDetailsByEveragePrincipalAndInterest(Model.BillModel billModel)
        {
            List <Model.BillDetailModel> details = new List <Model.BillDetailModel>();

            double tlnAcct = 0;

            tlnAcct = billModel.TotalMoney;

            Model.BillDetailModel detail = null;
            DateTime beginDay            = DateTime.Parse(billModel.BeginDay);

            for (int i = 0; i < billModel.Deadline; i++)
            {
                detail = new Model.BillDetailModel();
                double paybaseAcct = (Math.Pow((1 + billModel.YearRete / 12), i + 1) - Math.Pow((1 + billModel.YearRete / 12), i)) / (Math.Pow((1 + billModel.YearRete / 12), billModel.Deadline) - 1) * billModel.TotalMoney;
                detail.ReceivableInterest             = tlnAcct * billModel.YearRete / 12;                      //利息
                detail.ReceivablePrincipalAndInterest = Math.Round(paybaseAcct + detail.ReceivableInterest, 2); //还款总额
                detail.ReceivableInterest             = Math.Round(detail.ReceivableInterest, 2);
                tlnAcct = tlnAcct - paybaseAcct;

                detail.ReceivableDay = beginDay.AddMonths(i + 1).ToString("yyyy-MM-dd");
                detail.Periods       = string.Format("{0}/{1}", i + 1, billModel.Deadline);
                details.Add(detail);
            }

            return(details);
        }
예제 #3
0
        /// <summary>
        /// 月还息到期还本
        /// </summary>
        /// <param name="billModel"></param>
        /// <returns></returns>
        public static List <Model.BillDetailModel> GetDetailsByMonthInterestEndPrincipal(Model.BillModel billModel)
        {
            List <Model.BillDetailModel> details = new List <Model.BillDetailModel>();

            double[] depAcctbal = new double[billModel.Deadline]; /*总还款*/
            //double[] payrateAcct = new double[bill.Deadline]; /*每月应还利息*/

            double interest = Math.Round((billModel.TotalMoney * billModel.YearRete / 12), 2);

            Model.BillDetailModel detail = null;
            DateTime beginDay            = DateTime.Parse(billModel.BeginDay);

            for (int i = 0; i < billModel.Deadline; i++)
            {
                detail = new Model.BillDetailModel();
                detail.ReceivableInterest = interest;
                if ((i + 1) == billModel.Deadline)
                {
                    detail.ReceivablePrincipalAndInterest = interest + billModel.TotalMoney;
                }
                else
                {
                    detail.ReceivablePrincipalAndInterest = interest;
                }

                detail.ReceivableDay = beginDay.AddMonths(i + 1).ToString("yyyy-MM-dd");
                detail.Periods       = string.Format("{0}/{1}", i + 1, billModel.Deadline);
                details.Add(detail);
            }

            return(details);
        }
예제 #4
0
        /// <summary>
        /// 等额本金还款
        /// </summary>
        /// <param name="billModel"></param>
        /// <returns></returns>
        public static List <Model.BillDetailModel> GetDetailsByEveragePrincipal(Model.BillModel billModel)
        {
            List <Model.BillDetailModel> details = new List <Model.BillDetailModel>();

            Model.BillDetailModel detail = null;
            double   montyMoney          = billModel.TotalMoney / billModel.Deadline;//月还款本金
            double   SurplusPayment      = 0;
            DateTime beginDay            = DateTime.Parse(billModel.BeginDay);

            for (int i = 0; i < billModel.Deadline; i++)
            {
                detail = new Model.BillDetailModel();
                if (i == 0)
                {
                    SurplusPayment            = billModel.TotalMoney - montyMoney;                               //剩余本金
                    detail.ReceivableInterest = Math.Round(billModel.TotalMoney * (billModel.YearRete / 12), 2); //月利息
                }
                else
                {
                    detail.ReceivableInterest = Math.Round(SurplusPayment * (billModel.YearRete / 12), 2); //月利息=上个月的剩余本金×利率
                    SurplusPayment            = SurplusPayment - montyMoney;                               //剩余本金
                }

                detail.ReceivablePrincipalAndInterest = Math.Round(montyMoney + detail.ReceivableInterest, 2);
                detail.ReceivableDay = beginDay.AddMonths(i + 1).ToString("yyyy-MM-dd");
                detail.Periods       = string.Format("{0}/{1}", i + 1, billModel.Deadline);

                details.Add(detail);
            }
            return(details);
        }
예제 #5
0
        /// <summary>
        /// 按月计息按季还款
        /// </summary>
        /// <param name="billModel"></param>
        /// <returns></returns>
        public static List <Model.BillDetailModel> GetDetailsByMonthInterestSeasonCapital(Model.BillModel billModel)
        {
            List <Model.BillDetailModel> details = new List <Model.BillDetailModel>();

            int    curMonth;                                                                                         //当前期数
            double curMoney;                                                                                         //当前未还本金
            int    seasonCount   = billModel.Deadline % 3 > 0 ? billModel.Deadline / 3 + 1 : billModel.Deadline / 3; //分成几季
            double seasonCapital = Math.Round(billModel.TotalMoney / seasonCount);                                   //每季应还的本金
            double interest;                                                                                         //每月应还利息

            DateTime beginDay = DateTime.Parse(billModel.BeginDay);

            for (int i = 0; i < seasonCount; i++)
            {
                curMoney = billModel.TotalMoney - seasonCapital * i;
                interest = Math.Round((curMoney * billModel.YearRete / 12), 2);

                Model.BillDetailModel detail = null;
                for (int j = 1; j <= 3; j++)
                {
                    detail   = new Model.BillDetailModel();
                    curMonth = i * 3 + j;
                    if (curMonth < billModel.Deadline && curMonth % 3 == 0 && curMonth != 0)
                    {
                        detail.ReceivablePrincipalAndInterest = interest + seasonCapital;
                        detail.ReceivableInterest             = interest;
                    }
                    else if (curMonth < billModel.Deadline)
                    {
                        detail.ReceivablePrincipalAndInterest = interest;
                        detail.ReceivableInterest             = interest;
                    }
                    else if (curMonth == billModel.Deadline)
                    {
                        detail.ReceivablePrincipalAndInterest = interest + seasonCapital;
                        detail.ReceivableInterest             = interest;
                    }
                    detail.ReceivableDay = beginDay.AddMonths((i * 3) + j).ToString("yyyy-MM-dd");
                    detail.Periods       = string.Format("{0}/{1}", (i * 3) + j, billModel.Deadline);
                    details.Add(detail);
                }
            }


            return(details);
        }