1 package SL::InstanceConfiguration;
10 return bless {}, $class;
16 $self->{data} = selectfirst_hashref_query($::form, $::form->get_standard_dbh, qq|SELECT * FROM defaults|);
18 my $curr = $self->{data}->{curr} || '';
20 $self->{currencies} = [ split m/:/, $curr ];
25 sub get_default_currency {
28 return ($self->get_currencies)[0];
34 return $self->{currencies} ? @{ $self->{currencies} } : ();
37 sub get_accounting_method {
39 return $self->{data}->{accounting_method};
42 sub get_inventory_system {
44 return $self->{data}->{inventory_system};
47 sub get_profit_determination {
49 return $self->{data}->{profit_determination};
52 sub get_show_bestbefore {
54 return $self->{data}->{show_bestbefore};
67 SL::InstanceConfiguration - Provide instance-specific configuration data
71 Lx-Office has two configuration levels: installation specific
72 (provided by the global variable C<%::lx_office_conf>) and instance
73 specific. The latter is provided by a global instance of this class,
82 Creates a new instance. Does not read the configuration.
86 Reads the configuration from the database. Returns C<$self>.
88 =item C<get_currencies>
90 Returns an array of configured currencies.
92 =item C<get_default_currency>
94 Returns the default currency or undef if no currency has been
97 =item C<get_accounting_method>
99 Returns the default accounting method, accrual or cash
101 =item C<get_inventory_system>
103 Returns the default inventory system, perpetual or periodic
105 =item C<get_profit_determination>
107 Returns the default profit determination method, balance or income
109 =item C<get_show_bestbefore>
111 Returns the default behavior for showing best before date, true or false
117 Updates to the I<defaults> table require that the instance
118 configuration is re-read. This has not been implemented yet.
122 Moritz Bunkus E<lt>m.bunkus@linet-services.deE<gt>