LedgerSMB Documentation

Description manuals and libraries
LedgerSMB Documentation > Perl Modules > LedgerSMB::Company::Configuration::Currencies
Source

NAME

LedgerSMB::Company::Configuration::Currencies - Collection of currencies

SYNOPSIS

   use LedgerSMB::Database;
   use LedgerSMB::Company;

   my $dbh = LedgerSMB::Database->new( connect_data => { ... })
       ->connect;
   my $c   = LedgerSMB::Company->new(dbh => $dbh)->configuration
       ->currencies;

   # set default currency
   $c->default('USD');

DESCRIPTION

Collection of configured currencies providing access to existing ones as well as providing an API to create (instantiate) new ones.

ATTRIBUTES

CONSTRUCTOR ARGUMENTS

In addition to the attributes from the previous section, the following named arguments can (or even must) be provided to the new constructor.

dbh (required)

The database access handle. This is provided upon instantiation by the LedgerSMB::Company::Configuration collection.

METHODS

create(@args)

Instantiates a new currency, associated with the database that the collection is associated with, passing @args to the constructor.

default([$code])

Returns the code for the default currency when $new_value isn't provided, or when it is, sets it to the value provided.

LICENSE AND COPYRIGHT

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.