"als bezahlt markieren"-Knopf anzeigen in Mandantenkonfiguration einstellbar.
authorBernd Bleßmann <bernd@kivitendo-premium.de>
Mon, 5 Nov 2012 15:46:59 +0000 (16:46 +0100)
committerBernd Bleßmann <bernd@kivitendo-premium.de>
Mon, 5 Nov 2012 15:46:59 +0000 (16:46 +0100)
13 files changed:
SL/Controller/ClientConfig.pm
SL/DB/MetaSetup/Default.pm
SL/InstanceConfiguration.pm
bin/mozilla/ap.pl
bin/mozilla/ar.pl
locale/de/all
locale/de_DE/all
locale/en/all
sql/Pg-upgrade2/defaults_show_mark_as_paid_config.sql [new file with mode: 0644]
templates/webpages/ap/form_footer.html
templates/webpages/client_config/form.html
templates/webpages/ir/form_footer.html
templates/webpages/is/form_footer.html

index 0e424de..6f23b96 100644 (file)
@@ -29,6 +29,8 @@ sub action_edit {
 
   $self->{payments_changeable} = SL::DB::Default->get->payments_changeable;
 
 
   $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;
   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});
 
 
   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});
   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});
index 2e543fc..f66abac 100644 (file)
@@ -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 },
     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' ],
   ],
 
   primary_key_columns => [ 'id' ],
index 0f36408..65b7b7a 100644 (file)
@@ -104,6 +104,26 @@ sub get_show_bestbefore {
   return $self->{data}->{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__
 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
 
 
 Returns the default behavior for showing best before date, true or false
 
+=item C<get_is_show_mark_as_paid>
+
+=item C<get_ir_show_mark_as_paid>
+
+=item C<get_ar_show_mark_as_paid>
+
+=item C<get_ap_show_mark_as_paid>
+
+Returns the default behavior for showing the mark as paid button for the
+corresponding record type (true or false).
+
 =back
 
 =head1 BUGS
 =back
 
 =head1 BUGS
index f5f518e..732eaed 100644 (file)
@@ -855,10 +855,10 @@ sub form_footer {
 
   $::form->header;
   print $::form->parse_html_template('ap/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;
   });
 
   $::lxdebug->leave_sub;
index 834e1b1..be080ea 100644 (file)
@@ -533,7 +533,7 @@ $follow_ups_block
   }
   # /button for saving history
   # mark_as_paid button
   }
   # /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|<input type="submit" class="submit" name="action" value="|
           . $locale->text('mark as paid') . qq|">|;
   }
     print qq|<input type="submit" class="submit" name="action" value="|
           . $locale->text('mark as paid') . qq|">|;
   }
index 76497b5..8e9a591 100644 (file)
@@ -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 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'                        => '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',
   'Show Bestbefore'             => 'Mindesthaltbarkeit anzeigen',
   'Show Filter'                 => 'Filter zeigen',
   'Show Salesman'               => 'Verkäufer anzeigen',
index 7509719..f24032b 100644 (file)
@@ -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 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'                        => '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',
   'Show Bestbefore'             => 'Mindesthaltbarkeit anzeigen',
   'Show Salesman'               => 'Verkäufer anzeigen',
   'Show TODO list'              => 'Meine Aufgaben',
index faca27b..7f1d0cb 100644 (file)
@@ -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 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'                        => '',
+  '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'               => '',
   '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 (file)
index 0000000..8635763
--- /dev/null
@@ -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;
index 8ac37ec..2408d52 100644 (file)
@@ -42,7 +42,9 @@
 
 [%- IF id %]
   <input type="submit" onclick="set_history_window([% id %]);" name="history" id="history" value="[% 'history' | $T8 %]">
 
 [%- IF id %]
   <input type="submit" onclick="set_history_window([% id %]);" name="history" id="history" value="[% 'history' | $T8 %]">
-  <input type="submit" name="action" value="[% 'mark as paid' | $T8 %]">
+  [% IF INSTANCE_CONF.get_ap_show_mark_as_paid %]
+    <input type="submit" name="action" value="[% 'mark as paid' | $T8 %]">
+  [% END %]
 [%- END %]
 
 </form>
 [%- END %]
 
 </form>
