X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;ds=sidebyside;f=SL%2FController%2FTaxzones.pm;h=6f5adf7f15adf09fa92ab9fc8e5d5d7f88ccf42d;hb=4247547d2a925ddad7006cae89e5f9f1fda7d469;hp=5f19ea6d3acfb7d74ac2237a7b74ef33eecd0004;hpb=f5c454e3855012bdb1928f3e4c4964403d4d8163;p=kivitendo-erp.git diff --git a/SL/Controller/Taxzones.pm b/SL/Controller/Taxzones.pm index 5f19ea6d3..6f5adf7f1 100644 --- a/SL/Controller/Taxzones.pm +++ b/SL/Controller/Taxzones.pm @@ -11,10 +11,10 @@ use SL::Helper::Flash; use SL::Locale::String; use SL::DB::Manager::Buchungsgruppe; use SL::DB::Manager::TaxzoneChart; -use SL::Controller::ClientConfig; use Rose::Object::MakeMethods::Generic ( scalar => [ qw(config) ], + 'scalar --get_set_init' => [ qw(defaults) ], ); __PACKAGE__->run_before('check_auth'); @@ -46,15 +46,13 @@ sub show_form { my ($self, %params) = @_; $self->render('taxzones/form', %params, - BUCHUNGSGRUPPEN => SL::DB::Manager::Buchungsgruppe->get_all_sorted, - ACCOUNTS => SL::Controller::ClientConfig->init_accounts, - account_label => sub { "$_[0]{accno}--$_[0]{description}" }); + BUCHUNGSGRUPPEN => SL::DB::Manager::Buchungsgruppe->get_all_sorted); } sub action_edit { my ($self) = @_; - $self->show_form(title => t8('Edit custom variable'), + $self->show_form(title => t8('Edit taxzone'), CHARTLIST => SL::DB::TaxzoneChart->get_all_accounts_by_taxzone_id($self->config->id)); } @@ -115,6 +113,7 @@ sub create_or_update { } $self->config->save; + $self->config->obsolete($::form->{"obsolete"}); #Save taxzone_charts for new taxzones: if ($is_new) { @@ -135,4 +134,10 @@ sub create_or_update { $self->redirect_to(action => 'list'); } +# +# initializers +# + +sub init_defaults { SL::DB::Default->get }; + 1;