X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=bin%2Fmozilla%2Fwh.pl;h=3cb1243ca7414898a4ca1deb7042f89ae6dc09fc;hb=549f187d3a2b1d15f96c4556714666ed954447bb;hp=4012fa2fde2ed811f6cc140c1a677cd1c848c483;hpb=3193bd4a57817d4ad38397f3cf4c84647cf16051;p=kivitendo-erp.git diff --git a/bin/mozilla/wh.pl b/bin/mozilla/wh.pl index 4012fa2fd..3cb1243ca 100644 --- a/bin/mozilla/wh.pl +++ b/bin/mozilla/wh.pl @@ -198,9 +198,8 @@ sub transfer_or_removal_prepare_contents { my $all_units = AM->retrieve_units(\%myconfig, $form); foreach (@contents) { - $_->{qty} = $form->format_amount_units('amount' => $_->{qty}, - 'part_unit' => $_->{partunit}, - 'conv_units' => 'convertible'); + $_->{qty} = $form->format_amount(\%myconfig, $_->{qty}) . ' ' . $_->{partunit}; + my $this_unit = $_->{partunit}; if ($all_units->{$_->{partunit}} && ($all_units->{g}->{base_unit} eq $all_units->{$_->{partunit}}->{base_unit})) { @@ -575,7 +574,7 @@ sub journal { show_no_warehouses_error() if (!scalar @{ $form->{WAREHOUSES} }); my $cvar_configs = CVar->get_configs('module' => 'IC'); - (undef, + ($form->{CUSTOM_VARIABLES_FILTER_CODE}, $form->{CUSTOM_VARIABLES_INCLUSION_CODE}) = CVar->render_search_options('variables' => $cvar_configs, 'include_prefix' => 'l_', 'include_value' => 'Y'); @@ -649,11 +648,16 @@ sub generate_journal { my $cvar_configs = CVar->get_configs('module' => 'IC'); my @includeable_custom_variables = grep { $_->{includeable} } @{ $cvar_configs }; + my @searchable_custom_variables = grep { $_->{searchable} } @{ $cvar_configs }; push @columns, map { "cvar_$_->{name}" } @includeable_custom_variables; my @hidden_variables = map { "l_${_}" } @columns; push @hidden_variables, qw(warehouse_id bin_id partnumber description chargenumber bestbefore qty_op qty qty_unit unit partunit fromdate todate transtype_ids comment projectnumber); push @hidden_variables, qw(classification_id); + push @hidden_variables, map({'cvar_'. $_->{name}} @searchable_custom_variables); + push @hidden_variables, map({'cvar_'. $_->{name} .'_from'} grep({$_->{type} eq 'date'} @searchable_custom_variables)); + push @hidden_variables, map({'cvar_'. $_->{name} .'_to'} grep({$_->{type} eq 'date'} @searchable_custom_variables)); + push @hidden_variables, map({'cvar_'. $_->{name} .'_qtyop'} grep({$_->{type} eq 'number'} @searchable_custom_variables)); my %column_defs = ( 'ids' => { raw_header_data => checkbox_tag("", id => "check_all", checkall => "[data-checkall=1]") }, @@ -806,12 +810,13 @@ sub report { my $locale = $main::locale; $form->get_lists('warehouses' => { 'key' => 'WAREHOUSES', - 'bins' => 'BINS', }); + 'bins' => 'BINS', }, + 'partsgroup' => 'PARTSGROUPS'); show_no_warehouses_error() if (!scalar @{ $form->{WAREHOUSES} }); my $cvar_configs = CVar->get_configs('module' => 'IC'); - (undef, + ($form->{CUSTOM_VARIABLES_FILTER_CODE}, $form->{CUSTOM_VARIABLES_INCLUSION_CODE}) = CVar->render_search_options('variables' => $cvar_configs, 'include_prefix' => 'l_', 'include_value' => 'Y'); @@ -822,8 +827,9 @@ sub report { $form->header(); print $form->parse_html_template("wh/report_filter", - { "WAREHOUSES" => $form->{WAREHOUSES}, - "UNITS" => AM->unit_select_data(AM->retrieve_units(\%myconfig, $form)), + { "WAREHOUSES" => $form->{WAREHOUSES}, + "PARTSGROUPS" => $form->{PARTSGROUPS}, + "UNITS" => AM->unit_select_data(AM->retrieve_units(\%myconfig, $form)), }); $main::lxdebug->leave_sub(); @@ -846,7 +852,7 @@ sub generate_report { my @columns = qw(warehousedescription bindescription partnumber type_and_classific partdescription chargenumber bestbefore comment qty partunit list_price purchase_price stock_value); # filter stuff - map { $filter{$_} = $form->{$_} if ($form->{$_}) } qw(warehouse_id bin_id classification_id partnumber description chargenumber bestbefore date include_invalid_warehouses); + map { $filter{$_} = $form->{$_} if ($form->{$_}) } qw(warehouse_id bin_id classification_id partnumber description partsgroup_id chargenumber bestbefore date include_invalid_warehouses); # show filter stuff also in report my @options; @@ -863,6 +869,8 @@ sub generate_report { 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}"}, + partsgroup_id => sub { push @options, $locale->text('Partsgroup') . " : " . + SL::DB::PartsGroup->new(id => $form->{partsgroup_id})->load->partsgroup}, chargenumber => sub { push @options, $locale->text('Charge Number') . " : $form->{chargenumber}"}, bestbefore => sub { push @options, $locale->text('Best Before') . " : $form->{bestbefore}"}, include_invalid_warehouses => sub { push @options, $locale->text('Include invalid warehouses ')}, @@ -915,12 +923,17 @@ sub generate_report { my $cvar_configs = CVar->get_configs('module' => 'IC'); my @includeable_custom_variables = grep { $_->{includeable} } @{ $cvar_configs }; + my @searchable_custom_variables = grep { $_->{searchable} } @{ $cvar_configs }; push @columns, map { "cvar_$_->{name}" } @includeable_custom_variables; 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(warehouse_id bin_id partnumber partstypes_id description partsgroup_id 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 stock_value_basis allrows); + push @hidden_variables, map({'cvar_'. $_->{name}} @searchable_custom_variables); + push @hidden_variables, map({'cvar_'. $_->{name} .'_from'} grep({$_->{type} eq 'date'} @searchable_custom_variables)); + push @hidden_variables, map({'cvar_'. $_->{name} .'_to'} grep({$_->{type} eq 'date'} @searchable_custom_variables)); + push @hidden_variables, map({'cvar_'. $_->{name} .'_qtyop'} grep({$_->{type} eq 'number'} @searchable_custom_variables)); my %column_defs = ( 'warehousedescription' => { 'text' => $locale->text('Warehouse'), }, @@ -987,9 +1000,6 @@ sub generate_report { map { $subtotals{$_} += $entry->{$_} } @subtotals_columns; $total_stock_value += $entry->{stock_value} * 1; $entry->{qty} = $form->format_amount(\%myconfig, $entry->{qty}); -# $entry->{qty} = $form->format_amount_units('amount' => $entry->{qty}, -# 'part_unit' => $entry->{partunit}, -# 'conv_units' => 'convertible'); $entry->{stock_value} = $form->format_amount(\%myconfig, $entry->{stock_value} * 1, 2); $entry->{purchase_price} = $form->format_amount(\%myconfig, $entry->{purchase_price} * 1, 2); $entry->{list_price} = $form->format_amount(\%myconfig, $entry->{list_price} * 1, 2); @@ -1002,9 +1012,6 @@ sub generate_report { my $row = { map { $_ => { 'data' => '', 'class' => 'listsubtotal', 'align' => $column_alignment{$_}, } } @columns }; $row->{qty}->{data} = $form->format_amount(\%myconfig, $subtotals{qty}); -# $row->{qty}->{data} = $form->format_amount_units('amount' => $subtotals{qty} * 1, -# 'part_unit' => $entry->{partunit}, -# 'conv_units' => 'convertible'); $row->{stock_value}->{data} = $form->format_amount(\%myconfig, $subtotals{stock_value} * 1, 2); $row->{purchase_price}->{data} = $form->format_amount(\%myconfig, $subtotals{purchase_price} * 1, 2); $row->{list_price}->{data} = $form->format_amount(\%myconfig, $subtotals{list_price} * 1, 2);