use Rose::Object::MakeMethods::Generic
(
'scalar --get_set_init' => [ qw(client user group printer db_cfg is_locked
- all_dateformats all_numberformats all_countrycodes all_stylesheets all_menustyles all_clients all_groups all_users all_rights all_printers
+ all_dateformats all_numberformats all_countrycodes all_countrymodes all_stylesheets all_menustyles all_clients all_groups all_users all_rights all_printers
all_dbsources all_used_dbsources all_accounting_methods all_inventory_systems all_profit_determinations all_charts) ],
);
sub action_new_user {
my ($self) = @_;
+ my $defaults = SL::DefaultManager->new($::lx_office_conf{system}->{default_manager});
$self->user(SL::DB::AuthUser->new(
config_values => {
vclimit => 200,
- countrycode => "de",
- numberformat => "1.000,00",
- dateformat => "dd.mm.yy",
+ countrycode => $defaults->language('de'),
+ numberformat => $defaults->numberformat('1.000,00'),
+ dateformat => $defaults->dateformat('dd.mm.yy'),
stylesheet => "kivitendo.css",
menustyle => "neu",
},
sub init_all_groups { SL::DB::Manager::AuthGroup ->get_all_sorted }
sub init_all_printers { SL::DB::Manager::Printer ->get_all_sorted }
sub init_all_dateformats { [ qw(mm/dd/yy dd/mm/yy dd.mm.yy yyyy-mm-dd) ] }
-sub init_all_numberformats { [ '1,000.00', '1000.00', '1.000,00', '1000,00' ] }
-sub init_all_stylesheets { [ qw(lx-office-erp.css kivitendo.css) ] }
+sub init_all_numberformats { [ '1,000.00', '1000.00', '1.000,00', '1000,00', "1'000.00" ] }
+sub init_all_stylesheets { [ qw(lx-office-erp.css Mobile.css kivitendo.css) ] }
sub init_all_dbsources { [ sort User->dbsources($::form) ] }
sub init_all_used_dbsources { { map { (join(':', $_->dbhost || 'localhost', $_->dbport || 5432, $_->dbname) => $_->name) } @{ $_[0]->all_clients } } }
sub init_all_accounting_methods { [ { id => 'accrual', name => t8('Accrual accounting') }, { id => 'cash', name => t8('Cash accounting') } ] }
return [ map { id => $_, title => $cc{$_} }, sort { $cc{$a} cmp $cc{$b} } keys %cc ];
}
+sub init_all_countrymodes {
+ my %cm = SL::DefaultManager->country_modes;
+ return [ map { id => $_, title => "$_ ($cm{$_})" }, sort keys %cm ];
+}
+
#
# filters
#
sub setup_layout {
my ($self, $action) = @_;
+ my $defaults = SL::DefaultManager->new($::lx_office_conf{system}->{default_manager});
$::request->layout(SL::Layout::Dispatcher->new(style => 'admin'));
$::form->{favicon} = "favicon.ico";
%::myconfig = (
- countrycode => 'de',
- numberformat => '1.000,00',
- dateformat => 'dd.mm.yy',
+ countrycode => $defaults->language('de'),
+ numberformat => $defaults->numberformat('1.000,00'),
+ dateformat => $defaults->dateformat('dd.mm.yy'),
) if !%::myconfig;
}
sub create_dataset_form {
my ($self, %params) = @_;
+
+ 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');
+
$self->render('admin/create_dataset', title => (t8('Database Administration') . " / " . t8('Create Dataset')));
}
'Posustva_coa' => 'USTVA Kennz.',
'Pre-defined Texts' => 'Vordefinierte Textblöcke',
'Preamble' => 'Einleitung',
+ 'Precision' => 'Genauigkeit',
'Preferences' => 'Einstellungen',
'Preferences saved!' => 'Einstellungen gespeichert!',
'Prefix for the new bins\' names' => 'Namenspräfix für die neuen Lagerplätze',
'Posting Configuration' => '',
'Postscript' => '',
'Posustva_coa' => '',
+ 'Precision' => '',
'Preferences' => '',
'Preferences saved!' => '',
'Prefix for the new bins\' names' => '',
<td>[% L.input_tag('db', FORM.db, class="initial_focus") %]</td>
</tr>
+ <tr>
+ <th valign="top" align="right" nowrap>[% LxERP.t8('Country') %]</th>
+ <td>[% L.select_tag('countrymode', SELF.all_countrymodes, title_key="title", default=(FORM.countrymode), onchange='select_country_defaults(this.value)') %]</td>
+ </tr>
+
+ <tr>
+ <td colspan="1"> </td>
+ <td><hr size="1" noshade></td>
+ </tr>
+
<tr>
<th align="right" nowrap>[% LxERP.t8('Default currency') %]</th>
- <td>[% L.input_tag('defaultcurrency', FORM.defaultcurrency || 'EUR') %]</td>
+ <td>[% L.input_tag('defaultcurrency', FORM.defaultcurrency) %]</td>
+ </tr>
+
+ <tr>
+ <th align="right" nowrap>[% LxERP.t8('Precision') %]</th>
+ <td>[% L.input_tag('precision', FORM.precision) %]</td>
</tr>
<tr>
<th valign="top" align="right" nowrap>[% LxERP.t8('Create Chart of Accounts') %]</th>
- <td>[% L.select_tag('chart', SELF.all_charts, onchange='comment_selected_chart(this.value)', default=(FORM.chart || 'Germany-DATEV-SKR03EU')) %]</td>
+ <td>[% L.select_tag('chart', SELF.all_charts, default=(FORM.chart), onchange='comment_selected_chart(this.value)') %]</td>
</tr>
<tr>
<th valign="top" align="right" nowrap>[% LxERP.t8('Accounting method') %]</th>
- <td>[% L.select_tag('accounting_method', SELF.all_accounting_methods, title_key='name', default=(FORM.accounting_method || 'cash')) %]</td>
+ <td>[% L.select_tag('accounting_method', SELF.all_accounting_methods, title_key='name', default=(FORM.accounting_method)) %]</td>
</tr>
<tr>
<th valign="top" align="right" nowrap>[% LxERP.t8('Inventory system') %]</th>
- <td>[% L.select_tag('inventory_system', SELF.all_inventory_systems, title_key='name', default=(FORM.inventory_system || 'periodic')) %]</td>
+ <td>[% L.select_tag('inventory_system', SELF.all_inventory_systems, title_key='name', default=(FORM.inventory_system)) %]</td>
</tr>
<tr>
<th valign="top" align="right" nowrap>[% LxERP.t8('Profit determination') %]</th>
- <td>[% L.select_tag('profit_determination', SELF.all_profit_determinations, title_key='name', default=(FORM.profit_determination || 'income')) %]</td>
+ <td>[% L.select_tag('profit_determination', SELF.all_profit_determinations, title_key='name', default=(FORM.profit_determination)) %]</td>
</tr>
</table>
function comment_selected_chart(s) {
if (s == 'Austria') {
- alert("SKR07 Austria ist noch Stand 2002." +
+ alert("SKR07 Austria ist noch Stand 2002." +
"\n" +
"Die Buchungsgruppen sind nicht korrekt vorkonfiguriert" +
"\n" +
"fuer Kunden im Ausland." +
"\n" +
"Hinweis vom 20.09.2011");
-
- } else if (s == 'Swiss-German') {
- alert("Hinweis: Das ist weder ein Schweizer Kontorahmen nach Kaefer noch ein " +
- "Schweizer KMU-Kontenrahmen, sondern ein angelehnter KMU-Kontenrahmen fuer " +
- "ein EDV-Dienstleistungsunternehmen mit Stand 2006 (Bspw. 32001 Hardware, " +
- "statt 3200 Warenertrag)." +
- "\n" +
- "Ferner sind keine Buchungsgruppe vorkonfiguriert, somit wird " +
- "standardmaessig keine Rechnung mit Steuer ausgewiesen." +
- "\n" +
- "Zum schnellen Testen und Zusammenhaenge verstehen waehlen Sie lieber einen " +
- "deutschen Kontenrahmen aus (SKR03 oder SKR04) und passen die Steuer an." +
- "\n" +
- "Hinweis vom 21.09.2011");
}
+ return true;
+}
+function select_country_defaults(country) {
+ if (/^CH/.test(country)) {
+ document.getElementById('defaultcurrency').value='CHF';
+ document.getElementById('precision').value='0.05';
+ document.getElementById('chart').value='Switzerland-deutsch-MWST-2014';
+ document.getElementById('accounting_method').value='accrual';
+ document.getElementById('inventory_system').value='periodic';
+ document.getElementById('profit_determination').value='balance';
+ } else {
+ document.getElementById('defaultcurrency').value='EUR';
+ document.getElementById('precision').value='0.01';
+ document.getElementById('chart').value='Germany-DATEV-SKR03EU';
+ document.getElementById('accounting_method').value='cash';
+ document.getElementById('inventory_system').value='periodic';
+ document.getElementById('profit_determination').value='income';
+ }
return true;
}
+
-->
</script>