コード例 #1
0
        public AccountsChartDto GetAccounts(string accountsChartUID)
        {
            Assertion.AssertObject(accountsChartUID, "accountsChartUID");

            var accountsChart = AccountsChart.Parse(accountsChartUID);

            return(AccountsChartMapper.Map(accountsChart));
        }
コード例 #2
0
        public FixedList <StoredBalanceSetDto> BalanceSetsList(string accountsChartUID)
        {
            Assertion.AssertObject(accountsChartUID, "accountsChartUID");

            var accountsChart = AccountsChart.Parse(accountsChartUID);

            FixedList <StoredBalanceSet> list = StoredBalanceSet.GetList(accountsChart);

            return(StoredBalanceSetMapper.Map(list));
        }
コード例 #3
0
        private StoredBalanceSet ParseBalanceSet(string accountsChartUID, string balanceSetUID)
        {
            Assertion.AssertObject(accountsChartUID, "accountsChartUID");
            Assertion.AssertObject(balanceSetUID, "balanceSetUID");

            var accountsChart = AccountsChart.Parse(accountsChartUID);
            var balanceSet    = StoredBalanceSet.Parse(balanceSetUID);

            Assertion.Assert(balanceSet.AccountsChart.Equals(accountsChart),
                             "The requested balance set does not belong to the given accounts chart.");

            return(balanceSet);
        }
コード例 #4
0
        public StoredBalanceSetDto CreateOrGetBalanceSet(string accountsChartUID,
                                                         BalanceStorageCommand command)
        {
            Assertion.AssertObject(accountsChartUID, "accountsChartUID");
            Assertion.AssertObject(command, "command");

            var accountsChart = AccountsChart.Parse(accountsChartUID);

            var storedBalanceSet = StoredBalanceSet.CreateOrGetBalanceSet(accountsChart, command.BalancesDate);

            storedBalanceSet.Save();

            return(StoredBalanceSetMapper.Map(storedBalanceSet));
        }
コード例 #5
0
        public AccountDto GetAccount(string accountsChartUID, string accountUID)
        {
            Assertion.AssertObject(accountsChartUID, "accountsChartUID");
            Assertion.AssertObject(accountUID, "accountUID");

            var accountsChart = AccountsChart.Parse(accountsChartUID);

            Account account = Account.Parse(accountUID);

            Assertion.Assert(account.AccountsChart.Equals(accountsChart),
                             $"The account with uid {account.UID} does not belong " +
                             $"to accounts chart {accountsChart.Name}");

            return(AccountsChartMapper.MapAccount(account));
        }
            internal TrialBalanceCommandData GetTrialBalanceCommandData(TrialBalanceCommandPeriod commandPeriod)
            {
                var commandData = new TrialBalanceCommandData();

                var accountsChart = AccountsChart.Parse(_command.AccountsChartUID);

                StoredBalanceSet balanceSet = StoredBalanceSet.GetBestBalanceSet(
                    accountsChart, commandPeriod.FromDate);

                commandData.StoredInitialBalanceSet = balanceSet;
                commandData.FromDate        = commandPeriod.FromDate;
                commandData.ToDate          = commandPeriod.ToDate;
                commandData.InitialFields   = GetInitialFields();
                commandData.Fields          = GetOutputFields();
                commandData.Filters         = GetFilterString();
                commandData.AccountFilters  = GetAccountFilterString();
                commandData.InitialGrouping = GetInitialGroupingClause();
                commandData.Grouping        = GetGroupingClause();
                commandData.Having          = GetHavingClause();
                commandData.Ordering        = GetOrderClause();
                commandData.AccountsChart   = accountsChart;

                return(commandData);
            }