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};
 
  62 SL::InstanceConfiguration - Provide instance-specific configuration data
 
  66 Lx-Office has two configuration levels: installation specific
 
  67 (provided by the global variable C<%::lxoffice_conf>) and instance
 
  68 specific. The latter is provided by a global instance of this class,
 
  77 Creates a new instance. Does not read the configuration.
 
  81 Reads the configuration from the database. Returns C<$self>.
 
  83 =item C<get_currencies>
 
  85 Returns an array of configured currencies.
 
  87 =item C<get_default_currency>
 
  89 Returns the default currency or undef if no currency has been
 
  92 =item C<get_accounting_method>
 
  94 Returns the default accounting method, accrual or cash
 
  96 =item C<get_inventory_system>
 
  98 Returns the default inventory system, perpetual or periodic
 
 100 =item C<get_profit_determination>
 
 102 Returns the default profit determination method, balance or income
 
 108 Updates to the I<defaults> table require that the instance
 
 109 configuration is re-read. This has not been implemented yet.
 
 113 Moritz Bunkus E<lt>m.bunkus@linet-services.deE<gt>