commit 152cf51294705caacdc3d3f2621af4d3f4997772
Author: Rolf Fluehmann <rolf.fluehmann@revamp-it.ch>
Date:   Tue Jun 7 12:37:37 2016 +0200

    featured form-objects visible/unvisible

diff --git a/SL/Controller/ClientConfig.pm b/SL/Controller/ClientConfig.pm
index 4ce4faa0a..c8afe1da0 100644
--- a/SL/Controller/ClientConfig.pm
+++ b/SL/Controller/ClientConfig.pm
@@ -30,6 +30,7 @@ sub action_edit {
   my ($self, %params) = @_;
 
   $::form->{use_templates} = $self->defaults->templates ? 'existing' : 'new';
+  $::form->{feature_datev} = $self->defaults->feature_datev;
   $self->edit_form;
 }
 
diff --git a/bin/mozilla/am.pl b/bin/mozilla/am.pl
index 62c645a6f..fbe5bb8d1 100644
--- a/bin/mozilla/am.pl
+++ b/bin/mozilla/am.pl
@@ -45,6 +45,7 @@ use SL::TODO;
 use SL::DB::Printer;
 use SL::DB::Tax;
 use SL::DB::Language;
+use SL::DB::Default;
 use CGI;
 
 require "bin/mozilla/common.pl";
