X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FController%2FInventory.pm;h=a95efaddb0188a4bda21e5db971686b2bebb6774;hb=e40c9d4da8cedc8f5151661887f6c9a2da8237c7;hp=6a7dadc4f2bc6e2c3eab26b35676f34227471193;hpb=65d2537d658b99b005a18c6663bc1293b41a1d83;p=kivitendo-erp.git diff --git a/SL/Controller/Inventory.pm b/SL/Controller/Inventory.pm index 6a7dadc4f..a95efaddb 100644 --- a/SL/Controller/Inventory.pm +++ b/SL/Controller/Inventory.pm @@ -44,6 +44,7 @@ sub action_stock_in { $::request->layout->focus('#part_id_name'); my $transfer_types = WH->retrieve_transfer_types('in'); map { $_->{description} = $main::locale->text($_->{description}) } @{ $transfer_types }; + $self->setup_stock_in_action_bar; $self->render('inventory/warehouse_selection_stock', title => $::form->{title}, TRANSFER_TYPES => $transfer_types ); } @@ -56,6 +57,7 @@ sub action_stock_usage { 'bins' => 'BINS', }); $::request->layout->use_javascript("${_}.js") for qw(kivi.PartsWarehouse); + $self->setup_stock_usage_action_bar; $self->render('inventory/warehouse_usage', title => $::form->{title}, year => DateTime->today->year, @@ -384,7 +386,6 @@ sub make_row_result { $row->{averconsumed}->{data} = $row->{consumed}->{data}*30/$days ; map { $row->{$_}->{data} = $form->format_amount($myconfig,$row->{$_}->{data},2); } $self->getnumcolumns(); $row->{partnumber}->{link} = 'controller.pl?action=Part/edit&part.id' . $partid; -# $row->{partdescription}->{link} = 'ic.pl?action=edit&id='.$partid; } sub action_stock { @@ -622,6 +623,35 @@ sub show_no_warehouses_error { $::form->show_generic_error($msg); } +sub setup_stock_in_action_bar { + my ($self, %params) = @_; + + for my $bar ($::request->layout->get('actionbar')) { + $bar->add( + action => [ + t8('Stock'), + submit => [ '#form', { action => 'Inventory/stock' } ], + checks => [ 'check_part_selection_before_stocking' ], + accesskey => 'enter', + ], + ); + } +} + +sub setup_stock_usage_action_bar { + my ($self, %params) = @_; + + for my $bar ($::request->layout->get('actionbar')) { + $bar->add( + action => [ + t8('Show'), + submit => [ '#form', { action => 'Inventory/usage' } ], + accesskey => 'enter', + ], + ); + } +} + 1; __END__ @@ -678,4 +708,3 @@ Martin Helmling Emartin.helmling@opendynamic.deE =cut -