public AccountingTransactionManager(User pUser)
     : base(pUser)
 {
     _accountManagement = new AccountManager(pUser);
     _currencyManager = new CurrencyManager(pUser);
     _branchManager = new BranchManager(pUser);
 }
 public TellerManager()
 {
     accountManager = new AccountManager();
     branchManager = new BranchManager();
     userManager = new UserManager();
     currencyManager = new CurrencyManager();
 }
 public AccountingTransactionManager(string testDb)
     : base(testDb)
 {
     _accountManagement = new AccountManager(testDb);
     _currencyManager = new CurrencyManager(testDb);
     _branchManager = new BranchManager(testDb);
 }
 public StandardBookingManager(User pUser)
     : base(pUser)
 {
     _user = pUser;
     AccountManager _accountManagement =  new AccountManager(pUser);
     _chartOfAccounts = new ChartOfAccounts();
     _chartOfAccounts.Accounts = _accountManagement.SelectAllAccounts();
 }
Exemple #5
0
 public TellerManager(string pTestDb)
     : base(pTestDb)
 {
     accountManager = new AccountManager(pTestDb);
     branchManager = new BranchManager(pTestDb);
     userManager = new UserManager(pTestDb);
     currencyManager = new CurrencyManager(pTestDb);
 }
Exemple #6
0
 public TellerManager(User user)
     : base(user)
 {
     accountManager = new AccountManager(user);
     branchManager = new BranchManager(user);
     userManager = new UserManager(user);
     currencyManager = new CurrencyManager(user);
 }
 public ChartOfAccountsServices(string testDB)
 {
     _accountManagement = new AccountManager(testDB);
     _provisionningRuleManager = new ProvisioningRuleManager(testDB);
     _tellerManager = new TellerManager(testDB);
     _loanScaleManager = new LoanScaleManager(testDB);
     _currencyManager = new CurrencyManager(testDB);
     ConnectionManager.GetInstance(testDB);
 }
 public ChartOfAccountsServices(User pUser)
 {
     _user = pUser;
     _accountManagement = new AccountManager(pUser);
     _tellerManager = new TellerManager(pUser);
     _provisionningRuleManager = new ProvisioningRuleManager(pUser);
     _loanScaleManager = new LoanScaleManager(pUser);
     _currencyManager = new CurrencyManager(pUser);
 }
 public AccountingRuleManager(string pTestDB)
     : base(pTestDB)
 {
     _accountManager = new AccountManager(pTestDB);
     _loanProductManager = new LoanProductManager(pTestDB);
     _savingProductManager = new SavingProductManager(pTestDB);
     _economicActivityManager = new EconomicActivityManager(pTestDB);
     _fundingLineManager = new FundingLineManager(pTestDB);
     _currencyManager = new CurrencyManager(pTestDB);
 }
 public AccountingRuleManager(User pUser)
     : base(pUser)
 {
     _accountManager = new AccountManager(pUser);
     _loanProductManager = new LoanProductManager(pUser);
     _savingProductManager = new SavingProductManager(pUser);
     _economicActivityManager = new EconomicActivityManager(pUser);
     _fundingLineManager = new FundingLineManager(pUser);
     _currencyManager = new CurrencyManager(pUser);
     _paymentMethodManager = new PaymentMethodManager(pUser);
 }
