From: Bernd Bleßmann Date: Mon, 5 Nov 2012 15:46:59 +0000 (+0100) Subject: "als bezahlt markieren"-Knopf anzeigen in Mandantenkonfiguration einstellbar. X-Git-Tag: release-3.0.0beta1~14^2~9^2~4 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=50c2f2285ce7fc70626afdce52a25172761d0ab7;p=kivitendo-erp.git "als bezahlt markieren"-Knopf anzeigen in Mandantenkonfiguration einstellbar. --- diff --git a/SL/Controller/ClientConfig.pm b/SL/Controller/ClientConfig.pm index 0e424de69..6f23b96da 100644 --- a/SL/Controller/ClientConfig.pm +++ b/SL/Controller/ClientConfig.pm @@ -29,6 +29,8 @@ sub action_edit { $self->{payments_changeable} = SL::DB::Default->get->payments_changeable; + map { $self->{$_} = SL::DB::Default->get->$_ } qw(is_show_mark_as_paid ir_show_mark_as_paid ar_show_mark_as_paid ap_show_mark_as_paid); + map { $self->{$_} = SL::DB::Default->get->$_ } qw(accounting_method inventory_system profit_determination); $self->{show_bestbefore} = SL::DB::Default->get->show_bestbefore; @@ -50,6 +52,8 @@ sub action_save { SL::DB::Default->get->update_attributes('payments_changeable' => $::form->{payments_changeable}); + map { SL::DB::Default->get->update_attributes($_ => $::form->{$_}); } qw(is_show_mark_as_paid ir_show_mark_as_paid ar_show_mark_as_paid ap_show_mark_as_paid); + map { SL::DB::Default->get->update_attributes($_ => $::form->{$_}); } qw(accounting_method inventory_system profit_determination); SL::DB::Default->get->update_attributes('show_bestbefore' => $::form->{show_bestbefore}); diff --git a/SL/DB/MetaSetup/Default.pm b/SL/DB/MetaSetup/Default.pm index 2e543fcc4..f66abac98 100644 --- a/SL/DB/MetaSetup/Default.pm +++ b/SL/DB/MetaSetup/Default.pm @@ -59,6 +59,10 @@ __PACKAGE__->meta->setup( ar_changeable => { type => 'integer', default => 2, not_null => 1 }, ap_changeable => { type => 'integer', default => 2, not_null => 1 }, gl_changeable => { type => 'integer', default => 2, not_null => 1 }, + is_show_mark_as_paid => { type => 'boolean', default => 'true' }, + ir_show_mark_as_paid => { type => 'boolean', default => 'true' }, + ar_show_mark_as_paid => { type => 'boolean', default => 'true' }, + ap_show_mark_as_paid => { type => 'boolean', default => 'true' }, ], primary_key_columns => [ 'id' ], diff --git a/SL/InstanceConfiguration.pm b/SL/InstanceConfiguration.pm index 0f364086f..65b7b7a3d 100644 --- a/SL/InstanceConfiguration.pm +++ b/SL/InstanceConfiguration.pm @@ -104,6 +104,26 @@ sub get_show_bestbefore { return $self->{data}->{show_bestbefore}; } +sub get_is_show_mark_as_paid { + my ($self) = @_; + return $self->{data}->{is_show_mark_as_paid}; +} + +sub get_ir_show_mark_as_paid { + my ($self) = @_; + return $self->{data}->{ir_show_mark_as_paid}; +} + +sub get_ar_show_mark_as_paid { + my ($self) = @_; + return $self->{data}->{ar_show_mark_as_paid}; +} + +sub get_ap_show_mark_as_paid { + my ($self) = @_; + return $self->{data}->{ap_show_mark_as_paid}; +} + 1; __END__ @@ -194,6 +214,17 @@ Returns true if datev check should be performed on gl transactions Returns the default behavior for showing best before date, true or false +=item C + +=item C + +=item C + +=item C + +Returns the default behavior for showing the mark as paid button for the +corresponding record type (true or false). + =back =head1 BUGS diff --git a/bin/mozilla/ap.pl b/bin/mozilla/ap.pl index f5f518e07..732eaed5e 100644 --- a/bin/mozilla/ap.pl +++ b/bin/mozilla/ap.pl @@ -855,10 +855,10 @@ sub form_footer { $::form->header; print $::form->parse_html_template('ap/form_footer', { - num_due => $num_due, - num_follow_ups => $num_follow_ups, - show_post_draft => ($transdate > $closedto) && !$::form->{id}, - show_storno => $storno, + num_due => $num_due, + num_follow_ups => $num_follow_ups, + show_post_draft => ($transdate > $closedto) && !$::form->{id}, + show_storno => $storno, }); $::lxdebug->leave_sub; diff --git a/bin/mozilla/ar.pl b/bin/mozilla/ar.pl index 834e1b18e..be080ea6a 100644 --- a/bin/mozilla/ar.pl +++ b/bin/mozilla/ar.pl @@ -533,7 +533,7 @@ $follow_ups_block } # /button for saving history # mark_as_paid button - if($form->{id} ne "") { + if(($form->{id} ne "") && $::instance_conf->get_ar_show_mark_as_paid) { print qq||; } diff --git a/locale/de/all b/locale/de/all index 76497b5da..8e9a59158 100644 --- a/locale/de/all +++ b/locale/de/all @@ -1711,7 +1711,15 @@ $self->{texts} = { 'Should payments be and when should they be changeable after posting?' => 'Sollen Zahlungen nach dem Buchen änderbar sein, und wenn ja, wann?', 'Should purchase invoices be and when should they be deleteable after posting?' => 'Sollen Einkaufsrechnungen nach der Buchung zu löschen sein?', 'Should sales invoices be and when should they be changeable or deleteable after posting?' => 'Sollen Verkaufrechnung nach der Buchung zu ändern oder zu löschen sein?', + 'Should the "mark as paid" button showed in ap transactions?' => 'Soll der Knopf "als bezahlt markieren" bei Kreditorenbuchungen angezeigt werden?', + 'Should the "mark as paid" button showed in ar transactions?' => 'Soll der Knopf "als bezahlt markieren" bei Debitorenbuchungen angezeigt werden?', + 'Should the "mark as paid" button showed in purchase invoices?' => 'Soll der Knopf "als bezahlt markieren" bei Einkaufsrechnungen angezeigt werden?', + 'Should the "mark as paid" button showed on sales invoices?' => 'Soll der Knopf "als bezahlt markieren" bei Verkaufsrechnungen angezeigt werden?', 'Show' => 'Zeigen', + 'Show "mark as paid" in ap transactions' => '"als bezahlt markieren" bei Kreditorenbuchungen anzeigen', + 'Show "mark as paid" in ar transactions' => '"als bezahlt markieren" bei Debitorenbuchungen anzeigen', + 'Show "mark as paid" in purchase invoices' => '"als bezahlt markieren" bei Einkaufsrechnungen anzeigen', + 'Show "mark as paid" in sales invoices' => '"als bezahlt markieren" bei Verkaufsrechnungen anzeigen', 'Show Bestbefore' => 'Mindesthaltbarkeit anzeigen', 'Show Filter' => 'Filter zeigen', 'Show Salesman' => 'Verkäufer anzeigen', diff --git a/locale/de_DE/all b/locale/de_DE/all index 750971999..f24032bef 100644 --- a/locale/de_DE/all +++ b/locale/de_DE/all @@ -1666,7 +1666,15 @@ $self->{texts} = { 'Should payments be and when should they be changeable after posting?' => 'Sollen Zahlungen nach dem Buchen änderbar sein, und wenn ja, wann?', 'Should purchase invoices be and when should they be deleteable after posting?' => 'Sollen Einkaufsrechnungen nach der Buchung zu löschen sein?', 'Should sales invoices be and when should they be changeable or deleteable after posting?' => 'Sollen Verkaufrechnung nach der Buchung zu ändern oder zu löschen sein?', + 'Should the "mark as paid" button showed in ap transactions?' => 'Soll der Knopf "als bezahlt markieren" bei Kreditorenbuchungen angezeigt werden?', + 'Should the "mark as paid" button showed in ar transactions?' => 'Soll der Knopf "als bezahlt markieren" bei Debitorenbuchungen angezeigt werden?', + 'Should the "mark as paid" button showed in purchase invoices?' => 'Soll der Knopf "als bezahlt markieren" bei Einkaufsrechnungen angezeigt werden?', + 'Should the "mark as paid" button showed on sales invoices?' => 'Soll der Knopf "als bezahlt markieren" bei Verkaufsrechnungen angezeigt werden?', 'Show' => 'Zeigen', + 'Show "mark as paid" in ap transactions' => '"als bezahlt markieren" bei Kreditorenbuchungen anzeigen', + 'Show "mark as paid" in ar transactions' => '"als bezahlt markieren" bei Debitorenbuchungen anzeigen', + 'Show "mark as paid" in purchase invoices' => '"als bezahlt markieren" bei Einkaufsrechnungen anzeigen', + 'Show "mark as paid" in sales invoices' => '"als bezahlt markieren" bei Verkaufsrechnungen anzeigen', 'Show Bestbefore' => 'Mindesthaltbarkeit anzeigen', 'Show Salesman' => 'Verkäufer anzeigen', 'Show TODO list' => 'Meine Aufgaben', diff --git a/locale/en/all b/locale/en/all index faca27b58..7f1d0cb28 100644 --- a/locale/en/all +++ b/locale/en/all @@ -1688,7 +1688,15 @@ $self->{texts} = { 'Should payments be and when should they be changeable after posting?' => '', 'Should purchase invoices be and when should they be deleteable after posting?' => '', 'Should sales invoices be and when should they be changeable or deleteable after posting?' => '', + 'Should the "mark as paid" button showed in ap transactions?' => '', + 'Should the "mark as paid" button showed in ar transactions?' => '', + 'Should the "mark as paid" button showed in purchase invoices?' => '', + 'Should the "mark as paid" button showed on sales invoices?' => '', 'Show' => '', + 'Show "mark as paid" in ap transactions' => '', + 'Show "mark as paid" in ar transactions' => '', + 'Show "mark as paid" in purchase invoices' => '', + 'Show "mark as paid" in sales invoices' => '', 'Show Bestbefore' => '', 'Show Filter' => '', 'Show Salesman' => '', diff --git a/sql/Pg-upgrade2/defaults_show_mark_as_paid_config.sql b/sql/Pg-upgrade2/defaults_show_mark_as_paid_config.sql new file mode 100644 index 000000000..8635763f5 --- /dev/null +++ b/sql/Pg-upgrade2/defaults_show_mark_as_paid_config.sql @@ -0,0 +1,9 @@ +-- @tag: defaults_show_mark_as_paid_config +-- @description: Einstellung, ob der "als bezahlt markieren"-Knopf angezeigt wird. +-- @depends: release_2_7_0 +-- @charset: utf-8 + +ALTER TABLE defaults ADD COLUMN is_show_mark_as_paid boolean DEFAULT TRUE; +ALTER TABLE defaults ADD COLUMN ir_show_mark_as_paid boolean DEFAULT TRUE; +ALTER TABLE defaults ADD COLUMN ar_show_mark_as_paid boolean DEFAULT TRUE; +ALTER TABLE defaults ADD COLUMN ap_show_mark_as_paid boolean DEFAULT TRUE; diff --git a/templates/webpages/ap/form_footer.html b/templates/webpages/ap/form_footer.html index 8ac37eca6..2408d5245 100644 --- a/templates/webpages/ap/form_footer.html +++ b/templates/webpages/ap/form_footer.html @@ -42,7 +42,9 @@ [%- IF id %] - + [% IF INSTANCE_CONF.get_ap_show_mark_as_paid %] + + [% END %] [%- END %] diff --git a/templates/webpages/client_config/form.html b/templates/webpages/client_config/form.html index 2a70a83a7..f772d3e7f 100644 --- a/templates/webpages/client_config/form.html +++ b/templates/webpages/client_config/form.html @@ -50,6 +50,30 @@ + + [% 'Show "mark as paid" in sales invoices' | $T8 %] + [% L.yes_no_tag('is_show_mark_as_paid', SELF.is_show_mark_as_paid) %] + [% 'Should the "mark as paid" button showed on sales invoices?' | $T8 %] + + + [% 'Show "mark as paid" in purchase invoices' | $T8 %] + [% L.yes_no_tag('ir_show_mark_as_paid', SELF.ir_show_mark_as_paid) %] + [% 'Should the "mark as paid" button showed in purchase invoices?' | $T8 %] + + + [% 'Show "mark as paid" in ar transactions' | $T8 %] + [% L.yes_no_tag('ar_show_mark_as_paid', SELF.ar_show_mark_as_paid) %] + [% 'Should the "mark as paid" button showed in ar transactions?' | $T8 %] + + + [% 'Show "mark as paid" in ap transactions' | $T8 %] + [% L.yes_no_tag('ap_show_mark_as_paid', SELF.ap_show_mark_as_paid) %] + [% 'Should the "mark as paid" button showed in ap transactions?' | $T8 %] + + + + + [% 'Accounting method' | $T8 %] [% L.select_tag('accounting_method', SELF.accounting_options, value_key => 'value', title_key => 'title', default => SELF.accounting_method) %] diff --git a/templates/webpages/ir/form_footer.html b/templates/webpages/ir/form_footer.html index 2f255f788..b2732a7ce 100644 --- a/templates/webpages/ir/form_footer.html +++ b/templates/webpages/ir/form_footer.html @@ -116,7 +116,9 @@ [%#- button for saving history %] - + [% IF INSTANCE_CONF.get_ir_show_mark_as_paid %] + + [% END %] [% END %] diff --git a/templates/webpages/is/form_footer.html b/templates/webpages/is/form_footer.html index 6cbcd4ef1..ee093dc95 100644 --- a/templates/webpages/is/form_footer.html +++ b/templates/webpages/is/form_footer.html @@ -157,8 +157,9 @@ [% IF id %] [%#- button for saving history %] - - + [% IF INSTANCE_CONF.get_is_show_mark_as_paid %] + + [% END %] [% END %]