public List <EntryFee> GetProductEntryFees(LoanProduct product, IClient client) { if (product.UseEntryFeesCycles) { int loanCycle = _productManager.SelectSuitableEntryFeeCycle(product.Id, client.LoanCycle + 1); return(_productManager.SelectEntryFeesAccordingCycle(product.Id, loanCycle, false)); } else { return(_productManager.SelectEntryFeesWithoutCycles(product.Id, false)); } }
public void UpdateProduct_Values_DontUpdateContracts() { LoanProductManager loanProductManager = (LoanProductManager)container["LoanProductManager"]; LoanProduct loanProduct = loanProductManager.Select(_productWithValues.Id); loanProduct.GracePeriod = 8; loanProduct.AnticipatedTotalRepaymentPenaltiesBase = OAnticipatedRepaymentPenaltiesBases.RemainingInterest; loanProduct.AnticipatedTotalRepaymentPenalties = 33; loanProduct.ChargeInterestWithinGracePeriod = true; loanProduct.NbOfInstallments = 5; loanProduct.NonRepaymentPenalties.InitialAmount = 111; loanProduct.NonRepaymentPenalties.OLB = 222; loanProduct.NonRepaymentPenalties.OverDueInterest = 333; loanProduct.NonRepaymentPenalties.OverDuePrincipal = 444; loanProduct.EntryFees = new List <EntryFee>(); EntryFee fee = new EntryFee(); fee.Value = 2; fee.IsAdded = true; loanProduct.EntryFees.Add(fee); loanProductManager.UpdatePackage(loanProduct, false); loanProductManager.InsertEntryFees(loanProduct.EntryFees, loanProduct.Id); LoanProduct updatedLoanProduct = loanProductManager.Select(loanProduct.Id); updatedLoanProduct.EntryFees = loanProductManager.SelectEntryFeesWithoutCycles(updatedLoanProduct.Id, false); AssertLoanProduct(loanProduct, updatedLoanProduct, false); }