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_is_changeable {
 
  54   return $self->{data}->{is_changeable};
 
  57 sub get_ir_changeable {
 
  59   return $self->{data}->{ir_changeable};
 
  62 sub get_ar_changeable {
 
  64   return $self->{data}->{ar_changeable};
 
  67 sub get_ap_changeable {
 
  69   return $self->{data}->{ap_changeable};
 
  72 sub get_gl_changeable {
 
  74   return $self->{data}->{gl_changeable};
 
  77 sub get_datev_check_on_sales_invoice {
 
  79   return $self->{data}->{datev_check_on_sales_invoice};
 
  82 sub get_datev_check_on_purchase_invoice {
 
  84   return $self->{data}->{datev_check_on_purchase_invoice};
 
  87 sub get_datev_check_on_ar_transaction {
 
  89   return $self->{data}->{datev_check_on_ar_transaction};
 
  92 sub get_datev_check_on_ap_transaction {
 
  94   return $self->{data}->{datev_check_on_ap_transaction};
 
  97 sub get_datev_check_on_gl_transaction {
 
  99   return $self->{data}->{datev_check_on_gl_transaction};
 
 102 sub get_show_bestbefore {
 
 104   return $self->{data}->{show_bestbefore};
 
 107 sub get_is_show_mark_as_paid {
 
 109   return $self->{data}->{is_show_mark_as_paid};
 
 112 sub get_ir_show_mark_as_paid {
 
 114   return $self->{data}->{ir_show_mark_as_paid};
 
 117 sub get_ar_show_mark_as_paid {
 
 119   return $self->{data}->{ar_show_mark_as_paid};
 
 122 sub get_ap_show_mark_as_paid {
 
 124   return $self->{data}->{ap_show_mark_as_paid};
 
 127 sub get_sales_order_show_delete {
 
 129   return $self->{data}->{sales_order_show_delete};
 
 132 sub get_purchase_order_show_delete {
 
 134   return $self->{data}->{purchase_order_show_delete};
 
 137 sub get_sales_delivery_order_show_delete {
 
 139   return $self->{data}->{sales_delivery_order_show_delete};
 
 142 sub get_purchase_delivery_order_show_delete {
 
 144   return $self->{data}->{purchase_delivery_order_show_delete};
 
 157 SL::InstanceConfiguration - Provide instance-specific configuration data
 
 161 kivitendo has two configuration levels: installation specific
 
 162 (provided by the global variable C<%::lx_office_conf>) and instance
 
 163 specific. The latter is provided by a global instance of this class,
 
 172 Creates a new instance. Does not read the configuration.
 
 176 Reads the configuration from the database. Returns C<$self>.
 
 178 =item C<get_currencies>
 
 180 Returns an array of configured currencies.
 
 182 =item C<get_default_currency>
 
 184 Returns the default currency or undef if no currency has been
 
 187 =item C<get_accounting_method>
 
 189 Returns the default accounting method, accrual or cash
 
 191 =item C<get_inventory_system>
 
 193 Returns the default inventory system, perpetual or periodic
 
 195 =item C<get_profit_determination>
 
 197 Returns the default profit determination method, balance or income
 
 200 =item C<get_is_changeable>
 
 202 =item C<get_ir_changeable>
 
 204 =item C<get_ar_changeable>
 
 206 =item C<get_ap_changeable>
 
 208 =item C<get_gl_changeable>
 
 210 Returns if and when these record types are changeable or deleteable after
 
 211 posting. 0 means never, 1 means always and 2 means on the same day.
 
 213 =item C<get_datev_check_on_sales_invoice>
 
 215 Returns true if datev check should be performed on sales invoices
 
 217 =item C<get_datev_check_on_purchase_invoice>
 
 219 Returns true if datev check should be performed on purchase invoices
 
 221 =item C<get_datev_check_on_ar_transaction>
 
 223 Returns true if datev check should be performed on ar transactions
 
 225 =item C<get_datev_check_on_ap_transaction>
 
 227 Returns true if datev check should be performed on ap transactions
 
 229 =item C<get_datev_check_on_gl_transaction>
 
 231 Returns true if datev check should be performed on gl transactions
 
 233 =item C<get_show_bestbefore>
 
 235 Returns the default behavior for showing best before date, true or false
 
 237 =item C<get_is_show_mark_as_paid>
 
 239 =item C<get_ir_show_mark_as_paid>
 
 241 =item C<get_ar_show_mark_as_paid>
 
 243 =item C<get_ap_show_mark_as_paid>
 
 245 Returns the default behavior for showing the mark as paid button for the
 
 246 corresponding record type (true or false).
 
 248 =item C<get_sales_order_show_delete>
 
 250 =item C<get_purchase_order_show_delete>
 
 252 =item C<get_sales_delivery_order_show_delete>
 
 254 =item C<get_purchase_delivery_order_show_delete>
 
 256 Returns the default behavior for showing the delete button for the
 
 257 corresponding record type (true or false).
 
 263 Updates to the I<defaults> table require that the instance
 
 264 configuration is re-read. This has not been implemented yet.
 
 268 Moritz Bunkus E<lt>m.bunkus@linet-services.deE<gt>