X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FInstanceConfiguration.pm;h=4c767961da3d3fe31bb3724ce017de86a4953ebc;hb=549f187d3a2b1d15f96c4556714666ed954447bb;hp=13c4d1c5e62733e417800501105a566faa526043;hpb=2524843b93c48a8f24c5dadc4b3dd07e65e4770b;p=kivitendo-erp.git diff --git a/SL/InstanceConfiguration.pm b/SL/InstanceConfiguration.pm index 13c4d1c5e..4c767961d 100644 --- a/SL/InstanceConfiguration.pm +++ b/SL/InstanceConfiguration.pm @@ -4,10 +4,11 @@ use strict; use Carp; use SL::DBUtils (); +use SL::System::Process; use parent qw(Rose::Object); use Rose::Object::MakeMethods::Generic ( - 'scalar --get_set_init' => [ qw(data currencies default_currency _table_currencies_exists) ], + 'scalar --get_set_init' => [ qw(data currencies default_currency _table_currencies_exists crm_installed) ], ); sub init_data { @@ -34,6 +35,10 @@ sub init_default_currency { return (SL::DBUtils::selectfirst_array_query($::form, $::form->get_standard_dbh, qq|SELECT name FROM currencies WHERE id = ?|, $self->data->{currency_id}))[0]; } +sub init_crm_installed { + return -f (SL::System::Process->exe_dir . '/crm/Changelog'); +} + sub reload { my ($self) = @_; @@ -47,6 +52,16 @@ sub get_currencies { return @{ $self->currencies }; } +sub get_address { + # Compatibility function: back in the day there was only a single + # address field. + my ($self) = @_; + + my $zipcode_city = join ' ', grep { $_ } ($self->get_address_zipcode, $self->get_address_city); + + return join "\n", grep { $_ } ($self->get_address_street1, $self->get_address_street2, $zipcode_city, $self->get_address_country); +} + sub AUTOLOAD { our $AUTOLOAD; @@ -93,9 +108,9 @@ C<$::instance_conf>. Creates a new instance. Does not read the configuration. -=item C +=item C -Reads the configuration from the database. Returns C<$self>. +Returns trueish if the CRM component is installed. =item C @@ -118,6 +133,13 @@ Returns the default inventory system, perpetual or periodic Returns the default profit determination method, balance or income +=item C + +Returns the default method for determining the startdate for the balance +report. + +Valid options: +closed_to start_of_year all_transactions last_ob_or_all_transactions last_ob_or_start_of_year =item C @@ -164,7 +186,7 @@ Returns the default behavior for showing best before date, true or false =item C -Returns the default behavior for showing the mark as paid button for the +Returns the default behavior for showing the "mark as paid" button for the corresponding record type (true or false). =item C @@ -193,11 +215,9 @@ current stock quantity =item C -Returns the default bin_id for transfers without checking the. +Returns the default bin_id for transfers without checking the current stock quantity - - =item C =item C @@ -222,6 +242,14 @@ Returns the configuration for storing documents in the corresponding WebDAV fold Returns the configuration for "vertreter" +=item C + +Returns the configuration for experimental feature "assortment" + +=item C + +Returns the configuration for the experimental feature "order" + =item C Returns the configuarion for show image in parts @@ -232,7 +260,7 @@ Returns the css format string for images shown in parts =item C -Returns the configuartion for showing the picture in the results when you search for parts +Returns the configuration for showing the picture in the results when you search for parts =back