Revision a0b8d78b
Von Sven Schöling vor mehr als 8 Jahren hinzugefügt
SL/User.pm | ||
---|---|---|
46 | 46 |
use SL::Iconv; |
47 | 47 |
use SL::Inifile; |
48 | 48 |
use SL::System::InstallationLock; |
49 |
use SL::DefaultManager; |
|
50 | 49 |
|
51 | 50 |
use strict; |
52 | 51 |
|
... | ... | |
292 | 291 |
my $dbupdater = SL::DBUpgrade2->new(form => $form, return_on_error => 1, silent => 1)->parse_dbupdate_controls; |
293 | 292 |
# create the tables |
294 | 293 |
$dbupdater->process_query($dbh, "sql/lx-office.sql"); |
295 |
$dbupdater->process_query($dbh, "sql/$form->{chart}-chart.sql"); |
|
296 |
|
|
297 |
$query = qq|UPDATE defaults SET coa = ?|; |
|
298 |
do_query($form, $dbh, $query, map { $form->{$_} } qw(chart)); |
|
299 |
|
|
300 |
$dbh->disconnect; |
|
301 |
|
|
302 |
# update new database |
|
303 |
$self->dbupdate2(form => $form, updater => $dbupdater, database => $form->{db}, silent => 1); |
|
304 | 294 |
|
305 |
$dbh = SL::DBConnect->connect($form->{dbconnect}, $form->{dbuser}, $form->{dbpasswd}, SL::DBConnect->get_options) |
|
306 |
or $form->dberror; |
|
307 |
|
|
308 |
$query = "SELECT * FROM currencies WHERE name = ?"; |
|
309 |
my $curr = selectfirst_hashref_query($form, $dbh, $query, $form->{defaultcurrency}); |
|
310 |
if (!$curr->{id}) { |
|
311 |
do_query($form, $dbh, "INSERT INTO currencies (name) VALUES (?)", $form->{defaultcurrency}); |
|
312 |
$curr = selectfirst_hashref_query($form, $dbh, $query, $form->{defaultcurrency}); |
|
313 |
} |
|
295 |
# load chart of accounts |
|
296 |
$dbupdater->process_query($dbh, "sql/$form->{chart}-chart.sql"); |
|
314 | 297 |
|
315 |
$query = qq|UPDATE defaults SET accounting_method = ?, profit_determination = ?, inventory_system = ?, precision = ?, currency_id = ?|; |
|
316 |
do_query($form, $dbh, $query, |
|
317 |
$form->{accounting_method}, |
|
318 |
$form->{profit_determination}, |
|
319 |
$form->{inventory_system}, |
|
320 |
$form->parse_amount(\%::myconfig, $form->{precision_as_number}), |
|
321 |
$curr->{id}, |
|
322 |
); |
|
298 |
$query = qq|UPDATE defaults SET coa = ?, accounting_method = ?, profit_determination = ?, inventory_system = ?, curr = ?|; |
|
299 |
do_query($form, $dbh, $query, map { $form->{$_} } qw(chart accounting_method profit_determination inventory_system defaultcurrency)); |
|
323 | 300 |
|
324 | 301 |
$dbh->disconnect; |
325 | 302 |
|
... | ... | |
447 | 424 |
|
448 | 425 |
sub get_default_myconfig { |
449 | 426 |
my ($self_or_class, %user_config) = @_; |
450 |
my $defaults = SL::DefaultManager->new($::lx_office_conf{system}->{default_manager}); |
|
451 | 427 |
|
452 | 428 |
return ( |
453 |
countrycode => $defaults->language('de'),
|
|
429 |
countrycode => 'de',
|
|
454 | 430 |
css_path => 'css', # Needed for menunew, see SL::Layout::Base::get_stylesheet_for_user |
455 |
dateformat => $defaults->dateformat('dd.mm.yy'),
|
|
456 |
numberformat => $defaults->numberformat('1.000,00'),
|
|
457 |
stylesheet => $defaults->stylesheet('kivitendo.css'),
|
|
458 |
timeformat => $defaults->timeformat('hh:mm'),
|
|
431 |
dateformat => 'dd.mm.yy',
|
|
432 |
numberformat => '1.000,00',
|
|
433 |
stylesheet => 'kivitendo.css',
|
|
434 |
timeformat => 'hh:mm',
|
|
459 | 435 |
%user_config, |
460 | 436 |
); |
461 | 437 |
} |
Auch abrufbar als: Unified diff
Revert "country_mode entfernt."
Originalcommit: b05b5075ac0f3cbb0823c2f513cdbcacfb17bede.