X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FController%2FAdmin.pm;h=1dae1b3c329f9d9948a2171777a50e16dcf0bed2;hb=1cbc459da604c31d21593df298a522e6cbe69e2b;hp=c595b241126f2866efcac3561f82cdb5f3a9d116;hpb=1e403f489b283e2e6b725f32cea29f38b3fe4e1f;p=kivitendo-erp.git diff --git a/SL/Controller/Admin.pm b/SL/Controller/Admin.pm index c595b2411..1dae1b3c3 100644 --- a/SL/Controller/Admin.pm +++ b/SL/Controller/Admin.pm @@ -21,7 +21,7 @@ use SL::Layout::AdminLogin; 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_countrymodes all_stylesheets all_menustyles all_clients all_groups all_users all_rights all_printers + all_dateformats all_numberformats all_countrycodes 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) ], ); @@ -115,7 +115,6 @@ sub action_new_user { my $defaults = SL::DefaultManager->new($::lx_office_conf{system}->{default_manager}); $self->user(SL::DB::AuthUser->new( config_values => { - vclimit => 200, countrycode => $defaults->language('de'), numberformat => $defaults->numberformat('1.000,00'), dateformat => $defaults->dateformat('dd.mm.yy'), @@ -490,7 +489,7 @@ sub action_lock_system { sub init_db_cfg { $::lx_office_conf{'authentication/database'} } sub init_is_locked { SL::System::InstallationLock->is_locked } -sub init_client { SL::DB::Manager::AuthClient->find_by(id => ($::form->{id} || ($::form->{client} || {})->{id})) } +sub init_client { SL::DB::Manager::AuthClient->find_by(id => (($::form->{client} || {})->{id} || $::form->{id})) } sub init_user { SL::DB::AuthUser ->new(id => ($::form->{id} || ($::form->{user} || {})->{id}))->load } sub init_group { SL::DB::AuthGroup ->new(id => ($::form->{id} || ($::form->{group} || {})->{id}))->load } sub init_printer { SL::DB::Printer ->new(id => ($::form->{id} || ($::form->{printer} || {})->{id}))->load } @@ -552,11 +551,6 @@ sub init_all_countrycodes { 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 # @@ -578,7 +572,7 @@ sub setup_client { my ($self) = @_; $self->client(SL::DB::Manager::AuthClient->get_default || $self->all_clients->[0]) if !$self->client; - $::auth->set_client($self->client->id); + $::auth->set_client($self->client->id) if $self->client; } # @@ -638,13 +632,18 @@ sub create_dataset_form { 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'); + $::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'); + $::form->{feature_balance} = $defaults->feature_balance(1); + $::form->{feature_datev} = $defaults->feature_datev(1); + $::form->{feature_erfolgsrechnung} = $defaults->feature_erfolgsrechnung(0); + $::form->{feature_eurechnung} = $defaults->feature_eurechnung(1); + $::form->{feature_ustva} = $defaults->feature_ustva(1); $self->render('admin/create_dataset', title => (t8('Database Administration') . " / " . t8('Create Dataset'))); }