private static Loan _SetContract(OLoanTypes pLoansType, NonRepaymentPenalties pNonRepaymentPenalties, bool pKeepExpectedInstallment) { var package = new LoanProduct { InstallmentType = new InstallmentType(1, "Monthly", 0, 1), LoanType = pLoansType, ChargeInterestWithinGracePeriod = true, Currency = new Currency { Id = 1, UseCents = true }, RoundingType = ORoundingType.Approximate }; package.KeepExpectedInstallment = pKeepExpectedInstallment; package.AnticipatedTotalRepaymentPenaltiesBase = OAnticipatedRepaymentPenaltiesBases.RemainingOLB; var 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.AnticipatedTotalRepaymentPenalties = 0.01; myContract.NonRepaymentPenalties = pNonRepaymentPenalties; return(myContract); }
private static Loan _SetContract(OCurrency amount, decimal rate, OLoanTypes loansType, NonRepaymentPenalties nonRepaymentFees, bool keepExpectedInstallment, int numberOfGracePeriod, DateTime stratDate, int nbInstallment) { LoanProduct package = new LoanProduct { InstallmentType = new InstallmentType(1, "Monthly", 0, 1), LoanType = loansType, ChargeInterestWithinGracePeriod = true, Currency = new Currency { Id = 1 } }; package.KeepExpectedInstallment = keepExpectedInstallment; package.AnticipatedTotalRepaymentPenaltiesBase = OAnticipatedRepaymentPenaltiesBases.RemainingOLB; Loan myContract = new Loan(package, amount, rate, nbInstallment, numberOfGracePeriod, stratDate, new User(), ApplicationSettings.GetInstance(""), NonWorkingDateSingleton.GetInstance(""), ProvisionTable.GetInstance(new User()), ChartOfAccounts.GetInstance(new User())); myContract.BadLoan = false; myContract.AnticipatedTotalRepaymentPenalties = 0; myContract.NonRepaymentPenalties = nonRepaymentFees; return(myContract); }