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_datev_check_on_sales_invoice {
54 return $self->{data}->{datev_check_on_sales_invoice};
57 sub get_datev_check_on_purchase_invoice {
59 return $self->{data}->{datev_check_on_purchase_invoice};
62 sub get_datev_check_on_ar_transaction {
64 return $self->{data}->{datev_check_on_ar_transaction};
67 sub get_datev_check_on_ap_transaction {
69 return $self->{data}->{datev_check_on_ap_transaction};
72 sub get_datev_check_on_gl_transaction {
74 return $self->{data}->{datev_check_on_gl_transaction};
77 sub get_show_bestbefore {
79 return $self->{data}->{show_bestbefore};
92 SL::InstanceConfiguration - Provide instance-specific configuration data
96 Lx-Office has two configuration levels: installation specific
97 (provided by the global variable C<%::lx_office_conf>) and instance
98 specific. The latter is provided by a global instance of this class,
107 Creates a new instance. Does not read the configuration.
111 Reads the configuration from the database. Returns C<$self>.
113 =item C<get_currencies>
115 Returns an array of configured currencies.
117 =item C<get_default_currency>
119 Returns the default currency or undef if no currency has been
122 =item C<get_accounting_method>
124 Returns the default accounting method, accrual or cash
126 =item C<get_inventory_system>
128 Returns the default inventory system, perpetual or periodic
130 =item C<get_profit_determination>
132 Returns the default profit determination method, balance or income
134 =item C<get_datev_check_on_sales_invoice>
136 Returns true if datev check should be performed on sales invoices
138 =item C<get_datev_check_on_purchase_invoice>
140 Returns true if datev check should be performed on purchase invoices
142 =item C<get_datev_check_on_ar_transaction>
144 Returns true if datev check should be performed on ar transactions
146 =item C<get_datev_check_on_ap_transaction>
148 Returns true if datev check should be performed on ap transactions
150 =item C<get_datev_check_on_gl_transaction>
152 Returns true if datev check should be performed on gl transactions
154 =item C<get_show_bestbefore>
156 Returns the default behavior for showing best before date, true or false
162 Updates to the I<defaults> table require that the instance
163 configuration is re-read. This has not been implemented yet.
167 Moritz Bunkus E<lt>m.bunkus@linet-services.deE<gt>