@@ -87,10 +88,17 @@ sub edit_account {
 
   my $form     = $main::form;
   my %myconfig = %main::myconfig;
+  my $defaults = SL::DB::Default->get;
 
   $main::auth->assert('config');
 
   $form->{title} = "Edit";
+  $form->{feature_balance} = $defaults->feature_balance;
+  $form->{feature_datev} = $defaults->feature_datev;
+  $form->{feature_erfolgsrechnung} = $defaults->feature_erfolgsrechnung;
+  $form->{feature_eurechnung} = $defaults->feature_eurechnung;
+  $form->{feature_ustva} = $defaults->feature_ustva;
+
   AM->get_account(\%myconfig, \%$form);
 
   foreach my $item (split(/:/, $form->{link})) {
diff --git a/templates/webpages/am/edit_accounts.html b/templates/webpages/am/edit_accounts.html
index b89a9320d..b2ba877ad 100644
--- a/templates/webpages/am/edit_accounts.html
+++ b/templates/webpages/am/edit_accounts.html
@@ -217,7 +217,9 @@ $(function() {
               <tr>
                 <th align="left">[% 'Taxkey' | $T8 %]</th>
                 <th align="left">[% 'valid from' | $T8 %]</th>
-                <th align="left">[% 'pos_ustva' | $T8 %]</th>
+                [% IF feature_ustva %]
+                  <th align="left">[% 'pos_ustva' | $T8 %]</th>
+                [% END %]
                 <th align="left">[% 'delete' | $T8 %] ? </th>
               </tr>
 [% FOREACH tk = ACCOUNT_TAXKEYS %]
@@ -227,14 +229,18 @@ $(function() {
                 <input type="hidden" name="taxkey_id_[% tk.runningnumber %]" value="[% tk.id %]">
                 <td><select name="taxkey_tax_[% tk.runningnumber %]">[% tk.selecttaxkey %]</select></td>
                 <td><input name="taxkey_startdate_[% tk.runningnumber %]" value="[% HTML.escape(tk.startdate) %]"></td>
-                <td><select name="taxkey_pos_ustva_[% tk.runningnumber %]">[% tk.select_tax %]</select></td>
+                [% IF feature_ustva %]
+                  <td><select name="taxkey_pos_ustva_[% tk.runningnumber %]">[% tk.select_tax %]</select></td>
+                [% END %]
                 <td><input name="taxkey_del_[% tk.runningnumber %]" type="checkbox"
                 class="checkbox" value="delete"></td>
     [% ELSE %]
                 <input type="hidden" name="taxkey_id_[% tk.runningnumber %]" value="NEW">
                 <td><select name="taxkey_tax_[% tk.runningnumber %]">[% tk.selecttaxkey %]</select></td>
                 <td><input name="taxkey_startdate_[% tk.runningnumber %]" value="[% HTML.escape(tk.startdate) %]"></td>
-                <td><select name="taxkey_pos_ustva_[% tk.runningnumber %]">[% tk.select_tax %]</select></td>
+                [% IF feature_ustva %]
+                  <td><select name="taxkey_pos_ustva_[% tk.runningnumber %]">[% tk.select_tax %]</select></td>
+                [% END %]
                 <td>&nbsp;</td>
     [% END %]
               </tr>
@@ -247,27 +253,35 @@ $(function() {
 <fieldset class="DEPENDS ON charttype BEING A">
   <legend>[% 'Report and misc. Preferences' | $T8 %]</legend>
   <table>
-        <tr>
-          <th align="left">[% 'EUER' | $T8 %]</th>
-          <td colspan="3"><select name="pos_eur">[% select_eur %]</select></td>
-        </tr>
-        <tr>
-          <th align="left">[% 'Erfolgsrechnung' | $T8 %]</th>
-          <td colspan="3"><select name="pos_er">[% select_er %]</select></td>
-        </tr>
-        <tr>
-          <th align="left">[% 'BWA' | $T8 %]</th>
-          <td colspan="3"><select name="pos_bwa">[% select_bwa %]</select></td>
-        </tr>
-        <!-- Diese Steuerfunktion hat keine Auswirkung in der Bilanz und wird erstmal deaktiviert. -->
-        <!-- tr>
-          <th align="left">[% 'Bilanz' | $T8 %]</th>
-          <td colspan="3"><select name="pos_bilanz">[% select_bilanz %]</select></td>
-        </tr -->
-        <tr>
-          <th align="left">[% 'Datevautomatik' | $T8 %]</th>
-          <td colspan="3"><input name="datevautomatik" type="checkbox" class="checkbox" value="T" [% IF datevautomatik %]checked [% END %]>[% 'If checked the taxkey will not be exported in the DATEV Export, but only IF chart taxkeys differ from general ledger taxkeys' | $T8 %] </td>
-        </tr>
+        [% IF feature_erfolgsrechnung %]
+          <tr>
+            <th align="left">[% 'Erfolgsrechnung' | $T8 %]</th>
+            <td colspan="3"><select name="pos_er">[% select_er %]</select></td>
+          </tr>
+        [% END %]
+        [% IF feature_eurechnung %]
+          <tr>
+            <th align="left">[% 'EUER' | $T8 %]</th>
+            <td colspan="3"><select name="pos_eur">[% select_eur %]</select></td>
+          </tr>
+          <tr>
+            <th align="left">[% 'BWA' | $T8 %]</th>
+            <td colspan="3"><select name="pos_bwa">[% select_bwa %]</select></td>
+          </tr>
+        [% END %]
+        [% IF feature_balance %]
+          <!-- Diese Steuerfunktion hat keine Auswirkung in der Bilanz und wird erstmal deaktiviert. -->
+          <!-- tr>
+            <th align="left">[% 'Bilanz' | $T8 %]</th>
+            <td colspan="3"><select name="pos_bilanz">[% select_bilanz %]</select></td>
+          </tr -->
+        [% END %]
+        [% IF feature_datev %]
+          <tr>
+            <th align="left">[% 'Datevautomatik' | $T8 %]</th>
+            <td colspan="3"><input name="datevautomatik" type="checkbox" class="checkbox" value="T" [% IF datevautomatik %]checked [% END %]>[% 'If checked the taxkey will not be exported in the DATEV Export, but only IF chart taxkeys differ from general ledger taxkeys' | $T8 %] </td>
+          </tr>
+        [% END %]
         <tr>
           <th align="left">[% 'Folgekonto' | $T8 %]</th>
           <td><select name="new_chart_id">[% selectnewaccount %]</select></td>
diff --git a/templates/webpages/client_config/form.html b/templates/webpages/client_config/form.html
index 0f85512b3..56403108a 100644
--- a/templates/webpages/client_config/form.html
+++ b/templates/webpages/client_config/form.html
@@ -58,7 +58,9 @@ $(function() {
    <li><a href="#ranges_of_numbers">[% LxERP.t8('Ranges of numbers') %]</a></li>
    <li><a href="#default_accounts">[% LxERP.t8('Default Accounts') %]</a></li>
    <li><a href="#posting_configuration">[% LxERP.t8('Posting Configuration') %]</a></li>
-   <li><a href="#datev_check_configuration">[% LxERP.t8('DATEV check configuration') %]</a></li>
+   [% IF FORM.feature_datev %]
+     <li><a href="#datev_check_configuration">[% LxERP.t8('DATEV check configuration') %]</a></li>
+   [% END %]
    <li><a href="#orders_deleteable">[% LxERP.t8('Orders / Delivery Orders deleteable') %]</a></li>
    <li><a href="#warehouse">[% LxERP.t8('Warehouse') %]</a></li>
    <li><a href="#features">[% LxERP.t8('Features') %]</a></li>
