From 064d15bb6c59188be545d75e895689cdfea04ad6 Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Thu, 4 Jul 2013 09:13:23 +0200 Subject: [PATCH] Standardstundensatz in Tabelle defaults speichern, nicht in Konfigurationsdatei --- SL/Controller/CustomerVendor.pm | 2 +- SL/DB/MetaSetup/Default.pm | 1 + config/kivitendo.conf.default | 7 ------- sql/Pg-upgrade2/defaults_customer_hourly_rate.sql | 5 +++++ 4 files changed, 7 insertions(+), 8 deletions(-) create mode 100644 sql/Pg-upgrade2/defaults_customer_hourly_rate.sql diff --git a/SL/Controller/CustomerVendor.pm b/SL/Controller/CustomerVendor.pm index 1acd528b0..5ea038944 100644 --- a/SL/Controller/CustomerVendor.pm +++ b/SL/Controller/CustomerVendor.pm @@ -641,7 +641,7 @@ sub _instantiate_args { $self->{cv}->taxincluded_checked(undef); } - $self->{cv}->hourly_rate($::lx_office_conf{'features/customer'}->{default_hourly_rate}) if $self->is_customer && !$self->{cv}->hourly_rate; + $self->{cv}->hourly_rate($::instance_conf->get_customer_hourly_rate) if $self->is_customer && !$self->{cv}->hourly_rate; foreach my $cvar (@{$self->{cv}->cvars_by_config()}) { my $value = $::form->{cv_cvars}->{$cvar->config->name}; diff --git a/SL/DB/MetaSetup/Default.pm b/SL/DB/MetaSetup/Default.pm index 435fd2729..c8f4ed408 100644 --- a/SL/DB/MetaSetup/Default.pm +++ b/SL/DB/MetaSetup/Default.pm @@ -28,6 +28,7 @@ __PACKAGE__->meta->columns( coa => { type => 'text' }, company => { type => 'text' }, currency_id => { type => 'integer', not_null => 1 }, + customer_hourly_rate => { type => 'numeric', precision => 2, scale => 8 }, customernumber => { type => 'text' }, datev_check_on_ap_transaction => { type => 'boolean', default => 'true' }, datev_check_on_ar_transaction => { type => 'boolean', default => 'true' }, diff --git a/config/kivitendo.conf.default b/config/kivitendo.conf.default index 9cdf4d26d..0005aba59 100644 --- a/config/kivitendo.conf.default +++ b/config/kivitendo.conf.default @@ -65,13 +65,6 @@ bind_password = # and "en" (English, not perfect) are available. language = de -[features] - -[features/customer] -# Default for the 'hourly rate' input in the customer master data -# dialog. -default_hourly_rate = 100 - [paths] # path to temporary files (must be writeable by the web server) userspath = users diff --git a/sql/Pg-upgrade2/defaults_customer_hourly_rate.sql b/sql/Pg-upgrade2/defaults_customer_hourly_rate.sql new file mode 100644 index 000000000..ae8ae1bfb --- /dev/null +++ b/sql/Pg-upgrade2/defaults_customer_hourly_rate.sql @@ -0,0 +1,5 @@ +-- @tag: defaults_customer_hourly_rate +-- @description: defaults_customer_hourly_rate +-- @depends: requirement_specs +ALTER TABLE defaults ADD COLUMN customer_hourly_rate NUMERIC(8, 2); +UPDATE defaults SET customer_hourly_rate = 100.0; -- 2.20.1