public StandardBookingManager(User pUser)
     : base(pUser)
 {
     _user = pUser;
     AccountManager _accountManagement =  new AccountManager(pUser);
     _chartOfAccounts = new ChartOfAccounts();
     _chartOfAccounts.Accounts = _accountManagement.SelectAllAccounts();
 }
Beispiel #2
0
        protected ContractChartOfAccounts FillChartOfAccounts(ChartOfAccounts pChartOfAccounts)
        {
            ContractChartOfAccounts contractChartOfAccounts;
            if (pChartOfAccounts.UniqueAccounts.Count > 0)
                contractChartOfAccounts = new ContractChartOfAccounts(pChartOfAccounts.UniqueAccounts.
                    Select(item => new Account(item.Number, item.Label, 0, item.TypeCode, item.DebitPlus, item.AccountCategory, Product != null && Product.Currency != null ? Product.Currency.Id : 1)).ToList());
            else
                contractChartOfAccounts = new ContractChartOfAccounts(pChartOfAccounts.DefaultAccounts.ToList());

            contractChartOfAccounts.AccountingRuleCollection = pChartOfAccounts.AccountingRuleCollection;

            return contractChartOfAccounts;
        }
Beispiel #3
0
        public Loan(LoanProduct pAckage, OCurrency pAmount, decimal 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);
            CalculateStartDates();
        }
Beispiel #4
0
        /// <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();
        }
Beispiel #5
0
 public void TestFixtureSetUp()
 {
     mockContractManagement = new DynamicMock(typeof(LoanManager));
     chartOfAccounts = ChartOfAccounts.GetInstance(new User{Id = 5});
 }
Beispiel #6
0
 public void TestFixtureSetUp()
 {
     chartOfAccounts = ChartOfAccounts.GetInstance(new User());
 }