From fbbfd3ce7bdc893ac30638cce1427938276b659b Mon Sep 17 00:00:00 2001 From: Rolf Fluehmann Date: Tue, 7 Jun 2016 18:23:53 +0200 Subject: [PATCH] preferences to client-features managed --- SL/Controller/Admin.pm | 19 +++++++++----- SL/DefaultManager/German.pm | 27 ++++++++++++-------- SL/DefaultManager/Swiss.pm | 27 ++++++++++++-------- SL/User.pm | 18 ++++++++++++- templates/webpages/admin/create_dataset.html | 6 +++++ 5 files changed, 67 insertions(+), 30 deletions(-) diff --git a/SL/Controller/Admin.pm b/SL/Controller/Admin.pm index ab4e24fbb..0d60ba671 100644 --- a/SL/Controller/Admin.pm +++ b/SL/Controller/Admin.pm @@ -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'))); } diff --git a/SL/DefaultManager/German.pm b/SL/DefaultManager/German.pm index 372b8f3a5..d4ce4c0b7 100644 --- a/SL/DefaultManager/German.pm +++ b/SL/DefaultManager/German.pm @@ -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; diff --git a/SL/DefaultManager/Swiss.pm b/SL/DefaultManager/Swiss.pm index 78444de68..f5f553edb 100644 --- a/SL/DefaultManager/Swiss.pm +++ b/SL/DefaultManager/Swiss.pm @@ -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; diff --git a/SL/User.pm b/SL/User.pm index 00c25d55a..742cb3a2a 100644 --- a/SL/User.pm +++ b/SL/User.pm @@ -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; diff --git a/templates/webpages/admin/create_dataset.html b/templates/webpages/admin/create_dataset.html index 741a941db..49320eb6b 100644 --- a/templates/webpages/admin/create_dataset.html +++ b/templates/webpages/admin/create_dataset.html @@ -63,6 +63,12 @@ [% 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) %] +
-- 2.20.1