index 2a70a83..f772d3e 100644 (file)
  <tr> </tr>
  <tr> </tr>
 
  <tr> </tr>
  <tr> </tr>
 
+ <tr>
+   <td align="right">[% 'Show "mark as paid" in sales invoices' | $T8 %]</td>
+   <td>[% L.yes_no_tag('is_show_mark_as_paid', SELF.is_show_mark_as_paid) %]</td>
+   <td>[% 'Should the "mark as paid" button showed on sales invoices?' | $T8 %]</td>
+ </tr>
+ <tr>
+   <td align="right">[% 'Show "mark as paid" in purchase invoices' | $T8 %]</td>
+   <td>[% L.yes_no_tag('ir_show_mark_as_paid', SELF.ir_show_mark_as_paid) %]</td>
+   <td>[% 'Should the "mark as paid" button showed in purchase invoices?' | $T8 %]</td>
+ </tr>
+ <tr>
+   <td align="right">[% 'Show "mark as paid" in ar transactions' | $T8 %]</td>
+   <td>[% L.yes_no_tag('ar_show_mark_as_paid', SELF.ar_show_mark_as_paid) %]</td>
+   <td>[% 'Should the "mark as paid" button showed in ar transactions?' | $T8 %]</td>
+ </tr>
+ <tr>
+   <td align="right">[% 'Show "mark as paid" in ap transactions' | $T8 %]</td>
+   <td>[% L.yes_no_tag('ap_show_mark_as_paid', SELF.ap_show_mark_as_paid) %]</td>
+   <td>[% 'Should the "mark as paid" button showed in ap transactions?' | $T8 %]</td>
+ </tr>
+
+ <tr> </tr>
+ <tr> </tr>
+
  <tr>
    <td align="right">[% 'Accounting method' | $T8 %]</td>
    <td>[% L.select_tag('accounting_method', SELF.accounting_options, value_key => 'value', title_key => 'title', default => SELF.accounting_method) %]</td>
  <tr>
    <td align="right">[% 'Accounting method' | $T8 %]</td>
    <td>[% L.select_tag('accounting_method', SELF.accounting_options, value_key => 'value', title_key => 'title', default => SELF.accounting_method) %]</td>
index 2f255f7..b2732a7 100644 (file)
       [%#- button for saving history %]
       <input type="button" class="submit" onclick="set_history_window([% id | html %]);" name="history" id="history" value="[% 'history' | $T8 %]">
 
       [%#- button for saving history %]
       <input type="button" class="submit" onclick="set_history_window([% id | html %]);" name="history" id="history" value="[% 'history' | $T8 %]">
 
-      <input type="submit" class="submit" name="action" value="[% 'mark as paid' | $T8 %]">
+      [% IF INSTANCE_CONF.get_ir_show_mark_as_paid %]
+          <input type="submit" class="submit" name="action" value="[% 'mark as paid' | $T8 %]">
+      [% END %]
   [% END %]
 
 <input type="hidden" name="rowcount" value="[% rowcount %]">
   [% END %]
 
 <input type="hidden" name="rowcount" value="[% rowcount %]">
index 6cbcd4e..ee093dc 100644 (file)
   [% IF id %]
       [%#- button for saving history %]
       <input type="button" class="submit" onclick="set_history_window([% id | html %]);" name="history" id="history" value="[% 'history' | $T8 %]">
   [% IF id %]
       [%#- button for saving history %]
       <input type="button" class="submit" onclick="set_history_window([% id | html %]);" name="history" id="history" value="[% 'history' | $T8 %]">
-
-      <input type="submit" class="submit" name="action" value="[% 'mark as paid' | $T8 %]">
+      [% IF INSTANCE_CONF.get_is_show_mark_as_paid %]
+          <input type="submit" class="submit" name="action" value="[% 'mark as paid' | $T8 %]">
+      [% END %]
   [% END %]
 
 <input type="hidden" name="rowcount" value="[% rowcount %]">
   [% END %]
 
 <input type="hidden" name="rowcount" value="[% rowcount %]">