preferences to client-features managed
authorRolf Fluehmann <rolf.fluehmann@revamp-it.ch>
Tue, 7 Jun 2016 16:23:53 +0000 (18:23 +0200)
committerSven Schöling <s.schoeling@linet-services.de>
Thu, 16 Jun 2016 14:23:13 +0000 (16:23 +0200)
SL/Controller/Admin.pm
SL/DefaultManager/German.pm
SL/DefaultManager/Swiss.pm
SL/User.pm
templates/webpages/admin/create_dataset.html

index ab4e24f..0d60ba6 100644 (file)
@@ -633,13 +633,18 @@ sub create_dataset_form {
 
   my $defaults = SL::DefaultManager->new($::lx_office_conf{system}->{default_manager});
   $::form->{favicon} = "favicon.ico";
-  $::form->{countrymode}          = $defaults->country('DE');
-  $::form->{chart}                = $defaults->chart_of_accounts('Germany-DATEV-SKR03EU');
-  $::form->{defaultcurrency}      = $defaults->currency('EUR');
-  $::form->{precision}            = $defaults->precision(0.01);
-  $::form->{accounting_method}    = $defaults->accounting_method('cash');
-  $::form->{inventory_system}     = $defaults->inventory_system('periodic');
-  $::form->{profit_determination} = $defaults->profit_determination('balance');
+  $::form->{countrymode}             = $defaults->country('DE');
+  $::form->{chart}                   = $defaults->chart_of_accounts('Germany-DATEV-SKR03EU');
+  $::form->{defaultcurrency}         = $defaults->currency('EUR');
+  $::form->{precision}               = $defaults->precision(0.01);
+  $::form->{accounting_method}       = $defaults->accounting_method('cash');
+  $::form->{inventory_system}        = $defaults->inventory_system('periodic');
+  $::form->{profit_determination}    = $defaults->profit_determination('balance');
+  $::form->{feature_balance}         = $defaults->feature_balance(1);
+  $::form->{feature_datev}           = $defaults->feature_datev(1);
+  $::form->{feature_erfolgsrechnung} = $defaults->feature_erfolgsrechnung(0);
+  $::form->{feature_eurechnung}      = $defaults->feature_eurechnung(1);
+  $::form->{feature_ustva}           = $defaults->feature_ustva(1);
 
   $self->render('admin/create_dataset', title => (t8('Database Administration') . " / " . t8('Create Dataset')));
 }
index 372b8f3..d4ce4c0 100644 (file)
@@ -4,20 +4,25 @@ use strict;
 use parent qw(Rose::Object);
 
 # client defaults
-sub chart_of_accounts    { 'Germany-DATEV-SKR03EU' }
-sub accounting_method    { 'cash' }
-sub inventory_system     { 'periodic' }
-sub profit_determination { 'income' }
-sub currency             { 'EUR' }
-sub precision            { 0.01 }
+sub chart_of_accounts       { 'Germany-DATEV-SKR03EU' }
+sub accounting_method       { 'cash' }
+sub inventory_system        { 'periodic' }
+sub profit_determination    { 'income' }
+sub currency                { 'EUR' }
+sub precision               { 0.01 }
+sub feature_balance         { 1 }
+sub feature_datev           { 1 }
+sub feature_erfolgsrechnung { 0 }
+sub feature_eurechnung      { 1 }
+sub feature_ustva           { 1 }
 
 # user defaults
-sub numberformat        { '1.000,00' }
-sub dateformat          { 'dd.mm.yy' }
-sub timeformat          { 'hh:mm' }
+sub numberformat            { '1.000,00' }
+sub dateformat              { 'dd.mm.yy' }
+sub timeformat              { 'hh:mm' }
 
 # default for login/admin areas
-sub country             { 'DE' }
-sub language            { 'de' }
+sub country                 { 'DE' }
+sub language                { 'de' }
 
 1;
index 78444de..f5f553e 100644 (file)
@@ -4,20 +4,25 @@ use strict;
 use parent qw(Rose::Object);
 
 # client defaults
-sub chart_of_accounts    { 'Switzerland-deutsch-MWST-2014' }
-sub accounting_method    { 'accrual' }
-sub inventory_system     { 'periodic' }
-sub profit_determination { 'balance' }
-sub currency             { 'CHF' }
-sub precision            { 0.05 }
+sub chart_of_accounts       { 'Switzerland-deutsch-MWST-2014' }
+sub accounting_method       { 'accrual' }
+sub inventory_system        { 'periodic' }
+sub profit_determination    { 'balance' }
+sub currency                { 'CHF' }
+sub precision               { 0.05 }
+sub feature_balance         { 1 }
+sub feature_datev           { 0 }
+sub feature_erfolgsrechnung { 1 }
+sub feature_eurechnung      { 0 }
+sub feature_ustva           { 0 }
 
 # user defaults
-sub numberformat        { "1'000.00" }
-sub dateformat          { 'dd.mm.yy' }
-sub timeformat          { 'hh:mm' }
+sub numberformat            { "1'000.00" }
+sub dateformat              { 'dd.mm.yy' }
+sub timeformat              { 'hh:mm' }
 
 # default for login/admin areas
-sub country             { 'CH' }
-sub language            { 'de' }
+sub country                 { 'CH' }
+sub language                { 'de' }
 
 1;
index 00c25d5..742cb3a 100644 (file)
@@ -312,13 +312,29 @@ sub dbcreate {
     $curr = selectfirst_hashref_query($form, $dbh, $query, $form->{defaultcurrency});
   }
 
-  $query = qq|UPDATE defaults SET accounting_method = ?, profit_determination = ?, inventory_system = ?, precision = ?, currency_id = ?|;
+  $query = qq|UPDATE defaults SET
+    accounting_method = ?,
+    profit_determination = ?,
+    inventory_system = ?,
+    precision = ?,
+    currency_id = ?,
+    feature_balance = ?,
+    feature_datev = ?,
+    feature_erfolgsrechnung = ?,
+    feature_eurechnung = ?,
+    feature_ustva = ?
+  |;
   do_query($form, $dbh, $query,
     $form->{accounting_method},
     $form->{profit_determination},
     $form->{inventory_system},
     $form->parse_amount(\%::myconfig, $form->{precision_as_number}),
     $curr->{id},
+    $form->{feature_balance},
+    $form->{feature_datev},
+    $form->{feature_erfolgsrechnung},
+    $form->{feature_eurechnung},
+    $form->{feature_ustva}
   );
 
   $dbh->disconnect;
index 741a941..49320eb 100644 (file)
  [% L.hidden_tag("dbpasswd", FORM.dbpasswd) %]
  [% L.hidden_tag("dbdefault", FORM.dbdefault) %]
  [% L.hidden_tag("action", "Admin/do_create_dataset") %]
+ [% L.hidden_tag("feature_balance", FORM.feature_balance) %]
+ [% L.hidden_tag("feature_datev", FORM.feature_datev) %]
+ [% L.hidden_tag("feature_erfolgsrechnung", FORM.feature_erfolgsrechnung) %]
+ [% L.hidden_tag("feature_eurechnung", FORM.feature_eurechnung) %]
+ [% L.hidden_tag("feature_ustva", FORM.feature_ustva) %]
+
 
  <hr size="3" noshade>