Exemple #11
0
        public void InitManager()
        {
            TechnicalSettings.CheckSettings();

            LoanProductManager loanProductManager = new LoanProductManager(DataUtil.TESTDB);
            AccountingTransactionManager accountingTransactionManager = new AccountingTransactionManager(DataUtil.TESTDB);
            EventManager eventManager = new EventManager(DataUtil.TESTDB);
            ExchangeRateManager exchangeRateManager = new ExchangeRateManager(DataUtil.TESTDB);
            ProvisioningRuleManager provisioningRuleManager = new ProvisioningRuleManager(DataUtil.TESTDB);
            AccountManager accountManager = new AccountManager(DataUtil.TESTDB);
            InstallmentTypeManager installmentTypeManager = new InstallmentTypeManager(DataUtil.TESTDB);
            UserManager userManager = new UserManager(DataUtil.TESTDB);
            EconomicActivityManager economicActivityManager = new EconomicActivityManager(DataUtil.TESTDB);
            InstallmentManager installmentManager = new InstallmentManager(DataUtil.TESTDB);
            FundingLineManager fundingLineManager = new FundingLineManager(DataUtil.TESTDB);
            ClientManager clientManager = new ClientManager(DataUtil.TESTDB);
            LocationsManager locationsManager = new LocationsManager(DataUtil.TESTDB);
            LoanManager loanManager = new LoanManager(DataUtil.TESTDB);
            ProjectManager projectManager = new ProjectManager(DataUtil.TESTDB);
            MFIManager mfiManager = new MFIManager(DataUtil.TESTDB);
            SavingManager savingManager = new SavingManager(DataUtil.TESTDB);
            SavingProductManager savingProductManager = new SavingProductManager(DataUtil.TESTDB);
            SavingEventManager savingEventManager = new SavingEventManager(DataUtil.TESTDB);
            CurrencyManager currencyManager = new CurrencyManager(DataUtil.TESTDB);
            AccountingRuleManager accountingRuleManager = new AccountingRuleManager(DataUtil.TESTDB);
            FundingLineServices fundingLineServices = new FundingLineServices(DataUtil.TESTDB);

            container = new Hashtable
                            {
                                {"LoanProductManager", loanProductManager},
                                {"AccountingTransactionManager", accountingTransactionManager},
                                {"EventManager", eventManager},
                                {"ExchangeRateManager", exchangeRateManager},
                                {"ProvisioningRuleManager", provisioningRuleManager},
                                {"AccountManager", accountManager},
                                {"InstallmentTypeManager", installmentTypeManager},
                                {"UserManager", userManager},
                                {"FundingLineManager", fundingLineManager},
                                {"LoanManager", loanManager},
                                {"ClientManager", clientManager},
                                {"LocationsManager", locationsManager},
                                {"ProjectManager", projectManager},
                                {"EconomicActivityManager", economicActivityManager},
                                {"InstallmentManager", installmentManager},
                                {"MFIManager", mfiManager},
                                {"SavingManager", savingManager},
                                {"SavingProductManager", savingProductManager},
                                {"SavingEventManager", savingEventManager},
                                {"CurrencyManager", currencyManager},
                                {"FundingLineServices", fundingLineServices},
                                {"AccountingRuleManager", accountingRuleManager}
                            };
        }
 public EventProcessorServices(EventManager eventManagement,AccountingTransactionManager movementSetManagement,LoanManager loanManager,
     AccountManager accountManagement)
 {
     _eventManagement = eventManagement;
     _movementSetManagement = movementSetManagement;
     _loanManager = loanManager;
     _InitializeEventProcessor();
 }
 public EventProcessorServices(SavingEventManager savingEventManagement, AccountingTransactionManager movementSetManagement, AccountManager accountManager)
 {
     _savingEventManagement = savingEventManagement;
     _movementSetManagement = movementSetManagement;
     _InitializeEventProcessor();
 }
 public StandardBookingServices(AccountManager accountManagement)
 {
 }
        protected override void SetUp()
        {
            base.SetUp();

            _accountingRuleManager = (AccountingRuleManager)container["AccountingRuleManager"];
            _accountManager = (AccountManager)container["AccountManager"];
            _loanProductManager = (LoanProductManager)container["LoanProductManager"];
            _savingProductManager = (SavingProductManager)container["SavingProductManager"];
            _economicActivityManager = (EconomicActivityManager)container["EconomicActivityManager"];
            _fundingLineManager = (FundingLineManager)container["FundingLineManager"];
            _eventManager = (EventManager)container["EventManager"];

            Assert.IsNotNull(_accountingRuleManager);
            Assert.IsNotNull(_accountManager);
            Assert.IsNotNull(_loanProductManager);
            Assert.IsNotNull(_savingProductManager);
            Assert.IsNotNull(_economicActivityManager);
            Assert.IsNotNull(_fundingLineManager);
            Assert.IsNotNull(_eventManager);
        }
 public ChartOfAccountsServices(AccountManager pAccountManager)
 {
     _accountManagement = pAccountManager;
 }
        public void RepayWrittenOffLoan()
        {
            ApplicationSettings.GetInstance("").UpdateParameter(OGeneralSettings.ALLOWSMULTIPLELOANS, false);
            ApplicationSettings.GetInstance("").UpdateParameter(OGeneralSettings.INCREMENTALDURINGDAYOFF, false);
            ApplicationSettings.GetInstance("").UpdateParameter(OGeneralSettings.ACCOUNTINGPROCESS, OAccountingProcesses.Cash);
            ApplicationSettings.GetInstance("").UpdateParameter(OGeneralSettings.CALCULATIONLATEFEESDURINGPUBLICHOLIDAYS, 0);
            ApplicationSettings.GetInstance("").UpdateParameter(OGeneralSettings.INTERESTS_ALSO_CREDITED_IN_FL, 1);
            ApplicationSettings.GetInstance("").UpdateParameter(OGeneralSettings.DONOTSKIPWEEKENDSININSTALLMENTSDATE, 0);
            ApplicationSettings.GetInstance("").UpdateParameter(OGeneralSettings.BAD_LOAN_DAYS, "180");

            ProvisionTable _provisionningTable = ProvisionTable.GetInstance(new User() {Id = 1});
            _provisionningTable.ProvisioningRates = new List<ProvisioningRate>();
            _provisionningTable.Add(new ProvisioningRate { Number = 1, NbOfDaysMin = 0, NbOfDaysMax = 0, ProvisioningValue = 0.02, ProvisioningInterest = 0.02, ProvisioningPenalty = 0.02 });
            _provisionningTable.Add(new ProvisioningRate { Number = 2, NbOfDaysMin = 1, NbOfDaysMax = 30, ProvisioningValue = 0.1, ProvisioningInterest = 0.01, ProvisioningPenalty = 0.01 });
            _provisionningTable.Add(new ProvisioningRate { Number = 3, NbOfDaysMin = 31, NbOfDaysMax = 60, ProvisioningValue = 0.25, ProvisioningInterest = 0.025, ProvisioningPenalty = 0.025 });
            _provisionningTable.Add(new ProvisioningRate { Number = 4, NbOfDaysMin = 61, NbOfDaysMax = 90, ProvisioningValue = 0.5, ProvisioningInterest = 0.5, ProvisioningPenalty = 0.5 });
            _provisionningTable.Add(new ProvisioningRate { Number = 5, NbOfDaysMin = 91, NbOfDaysMax = 180, ProvisioningValue = 0.75, ProvisioningInterest = 0.75, ProvisioningPenalty = 0.75 });
            _provisionningTable.Add(new ProvisioningRate { Number = 6, NbOfDaysMin = 181, NbOfDaysMax = 365, ProvisioningValue = 1, ProvisioningInterest = 1, ProvisioningPenalty = 1 });
            _provisionningTable.Add(new ProvisioningRate { Number = 7, NbOfDaysMin = 366, NbOfDaysMax = 99999, ProvisioningValue = 1, ProvisioningInterest = 1, ProvisioningPenalty = 1 });

            Teller.CurrentTeller = null;

            //DynamicMock mockClientManager = new DynamicMock(typeof(ClientManager));
            //DynamicMock mockLoanManager = new DynamicMock(typeof(LoanManager));

            //Loan loan = new Loan
            //{
            //    Amount = 11,
            //    Code = "Test",
            //    InterestRate = 1,
            //    NbOfInstallments = 2,
            //    InstallmentType = new InstallmentType(),
            //    AnticipatedTotalRepaymentPenalties = 2,
            //    NonRepaymentPenalties = new NonRepaymentPenalties(1, 1, 1, 1),
            //    GracePeriod = 2,
            //    Events = new EventStock(),
            //    StartDate = new DateTime(2009, 1, 1),
            //    FundingLine = new FundingLine { Currency = new Currency { Id = 1, Code = "Code", Name = "Name" } },
            //    LoanOfficer = new User(),
            //    Product = new LoanProduct { Currency = new Currency { Id = 1, Code = "Code", Name = "Name" } },
            //    InstallmentList = new List<Installment> { _installment1, _installment2 }
            //};

            //Person person = new Person { Active = false, LoanCycle = 1 };
            //IClient group = new Group { Active = false, LoanCycle = 1, Members = new List<Member> { new Member { Tiers = person } } };

            //mockClientManager.Expect("UpdateClientStatus", group, null);
            //mockClientManager.Expect("UpdateClientLoanCycle", group, null);

            //mockClientManager.Expect("UpdateClientStatus", person, null);
            //mockClientManager.Expect("UpdateClientLoanCycle", person, null);

            //LoanServices loanServices = new LoanServices(null, (ClientManager)mockClientManager.MockInstance, (LoanManager)mockLoanManager.MockInstance);
            //loanServices.SaveLoan(ref loan, 1, ref group);

            //loanServices.Disburse(loan, new DateTime(2008, 1, 1), true, true);
            //loanServices.Repay(loan, group, 1, DateTime.Now, 1, true, 0, 0, false, 0, true);

            //Loan disbursedLoan = loan;
            //disbursedLoan.Disbursed = true;
            //LoanDisbursmentEvent loanDisbursmentEvent = new LoanDisbursmentEvent
            //                                                {
            //                                                    Date = new DateTime(2008, 1, 1),
            //                                                    Amount = disbursedLoan.Amount,
            //                                                    Commission = disbursedLoan.CalculateEntryFeesAmount(),
            //                                                    ClientType = disbursedLoan.ClientType
            //                                                };
            //disbursedLoan.Events.Add(loanDisbursmentEvent);
            //loanServices.Repay(disbursedLoan, group, 1, DateTime.Now, 1, true, 0,0, false, 1, true);
            AddDataForTestingTransaction dataHelper = new AddDataForTestingTransaction();
            int _creditId = dataHelper.AddGenericCreditContractIntoDatabase();

            IClient _client = new Group {Id = 5};
            LoanManager _loanManager = new LoanManager(new User() {Id = 1});
            Loan _loan = _loanManager.SelectLoan(_creditId, true, true, true);

            _loan.CreditCommiteeDate = _loan.StartDate;

            AccountManager accountManager = new AccountManager(new User() {Id = 1});
            //accountManager.AddForCurrency(_loan.Product.Currency.Id);

            FundingLine f = _loan.FundingLine;
            f.Currency.Id = _loan.Product.Currency.Id;
            FundingLineServices fundingLineServices = new FundingLineServices(new User() {Id = 1});

            var ev = new FundingLineEvent
            {
                Code = "KAO",
                Type = OFundingLineEventTypes.Entry,
                CreationDate = new DateTime(2008,1,1),
                EndDate = DateTime.Now.AddDays(1),
                Amount = 1000,
                FundingLine = f,
                Movement = OBookingDirections.Credit,
                IsDeleted = false
            };
            fundingLineServices.AddFundingLineEvent(ev, null);
            f.AddEvent(ev);
            _loan.LoanEntryFeesList=new List<LoanEntryFee>();

            EntryFee productEntryFee = new EntryFee();
            productEntryFee.Value = 1;
            productEntryFee.IsRate = false;
            productEntryFee.Id = 21;
            LoanEntryFee loanEntryFee = new LoanEntryFee();
            loanEntryFee.FeeValue = 1;
            loanEntryFee.ProductEntryFee = productEntryFee;
            loanEntryFee.ProductEntryFeeId = 21;

            LoanServices loanServices = new LoanServices(new User() { Id = 1 });

            PaymentMethod method = new PaymentMethod(1, "Savings", "Savings method", false);
            loanServices.Disburse(_loan, new DateTime(2008, 1, 1), true, false, method);

            ////_loan.WrittenOff = true;
            ////_loan = loanServices.Repay(_loan, _client, 1, DateTime.Now, 10, true, 0, 0,false, 1, true);
            //Assert.AreEqual(_loan.Disbursed, true);
            //_loan.WrittenOff = true;
            //OCurrency prevAmount = _loan.ChartOfAccounts.GetAccountByNumber(OAccounts.RECOVERY_OF_CHARGED_OFF_ASSETS, _loan.Product.Currency.Id).Balance;
            //_loan = loanServices.Repay(_loan, _client, 1, DateTime.Now, 100, true, 0, 0, false, 5, false, OPaymentMethods.Cash, null, false);

            //Assert.AreEqual(_loan.Events.GetNumberOfEvents, 1);
            //_loan.Events.SortEventsByDate();
            //Assert.AreEqual(_loan.Events.GetEvent(0).Code, "ROWO");

            //_loan = loanServices.Repay(_loan, _client, 2, DateTime.Now, 100, true, 0, 0, false, 5, false, OPaymentMethods.Cash, null, false);

            //Assert.AreEqual(_loan.Events.GetNumberOfEvents, 2);

            //_loan.Events.SortEventsByDate();
            //Assert.AreEqual(_loan.Events.GetEvent(0).Code, "ROWO");
        }
 public PaymentMethodManager(User user)
     : base(user)
 {
     _branchManager = new BranchManager(user);
     _accountManager = new AccountManager(user);
 }
 public PaymentMethodManager(string testDb)
     : base(testDb)
 {
     _branchManager = new BranchManager(testDb);
     _accountManager = new AccountManager(testDb);
 }
