public static DateTime GetNextMaturity(DateTime pDate, InstallmentType pPeriodicity, int pNumberPeriods)
        {
            for (int i = 0; i < pNumberPeriods; i++)
            {
                pDate = pDate.AddMonths(pPeriodicity.NbOfMonths).AddDays(pPeriodicity.NbOfDays);
            }

            return pDate;
        }
Exemple #2
0
        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;
        }