public Loan(LoanProduct pAckage, OCurrency pAmount, double pInterestRate, int pNbOfInstallments, int pGracePeriod, DateTime pStartDate, DayOfWeek? meetingDay, User pUser, ApplicationSettings pGeneralSettings, NonWorkingDateSingleton pNwds, ProvisionTable pPt, ChartOfAccounts pChartOfAccounts) { _user = pUser; _generalSettings = pGeneralSettings; _nwdS = pNwds; Product = pAckage; NonRepaymentPenalties = new NonRepaymentPenalties(); _events = new EventStock(); _guarantors = new List<Guarantor>(); _collaterals = new List<ContractCollateral>(); _installmentType = pAckage.InstallmentType; _amount = pAmount; _interestRate = pInterestRate; _nbOfInstallments = pNbOfInstallments; GracePeriod = pGracePeriod; CreationDate = pStartDate; _startDate = pStartDate; _firstInstallmentDate = CalculateInstallmentDate(pStartDate, 1); if (meetingDay.HasValue) _firstInstallmentDate = GetMeetingDate(_firstInstallmentDate, meetingDay); _alignAlignDisbursementDate = CalculateAlignDisbursementDate(_firstInstallmentDate); //with this constructor, installment are directly calculated when a new CreditContract is instanciated _installmentList = CalculateInstallments(true); EntryFeesPercentage = pAckage.EntryFeesPercentage; }
/// <summary> /// Instancy a new CreditContract. Use it if installments need'nt calculate /// </summary> /// <param name="pUser"></param> /// <param name="pGeneralSettings"></param> /// <param name="pNwds"></param> /// <param name="pPt"></param> /// <param name="pChartOfAccounts"></param> public Loan(User pUser, ApplicationSettings pGeneralSettings, NonWorkingDateSingleton pNwds, ProvisionTable pPt, ChartOfAccounts pChartOfAccounts) { _user = pUser; _generalSettings = pGeneralSettings; _nwdS = pNwds; NonRepaymentPenalties = new NonRepaymentPenalties(); _installmentList = new List<Installment>(); _guarantors = new List<Guarantor>(); _collaterals = new List<ContractCollateral>(); _events = new EventStock(); EntryFeesPercentage = true; }