本文整理汇总了C#中OpenCBS.CoreDomain.Contracts.Loans.Loan.GetInstallment方法的典型用法代码示例。如果您正苦于以下问题:C# Loan.GetInstallment方法的具体用法?C# Loan.GetInstallment怎么用?C# Loan.GetInstallment使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OpenCBS.CoreDomain.Contracts.Loans.Loan
的用法示例。
在下文中一共展示了Loan.GetInstallment方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DecliningRate_ExoticInstallments_GracePeriod
public void DecliningRate_ExoticInstallments_GracePeriod()
{
LoanProduct package = new LoanProduct
{
InstallmentType = new InstallmentType(1, "Monthly", 0, 1),
LoanType = OLoanTypes.DecliningFixedInstallments,
ChargeInterestWithinGracePeriod = true,
ExoticProduct = new ExoticInstallmentsTable
{
new ExoticInstallment(1, 0.1, null),
new ExoticInstallment(2, 0.1, null),
new ExoticInstallment(3, 0.1, null),
new ExoticInstallment(4, 0.1, null),
new ExoticInstallment(5, 0.1, null),
new ExoticInstallment(6, 0.5, null)
},
Currency = new Currency { Id = 1 }
};
Loan myContract = new Loan(package, 1000, 0.03m, 7, 1, new DateTime(2006, 1, 1), new User(), ApplicationSettings.GetInstance(""), NonWorkingDateSingleton.GetInstance(""), ProvisionTable.GetInstance(new User()), ChartOfAccounts.GetInstance(new User()));
_AssertSpecifiedInstallment(myContract.GetInstallment(0), 1, new DateTime(2006, 2, 1), 30.00m, 0, 1000);
_AssertSpecifiedInstallment(myContract.GetInstallment(1), 2, new DateTime(2006, 3, 1), 30.00m, 100.00m, 1000);
_AssertSpecifiedInstallment(myContract.GetInstallment(2), 3, new DateTime(2006, 4, 3), 27.00m, 100.00m, 900);
_AssertSpecifiedInstallment(myContract.GetInstallment(3), 4, new DateTime(2006, 5, 1), 24.00m, 100.00m, 800);
_AssertSpecifiedInstallment(myContract.GetInstallment(4), 5, new DateTime(2006, 6, 1), 21.00m, 100.00m, 700);
_AssertSpecifiedInstallment(myContract.GetInstallment(5), 6, new DateTime(2006, 7, 3), 18.00m, 100.00m, 600);
_AssertSpecifiedInstallment(myContract.GetInstallment(6), 7, new DateTime(2006, 8, 1), 15.00m, 500.00m, 500);
}
示例2: _AccruedInterestsLoanBalance
private static OCurrency _AccruedInterestsLoanBalance(Loan pCredit)
{
if (!pCredit.Disbursed || pCredit.Rescheduled) return 0;
if (pCredit.GetPastDueDays(TimeProvider.Today) != 0) return 0;
foreach (Installment installment in pCredit.InstallmentList)
{
if(!installment.IsRepaid)
{
DateTime date = installment.Number == 1
? pCredit.StartDate
: pCredit.GetInstallment(installment.Number - 2).ExpectedDate;
int days = (TimeProvider.Today - date).Days;
OCurrency accruedInterest = installment.InterestsRepayment * (double)days / (double)DateTime.DaysInMonth(date.Year, date.Month);
accruedInterest -= installment.PaidInterests;
return accruedInterest > 0 ? accruedInterest : 0;
}
}
return 0;
}
示例3: FlatRate_BiWeeklyInstallmentType_GracePeriod
public void FlatRate_BiWeeklyInstallmentType_GracePeriod()
{
LoanProduct package = new LoanProduct
{
InstallmentType = new InstallmentType(1, "Bi-Weekly", 14, 0),
LoanType = OLoanTypes.Flat,
ChargeInterestWithinGracePeriod = true,
Currency = new Currency { Id = 1, UseCents = true}
};
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()));
_AssertSpecifiedInstallment(myContract.GetInstallment(0), 1, new DateTime(2006, 1, 16), 32.14m, 0, 1000);
_AssertSpecifiedInstallment(myContract.GetInstallment(1), 2, new DateTime(2006, 1, 30), 30.00m, 0, 1000);
_AssertSpecifiedInstallment(myContract.GetInstallment(2), 3, new DateTime(2006, 2, 13), 30.00m, 250, 1000);
_AssertSpecifiedInstallment(myContract.GetInstallment(3), 4, new DateTime(2006, 2, 27), 30.00m, 250, 750);
_AssertSpecifiedInstallment(myContract.GetInstallment(4), 5, new DateTime(2006, 3, 13), 30.00m, 250, 500);
_AssertSpecifiedInstallment(myContract.GetInstallment(5), 6, new DateTime(2006, 3, 27), 30.00m, 250, 250);
}
示例4: TestDisburseWhenDisburseDateEqualsToContractStartDate
public void TestDisburseWhenDisburseDateEqualsToContractStartDate()
{
ApplicationSettings.GetInstance("").UpdateParameter(OGeneralSettings.INCREMENTALDURINGDAYOFF, true);
LoanProduct package = new LoanProduct
{
InstallmentType = new InstallmentType(1, "Monthly", 0, 1),
LoanType = OLoanTypes.Flat,
ChargeInterestWithinGracePeriod = true,
Currency = new Currency { Id = 1 }
};
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()));
EntryFee entryFee = new EntryFee();
entryFee.Value = 5;
entryFee.IsRate = true;
entryFee.Id = 21;
LoanEntryFee loanEntryFee = new LoanEntryFee();
loanEntryFee.FeeValue = 5;
loanEntryFee.ProductEntryFee = entryFee;
loanEntryFee.ProductEntryFeeId = 21;
myContract.LoanEntryFeesList = new List<LoanEntryFee>();
myContract.LoanEntryFeesList.Add(loanEntryFee);
LoanDisbursmentEvent lDE = myContract.Disburse(new DateTime(2006,1,1),false,false);
Assert.AreEqual(new DateTime(2006,1,1),myContract.StartDate);
Assert.AreEqual(30m,myContract.GetInstallment(0).InterestsRepayment.Value);
Assert.AreEqual(1000m,lDE.Amount.Value);
Assert.AreEqual(50m,lDE.Commissions[0].Fee.Value);
}
示例5: TestDisburseWhenBiWeeklyInstallmentType
public void TestDisburseWhenBiWeeklyInstallmentType()
{
LoanProduct package = new LoanProduct
{
InstallmentType = new InstallmentType(1, "Bi-Weelky", 14, 0),
LoanType = OLoanTypes.Flat,
ChargeInterestWithinGracePeriod = true,
Currency = new Currency { Id = 1 }
};
Loan myContract = new Loan(package, 1000, 0.02m, 6, 1, new DateTime(2006, 1, 2), new User(), ApplicationSettings.GetInstance(""), NonWorkingDateSingleton.GetInstance(""), ProvisionTable.GetInstance(new User()), ChartOfAccounts.GetInstance(new User()));
EntryFee entryFee = new EntryFee();
entryFee.Value = 5;
entryFee.IsRate = true;
entryFee.Id = 21;
LoanEntryFee loanEntryFee = new LoanEntryFee();
loanEntryFee.FeeValue = 5;
loanEntryFee.ProductEntryFee = entryFee;
loanEntryFee.ProductEntryFeeId = 21;
myContract.LoanEntryFeesList = new List<LoanEntryFee>();
myContract.LoanEntryFeesList.Add(loanEntryFee);
LoanDisbursmentEvent lDE = myContract.Disburse(new DateTime(2006, 1, 6), false, false);
Assert.AreEqual(new DateTime(2006,1,2), myContract.StartDate);
Assert.AreEqual(14.29m, myContract.GetInstallment(0).InterestsRepayment.Value);
Assert.AreEqual(1000m, lDE.Amount.Value);
Assert.AreEqual(50m, lDE.Commissions[0].Fee.Value);
}
示例6: TestContract9InstallmentsDecliningRateWhenLittleOverPaid
public void TestContract9InstallmentsDecliningRateWhenLittleOverPaid()
{
ApplicationSettings.GetInstance("").UpdateParameter(OGeneralSettings.CALCULATIONLATEFEESDURINGPUBLICHOLIDAYS, true);
LoanProduct package = new LoanProduct
{
InstallmentType = new InstallmentType(1, "Monthly", 0, 1),
LoanType = OLoanTypes.DecliningFixedInstallments,
ChargeInterestWithinGracePeriod = true,
Currency = new Currency { Id = 1 }
};
package.KeepExpectedInstallment = false;
Loan myContract = new Loan(package,1500,0.03m,9,1,new DateTime(2006,1,1), new User(), ApplicationSettings.GetInstance(""), NonWorkingDateSingleton.GetInstance(""), ProvisionTable.GetInstance(new User()), ChartOfAccounts.GetInstance(new User()));
myContract.AnticipatedTotalRepaymentPenalties = 0.02;
Assert.AreEqual(45m,myContract.GetInstallment(0).InterestsRepayment.Value);
Assert.AreEqual(0,myContract.GetInstallment(0).CapitalRepayment.Value);
Assert.AreEqual(new DateTime(2006,2,1),myContract.GetInstallment(0).ExpectedDate);
RepaymentEvent rPE = myContract.Repay(1,new DateTime(2006,2,1),45m,false,false);
Assert.AreEqual(45,myContract.GetInstallment(0).PaidInterests.Value);
Assert.AreEqual(0,myContract.GetInstallment(0).PaidCapital.Value);
Assert.AreEqual(0m,rPE.Fees.Value);
Assert.AreEqual(45m,rPE.Interests.Value);
Assert.AreEqual(0m,rPE.Principal.Value);
}
示例7: 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)));
}
示例8: TestCalculateOverDueAmountWithInterest
public void TestCalculateOverDueAmountWithInterest()
{
LoanProduct package = new LoanProduct
{
InstallmentType = new InstallmentType(1, "Monthly", 0, 1),
LoanType = OLoanTypes.DecliningFixedInstallments,
ChargeInterestWithinGracePeriod = true,
Currency = new Currency { Id = 1, UseCents = true},
RoundingType = ORoundingType.Approximate
};
Loan myContract = new Loan(package, 1000, 0.03m, 12, 0, new DateTime(2006, 1, 1), new User(), ApplicationSettings.GetInstance(""), NonWorkingDateSingleton.GetInstance(""), ProvisionTable.GetInstance(new User()), ChartOfAccounts.GetInstance(new User()));
myContract.NonRepaymentPenalties.OLB = 0.0016;
Assert.AreEqual(30m,myContract.GetInstallment(0).InterestsRepayment.Value);
Assert.AreEqual(70.46m,myContract.GetInstallment(0).CapitalRepayment.Value);
Assert.AreEqual(new DateTime(2006,2,1),myContract.GetInstallment(0).ExpectedDate);
Assert.AreEqual(1000, _CheckInstalmentsTotalPrincipal(myContract).Value);
Assert.AreEqual(27.89m,myContract.GetInstallment(1).InterestsRepayment.Value);
Assert.AreEqual(72.57m,myContract.GetInstallment(1).CapitalRepayment.Value);
Assert.AreEqual(new DateTime(2006,3,1),myContract.GetInstallment(1).ExpectedDate);
Assert.AreEqual(new DateTime(2006,4,3),myContract.GetInstallment(2).ExpectedDate);
Assert.AreEqual(new DateTime(2006,5,1),myContract.GetInstallment(3).ExpectedDate);
Assert.AreEqual(new DateTime(2006,6,1),myContract.GetInstallment(4).ExpectedDate);
Assert.AreEqual(new DateTime(2006,7,3),myContract.GetInstallment(5).ExpectedDate);
}
示例9: TestAddInstallmentAndGetInstallment
public void TestAddInstallmentAndGetInstallment()
{
Loan newContract = new Loan(new User(), ApplicationSettings.GetInstance(""), NonWorkingDateSingleton.GetInstance(""), ProvisionTable.GetInstance(new User()), ChartOfAccounts.GetInstance(new User())); new Loan(new User(), ApplicationSettings.GetInstance(""), NonWorkingDateSingleton.GetInstance(""), ProvisionTable.GetInstance(new User()), ChartOfAccounts.GetInstance(new User()));
Installment i = new Installment {PaidCapital = 100};
newContract.AddInstallment(i);
Assert.AreEqual(100m,newContract.GetInstallment(0).PaidCapital.Value);
}
示例10: Disburse_DisburseDateGreaterThanContractFirstInstallmentDate_NoAlignDates
public void Disburse_DisburseDateGreaterThanContractFirstInstallmentDate_NoAlignDates()
{
LoanProduct package = new LoanProduct{
InstallmentType = new InstallmentType(1, "Monthly", 0, 1),
LoanType = OLoanTypes.Flat,
ChargeInterestWithinGracePeriod = true,
Currency = new Currency { Id = 1 }
};
Loan myContract = new Loan(package, 750, 0.03m,6,1,new DateTime(2006,1,1), new User(), ApplicationSettings.GetInstance(""), NonWorkingDateSingleton.GetInstance(""), ProvisionTable.GetInstance(new User()), ChartOfAccounts.GetInstance(new User()));
LoanDisbursmentEvent lDE = myContract.Disburse(new DateTime(2006,3,1),false,false);
Assert.IsNotNull(lDE);
Assert.AreEqual(new DateTime(2006,1,1),myContract.StartDate);
Assert.AreEqual(0m,myContract.GetInstallment(0).InterestsRepayment.Value);
}
示例11: TestRepayEventCorrectlyGenerateWhenTenDaysLateAndPayFees
public void TestRepayEventCorrectlyGenerateWhenTenDaysLateAndPayFees()
{
ApplicationSettings.GetInstance("").UpdateParameter(OGeneralSettings.CALCULATIONLATEFEESDURINGPUBLICHOLIDAYS, true);
ApplicationSettings.GetInstance("").UpdateParameter(OGeneralSettings.STOP_WRITEOFF_PENALTY, true);
LoanProduct package = new LoanProduct
{
InstallmentType = new InstallmentType(1, "Monthly", 0, 1),
LoanType = OLoanTypes.Flat,
ChargeInterestWithinGracePeriod = true,
Currency = new Currency { Id = 1 }
};
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.NonRepaymentPenalties.OLB = 0.003;
Assert.AreEqual(new DateTime(2006, 2, 1), myContract.GetInstallment(0).ExpectedDate);
Assert.AreEqual(new DateTime(2006, 3, 1), myContract.GetInstallment(1).ExpectedDate);
myContract.Repay(1, new DateTime(2006, 2, 1), 30, true, false);
RepaymentEvent rPE = myContract.Repay(2, new DateTime(2006, 3, 11), 230.41m, false, false);
Assert.AreEqual(30m, rPE.Fees.Value);
Assert.AreEqual(30m, rPE.Interests.Value);
Assert.AreEqual(170.41m, rPE.Principal.Value);
}
示例12: TestIfPastDueCorrectlyCalculatedWhenLimitDateYearIsLowerThanInstallmentDateOne
public void TestIfPastDueCorrectlyCalculatedWhenLimitDateYearIsLowerThanInstallmentDateOne()
{
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.NonRepaymentPenalties.OLB = 0.001;
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()));
Assert.AreEqual(1000m,myContract.GetInstallment(0).OLB.Value);
Assert.AreEqual(1000m,myContract.GetInstallment(1).OLB.Value);
Assert.AreEqual(800m,myContract.GetInstallment(2).OLB.Value);
Assert.AreEqual(600m,myContract.GetInstallment(3).OLB.Value);
}
示例13: TestDisburseWhenMontlyInstallmentTypeAndAlignDateWithRealDisbuseDate
public void TestDisburseWhenMontlyInstallmentTypeAndAlignDateWithRealDisbuseDate()
{
ApplicationSettings pDataParam = ApplicationSettings.GetInstance("");
pDataParam.DeleteAllParameters();
pDataParam.AddParameter("ALIGN_INSTALLMENTS_ON_REAL_DISBURSEMENT_DATE", true);
pDataParam.AddParameter(OGeneralSettings.DONOTSKIPWEEKENDSININSTALLMENTSDATE, false);
pDataParam.AddParameter(OGeneralSettings.INCREMENTALDURINGDAYOFF, true);
pDataParam.AddParameter(OGeneralSettings.PAYFIRSTINSTALLMENTREALVALUE, true);
LoanProduct package = new LoanProduct
{
InstallmentType = new InstallmentType(1, "Monthly", 0, 1),
LoanType = OLoanTypes.Flat,
ChargeInterestWithinGracePeriod = true,
Currency = new Currency { Id = 1 }
};
Loan myContract = new Loan(package,1000,0.02m,6,1,new DateTime(2006,1,2), new User(), ApplicationSettings.GetInstance(""), NonWorkingDateSingleton.GetInstance(""), ProvisionTable.GetInstance(new User()), ChartOfAccounts.GetInstance(new User()));
EntryFee entryFee = new EntryFee();
entryFee.Value = 5;
entryFee.IsRate = true;
entryFee.Id = 21;
LoanEntryFee loanEntryFee = new LoanEntryFee();
loanEntryFee.FeeValue = 5;
loanEntryFee.ProductEntryFee = entryFee;
loanEntryFee.ProductEntryFeeId = 21;
myContract.LoanEntryFeesList = new List<LoanEntryFee>();
myContract.LoanEntryFeesList.Add(loanEntryFee);
LoanDisbursmentEvent lDE = myContract.Disburse(new DateTime(2006,1,2),true,false);
Assert.AreEqual(new DateTime(2006, 1, 2), myContract.StartDate);
Assert.AreEqual(20m,myContract.GetInstallment(0).InterestsRepayment.Value);
Assert.AreEqual(new DateTime(2006,2,2),myContract.GetInstallment(0).ExpectedDate);
Assert.AreEqual(1000m,lDE.Amount.Value);
Assert.AreEqual(50m, lDE.Commissions[0].Fee.Value);
}
示例14: TestDisburseWhenMonthlyInstallmentTypeAndNotAlignWithRealDisburseDate
public void TestDisburseWhenMonthlyInstallmentTypeAndNotAlignWithRealDisburseDate()
{
ApplicationSettings pDataParam = ApplicationSettings.GetInstance("");
pDataParam.DeleteAllParameters();
pDataParam.AddParameter("ALIGN_INSTALLMENTS_ON_REAL_DISBURSEMENT_DATE", false);
pDataParam.AddParameter("PAY_FIRST_INSTALLMENT_REAL_VALUE", true);
pDataParam.AddParameter(OGeneralSettings.DONOTSKIPWEEKENDSININSTALLMENTSDATE, false);
pDataParam.AddParameter(OGeneralSettings.INCREMENTALDURINGDAYOFF, true);
LoanProduct package = new LoanProduct
{
InstallmentType = new InstallmentType(1, "Monthly", 0, 1),
LoanType = OLoanTypes.Flat,
ChargeInterestWithinGracePeriod = true,
Currency = new Currency { Id = 1 }
};
Loan myContract = new Loan(package, 1000, 0.03m, 6, 1, new DateTime(2006, 1, 2), new User(), ApplicationSettings.GetInstance(""), NonWorkingDateSingleton.GetInstance(""), ProvisionTable.GetInstance(new User()), ChartOfAccounts.GetInstance(new User()));
myContract.Disburse(new DateTime(2006,1,6),false,true);
Assert.AreEqual(26m,myContract.GetInstallment(0).InterestsRepayment.Value);
}
示例15: TestDisburseWhenDisburseDateLowerThanContractStartDate
public void TestDisburseWhenDisburseDateLowerThanContractStartDate()
{
ApplicationSettings.GetInstance("").UpdateParameter(OGeneralSettings.CALCULATIONLATEFEESDURINGPUBLICHOLIDAYS, true);
ApplicationSettings.GetInstance("").UpdateParameter(OGeneralSettings.INCREMENTALDURINGDAYOFF, true);
LoanProduct package = new LoanProduct
{
InstallmentType = new InstallmentType(1, "Monthly", 0, 1),
LoanType = OLoanTypes.Flat,
ChargeInterestWithinGracePeriod = true,
Currency = new Currency { Id = 1 }
};
Loan myContract = new Loan(package,1000,0.03m,6,1,new DateTime(2006,2,1), new User(), ApplicationSettings.GetInstance(""), NonWorkingDateSingleton.GetInstance(""), ProvisionTable.GetInstance(new User()), ChartOfAccounts.GetInstance(new User()));
Assert.AreEqual(new DateTime(2006,2,1),myContract.StartDate);
myContract.Disburse(new DateTime(2005,12,25),false,false);
Assert.AreEqual(new DateTime(2006,2,1),myContract.StartDate);
Assert.AreEqual(68m,myContract.GetInstallment(0).InterestsRepayment.Value);
}