Revision 158bf855
Von Sven Schöling vor mehr als 15 Jahren hinzugefügt
SL/IC.pm | ||
---|---|---|
965 | 965 |
|
966 | 966 |
map { $_->{onhand} *= 1 } @{ $form->{parts} }; |
967 | 967 |
|
968 |
# post processing for assembly parts lists (bom) |
|
969 |
# for each part get the assembly parts and add them into the partlist. |
|
968 | 970 |
my @assemblies; |
969 |
# include individual items for assemblies |
|
970 | 971 |
if ($form->{searchitems} eq 'assembly' && $form->{bom}) { |
971 | 972 |
$query = |
972 | 973 |
qq|SELECT p.id, p.partnumber, p.description, a.qty AS onhand, |
973 | 974 |
p.unit, p.bin, |
974 | 975 |
p.sellprice, p.listprice, p.lastcost, |
975 | 976 |
p.rop, p.weight, p.priceupdate, |
976 |
p.image, p.drawing, p.microfiche |
|
977 |
FROM parts p, assembly a |
|
978 |
WHERE (p.id = a.parts_id) AND (a.id = ?)|; |
|
977 |
p.image, p.drawing, p.microfiche, |
|
978 |
pfac.factor |
|
979 |
FROM parts p |
|
980 |
INNER JOIN assembly a ON (p.id = a.parts_id) |
|
981 |
$joins{pfac} |
|
982 |
WHERE a.id = ?|; |
|
979 | 983 |
$sth = prepare_query($form, $dbh, $query); |
980 | 984 |
|
981 | 985 |
foreach $item (@{ $form->{parts} }) { |
... | ... | |
984 | 988 |
|
985 | 989 |
while ($ref = $sth->fetchrow_hashref(NAME_lc)) { |
986 | 990 |
$ref->{assemblyitem} = 1; |
991 |
map { $ref->{$_} /= $ref->{factor} || 1 } qw(sellprice listprice lastcost); |
|
987 | 992 |
push(@assemblies, $ref); |
988 | 993 |
} |
989 | 994 |
$sth->finish; |
Auch abrufbar als: Unified diff
IC.pm->all_parts: Im bom Modus (Einzelteile von Erzeugnissen mit anzeigen) Preisfaktoren berücksichtigen.
Ausserdem das recht seltsame Query umgeschrieben.
Fix für Bug 987.