本文整理汇总了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;
//.........这里部分代码省略.........