当前位置: 首页>>代码示例>>C#>>正文


C# CreditContractRepayment.Repay方法代码示例

本文整理汇总了C#中OpenCBS.CoreDomain.Contracts.Loans.LoanRepayment.CreditContractRepayment.Repay方法的典型用法代码示例。如果您正苦于以下问题:C# CreditContractRepayment.Repay方法的具体用法?C# CreditContractRepayment.Repay怎么用?C# CreditContractRepayment.Repay使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在OpenCBS.CoreDomain.Contracts.Loans.LoanRepayment.CreditContractRepayment的用法示例。


在下文中一共展示了CreditContractRepayment.Repay方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Repay

        /// <summary>
        /// This method manages all the repayment cases implemented in the software
        /// </summary>
        /// <param name="pNumber">pNumber of the installment paid</param>
        /// <param name="pDate">pDate of the payment</param>
        /// <param name="pAmountPaid">amount paid by the client which can be lower, equal or greater than the expected amount for an installment</param>
        /// <param name="cancelFees">when true, cancel anticipated payment Commission</param>
        /// <param name="manualFeesAmount">manual amount of commission (when anticipated payment commission are cancelled)</param>
        /// <returns>A RepaymentEvent or null if : 
        /// - repayment amount lower than 0
        /// - repayment amount greater than olb + interestsToPay + commission
        /// - installment already repaid
        /// - bad loan and past due days greater than 180
        /// </returns>
        /// <param name="manualCommissionAmount"></param>
        /// <param name="disableInterests"></param>
        /// <param name="manualInterests"></param>
        /// <param name="keepExpectedInstallment"></param>
        /// <param name="payProportion"></param>
        /// <param name="paymentMethod"></param>
        /// <param name="comment"></param>
        /// <param name="pending"></param>
        public RepaymentEvent Repay(int pNumber, 
                                    DateTime pDate, 
                                    OCurrency pAmountPaid,
                                    bool cancelFees, 
                                    OCurrency manualFeesAmount, 
                                    OCurrency manualCommissionAmount,
                                    bool disableInterests, 
                                    OCurrency manualInterests, 
                                    bool keepExpectedInstallment,
                                    bool payProportion,
                                    PaymentMethod paymentMethod, 
                                    string comment, 
                                    bool pending)
        {
            OCurrency anticipatePayment =
                CalculateAnticipateInteresAmountForClosure(pDate, OPaymentType.PartialPayment, payProportion) +
                CalculateTotalNonRepaymentPenalties(pDate);

            if (anticipatePayment >= pAmountPaid
                || (anticipatePayment == 0 && GetInstallment(pNumber - 1).ExpectedDate <= pDate))
            {
                keepExpectedInstallment = true;
                payProportion = false;
            }

            var cCo = new CreditContractOptions(Product.LoanType,
                                                keepExpectedInstallment,
                                                cancelFees,
                                                manualFeesAmount,
                                                manualCommissionAmount,
                                                disableInterests,
                                                manualInterests,
                                                Product.AnticipatedTotalRepaymentPenaltiesBase,
                                                Product.IsExotic,
                                                payProportion);

            var cCr = new CreditContractRepayment(this, cCo, pDate, pNumber, _user, _generalSettings, _nwdS);

            if (AmountComparer.Compare(pAmountPaid, cCr.MaximumAmountAuthorizeToRepay, pNumber) > 0)
            {
                return null;
            }

            OCurrency principalEvent = 0;
            OCurrency interestEvent = 0;
            OCurrency interestPrepayment = 0;
            OCurrency penaltiesEvent = 0;
            OCurrency commissionsEvent = 0;
            OCurrency manualInterestEvent = cCo.ManualInterestsAmount;

            int pastDueDays = CalculatePastDueSinceLastRepayment(pDate);

            OPaymentType paymentType = OPaymentType.StandardPayment;

            foreach (Installment installment in InstallmentList)
            {
                if (!installment.IsRepaid && installment.Number == pNumber && !keepExpectedInstallment)
                {
                    paymentType = OPaymentType.PartialPayment;
                }
            }

            //we have total repayment for a person
            if(EscapedMember != null)
            {
                paymentType = OPaymentType.PartialPayment;
                keepExpectedInstallment = false;
                cCo.KeepExpectedInstallments = false;
            }

            if (AmountComparer.Compare(pAmountPaid, cCr.MaximumAmountAuthorizeToRepay, pNumber) == 0 && !keepExpectedInstallment)
            {
                paymentType = OPaymentType.TotalPayment;
            }

            if (payProportion && _product.LoanType == OLoanTypes.DecliningFixedPrincipal)
            {
                paymentType = OPaymentType.ProportionalPayment;
//.........这里部分代码省略.........
开发者ID:TalasZh,项目名称:opencbs,代码行数:101,代码来源:Loan.cs


注:本文中的OpenCBS.CoreDomain.Contracts.Loans.LoanRepayment.CreditContractRepayment.Repay方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。