Description | manuals and libraries |
LedgerSMB::Company::Configuration::COANodes - Collection of CoA nodes
use LedgerSMB::Database;
use LedgerSMB::Company;
my $dbh = LedgerSMB::Database->new( connect_data => { ... })
->connect;
my $c = LedgerSMB::Company->new(dbh => $dbh)->configuration->coa_nodes;
# look up a heading or account
my $node = $c->get(by => (accno => 'H-1500'));
# create a new node (account)
my $new = $c->create(type => 'account',
accno => '1501',
description => 'Account 1501',
heading_id => $node->id);
Collection of Chart of Accounts nodes (accounts and headings) providing access to existing nodes as well as providing an API to create (instantiate) new ones.
In addition to the attributes from the previous section, the following named arguments can (or even must) be provided to the new
constructor.
The database access handle. This is provided upon instantiation by the LedgerSMB::Company::Configuration::COANodes
collection.
Instantiates a new CoA node of type type
, associated with the database that the collection is associated with.
type
can be either account
or heading
.
@args
are passed to the constructor of the indicated type, LedgerSMB::Company::Configuration::Account
for type account
and LedgerSMB::Company::Configuration::Heading
for type heading
.
Copyright (C) 2020 The LedgerSMB Core Team
This file is licensed under the GNU General Public License version 2, or at your option any later version. A copy of the license should have been included with your software.