public void SetUp()
        {
            _rules    = new AccountingRuleCollection();
            _accounts = DefaultAccounts.DefaultAccount(1);

            Account account1 = new Account("1020", "Test1", 0, "Test1", true, OAccountCategories.BalanceSheetAsset, 1);

            _accounts.Add(account1);

            Account account2 = new Account("1052", "Test2", 0, "Test2", true, OAccountCategories.BalanceSheetAsset, 1);

            _accounts.Add(account2);

            Account account3 = new Account("1051", "Test3", 0, "Test3", true, OAccountCategories.BalanceSheetAsset, 1);

            _accounts.Add(account3);

            Account vaultAccount = new Account("1999", "VaultAccount", 0, "VA", true, OAccountCategories.BalanceSheetAsset, 1);

            _accounts.Add(vaultAccount);

            Account tellerAccount1 = new Account("1991", "TellerAccount1", 0, "TA1", true, OAccountCategories.BalanceSheetAsset, 1);

            _accounts.Add(tellerAccount1);

            Account tellerAccount2 = new Account("1992", "TellerAccount2", 0, "TA2", true, OAccountCategories.BalanceSheetAsset, 1);

            _accounts.Add(tellerAccount2);

            _loanProductEde60 = new LoanProduct {
                Id = 2, Code = "EDE60", Name = "EDEN 60", Currency = new Currency {
                    Id = 1
                }
            };
            _loanProductEde34 = new LoanProduct {
                Id = 1, Code = "EDE34", Name = "EDEN 34", Currency = new Currency {
                    Id = 1
                }
            };

            var vault = new Teller
            {
                Id      = 1,
                Name    = "Vault",
                Account = vaultAccount,
                Branch  = new Branch {
                    Id = 1
                },
                Currency = new Currency {
                    Id = 1
                },
                User = new User {
                    Id = 0
                },
                Deleted = false
            };

            _tellers.Add(vault);

            var teller1 = new Teller
            {
                Id      = 2,
                Name    = "Teller1",
                Account = tellerAccount1,
                Branch  = new Branch {
                    Id = 1
                },
                Currency = new Currency {
                    Id = 1
                },
                User = new User {
                    Id = 1
                },
                Deleted = false,
                Vault   = vault
            };

            _tellers.Add(teller1);

            var teller2 = new Teller
            {
                Id      = 3,
                Name    = "Teller2",
                Account = tellerAccount2,
                Branch  = new Branch {
                    Id = 1
                },
                Currency = new Currency {
                    Id = 1
                },
                User = new User {
                    Id = 2
                },
                Deleted = false,
                Vault   = vault
            };

            _tellers.Add(teller2);

            _rules.Add(new ContractAccountingRule
            {
                DebitAccount   = account2,
                CreditAccount  = account3,
                Order          = 1,
                EventType      = new EventType("RGLE"),
                EventAttribute = new EventAttribute("principal", "RGLE"),
                ProductType    = OProductTypes.Loan,
                LoanProduct    = _loanProductEde60,
                ClientType     = OClientTypes.Person,
                //EconomicActivity = new EconomicActivity(1, "Agriculture", null, false),
                BookingDirection = OBookingDirections.Credit,
                Currency         = new Currency {
                    Id = 1
                }
            });

            _rules.Add(new ContractAccountingRule
            {
                DebitAccount     = account1,
                CreditAccount    = account2,
                Order            = 4,
                EventType        = new EventType("RGLE"),
                EventAttribute   = new EventAttribute("principal", "RGLE"),
                ProductType      = OProductTypes.All,
                LoanProduct      = null,
                ClientType       = OClientTypes.Group,
                EconomicActivity = null,
                BookingDirection = OBookingDirections.Credit,
                Currency         = new Currency {
                    Id = 2
                }
            });

            _rules.Add(new ContractAccountingRule
            {
                DebitAccount     = account1,
                CreditAccount    = account2,
                Order            = 9,
                EventType        = new EventType("RGLE"),
                EventAttribute   = new EventAttribute("principal", "RGLE"),
                ProductType      = OProductTypes.All,
                SavingProduct    = null,
                ClientType       = OClientTypes.All,
                EconomicActivity = null,
                BookingDirection = OBookingDirections.Both
            });

            _rules.Add(new ContractAccountingRule
            {
                DebitAccount     = account2,
                CreditAccount    = account1,
                Order            = 3,
                EventType        = new EventType("LODE"),
                EventAttribute   = new EventAttribute("amount", "LODE"),
                ProductType      = OProductTypes.Loan,
                LoanProduct      = null,
                ClientType       = OClientTypes.Person,
                EconomicActivity = new EconomicActivity(1, "Agriculture", null, false),
                BookingDirection = OBookingDirections.Both
            });
        }
示例#2
0
        public void SetUp()
        {
            _rules    = new AccountingRuleCollection();
            _accounts = DefaultAccounts.DefaultAccount(1);

            Account cashSavings = new Account("1020", "CASH_SAVINGS", 0, "CASH_SAVIGNS", true, OAccountCategories.BalanceSheetAsset, 1);

            _accounts.Add(cashSavings);

            _rules.Add(new ContractAccountingRule
            {
                DebitAccount     = _accounts[0],
                CreditAccount    = cashSavings,
                ProductType      = OProductTypes.Saving,
                SavingProduct    = null,
                ClientType       = OClientTypes.All,
                EconomicActivity = null,
                BookingDirection = OBookingDirections.Both
            });

            _loanProductEde34 = new LoanProduct {
                Id = 1, Code = "EDE34", Name = "EDEN 34", Currency = new Currency {
                    Id = 1
                }
            };

            Account cashEDE34 = new Account("1051", "CASH_EDE34", 0, "CASH_EDE34", true, OAccountCategories.BalanceSheetAsset, 1);

            _accounts.Add(cashEDE34);

            _rules.Add(new ContractAccountingRule
            {
                DebitAccount     = _accounts[0],
                CreditAccount    = cashEDE34,
                ProductType      = OProductTypes.Loan,
                LoanProduct      = _loanProductEde34,
                ClientType       = OClientTypes.Person,
                EconomicActivity = new EconomicActivity(1, "Agriculture", null, false),
                BookingDirection = OBookingDirections.Both
            });

            _loanProductEde60 = new LoanProduct {
                Id = 2, Code = "EDE60", Name = "EDEN 60", Currency = new Currency {
                    Id = 1
                }
            };

            Account cashEDE60 = new Account("1052", "CASH_EDE60", 0, "CASH_EDE60", true, OAccountCategories.BalanceSheetAsset, 1);

            _accounts.Add(cashEDE60);

            _rules.Add(new ContractAccountingRule
            {
                DebitAccount     = _accounts[0],
                CreditAccount    = cashEDE60,
                ProductType      = OProductTypes.Loan,
                LoanProduct      = _loanProductEde60,
                ClientType       = OClientTypes.Person,
                EconomicActivity = new EconomicActivity(1, "Agriculture", null, false),
                BookingDirection = OBookingDirections.Credit
            });
        }
示例#3
0
 public override string ToString()
 {
     return($"DefaultName: {DefaultName}, DefaultAccounts: {DefaultAccounts.ToElementsString()}, DefaultDuration: {DefaultDuration}");
 }