internal AccountsChartMasterData(AccountsChart accountsChart, JsonObject fields)
        {
            Assertion.AssertObject(accountsChart, "accountsChart");
            Assertion.AssertObject(fields, "fields");

            this.AccountsChart = accountsChart;

            Load(fields);
        }
示例#2
0
        public Account GetParent()
        {
            if (this.Level == 1)
            {
                return(Account.Empty);
            }

            var accountNumberSeparator = this.AccountsChart.MasterData.AccountNumberSeparator;

            var parentAccountNumber = this.Number.Substring(0, this.Number.LastIndexOf(accountNumberSeparator));

            return(AccountsChart.GetAccount(parentAccountNumber));
        }
示例#3
0
 static public void Preload()
 {
     try {
         EmpiriaLog.Info($"Application preloading starts at {DateTime.Now}.");
         StandardAccount.Preload();
         AccountsChart.Preload();
         SubsidiaryLedger.Preload();
         SubsidiaryAccount.Preload();
         EmpiriaLog.Info($"Application preloading ends at {DateTime.Now}.");
     } catch (Exception e) {
         EmpiriaLog.Error(e);
     }
 }
示例#4
0
        public StandardAccount GetParent()
        {
            if (!this.HasParent)
            {
                return(StandardAccount.Empty);
            }

            var accountNumberSeparator = this.AccountsChart.MasterData.AccountNumberSeparator;

            var parentAccountNumber = this.Number.Substring(0, this.Number.LastIndexOf(accountNumberSeparator));

            var parent = AccountsChart.GetAccount(parentAccountNumber);

            return(StandardAccount.Parse(parent.StandardAccountId));
        }
        internal AccountsChartMasterData(AccountsChart accountsChart)
        {
            Assertion.AssertObject(accountsChart, "accountsChart");

            this.AccountsChart = accountsChart;
        }