Revision 1e403f48
Von Rolf Fluehmann 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_stylesheets all_menustyles all_clients all_groups all_users all_rights all_printers |
|
24 |
all_dateformats all_numberformats all_countrycodes all_countrymodes 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 |
|
... | ... | |
112 | 112 |
sub action_new_user { |
113 | 113 |
my ($self) = @_; |
114 | 114 |
|
115 |
my $defaults = SL::DefaultManager->new($::lx_office_conf{system}->{default_manager}); |
|
115 | 116 |
$self->user(SL::DB::AuthUser->new( |
116 | 117 |
config_values => { |
117 | 118 |
vclimit => 200, |
118 |
countrycode => "de",
|
|
119 |
numberformat => "1.000,00",
|
|
120 |
dateformat => "dd.mm.yy",
|
|
119 |
countrycode => $defaults->language('de'),
|
|
120 |
numberformat => $defaults->numberformat('1.000,00'),
|
|
121 |
dateformat => $defaults->dateformat('dd.mm.yy'),
|
|
121 | 122 |
stylesheet => "kivitendo.css", |
122 | 123 |
menustyle => "neu", |
123 | 124 |
}, |
... | ... | |
498 | 499 |
sub init_all_groups { SL::DB::Manager::AuthGroup ->get_all_sorted } |
499 | 500 |
sub init_all_printers { SL::DB::Manager::Printer ->get_all_sorted } |
500 | 501 |
sub init_all_dateformats { [ qw(mm/dd/yy dd/mm/yy dd.mm.yy yyyy-mm-dd) ] } |
501 |
sub init_all_numberformats { [ '1,000.00', '1000.00', '1.000,00', '1000,00' ] }
|
|
502 |
sub init_all_stylesheets { [ qw(lx-office-erp.css kivitendo.css) ] }
|
|
502 |
sub init_all_numberformats { [ '1,000.00', '1000.00', '1.000,00', '1000,00', "1'000.00" ] }
|
|
503 |
sub init_all_stylesheets { [ qw(lx-office-erp.css Mobile.css kivitendo.css) ] }
|
|
503 | 504 |
sub init_all_dbsources { [ sort User->dbsources($::form) ] } |
504 | 505 |
sub init_all_used_dbsources { { map { (join(':', $_->dbhost || 'localhost', $_->dbport || 5432, $_->dbname) => $_->name) } @{ $_[0]->all_clients } } } |
505 | 506 |
sub init_all_accounting_methods { [ { id => 'accrual', name => t8('Accrual accounting') }, { id => 'cash', name => t8('Cash accounting') } ] } |
... | ... | |
551 | 552 |
return [ map { id => $_, title => $cc{$_} }, sort { $cc{$a} cmp $cc{$b} } keys %cc ]; |
552 | 553 |
} |
553 | 554 |
|
555 |
sub init_all_countrymodes { |
|
556 |
my %cm = SL::DefaultManager->country_modes; |
|
557 |
return [ map { id => $_, title => "$_ ($cm{$_})" }, sort keys %cm ]; |
|
558 |
} |
|
559 |
|
|
554 | 560 |
# |
555 | 561 |
# filters |
556 | 562 |
# |
... | ... | |
558 | 564 |
sub setup_layout { |
559 | 565 |
my ($self, $action) = @_; |
560 | 566 |
|
567 |
my $defaults = SL::DefaultManager->new($::lx_office_conf{system}->{default_manager}); |
|
561 | 568 |
$::request->layout(SL::Layout::Dispatcher->new(style => 'admin')); |
562 | 569 |
$::form->{favicon} = "favicon.ico"; |
563 | 570 |
%::myconfig = ( |
564 |
countrycode => 'de',
|
|
565 |
numberformat => '1.000,00',
|
|
566 |
dateformat => 'dd.mm.yy',
|
|
571 |
countrycode => $defaults->language('de'),
|
|
572 |
numberformat => $defaults->numberformat('1.000,00'),
|
|
573 |
dateformat => $defaults->dateformat('dd.mm.yy'),
|
|
567 | 574 |
) if !%::myconfig; |
568 | 575 |
} |
569 | 576 |
|
... | ... | |
628 | 635 |
|
629 | 636 |
sub create_dataset_form { |
630 | 637 |
my ($self, %params) = @_; |
638 |
|
|
639 |
my $defaults = SL::DefaultManager->new($::lx_office_conf{system}->{default_manager}); |
|
640 |
$::form->{favicon} = "favicon.ico"; |
|
641 |
$::form->{countrymode} = $defaults->country('DE'); |
|
642 |
$::form->{chart} = $defaults->chart_of_accounts('Germany-DATEV-SKR03EU'); |
|
643 |
$::form->{defaultcurrency} = $defaults->currency('EUR'); |
|
644 |
$::form->{precision} = $defaults->precision(0.01); |
|
645 |
$::form->{accounting_method} = $defaults->accounting_method('cash'); |
|
646 |
$::form->{inventory_system} = $defaults->inventory_system('periodic'); |
|
647 |
$::form->{profit_determination} = $defaults->profit_determination('balance'); |
|
648 |
|
|
631 | 649 |
$self->render('admin/create_dataset', title => (t8('Database Administration') . " / " . t8('Create Dataset'))); |
632 | 650 |
} |
633 | 651 |
|
locale/de/all | ||
---|---|---|
2004 | 2004 |
'Posustva_coa' => 'USTVA Kennz.', |
2005 | 2005 |
'Pre-defined Texts' => 'Vordefinierte Textblöcke', |
2006 | 2006 |
'Preamble' => 'Einleitung', |
2007 |
'Precision' => 'Genauigkeit', |
|
2007 | 2008 |
'Preferences' => 'Einstellungen', |
2008 | 2009 |
'Preferences saved!' => 'Einstellungen gespeichert!', |
2009 | 2010 |
'Prefix for the new bins\' names' => 'Namenspräfix für die neuen Lagerplätze', |
locale/en/all | ||
---|---|---|
1624 | 1624 |
'Posting Configuration' => '', |
1625 | 1625 |
'Postscript' => '', |
1626 | 1626 |
'Posustva_coa' => '', |
1627 |
'Precision' => '', |
|
1627 | 1628 |
'Preferences' => '', |
1628 | 1629 |
'Preferences saved!' => '', |
1629 | 1630 |
'Prefix for the new bins\' names' => '', |
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 |
<tr> |
|
30 |
<td colspan="1"> </td> |
|
31 |
<td><hr size="1" noshade></td> |
|
32 |
</tr> |
|
33 |
|
|
24 | 34 |
<tr> |
25 | 35 |
<th align="right" nowrap>[% LxERP.t8('Default currency') %]</th> |
26 |
<td>[% L.input_tag('defaultcurrency', FORM.defaultcurrency || 'EUR') %]</td> |
|
36 |
<td>[% L.input_tag('defaultcurrency', FORM.defaultcurrency) %]</td> |
|
37 |
</tr> |
|
38 |
|
|
39 |
<tr> |
|
40 |
<th align="right" nowrap>[% LxERP.t8('Precision') %]</th> |
|
41 |
<td>[% L.input_tag('precision', FORM.precision) %]</td> |
|
27 | 42 |
</tr> |
28 | 43 |
|
29 | 44 |
<tr> |
30 | 45 |
<th valign="top" align="right" nowrap>[% LxERP.t8('Create Chart of Accounts') %]</th> |
31 |
<td>[% L.select_tag('chart', SELF.all_charts, onchange='comment_selected_chart(this.value)', default=(FORM.chart || 'Germany-DATEV-SKR03EU')) %]</td>
|
|
46 |
<td>[% L.select_tag('chart', SELF.all_charts, default=(FORM.chart), onchange='comment_selected_chart(this.value)') %]</td>
|
|
32 | 47 |
</tr> |
33 | 48 |
|
34 | 49 |
<tr> |
35 | 50 |
<th valign="top" align="right" nowrap>[% LxERP.t8('Accounting method') %]</th> |
36 |
<td>[% L.select_tag('accounting_method', SELF.all_accounting_methods, title_key='name', default=(FORM.accounting_method || 'cash')) %]</td>
|
|
51 |
<td>[% L.select_tag('accounting_method', SELF.all_accounting_methods, title_key='name', default=(FORM.accounting_method)) %]</td> |
|
37 | 52 |
</tr> |
38 | 53 |
|
39 | 54 |
<tr> |
40 | 55 |
<th valign="top" align="right" nowrap>[% LxERP.t8('Inventory system') %]</th> |
41 |
<td>[% L.select_tag('inventory_system', SELF.all_inventory_systems, title_key='name', default=(FORM.inventory_system || 'periodic')) %]</td>
|
|
56 |
<td>[% L.select_tag('inventory_system', SELF.all_inventory_systems, title_key='name', default=(FORM.inventory_system)) %]</td> |
|
42 | 57 |
</tr> |
43 | 58 |
|
44 | 59 |
<tr> |
45 | 60 |
<th valign="top" align="right" nowrap>[% LxERP.t8('Profit determination') %]</th> |
46 |
<td>[% L.select_tag('profit_determination', SELF.all_profit_determinations, title_key='name', default=(FORM.profit_determination || 'income')) %]</td>
|
|
61 |
<td>[% L.select_tag('profit_determination', SELF.all_profit_determinations, title_key='name', default=(FORM.profit_determination)) %]</td> |
|
47 | 62 |
</tr> |
48 | 63 |
</table> |
49 | 64 |
|
... | ... | |
67 | 82 |
|
68 | 83 |
function comment_selected_chart(s) { |
69 | 84 |
if (s == 'Austria') { |
70 |
alert("SKR07 Austria ist noch Stand 2002." + |
|
85 |
alert("SKR07 Austria ist noch Stand 2002." +
|
|
71 | 86 |
"\n" + |
72 | 87 |
"Die Buchungsgruppen sind nicht korrekt vorkonfiguriert" + |
73 | 88 |
"\n" + |
74 | 89 |
"fuer Kunden im Ausland." + |
75 | 90 |
"\n" + |
76 | 91 |
"Hinweis vom 20.09.2011"); |
77 |
|
|
78 |
} else if (s == 'Swiss-German') { |
|
79 |
alert("Hinweis: Das ist weder ein Schweizer Kontorahmen nach Kaefer noch ein " + |
|
80 |
"Schweizer KMU-Kontenrahmen, sondern ein angelehnter KMU-Kontenrahmen fuer " + |
|
81 |
"ein EDV-Dienstleistungsunternehmen mit Stand 2006 (Bspw. 32001 Hardware, " + |
|
82 |
"statt 3200 Warenertrag)." + |
|
83 |
"\n" + |
|
84 |
"Ferner sind keine Buchungsgruppe vorkonfiguriert, somit wird " + |
|
85 |
"standardmaessig keine Rechnung mit Steuer ausgewiesen." + |
|
86 |
"\n" + |
|
87 |
"Zum schnellen Testen und Zusammenhaenge verstehen waehlen Sie lieber einen " + |
|
88 |
"deutschen Kontenrahmen aus (SKR03 oder SKR04) und passen die Steuer an." + |
|
89 |
"\n" + |
|
90 |
"Hinweis vom 21.09.2011"); |
|
91 | 92 |
} |
93 |
return true; |
|
94 |
} |
|
92 | 95 |
|
96 |
function select_country_defaults(country) { |
|
97 |
if (/^CH/.test(country)) { |
|
98 |
document.getElementById('defaultcurrency').value='CHF'; |
|
99 |
document.getElementById('precision').value='0.05'; |
|
100 |
document.getElementById('chart').value='Switzerland-deutsch-MWST-2014'; |
|
101 |
document.getElementById('accounting_method').value='accrual'; |
|
102 |
document.getElementById('inventory_system').value='periodic'; |
|
103 |
document.getElementById('profit_determination').value='balance'; |
|
104 |
} else { |
|
105 |
document.getElementById('defaultcurrency').value='EUR'; |
|
106 |
document.getElementById('precision').value='0.01'; |
|
107 |
document.getElementById('chart').value='Germany-DATEV-SKR03EU'; |
|
108 |
document.getElementById('accounting_method').value='cash'; |
|
109 |
document.getElementById('inventory_system').value='periodic'; |
|
110 |
document.getElementById('profit_determination').value='income'; |
|
111 |
} |
|
93 | 112 |
return true; |
94 | 113 |
} |
114 |
|
|
95 | 115 |
--> |
96 | 116 |
</script> |
Auch abrufbar als: Unified diff
Admin: create_dataset Änderungen für neue Eingenschaften