X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/60d62c9e8923f671ac1c2eb9318cf78789787e1c..7321146cf5a08364a9db2ddddbb0b74a5d3fc4c9:/bin/mozilla/wh.pl diff --git a/bin/mozilla/wh.pl b/bin/mozilla/wh.pl index b3550b253..92cfcb69b 100644 --- a/bin/mozilla/wh.pl +++ b/bin/mozilla/wh.pl @@ -44,6 +44,8 @@ use SL::WH; use SL::OE; use SL::ReportGenerator; +use SL::DB::Part; + use Data::Dumper; require "bin/mozilla/common.pl"; @@ -85,8 +87,16 @@ sub transfer_warehouse_selection { show_no_warehouses_error() if (!scalar @{ $form->{WAREHOUSES} }); my $units = AM->retrieve_units(\%myconfig, $form); + + my $part = 0; + if ( $form->{parts_id} ) { + $part = SL::DB::Part->new(); + $part->id($form->{parts_id}); + $part->load(); + } + # der zweite Parameter von unit_select_data gibt den default-Namen (selected) vor - $form->{UNITS} = AM->unit_select_data($units, $form->{partunit}, 0, $form->{partunit}); + $form->{UNITS} = AM->unit_select_data($units, $form->{unit}, 0, $part ? $part->unit : 0); if (scalar @{ $form->{WAREHOUSES} }) { $form->{warehouse_id} ||= $form->{WAREHOUSES}->[0]->{id}; @@ -438,7 +448,7 @@ sub create_assembly { $form->error($locale->text('The warehouse or the bin is missing.')); } - if (!$::lx_office_conf{features}->{show_best_before}) { + if (!$::instance_conf->get_show_bestbefore) { $form->{bestbefore} = ''; } @@ -794,8 +804,6 @@ sub report { $form->{jsscript} = 1; -# $form->{fokus} = "partnumber"; -# $form->{onload} .= "focus();"; $form->{title} = $locale->text("Report about warehouse contents"); $form->header(); @@ -896,7 +904,7 @@ sub generate_report { my $row_set = [ { map { $_ => { 'data' => $entry->{$_}, 'align' => $column_alignment{$_} } } @columns } ]; - if (($form->{subtotal} eq 'Y') + if ( ($form->{subtotal} eq 'Y' && !$form->{report_generator_csv_options_for_import} ) && (($idx == (scalar @contents - 1)) || ($entry->{$sort_col} ne $contents[$idx + 1]->{$sort_col}))) { @@ -916,7 +924,7 @@ sub generate_report { $idx++; } - if ($column_defs{stock_value}->{visible}) { + if ( $column_defs{stock_value}->{visible} && !$form->{report_generator_csv_options_for_import} ) { $report->add_separator(); my $row = { map { $_ => { 'data' => '', 'class' => 'listsubtotal', } } @columns };