From 16c66f611b987008d72c4475ce7cf691d517af0f Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jan=20B=C3=BCren?= Date: Tue, 5 May 2009 11:39:55 +0000 Subject: [PATCH] Bugzilla Eintrag 856 EAN auch fuers Einlagern ... Teil II von III --- SL/Common.pm | 9 +++------ bin/mozilla/wh.pl | 10 +++++----- templates/webpages/generic/select_part_de.html | 9 +++++++++ templates/webpages/generic/select_part_master.html | 9 +++++++++ .../webpages/wh/warehouse_selection_stock_de.html | 4 ++++ .../webpages/wh/warehouse_selection_stock_master.html | 4 ++++ 6 files changed, 34 insertions(+), 11 deletions(-) diff --git a/SL/Common.pm b/SL/Common.pm index e4d01fae2..b5e231c7b 100644 --- a/SL/Common.pm +++ b/SL/Common.pm @@ -51,7 +51,7 @@ sub retrieve_parts { my (@filter_values, $filter); - foreach (qw(partnumber description)) { + foreach (qw(partnumber description ean)) { next unless $form->{$_}; $filter .= qq| AND ($_ ILIKE ?)|; @@ -62,10 +62,7 @@ sub retrieve_parts { $filter .= qq| AND (NOT COALESCE(assembly, FALSE))|; } if ($form->{assemblies}) { - $filter .= qq| AND assembly=TRUE|; # alles was assembly ist rausgeben erweiterung für bin/mozilla/wh.pl -> transfer_assembly_update_part -# eigentlich möchte ich diesen filter abbilden: -# select distinct partnumber from parts inner join assembly on (parts.id = assembly.id) where assembly='t'; -# und so common ist die anweisung gar nicht. wie wäre es mit auslagern in WH.pm? -> get_all_working_assemblies? jb 21.2.2009 + $filter .= qq| AND assembly=TRUE|; } if ($form->{no_services}) { @@ -78,7 +75,7 @@ sub retrieve_parts { $order_dir = $order_dir ? "ASC" : "DESC"; my $query = - qq|SELECT id, partnumber, description | . + qq|SELECT id, partnumber, description, ean | . qq|FROM parts $filter | . qq|ORDER BY $order_by $order_dir|; my $sth = $dbh->prepare($query); diff --git a/bin/mozilla/wh.pl b/bin/mozilla/wh.pl index d1d406da6..d632d5d96 100644 --- a/bin/mozilla/wh.pl +++ b/bin/mozilla/wh.pl @@ -281,11 +281,11 @@ sub transfer_stock_update_part { $form->{trans_type} = 'stock'; $form->{qty} = $form->parse_amount(\%myconfig, $form->{qty}); - if (!$form->{partnumber} && !$form->{description}) { - delete @{$form}{qw(parts_id partunit)}; + if (!$form->{partnumber} && !$form->{description} && !$form->{ean}) { + delete @{$form}{qw(parts_id partunit ean)}; transfer_warehouse_selection(); - } elsif (($form->{partnumber} && ($form->{partnumber} ne $form->{old_partnumber})) || $form->{description}) { + } elsif (($form->{partnumber} && ($form->{partnumber} ne $form->{old_partnumber})) || $form->{description} || $form->{ean}) { $form->{no_services} = 1; $form->{no_assemblies} = 0; # assemblies duerfen eingelagert werden (z.B. bei retouren) @@ -293,7 +293,7 @@ sub transfer_stock_update_part { my $parts = Common->retrieve_parts(\%myconfig, $form, 'description', 1); if (scalar @{ $parts } == 1) { - @{$form}{qw(parts_id partnumber description)} = @{$parts->[0]}{qw(id partnumber description)}; + @{$form}{qw(parts_id partnumber description ean)} = @{$parts->[0]}{qw(id partnumber description ean)}; transfer_stock_get_partunit(); transfer_warehouse_selection(); @@ -353,7 +353,7 @@ sub transfer_stock_part_selected { my $part = shift; - @{$form}{qw(parts_id partnumber description)} = @{$part}{qw(id partnumber description)}; + @{$form}{qw(parts_id partnumber description ean)} = @{$part}{qw(id partnumber description ean)}; transfer_stock_get_partunit(); transfer_warehouse_selection(); diff --git a/templates/webpages/generic/select_part_de.html b/templates/webpages/generic/select_part_de.html index e2e315bb8..80ab53787 100644 --- a/templates/webpages/generic/select_part_de.html +++ b/templates/webpages/generic/select_part_de.html @@ -20,6 +20,9 @@ [% IF has_charge %] Chargennummer [% END %] + [% IF has_ean %] + EAN + [% END %] [% FOREACH part = PARTS %] @@ -46,6 +49,12 @@ [% HTML.escape(part.chargenumber) %] [% END %] + [% IF has_ean %] + + + [% HTML.escape(part.ean) %] + [% END %] + [% END %] diff --git a/templates/webpages/generic/select_part_master.html b/templates/webpages/generic/select_part_master.html index 66df8fc22..c7e2f347f 100644 --- a/templates/webpages/generic/select_part_master.html +++ b/templates/webpages/generic/select_part_master.html @@ -20,6 +20,9 @@ [% IF has_charge %] Charge number [% END %] + [% IF has_ean %] + EAN + [% END %] [% FOREACH part = PARTS %] @@ -46,6 +49,12 @@ [% HTML.escape(part.chargenumber) %] [% END %] + [% IF has_ean %] + + + [% HTML.escape(part.ean) %] + [% END %] + [% END %] diff --git a/templates/webpages/wh/warehouse_selection_stock_de.html b/templates/webpages/wh/warehouse_selection_stock_de.html index 37d1019b6..d9ce5cba6 100644 --- a/templates/webpages/wh/warehouse_selection_stock_de.html +++ b/templates/webpages/wh/warehouse_selection_stock_de.html @@ -104,6 +104,10 @@ Chargennummer + + EAN + + Menge diff --git a/templates/webpages/wh/warehouse_selection_stock_master.html b/templates/webpages/wh/warehouse_selection_stock_master.html index 300516306..2558429ad 100644 --- a/templates/webpages/wh/warehouse_selection_stock_master.html +++ b/templates/webpages/wh/warehouse_selection_stock_master.html @@ -104,6 +104,10 @@ Charge number + + EAN + + Quantity -- 2.20.1