本文整理汇总了C#中OpenCBS.CoreDomain.Contracts.Loans.Loan.Disburse方法的典型用法代码示例。如果您正苦于以下问题:C# Loan.Disburse方法的具体用法?C# Loan.Disburse怎么用?C# Loan.Disburse使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OpenCBS.CoreDomain.Contracts.Loans.Loan
的用法示例。
在下文中一共展示了Loan.Disburse方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TestDisburseWhenDisburseDateGreaterThanContractStartDate
public void TestDisburseWhenDisburseDateGreaterThanContractStartDate()
{
ApplicationSettings.GetInstance("").UpdateParameter(OGeneralSettings.CALCULATIONLATEFEESDURINGPUBLICHOLIDAYS, true);
ApplicationSettings.GetInstance("").UpdateParameter(OGeneralSettings.INCREMENTALDURINGDAYOFF, true);
//startdate = 1/1/2006
//expectedFirstInstallment = 1/2/2006
//real startdate = 6/1/2006
LoanProduct package = new LoanProduct
{
InstallmentType = new InstallmentType(1, "Monthly", 0, 1),
LoanType = OLoanTypes.Flat,
ChargeInterestWithinGracePeriod = true,
Currency = new Currency { Id = 1 }
};
EntryFee productEntryFee = new EntryFee();
productEntryFee.IsRate = true;
productEntryFee.Value = 5;//5% of an amount
productEntryFee.Id = 21;
productEntryFee.Name = "Test entry fee";
package.EntryFees = new List<EntryFee>();
package.EntryFees.Add(productEntryFee);
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())
);
LoanEntryFee fee = new LoanEntryFee();
fee.ProductEntryFee = package.EntryFees[0];
fee.FeeValue = (decimal)fee.ProductEntryFee.Value;
fee.ProductEntryFeeId = (int) package.EntryFees[0].Id;
myContract.LoanEntryFeesList=new List<LoanEntryFee>();
myContract.LoanEntryFeesList.Add(fee);
LoanDisbursmentEvent lDE = myContract.Disburse(new DateTime(2006,1,6),false,false);
Assert.AreEqual(new DateTime(2006,1,1),myContract.StartDate);
Assert.AreEqual(25m,myContract.GetInstallment(0).InterestsRepayment.Value);
Assert.AreEqual(1000m,lDE.Amount.Value);
Assert.AreEqual(50m, lDE.Commissions[0].Fee.Value);
}
示例2: TestDisburseWhenDisableFeesTrue
public void TestDisburseWhenDisableFeesTrue()
{
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, "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 productFee = new EntryFee();
productFee.Value = 5;
productFee.IsRate = true;
LoanEntryFee entryFee = new LoanEntryFee();
entryFee.FeeValue = 5;
entryFee.ProductEntryFee = productFee;
myContract.LoanEntryFeesList = new List<LoanEntryFee>();
myContract.LoanEntryFeesList.Add(entryFee);
LoanDisbursmentEvent lDE = myContract.Disburse(new DateTime(2006,1,6),false,true);
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(null, lDE.Commissions);
}
示例3: 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);
}
示例4: TestCalculateInstallmentWhenChangeDateSetToFalse
public void TestCalculateInstallmentWhenChangeDateSetToFalse()
{
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.CALCULATIONLATEFEESDURINGPUBLICHOLIDAYS, 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.02m,6,1,new DateTime(2006,1,2), new User(), ApplicationSettings.GetInstance(""), NonWorkingDateSingleton.GetInstance(""), ProvisionTable.GetInstance(new User()), ChartOfAccounts.GetInstance(new User()));
Assert.AreEqual(new DateTime(2006,2,2),myContract.GetInstallment(0).ExpectedDate);
Assert.AreEqual(new DateTime(2006,3,2),myContract.GetInstallment(1).ExpectedDate);
myContract.Disburse(new DateTime(2006,1,6),false,false);
Assert.AreEqual(new DateTime(2006,1,2),myContract.StartDate);
Assert.AreEqual(new DateTime(2006,2,2),myContract.GetInstallment(0).ExpectedDate);
Assert.AreEqual(new DateTime(2006,3,2),myContract.GetInstallment(1).ExpectedDate);
myContract.Repay(1,new DateTime(2006,2,2),100,true,false);
Assert.AreEqual(new DateTime(2006,2,2),myContract.GetInstallment(0).ExpectedDate);
Assert.AreEqual(new DateTime(2006,3,2),myContract.GetInstallment(1).ExpectedDate);
}
示例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: 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);
}
示例7: 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);
}
示例8: 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);
}
示例9: 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);
}
示例10: RepayInstallments_DontCancelFees_InitialAmount_RepaymentTwicelyADay
public void RepayInstallments_DontCancelFees_InitialAmount_RepaymentTwicelyADay()
{
LoanProduct package = new LoanProduct
{
InstallmentType = new InstallmentType(1, "10-days", 10, 0),
LoanType = OLoanTypes.Flat,
ChargeInterestWithinGracePeriod = true,
Currency = new Currency { Id = 1 }
};
package.KeepExpectedInstallment = true;
package.AnticipatedTotalRepaymentPenaltiesBase = OAnticipatedRepaymentPenaltiesBases.RemainingOLB;
Loan myContract = new Loan(package, 8000, 0.03333m, 5, 0, new DateTime(2010, 1, 1), new User(), ApplicationSettings.GetInstance(""), NonWorkingDateSingleton.GetInstance(""), ProvisionTable.GetInstance(new User()), ChartOfAccounts.GetInstance(new User()));
myContract.BadLoan = false;
myContract.AnticipatedTotalRepaymentPenalties = 0.01;
myContract.NonRepaymentPenalties = new NonRepaymentPenalties(0, 0, 0.0667, 0.01);
myContract.CalculateInstallments(true);
myContract.Disburse(new DateTime(2010, 1, 1), false, true);
myContract.Repay(1, new DateTime(2010, 1, 8), 30, false, true);
RepaymentEvent rPE = myContract.Repay(1, new DateTime(2010, 1, 11), 0, false, true);
Assert.AreEqual(rPE.Penalties, 0);
}