Exemple #20
0
        public FundingLine AddGenericFundingLineWithThreeEvents(DateTime startDate)
        {
            ChartOfAccounts _chartOfAccounts = ChartOfAccounts.GetInstance(new User { Id = 5 });
             AccountManager accountManager = new AccountManager(new User { Id = 5 });
             _chartOfAccounts.Accounts = accountManager.SelectAllAccounts();

             FundingLineServices service = new FundingLineServices(new User{Id = 5});
             int newFL_ID = AddGenericFundingLine4();
             FundingLine fundingLineInitial = service.SelectFundingLineById(newFL_ID, true);

             FundingLineEvent ev0 = new FundingLineEvent();
             ev0.Code = "6012";
             ev0.CreationDate = startDate.AddDays(-2);
             ev0.Amount = 1000;
             ev0.Movement = OBookingDirections.Credit;
             ev0.Type = OFundingLineEventTypes.Entry;
             ev0.FundingLine = fundingLineInitial;
             ev0.IsDeleted = false;

             fundingLineInitial.AddEvent( service.AddFundingLineEvent(ev0));

             FundingLineEvent ev1 = new FundingLineEvent();
             ev1.Code = "6013";
             ev1.CreationDate = startDate.AddDays(-1);
             ev1.Amount = 500;
             ev1.Movement = OBookingDirections.Debit;
             ev1.Type = OFundingLineEventTypes.Disbursment;
             ev1.FundingLine = fundingLineInitial;
             ev1.IsDeleted = false;
             fundingLineInitial.AddEvent(service.AddFundingLineEvent(ev1));

             FundingLineEvent ev2 = new FundingLineEvent();
             ev2.Code = "6014";
             ev2.CreationDate = startDate;
             ev2.Amount = 100;
             ev2.Movement = OBookingDirections.Credit;
             ev2.Type = OFundingLineEventTypes.Repay;
             ev2.FundingLine = fundingLineInitial;
             ev2.IsDeleted = false;

             fundingLineInitial.AddEvent(service.AddFundingLineEvent(ev2));

             return fundingLineInitial;
        }