Revision b05b5075
Von Sven Schöling vor fast 9 Jahren hinzugefügt
SL/Controller/Admin.pm | ||
---|---|---|
21 | 21 |
use Rose::Object::MakeMethods::Generic |
22 | 22 |
( |
23 | 23 |
'scalar --get_set_init' => [ qw(client user group printer db_cfg is_locked |
24 |
all_dateformats all_numberformats all_countrycodes all_countrymodes all_stylesheets all_menustyles all_clients all_groups all_users all_rights all_printers
|
|
24 |
all_dateformats all_numberformats all_countrycodes all_stylesheets all_menustyles all_clients all_groups all_users all_rights all_printers |
|
25 | 25 |
all_dbsources all_used_dbsources all_accounting_methods all_inventory_systems all_profit_determinations all_charts) ], |
26 | 26 |
); |
27 | 27 |
|
... | ... | |
552 | 552 |
return [ map { id => $_, title => $cc{$_} }, sort { $cc{$a} cmp $cc{$b} } keys %cc ]; |
553 | 553 |
} |
554 | 554 |
|
555 |
sub init_all_countrymodes { |
|
556 |
my %cm = SL::DefaultManager->country_modes; |
|
557 |
return [ map { id => $_, title => "$_ ($cm{$_})" }, sort keys %cm ]; |
|
558 |
} |
|
559 |
|
|
560 | 555 |
# |
561 | 556 |
# filters |
562 | 557 |
# |
SL/Controller/ClientConfig.pm | ||
---|---|---|
29 | 29 |
my ($self, %params) = @_; |
30 | 30 |
|
31 | 31 |
$::form->{use_templates} = $self->defaults->templates ? 'existing' : 'new'; |
32 |
$::form->{country_mode} = $self->defaults->country_mode; |
|
33 | 32 |
$self->edit_form; |
34 | 33 |
} |
35 | 34 |
|
SL/DB/MetaSetup/Default.pm | ||
---|---|---|
35 | 35 |
customer_hourly_rate => { type => 'numeric', precision => 8, scale => 2 }, |
36 | 36 |
customer_projects_only_in_sales => { type => 'boolean', default => 'false', not_null => 1 }, |
37 | 37 |
customernumber => { type => 'text' }, |
38 |
country_mode => { type => 'text', default => 'DE', not_null => 1 }, |
|
39 | 38 |
datev_check_on_ap_transaction => { type => 'boolean', default => 'true' }, |
40 | 39 |
datev_check_on_ar_transaction => { type => 'boolean', default => 'true' }, |
41 | 40 |
datev_check_on_gl_transaction => { type => 'boolean', default => 'true' }, |
SL/DefaultManager.pm | ||
---|---|---|
34 | 34 |
} |
35 | 35 |
} |
36 | 36 |
|
37 |
sub country_modes { |
|
38 |
my ($self) = @_; |
|
39 |
return ( |
|
40 |
'CH' => 'Switzerland', |
|
41 |
'DE' => 'Germany', |
|
42 |
) |
|
43 |
} |
|
44 |
|
|
45 | 37 |
sub AUTOLOAD { |
46 | 38 |
our $AUTOLOAD; |
47 | 39 |
|
SL/User.pm | ||
---|---|---|
46 | 46 |
use SL::Iconv; |
47 | 47 |
use SL::Inifile; |
48 | 48 |
use SL::System::InstallationLock; |
49 |
use SL::DefaultManager; |
|
49 | 50 |
|
50 | 51 |
use strict; |
51 | 52 |
|
... | ... | |
283 | 284 |
# create the tables |
284 | 285 |
$dbupdater->process_query($dbh, "sql/lx-office.sql"); |
285 | 286 |
|
287 |
# process update-scripts needed before 1st user-login |
|
288 |
$self->create_schema_info_table($form, $dbh); |
|
289 |
$dbupdater->process_query($dbh, "sql/Pg-upgrade2/defaults_add_precision.sql"); |
|
290 |
$dbh->do("INSERT INTO schema_info (tag, login) VALUES ('defaults_add_precision', 'admin')"); |
|
291 |
|
|
286 | 292 |
# load chart of accounts |
287 | 293 |
$dbupdater->process_query($dbh, "sql/$form->{chart}-chart.sql"); |
288 | 294 |
|
289 |
$query = qq|UPDATE defaults SET coa = ?, accounting_method = ?, profit_determination = ?, inventory_system = ?, curr = ?|; |
|
290 |
do_query($form, $dbh, $query, map { $form->{$_} } qw(chart accounting_method profit_determination inventory_system defaultcurrency)); |
|
295 |
$query = qq|UPDATE defaults SET coa = ?, accounting_method = ?, profit_determination = ?, inventory_system = ?, curr = ?, precision = ?|;
|
|
296 |
do_query($form, $dbh, $query, map { $form->{$_} } qw(chart accounting_method profit_determination inventory_system defaultcurrency precision countrymode));
|
|
291 | 297 |
|
292 | 298 |
$dbh->disconnect; |
293 | 299 |
|
... | ... | |
414 | 420 |
|
415 | 421 |
sub get_default_myconfig { |
416 | 422 |
my ($self_or_class, %user_config) = @_; |
423 |
my $defaults = SL::DefaultManager->new($::lx_office_conf{system}->{default_manager}); |
|
417 | 424 |
|
418 | 425 |
return ( |
419 |
countrycode => 'de',
|
|
426 |
countrycode => $defaults->language('de'),
|
|
420 | 427 |
css_path => 'css', # Needed for menunew, see SL::Layout::Base::get_stylesheet_for_user |
421 |
dateformat => 'dd.mm.yy',
|
|
422 |
numberformat => '1.000,00',
|
|
428 |
dateformat => $defaults->dateformat('dd.mm.yy'),
|
|
429 |
numberformat => $defaults->numberformat('1.000,00'),
|
|
423 | 430 |
stylesheet => 'kivitendo.css', |
424 |
timeformat => 'hh:mm',
|
|
431 |
timeformat => $defaults->timeformat('hh:mm'),
|
|
425 | 432 |
%user_config, |
426 | 433 |
); |
427 | 434 |
} |
sql/Pg-upgrade2/defaults_add_country_mode.sql | ||
---|---|---|
1 |
-- @tag: defaults_add_country_mode |
|
2 |
-- @description: adds new column 'country_mode' (ISO-3166) in table defaults used for erp.ini |
|
3 |
-- @depends: release_3_2_0 |
|
4 |
ALTER TABLE defaults ADD COLUMN country_mode TEXT NOT NULL DEFAULT('DE'); |
|
5 |
|
templates/webpages/admin/create_dataset.html | ||
---|---|---|
21 | 21 |
<td>[% L.input_tag('db', FORM.db, class="initial_focus") %]</td> |
22 | 22 |
</tr> |
23 | 23 |
|
24 |
<tr> |
|
25 |
<th valign="top" align="right" nowrap>[% LxERP.t8('Country') %]</th> |
|
26 |
<td>[% L.select_tag('countrymode', SELF.all_countrymodes, title_key="title", default=(FORM.countrymode), onchange='select_country_defaults(this.value)') %]</td> |
|
27 |
</tr> |
|
28 |
|
|
29 | 24 |
<tr> |
30 | 25 |
<td colspan="1"> </td> |
31 | 26 |
<td><hr size="1" noshade></td> |
Auch abrufbar als: Unified diff
country_mode entfernt.
Flags sollten unabhängig funktionieren, ausserdem in das im admin
bereich der hass.