本文整理汇总了C#中OpenCBS.CoreDomain.Products.LoanProduct类的典型用法代码示例。如果您正苦于以下问题:C# LoanProduct类的具体用法?C# LoanProduct怎么用?C# LoanProduct使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
LoanProduct类属于OpenCBS.CoreDomain.Products命名空间,在下文中一共展示了LoanProduct类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: FrmAvalaibleLoanProducts
public FrmAvalaibleLoanProducts()
{
InitializeComponent();
InitializePackages();
_package = new LoanProduct();
_selectedPackage = new LoanProduct();
}
示例2: 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);
}
示例3: CalculateExpectedOLB2
public void CalculateExpectedOLB2()
{
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, 20000, 0.02m, 10, 0, new DateTime(2009, 1, 17), new User(), ApplicationSettings.GetInstance(""), NonWorkingDateSingleton.GetInstance(""), ProvisionTable.GetInstance(new User()), ChartOfAccounts.GetInstance(new User()));
myContract.BadLoan = false;
myContract.Repay(1, new DateTime(2009, 1, 17), 1000, true, false);
Assert.AreEqual(19000, myContract.CalculateExpectedOlb(1, false).Value);
Assert.AreEqual(17100, myContract.CalculateExpectedOlb(2, false).Value);
Assert.AreEqual(15200, myContract.CalculateExpectedOlb(3, false).Value);
Assert.AreEqual(13300, myContract.CalculateExpectedOlb(4, false).Value);
Assert.AreEqual(11400, myContract.CalculateExpectedOlb(5, false).Value);
Assert.AreEqual(9500, myContract.CalculateExpectedOlb(6, false).Value);
Assert.AreEqual(7600, myContract.CalculateExpectedOlb(7, false).Value);
Assert.AreEqual(5700, myContract.CalculateExpectedOlb(8, false).Value);
Assert.AreEqual(3800, myContract.CalculateExpectedOlb(9, false).Value);
Assert.AreEqual(1900, myContract.CalculateExpectedOlb(10, false).Value);
}
示例4: FrmAvalaibleLoanProducts
public FrmAvalaibleLoanProducts()
{
InitializeComponent();
_package = new LoanProduct();
InitializePackages();
webBrowserPackage.ObjectForScripting = this;
}
示例5: VillageAddLoanForm
public VillageAddLoanForm(Village village, LoanProduct product, NonSolidaryGroupForm nsgForm)
{
_village = village;
_product = product;
_nsgForm = nsgForm;
_product.EntryFees = ServicesProvider.GetInstance().GetProductServices().GetProductEntryFees(_product, village);
_fLServices = new FundingLineServices(User.CurrentUser);
_accumulatedAmount = 0;
InitializeComponent();
InitializeControls();
}
示例6: SetUp
public void SetUp()
{
_rules = new AccountingRuleCollection();
_accounts = DefaultAccounts.DefaultAccount(1);
Account cashSavings = new Account("1020", "CASH_SAVINGS", 0, "CASH_SAVIGNS", true, OAccountCategories.BalanceSheetAsset, 1);
_accounts.Add(cashSavings);
_rules.Add(new ContractAccountingRule
{
DebitAccount = _accounts[0],
CreditAccount = cashSavings,
ProductType = OProductTypes.Saving,
SavingProduct = null,
ClientType = OClientTypes.All,
EconomicActivity = null,
BookingDirection = OBookingDirections.Both
});
_loanProductEde34 = new LoanProduct { Id = 1, Code = "EDE34", Name = "EDEN 34", Currency = new Currency { Id = 1} };
Account cashEDE34 = new Account("1051", "CASH_EDE34", 0, "CASH_EDE34", true, OAccountCategories.BalanceSheetAsset, 1);
_accounts.Add(cashEDE34);
_rules.Add(new ContractAccountingRule
{
DebitAccount = _accounts[0],
CreditAccount = cashEDE34,
ProductType = OProductTypes.Loan,
LoanProduct = _loanProductEde34,
ClientType = OClientTypes.Person,
EconomicActivity = new EconomicActivity(1, "Agriculture", null, false),
BookingDirection = OBookingDirections.Both
});
_loanProductEde60 = new LoanProduct { Id = 2, Code = "EDE60", Name = "EDEN 60", Currency = new Currency { Id = 1 } };
Account cashEDE60 = new Account("1052", "CASH_EDE60", 0, "CASH_EDE60", true, OAccountCategories.BalanceSheetAsset, 1);
_accounts.Add(cashEDE60);
_rules.Add(new ContractAccountingRule
{
DebitAccount = _accounts[0],
CreditAccount = cashEDE60,
ProductType = OProductTypes.Loan,
LoanProduct = _loanProductEde60,
ClientType = OClientTypes.Person,
EconomicActivity = new EconomicActivity(1, "Agriculture", null, false),
BookingDirection = OBookingDirections.Credit
});
}
示例7: 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);
}
示例8: CalculateRemainingInterest_AccrualAccounting
public void CalculateRemainingInterest_AccrualAccounting()
{
ApplicationSettings.GetInstance("").UpdateParameter(OGeneralSettings.ACCOUNTINGPROCESS, OAccountingProcesses.Accrual);
LoanProduct package = new LoanProduct
{
InstallmentType = new InstallmentType(1, "Monthly", 0, 1),
LoanType = OLoanTypes.Flat,
ChargeInterestWithinGracePeriod = true,
Currency = new Currency { Id = 1, UseCents = true}
};
Loan myContract = new Loan(package, 1000, 0.03m, 6, 0, new DateTime(2009, 12, 25), new User(), ApplicationSettings.GetInstance(""), NonWorkingDateSingleton.GetInstance(""), ProvisionTable.GetInstance(new User()), ChartOfAccounts.GetInstance(new User()));
myContract.Repay(1, new DateTime(2010, 1, 25), 196.67m, false, true);
Assert.AreEqual(17.42m, Math.Round(myContract.CalculateRemainingInterests(new DateTime(2010, 2, 12)).Value, 2));
ApplicationSettings.GetInstance("").UpdateParameter(OGeneralSettings.ACCOUNTINGPROCESS, OAccountingProcesses.Cash);
}
示例9: DecliningBadLoanWith42dayslateWhenNonRepaymentFeesBaseOnInitialAmountAndKeepNotExpectedInstallment
public void DecliningBadLoanWith42dayslateWhenNonRepaymentFeesBaseOnInitialAmountAndKeepNotExpectedInstallment()
{
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
};
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);
repayStrategy = new CalculateMaximumAmountToRegradingLoanStrategy(cCO, myContract, new User(), ApplicationSettings.GetInstance(""), NonWorkingDateSingleton.GetInstance(""));
//30 + 218.35 + 1000 * 0.003 * 42
Assert.AreEqual(374.35m, repayStrategy.CalculateMaximumAmountToRegradingLoan(new DateTime(2006, 3, 15)).Value);
}
示例10: CalculateRemainingInterest_CashAccounting_AfterFirstInstallment
public void CalculateRemainingInterest_CashAccounting_AfterFirstInstallment()
{
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()));
Assert.AreEqual(30, Math.Round(myContract.CalculateRemainingInterests(new DateTime(2006, 2, 14)).Value, 2));
}
示例11: 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);
}
示例12: TestCountFeesWithSmallPrepayment
public void TestCountFeesWithSmallPrepayment()
{
ApplicationSettings.GetInstance("").UpdateParameter(OGeneralSettings.CALCULATIONLATEFEESDURINGPUBLICHOLIDAYS, true);
ApplicationSettings.GetInstance("").UpdateParameter(OGeneralSettings.ACCOUNTINGPROCESS, OAccountingProcesses.Accrual);
ApplicationSettings.GetInstance("").UpdateParameter(OGeneralSettings.STOP_WRITEOFF_PENALTY, true);
LoanProduct package = new LoanProduct
{
InstallmentType = new InstallmentType(1, "Monthly", 0, 1),
LoanType = OLoanTypes.DecliningFixedInstallments,
ChargeInterestWithinGracePeriod = true,
Currency = new Currency { Id = 1, UseCents = true }
};
Loan myContract = new Loan(package, 1000, 0.03m, 6, 1, new DateTime(2010, 1, 1), new User(), ApplicationSettings.GetInstance(""), NonWorkingDateSingleton.GetInstance(""), ProvisionTable.GetInstance(new User()), ChartOfAccounts.GetInstance(new User()));
myContract.NonRepaymentPenalties.OverDuePrincipal = 0.01;
Assert.AreEqual(new DateTime(2010, 2, 1), myContract.GetInstallment(0).ExpectedDate);
Assert.AreEqual(new DateTime(2010, 3, 1), myContract.GetInstallment(1).ExpectedDate);
myContract.Repay(1, new DateTime(2010, 2, 1), 30, true, false);
myContract.Repay(2, new DateTime(2010, 2, 26), 30, true, false);
RepaymentEvent rPE = myContract.Repay(2, new DateTime(2010, 3, 4), 196.58m, false, false);
Assert.AreEqual(5.63m, rPE.Fees.Value);
Assert.AreEqual(3.2m, rPE.Interests.Value);
Assert.AreEqual(187.75m, rPE.Principal.Value);
Assert.AreEqual(myContract.GetInstallment(1).IsRepaid, true);
}
示例13: TestCalculateTotalInterests
public void TestCalculateTotalInterests()
{
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,6,30), new User(), ApplicationSettings.GetInstance(""), NonWorkingDateSingleton.GetInstance(""), ProvisionTable.GetInstance(new User()), ChartOfAccounts.GetInstance(new User()));
Assert.AreEqual(181m, myContract.CalculateTotalInterests().Value);
}
示例14: TestCalculateRemainingInterestsWithDateTimeParameter
public void TestCalculateRemainingInterestsWithDateTimeParameter()
{
LoanProduct package = new LoanProduct
{
InstallmentType = new InstallmentType(1, "Monthly", 0, 1),
LoanType = OLoanTypes.DecliningFixedInstallments,
ChargeInterestWithinGracePeriod = true,
Currency = new Currency { Id = 1, UseCents = true}
};
Loan myContract = new Loan(package,750,0.03m,9,1,new DateTime(2006,6,22), new User(), ApplicationSettings.GetInstance(""), NonWorkingDateSingleton.GetInstance(""), ProvisionTable.GetInstance(new User()), ChartOfAccounts.GetInstance(new User()));
Assert.AreEqual(46.5m, Math.Round(myContract.CalculateRemainingInterests(new DateTime(2006, 8, 22)).Value, 2));
}
示例15: 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));
}