X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=bin%2Fmozilla%2Fwh.pl;h=42639f579c12b423a7ce213a7498d8a38183f7ae;hb=71c23cdf2826595579b8e62fc964393875ef070f;hp=fb359085e940b04ed9c13aa63662878416b7f68d;hpb=34035b33f21af21316df798b19f2a758aa86b3a8;p=kivitendo-erp.git diff --git a/bin/mozilla/wh.pl b/bin/mozilla/wh.pl index fb359085e..42639f579 100644 --- a/bin/mozilla/wh.pl +++ b/bin/mozilla/wh.pl @@ -23,7 +23,8 @@ # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software -# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, +# MA 02110-1335, USA. # ####################################################################### # @@ -677,10 +678,10 @@ sub generate_journal { $form->{report_generator_output_format} = 'HTML' if !$form->{report_generator_output_format}; my %filter; - my @columns = qw(trans_id date warehouse_from bin_from warehouse_to bin_to partnumber partdescription chargenumber bestbefore trans_type comment qty employee oe_id projectnumber); + my @columns = qw(trans_id date warehouse_from bin_from warehouse_to bin_to partnumber type_and_classific partdescription chargenumber bestbefore trans_type comment qty unit partunit employee oe_id projectnumber); # filter stuff - map { $filter{$_} = $form->{$_} if ($form->{$_}) } qw(warehouse_id bin_id partnumber description chargenumber bestbefore); + map { $filter{$_} = $form->{$_} if ($form->{$_}) } qw(warehouse_id bin_id classification_id partnumber description chargenumber bestbefore); $filter{qty_op} = WH->convert_qty_op($form->{qty_op}); if ($filter{qty_op}) { @@ -696,6 +697,7 @@ sub generate_journal { my @hidden_variables = map { "l_${_}" } @columns; push @hidden_variables, qw(warehouse_id bin_id partnumber description chargenumber bestbefore qty_op qty qty_unit fromdate todate); + push @hidden_variables, qw(classification_id); my %column_defs = ( 'date' => { 'text' => $locale->text('Date'), }, @@ -707,6 +709,8 @@ sub generate_journal { 'bin_from' => { 'text' => $locale->text('Bin From'), }, 'bin_to' => { 'text' => $locale->text('Bin To'), }, 'partnumber' => { 'text' => $locale->text('Part Number'), }, + 'type_and_classific' + => { 'text' => $locale->text('Type'), }, 'partdescription' => { 'text' => $locale->text('Part Description'), }, 'chargenumber' => { 'text' => $locale->text('Charge Number'), }, 'bestbefore' => { 'text' => $locale->text('Best Before'), }, @@ -725,6 +729,8 @@ sub generate_journal { my %column_alignment = map { $_ => 'right' } qw(qty); map { $column_defs{$_}->{visible} = $form->{"l_${_}"} ? 1 : 0 } @columns; + $column_defs{type_and_classific}->{visible} = 1; + $column_defs{type_and_classific}->{link} =''; $report->set_columns(%column_defs); $report->set_column_order(@columns); @@ -752,17 +758,19 @@ sub generate_journal { 'purchase_invoice' => { script => 'ir', title => $locale->text('Purchase Invoice') }, ); - my $allrows = 0; - $allrows = 1 if $form->{report_generator_output_format} ne 'HTML' ; - - # manual paginating - my $pages = {}; - $pages->{per_page} = $::form->{per_page} || 15; - my $first_nr = ($page - 1) * $pages->{per_page}; - my $last_nr = $first_nr + $pages->{per_page}; - my $idx = 0; - + my $allrows = 0; + $allrows = 1 if $form->{report_generator_output_format} ne 'HTML' ; + + # manual paginating + my $pages = {}; + $pages->{per_page} = $::form->{per_page} || 15; + my $first_nr = ($page - 1) * $pages->{per_page}; + my $last_nr = $first_nr + $pages->{per_page}; + my $idx = 0; + foreach my $entry (@contents) { + $entry->{type_and_classific} = $::request->presenter->type_abbreviation($entry->{part_type}). + $::request->presenter->classification_abbreviation($entry->{classification_id}); $entry->{qty} = $form->format_amount_units('amount' => $entry->{qty}, 'part_unit' => $entry->{partunit}, 'conv_units' => 'convertible'); @@ -852,13 +860,16 @@ sub generate_report { my $sort_col = $form->{sort}; my %filter; - my @columns = qw(warehousedescription bindescription partnumber partdescription chargenumber bestbefore qty stock_value); + my @columns = qw(warehousedescription bindescription partnumber type_and_classific partdescription chargenumber bestbefore comment qty partunit stock_value); # filter stuff - map { $filter{$_} = $form->{$_} if ($form->{$_}) } qw(warehouse_id bin_id partstypes_id partnumber description chargenumber bestbefore date include_invalid_warehouses); + map { $filter{$_} = $form->{$_} if ($form->{$_}) } qw(warehouse_id bin_id classification_id partnumber description chargenumber bestbefore date include_invalid_warehouses); # show filter stuff also in report my @options; + my $currentdate = $form->current_date(\%myconfig); + push @options, $locale->text('Printdate') . " : ".$locale->date(\%myconfig, $currentdate, 1); + # dispatch all options my $dispatch_options = { warehouse_id => sub { push @options, $locale->text('Warehouse') . " : " . @@ -866,15 +877,18 @@ sub generate_report { bin_id => sub { push @options, $locale->text('Bin') . " : " . SL::DB::Manager::Bin->find_by(id => $form->{bin_id})->description}, partnumber => sub { push @options, $locale->text('Partnumber') . " : $form->{partnumber}"}, + classification_id => sub { push @options, $locale->text('Parts Classification'). " : ". + SL::DB::Manager::PartClassification->get_first(where => [ id => $form->{classification_id} ] )->description; }, description => sub { push @options, $locale->text('Description') . " : $form->{description}"}, chargenumber => sub { push @options, $locale->text('Charge Number') . " : $form->{chargenumber}"}, bestbefore => sub { push @options, $locale->text('Best Before') . " : $form->{bestbefore}"}, - date => sub { push @options, $locale->text('Date') . " : $form->{date}"}, include_invalid_warehouses => sub { push @options, $locale->text('Include invalid warehouses ')}, }; foreach (keys %filter) { $dispatch_options->{$_}->() if $dispatch_options->{$_}; } + push @options, $locale->text('Stock Qty for Date') . " " . $locale->date(\%myconfig, $form->{date}?$form->{date}:$currentdate, 1); + # / end show filter stuff also in report $filter{qty_op} = WH->convert_qty_op($form->{qty_op}); @@ -895,11 +909,13 @@ sub generate_report { my @hidden_variables = map { "l_${_}" } @columns; push @hidden_variables, qw(warehouse_id bin_id partnumber partstypes_id description chargenumber bestbefore qty_op qty qty_unit partunit l_warehousedescription l_bindescription); push @hidden_variables, qw(include_empty_bins subtotal include_invalid_warehouses date); + push @hidden_variables, qw(classification_id); my %column_defs = ( 'warehousedescription' => { 'text' => $locale->text('Warehouse'), }, 'bindescription' => { 'text' => $locale->text('Bin'), }, 'partnumber' => { 'text' => $locale->text('Part Number'), }, + 'type_and_classific' => { 'text' => $locale->text('Type'), }, 'partdescription' => { 'text' => $locale->text('Part Description'), }, 'chargenumber' => { 'text' => $locale->text('Charge Number'), }, 'bestbefore' => { 'text' => $locale->text('Best Before'), }, @@ -916,6 +932,9 @@ sub generate_report { map { $column_defs{$_}->{visible} = $form->{"l_${_}"} ? 1 : 0 } @columns; + $column_defs{type_and_classific}->{visible} = 1; + $column_defs{type_and_classific}->{link} =''; + $report->set_columns(%column_defs); $report->set_column_order(@columns); @@ -950,6 +969,9 @@ sub generate_report { my $last_nr = $first_nr + $pages->{per_page}; foreach my $entry (@contents) { + + $entry->{type_and_classific} = $::request->presenter->type_abbreviation($entry->{part_type}). + $::request->presenter->classification_abbreviation($entry->{classification_id}); map { $subtotals{$_} += $entry->{$_} } @subtotals_columns; $total_stock_value += $entry->{stock_value} * 1; $entry->{qty} = $form->format_amount(\%myconfig, $entry->{qty}); @@ -977,7 +999,7 @@ sub generate_report { } if ( $allrows || ($idx >= $first_nr && $idx < $last_nr )) { - $report->add_data($row_set); + $report->add_data($row_set); } $idx++; }