本文整理汇总了C#中OpenCBS.CoreDomain.Contracts.Loans.Loan.CalculatePastDueSinceLastRepayment方法的典型用法代码示例。如果您正苦于以下问题:C# Loan.CalculatePastDueSinceLastRepayment方法的具体用法?C# Loan.CalculatePastDueSinceLastRepayment怎么用?C# Loan.CalculatePastDueSinceLastRepayment使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OpenCBS.CoreDomain.Contracts.Loans.Loan
的用法示例。
在下文中一共展示了Loan.CalculatePastDueSinceLastRepayment方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TestCalculatePastDueSinceLastRepaymentWhenSameYearAndLimitBypassed
public void TestCalculatePastDueSinceLastRepaymentWhenSameYearAndLimitBypassed()
{
LoanProduct package = new LoanProduct
{
InstallmentType = new InstallmentType(1, "Monthly", 0, 1),
LoanType = OLoanTypes.Flat,
ChargeInterestWithinGracePeriod = true,
Currency = new Currency { Id = 1 },
KeepExpectedInstallment = false
};
Loan myContract = new Loan(package, 1000, 0.03m, 6, 2, new DateTime(2006, 1, 1), new User(), ApplicationSettings.GetInstance(""), NonWorkingDateSingleton.GetInstance(""), ProvisionTable.GetInstance(new User()), ChartOfAccounts.GetInstance(new User()));
myContract.Repay(1, new DateTime(2006, 2, 1), 30, true, false);
DateTime limit = new DateTime(2006, 5, 1);
Assert.AreEqual(61, myContract.CalculatePastDueSinceLastRepayment(limit));
}
示例2: TestCalculatePastDueSinceLastRepayment
public void TestCalculatePastDueSinceLastRepayment()
{
LoanProduct package = new LoanProduct
{
InstallmentType = new InstallmentType(1, "Monthly", 0, 1),
LoanType = OLoanTypes.Flat,
ChargeInterestWithinGracePeriod = true,
KeepExpectedInstallment = false,
Currency = new Currency { Id = 1 }
};
Loan myContract = new Loan(package, 1000, 0.03m, 6, 2, new DateTime(2006, 1, 1), new User(), ApplicationSettings.GetInstance(""), NonWorkingDateSingleton.GetInstance(""), ProvisionTable.GetInstance(new User()), ChartOfAccounts.GetInstance(new User()));
//before repayment
Assert.AreEqual(0, myContract.CalculatePastDueSinceLastRepayment(new DateTime(2006, 2, 1)));
Assert.AreEqual(14, myContract.CalculatePastDueSinceLastRepayment(new DateTime(2006, 2, 15)));
Assert.AreEqual(59, myContract.CalculatePastDueSinceLastRepayment(new DateTime(2006, 4, 1)));
Assert.AreEqual(152, myContract.CalculatePastDueSinceLastRepayment(new DateTime(2006, 7, 3)));
//partially repayment
PaymentMethod paymentMethod = new PaymentMethod(1, "Cash", "", false);
myContract.Repay(1, new DateTime(2006, 2, 1), 30, true, 0, 0, false, 0, false, false, false, paymentMethod);
myContract.Repay(2, new DateTime(2006, 3, 6), 10, true, 0, 0, false, 0, false, false, false, paymentMethod);
Assert.AreEqual(0, myContract.CalculatePastDueSinceLastRepayment(new DateTime(2006, 2, 1)));
Assert.AreEqual(0, myContract.CalculatePastDueSinceLastRepayment(new DateTime(2006, 2, 15)));
Assert.AreEqual(28, myContract.CalculatePastDueSinceLastRepayment(new DateTime(2006, 4, 3)));
Assert.AreEqual(119, myContract.CalculatePastDueSinceLastRepayment(new DateTime(2006, 7, 3)));
//totally repayment
myContract.Repay(2, new DateTime(2006, 3, 6), 20, true, 0, 0, false, 0, false, false, false, paymentMethod);
Assert.AreEqual(0, myContract.CalculatePastDueSinceLastRepayment(new DateTime(2006, 2, 1)));
Assert.AreEqual(0, myContract.CalculatePastDueSinceLastRepayment(new DateTime(2006, 2, 15)));
Assert.AreEqual(0, myContract.CalculatePastDueSinceLastRepayment(new DateTime(2006, 4, 3)));
Assert.AreEqual(91, myContract.CalculatePastDueSinceLastRepayment(new DateTime(2006, 7, 3)));
}
示例3: TestCalculatePastDueSinceLastRepayment2
public void TestCalculatePastDueSinceLastRepayment2()
{
LoanProduct package = new LoanProduct
{
InstallmentType = new InstallmentType(1, "Monthly", 0, 1),
LoanType = OLoanTypes.Flat,
ChargeInterestWithinGracePeriod = true,
KeepExpectedInstallment = false,
Currency = new Currency { Id = 1 }
};
Loan myContract = new Loan(package, 1000, 0.03m, 6, 2, new DateTime(2006, 1, 1), new User(), ApplicationSettings.GetInstance(""), NonWorkingDateSingleton.GetInstance(""), ProvisionTable.GetInstance(new User()), ChartOfAccounts.GetInstance(new User()));
PaymentMethod paymentMethod = new PaymentMethod(1, "Cash", "", false);
myContract.Repay(1, new DateTime(2006, 6, 1), 30, true, 0, 0, false, 0, true, false, false, paymentMethod);
Assert.IsTrue(myContract.GetInstallment(0).IsRepaid);
Assert.AreEqual(122, myContract.CalculatePastDueSinceLastRepayment(new DateTime(2006, 7, 1)));
}
示例4: TestIfPastDueIsEqualToZeroWhenAllInstallmentsAreRepaid
public void TestIfPastDueIsEqualToZeroWhenAllInstallmentsAreRepaid()
{
LoanProduct package = new LoanProduct
{
InstallmentType = new InstallmentType(1, "Monthly", 0, 1),
LoanType = OLoanTypes.Flat,
ChargeInterestWithinGracePeriod = true,
Currency = new Currency { Id = 1 }
};
package.KeepExpectedInstallment = false;
Loan myContract = new Loan(package, 1000, 0.03m, 6, 2, new DateTime(2006, 1, 1), new User(), ApplicationSettings.GetInstance(""), NonWorkingDateSingleton.GetInstance(""), ProvisionTable.GetInstance(new User()), ChartOfAccounts.GetInstance(new User()));
myContract.Repay(1, new DateTime(2006, 2, 1), 30, true, false);
myContract.Repay(2, new DateTime(2006, 3, 1), 30, true, false);
myContract.Repay(3, new DateTime(2006, 4, 1), 280, true, false);
myContract.Repay(4, new DateTime(2006, 5, 1), 280, true, false);
myContract.Repay(5, new DateTime(2006, 6, 1), 280, true, false);
myContract.Repay(6, new DateTime(2006, 7, 1), 280, true, false);
Assert.AreEqual(0, myContract.CalculatePastDueSinceLastRepayment(new DateTime(2005, 8, 7)));
}
示例5: TestIfPastDueCorrectlyCalculatedWhenYearAreDifferentAndDifferenceLowerThanOneYear
public void TestIfPastDueCorrectlyCalculatedWhenYearAreDifferentAndDifferenceLowerThanOneYear()
{
LoanProduct package = new LoanProduct
{
InstallmentType = new InstallmentType(1, "Monthly", 0, 1),
LoanType = OLoanTypes.Flat,
ChargeInterestWithinGracePeriod = true,
Currency = new Currency { Id = 1 }
};
package.KeepExpectedInstallment = false;
Loan myContract = new Loan(package, 1000, 0.03m, 6, 1, new DateTime(2006, 1, 1), new User(), ApplicationSettings.GetInstance(""), NonWorkingDateSingleton.GetInstance(""), ProvisionTable.GetInstance(new User()), ChartOfAccounts.GetInstance(new User()));
DateTime limit = new DateTime(2007,1,1);
Assert.AreEqual(334,myContract.CalculatePastDueSinceLastRepayment(limit));
}
示例6: TestRepayFlatLoanWhenCalculateFeesWithDelta
public void TestRepayFlatLoanWhenCalculateFeesWithDelta()
{
ApplicationSettings.GetInstance("").UpdateParameter(OGeneralSettings.CALCULATIONLATEFEESDURINGPUBLICHOLIDAYS, true);
var package = new LoanProduct
{
InstallmentType = new InstallmentType(1, "Monthly", 0, 1),
LoanType = OLoanTypes.Flat,
ChargeInterestWithinGracePeriod = true,
Currency = new Currency {Id = 1, UseCents = true}
};
package.KeepExpectedInstallment = false;
package.AnticipatedTotalRepaymentPenaltiesBase = OAnticipatedRepaymentPenaltiesBases.RemainingOLB;
var myContract = new Loan(package, 1000, 0.03m, 5, 0, new DateTime(2006, 1, 1), new User(),
ApplicationSettings.GetInstance(""), NonWorkingDateSingleton.GetInstance(""),
ProvisionTable.GetInstance(new User()), ChartOfAccounts.GetInstance(new User()));
myContract.BadLoan = false;
myContract.NonRepaymentPenalties.OLB = 0.003;
myContract.AnticipatedTotalRepaymentPenalties = 0;
Assert.AreEqual(14, myContract.CalculatePastDueSinceLastRepayment(new DateTime(2006, 2, 15)));
RepaymentEvent rPE = myContract.Repay(1, new DateTime(2006, 2, 15), 80, false, false);
Assert.AreEqual(42m, rPE.Fees.Value);
Assert.AreEqual(30, rPE.Interests.Value);
Assert.AreEqual(8, rPE.Principal.Value);
Assert.AreEqual(13, myContract.CalculatePastDueSinceLastRepayment(new DateTime(2006, 2, 28)));
RepaymentEvent rPE2 = myContract.Repay(1, new DateTime(2006, 2, 28), 231m, false, false);
Assert.AreEqual(38.69, rPE2.Fees.Value);
Assert.AreEqual(0.31, rPE2.Interests.Value);
Assert.AreEqual(192m, rPE2.Principal.Value);
Assert.IsTrue(myContract.GetInstallment(0).IsRepaid);
}
示例7: TestRepayFlatLoan2
public void TestRepayFlatLoan2()
{
ApplicationSettings.GetInstance("").UpdateParameter(OGeneralSettings.ACCOUNTINGPROCESS, OAccountingProcesses.Cash);
LoanProduct package = new LoanProduct
{
InstallmentType = new InstallmentType(1, "Monthly", 0, 1),
LoanType = OLoanTypes.Flat,
ChargeInterestWithinGracePeriod = true,
Currency = new Currency { Id = 1, UseCents = true }
};
package.KeepExpectedInstallment = false;
package.AnticipatedTotalRepaymentPenaltiesBase = OAnticipatedRepaymentPenaltiesBases.RemainingOLB;
Loan myContract = new Loan(package, 1000, 0.03m, 6, 1, new DateTime(2006, 1, 1), new User(), ApplicationSettings.GetInstance(""), NonWorkingDateSingleton.GetInstance(""), ProvisionTable.GetInstance(new User()), ChartOfAccounts.GetInstance(new User()));
myContract.BadLoan = true;
myContract.NonRepaymentPenalties.InitialAmount = 0.003;
myContract.AnticipatedTotalRepaymentPenalties = 0.01;
CreditContractOptions cCO = new CreditContractOptions(package.LoanType, package.KeepExpectedInstallment, false, 0, 0, false, 0,
package.AnticipatedTotalRepaymentPenaltiesBase);
CreditContractRepayment cCR = new CreditContractRepayment(myContract, cCO, new DateTime(2006, 3, 15), 1, new User(), ApplicationSettings.GetInstance(""), NonWorkingDateSingleton.GetInstance(""));
Assert.AreEqual(1194,Math.Round(cCR.MaximumAmountAuthorizeToRepay.Value,2));
Assert.AreEqual(386,Math.Round(cCR.MaximumAmountToRegradingLoan.Value,2));
Assert.AreEqual(42, myContract.CalculatePastDueSinceLastRepayment(new DateTime(2006, 3, 15)));
RepaymentEvent rPE = myContract.Repay(1,new DateTime(2006,3,15),386,false,false);
Assert.AreEqual(126m,rPE.Fees.Value);
Assert.AreEqual(60m,rPE.Interests.Value);
Assert.AreEqual(200m,rPE.Principal.Value);
Assert.IsFalse(myContract.BadLoan);
Assert.AreEqual(0, myContract.CalculatePastDueSinceLastRepayment(new DateTime(2006, 3, 15)));
CreditContractRepayment cCR2 = new CreditContractRepayment(myContract, cCO, new DateTime(2006, 3, 15), 3, new User(), ApplicationSettings.GetInstance(""), NonWorkingDateSingleton.GetInstance(""));
Assert.AreEqual(0, Math.Round(cCR2.MaximumAmountToRegradingLoan.Value,2));
Assert.AreEqual(808, Math.Round(cCR2.MaximumAmountAuthorizeToRepay.Value,2));
RepaymentEvent rPE2 = myContract.Repay(3,new DateTime(2006,3,15), 808m, false, false);
Assert.AreEqual(8m, rPE2.Fees.Value);
Assert.AreEqual(0m, rPE2.Interests.Value);
Assert.AreEqual(800m, rPE2.Principal.Value);
Assert.IsTrue(myContract.AllInstallmentsRepaid);
}
示例8: TestCalculatePastDue
public void TestCalculatePastDue()
{
LoanProduct package = new LoanProduct
{
InstallmentType = new InstallmentType(1, "Monthly", 0, 1),
LoanType = OLoanTypes.Flat,
ChargeInterestWithinGracePeriod = true,
Currency = new Currency { Id = 1 }
};
package.KeepExpectedInstallment = false;
package.AnticipatedTotalRepaymentPenaltiesBase = OAnticipatedRepaymentPenaltiesBases.RemainingOLB;
Loan myContract = new Loan(package, 1000, 0.03m, 5, 0, new DateTime(2006, 1, 1), new User(), ApplicationSettings.GetInstance(""), NonWorkingDateSingleton.GetInstance(""), ProvisionTable.GetInstance(new User()), ChartOfAccounts.GetInstance(new User()));
myContract.BadLoan = false;
myContract.NonRepaymentPenalties.InitialAmount = 0.003;
myContract.AnticipatedTotalRepaymentPenalties = 0;
Assert.AreEqual(14, myContract.CalculatePastDueSinceLastRepayment(new DateTime(2006, 2, 15)));
myContract.Repay(1,new DateTime(2006, 2, 15), 80, false, false);
Assert.AreEqual(13, myContract.CalculatePastDueSinceLastRepayment(new DateTime(2006, 2, 28)));
}