$::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 );
}
'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,
- # PARTSCLASSIFICATIONS => SL::DB:Manager::PartsClassification->get_all_classifications_by_name() ,
WAREHOUSES => $::form->{WAREHOUSES},
WAREHOUSE_FILTER => 1,
warehouse_id => 0,
$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 {
$::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__
+
+=encoding utf-8
+
+=head1 NAME
+
+SL::Controller::Inventory - Report Controller for inventory
+
+=head1 DESCRIPTION
+
+This controller makes three reports about inventory in warehouses/stocks
+
+- warehouse content
+
+- warehouse journal
+
+- warehouse withdrawal
+
+=head1 FUNCTIONS
+
+=over 4
+
+=item C<action_stock_usage>
+
+Create a search form for stock withdrawal.
+The search parameter for report are made like the reports in bin/mozilla/rp.pl
+
+=item C<action_usage>
+
+Make a report about stock withdrawal.
+
+The manual pagination is implemented like the pagination in SL::Controller::CsvImport.
+
+=back
+
+=head1 SPECIAL CASES
+
+Because of the PFD-Table Formatter some parameters for PDF must be different to the HTML parameters.
+So in german language there are some tries to use a HTML Break in the second heading line
+to produce two line heading inside table. The actual version has some abbreviations for the header texts.
+
+=head1 BUGS
+
+The PDF-Table library has some limits (doesn't display all if the line is to large) so
+the format is adapted to this
+
+
+=head1 AUTHOR
+
+only for C<action_stock_usage> and C<action_usage>:
+
+Martin Helmling E<lt>martin.helmling@opendynamic.deE<gt>
+
+
+=cut