CustomerVendor Picker auf displayable_name umgestellt
[kivitendo-erp.git] / SL / Controller / Taxzones.pm
index 5f19ea6..6f5adf7 100644 (file)
@@ -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;