my (@filter_values, $filter);
- foreach (qw(partnumber description)) {
+ foreach (qw(partnumber description ean)) {
next unless $form->{$_};
$filter .= qq| AND ($_ ILIKE ?)|;
$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}) {
$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);
$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)
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();
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();
[% IF has_charge %]
<th class="listheading">Chargennummer</th>
[% END %]
+ [% IF has_ean %]
+ <th class="listheading">EAN</th>
+ [% END %]
</tr>
[% FOREACH part = PARTS %]
[% HTML.escape(part.chargenumber) %]
</td>
[% END %]
+ [% IF has_ean %]
+ <td>
+ <input type="hidden" name="new_ean_[% loop.count %]" value="[% HTML.escape(part.ean) %]">
+ [% HTML.escape(part.ean) %]
+ [% END %]
+ </td>
</tr>
[% END %]
</table>
[% IF has_charge %]
<th class="listheading"><translate>Charge number</translate></th>
[% END %]
+ [% IF has_ean %]
+ <th class="listheading"><translate>EAN</translate></th>
+ [% END %]
</tr>
[% FOREACH part = PARTS %]
[% HTML.escape(part.chargenumber) %]
</td>
[% END %]
+ [% IF has_ean %]
+ <td>
+ <input type="hidden" name="new_ean_[% loop.count %]" value="[% HTML.escape(part.ean) %]">
+ [% HTML.escape(part.ean) %]
+ [% END %]
+ </td>
</tr>
[% END %]
</table>
<th align="right" nowrap>Chargennummer</th>
<td><input name="chargenumber" size="30" value="[% HTML.escape(chargenumber) %]"></td>
</tr>
+ <tr>
+ <th align="right" nowrap>EAN</th>
+ <td><input name="ean" size="30" value="[% HTML.escape(ean) %]"></td>
+ </tr>
<tr>
<th align="right" nowrap>Menge</th>
<th align="right" nowrap><translate>Charge number</translate></th>
<td><input name="chargenumber" size="30" value="[% HTML.escape(chargenumber) %]"></td>
</tr>
+ <tr>
+ <th align="right" nowrap><translate>EAN</translate></th>
+ <td><input name="ean" size="30" value="[% HTML.escape(ean) %]"></td>
+ </tr>
<tr>
<th align="right" nowrap><translate>Quantity</translate></th>