Esempio n. 1
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));
        }
Esempio n. 2
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));
        }