WebshopApi: falsche sql update Abhängigkeit
[kivitendo-erp.git] / SL / Controller / FinancialControllingReport.pm
index 125a8a8..7b392f1 100644 (file)
@@ -37,6 +37,7 @@ sub action_list {
 
   $self->calculate_data;
 
+  $self->setup_list_action_bar;
   $self->list_objects;
 }
 
@@ -243,6 +244,7 @@ sub init_models {
     query => [
       SL::DB::Manager::Order->type_filter('sales_order'),
       '!closed' => 1,
+      (salesman_id => SL::DB::Manager::Employee->current->id) x !$::auth->assert('sales_all_edit', 1),
       or        => [
         globalproject_id => undef,
         and              => [
@@ -288,4 +290,18 @@ sub link_to {
   }
 }
 
+sub setup_list_action_bar {
+  my ($self, %params) = @_;
+
+  for my $bar ($::request->layout->get('actionbar')) {
+    $bar->add(
+      action => [
+        t8('Update'),
+        submit    => [ '#filter_form', { action => 'FinancialControllingReport/list' } ],
+        accesskey => 'enter',
+      ],
+    );
+  }
+}
+
 1;