Description | manuals and libraries |
LedgerSMB::Company::Configuration - Entry-point for company configuration
use LedgerSMB::Database;
use LedgerSMB::Company;
my $dbh = LedgerSMB::Database->new(connect_data => { ... })
->connect;
my $c = LedgerSMB::Company->new(dbh => $dbh)->configuration;
# Get the session duration validity
print 'Session time-out after: ' . $c->setting('session_timeout');
# Set the value of a setting
$c->setting('company_name', 'Acme, Inc.');
Access to the various parts of the company configuration, including settings, accounts, account headings, currency setup, standardized industry codes (SIC), etc.
Please note that the only correct procedure to get an instance of this class is through a LedgerSMB::Company instance. That is the only supported entry-point for the Perl API.
This attribute is required and automatically passed into the instance upon instantiation by LedgerSMB::Company
.
Holds a LedgerSMB::Company::Configuration::COANodes instance, representing the configuration of the chart of accounts with its headings.
This attribute cannot be set at object instantiation.
Holds a LedgerSMB::Company::Configuration::Currencies instance, providing access to the currency setup, i.e. available currencies and default currency.
This attribute cannot be set at object instantiation.
Holds a LedgerSMB::Company::Configuration::GIFIs instance, providing access to the GIFI setup in the company.
This attribute cannot be set at object instantiation.
Holds a LedgerSMB::Company::Configuration::SICs instance, providing access to the setup of Standardized Industry Codes (SIC).
This attribute cannot be set at object instantiation.
Configures the company based on the XML content provided in $source
, which can be either a string or a file handle. In case of a string, $source
is interpreted as an XML source document. In case of a file handle, the XML content will be read from the backing file.
The specification of the XML structure (XSD) can be found at doc/company-setup/configuration.xsd
in the LedgerSMB repository.
Returns the value of company setting $name
when $new_value
is not provided, or sets the value when $new_values
is provided.
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.