X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/1e403f489b283e2e6b725f32cea29f38b3fe4e1f..b05b5075ac0f3cbb0823c2f513cdbcacfb17bede:/SL/User.pm diff --git a/SL/User.pm b/SL/User.pm index 44efe5c58..38154283e 100644 --- a/SL/User.pm +++ b/SL/User.pm @@ -46,6 +46,7 @@ use SL::DBUtils; use SL::Iconv; use SL::Inifile; use SL::System::InstallationLock; +use SL::DefaultManager; use strict; @@ -283,11 +284,16 @@ sub dbcreate { # create the tables $dbupdater->process_query($dbh, "sql/lx-office.sql"); + # process update-scripts needed before 1st user-login + $self->create_schema_info_table($form, $dbh); + $dbupdater->process_query($dbh, "sql/Pg-upgrade2/defaults_add_precision.sql"); + $dbh->do("INSERT INTO schema_info (tag, login) VALUES ('defaults_add_precision', 'admin')"); + # load chart of accounts $dbupdater->process_query($dbh, "sql/$form->{chart}-chart.sql"); - $query = qq|UPDATE defaults SET coa = ?, accounting_method = ?, profit_determination = ?, inventory_system = ?, curr = ?|; - do_query($form, $dbh, $query, map { $form->{$_} } qw(chart accounting_method profit_determination inventory_system defaultcurrency)); + $query = qq|UPDATE defaults SET coa = ?, accounting_method = ?, profit_determination = ?, inventory_system = ?, curr = ?, precision = ?|; + do_query($form, $dbh, $query, map { $form->{$_} } qw(chart accounting_method profit_determination inventory_system defaultcurrency precision countrymode)); $dbh->disconnect; @@ -414,14 +420,15 @@ sub data { sub get_default_myconfig { my ($self_or_class, %user_config) = @_; + my $defaults = SL::DefaultManager->new($::lx_office_conf{system}->{default_manager}); return ( - countrycode => 'de', + countrycode => $defaults->language('de'), css_path => 'css', # Needed for menunew, see SL::Layout::Base::get_stylesheet_for_user - dateformat => 'dd.mm.yy', - numberformat => '1.000,00', + dateformat => $defaults->dateformat('dd.mm.yy'), + numberformat => $defaults->numberformat('1.000,00'), stylesheet => 'kivitendo.css', - timeformat => 'hh:mm', + timeformat => $defaults->timeformat('hh:mm'), %user_config, ); }