X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FController%2FClientConfig.pm;h=41c19ee80f53b01cc6db147fa6765ece45ec785d;hb=8ae2bc4fb4c72f3ac907a3e47c0cbd5da23f62c5;hp=e6e687806e0c0e45515ea5b4f6d2f55ee2c0e269;hpb=3424bf80214aede7a8318c39b754290738e4aea0;p=kivitendo-erp.git diff --git a/SL/Controller/ClientConfig.pm b/SL/Controller/ClientConfig.pm index e6e687806..41c19ee80 100644 --- a/SL/Controller/ClientConfig.pm +++ b/SL/Controller/ClientConfig.pm @@ -12,11 +12,27 @@ __PACKAGE__->run_before('check_auth'); sub action_edit { my ($self, %params) = @_; + $self->{posting_options} = [ { title => $::locale->text("never"), value => 0 }, + { title => $::locale->text("every time"), value => 1 }, + { title => $::locale->text("on the same day"), value => 2 }, ]; $self->{payment_options} = [ { title => $::locale->text("never"), value => 0 }, { title => $::locale->text("every time"), value => 1 }, { title => $::locale->text("on the same day"), value => 2 }, ]; + $self->{accounting_options} = [ { title => $::locale->text("Accrual"), value => "accrual" }, + { title => $::locale->text("cash"), value => "cash" }, ]; + $self->{inventory_options} = [ { title => $::locale->text("perpetual"), value => "perpetual" }, + { title => $::locale->text("periodic"), value => "periodic" }, ]; + $self->{profit_options} = [ { title => $::locale->text("balance"), value => "balance" }, + { title => $::locale->text("income"), value => "income" }, ]; + + map { $self->{$_} = SL::DB::Default->get->$_ } qw(is_changeable ir_changeable ar_changeable ap_changeable gl_changeable); $self->{payments_changeable} = SL::DB::Default->get->payments_changeable; + + map { $self->{$_} = SL::DB::Default->get->$_ } qw(is_show_mark_as_paid ir_show_mark_as_paid ar_show_mark_as_paid ap_show_mark_as_paid); + + map { $self->{$_} = SL::DB::Default->get->$_ } qw(accounting_method inventory_system profit_determination); + $self->{show_bestbefore} = SL::DB::Default->get->show_bestbefore; map { $self->{$_} = SL::DB::Default->get->$_ } qw(datev_check_on_sales_invoice datev_check_on_purchase_invoice datev_check_on_ar_transaction datev_check_on_ap_transaction datev_check_on_gl_transaction); @@ -25,6 +41,8 @@ sub action_edit { #check_on_dunning = 0 #check_on_sepa_import = 0 + map { $self->{$_} = SL::DB::Default->get->$_ } qw(sales_order_show_delete purchase_order_show_delete sales_delivery_order_show_delete purchase_delivery_order_show_delete); + $self->render('client_config/form', title => $::locale->text('Client Configuration')); } @@ -32,11 +50,20 @@ sub action_edit { sub action_save { my ($self, %params) = @_; + map { SL::DB::Default->get->update_attributes($_ => $::form->{$_}); } qw(is_changeable ir_changeable ar_changeable ap_changeable gl_changeable); + SL::DB::Default->get->update_attributes('payments_changeable' => $::form->{payments_changeable}); + + map { SL::DB::Default->get->update_attributes($_ => $::form->{$_}); } qw(is_show_mark_as_paid ir_show_mark_as_paid ar_show_mark_as_paid ap_show_mark_as_paid); + + map { SL::DB::Default->get->update_attributes($_ => $::form->{$_}); } qw(accounting_method inventory_system profit_determination); + SL::DB::Default->get->update_attributes('show_bestbefore' => $::form->{show_bestbefore}); map { SL::DB::Default->get->update_attributes($_ => $::form->{$_}); } qw(datev_check_on_sales_invoice datev_check_on_purchase_invoice datev_check_on_ar_transaction datev_check_on_ap_transaction datev_check_on_gl_transaction); + map { SL::DB::Default->get->update_attributes($_ => $::form->{$_}); } qw(sales_order_show_delete purchase_order_show_delete sales_delivery_order_show_delete purchase_delivery_order_show_delete); + flash_later('info', $::locale->text('Client Configuration saved!')); $self->redirect_to(action => 'edit');