Revision 85ffde7a
Von Holger Lindemann vor etwa 14 Jahren hinzugefügt
SL/IC.pm | ||
---|---|---|
167 | 167 |
|
168 | 168 |
# get makes |
169 | 169 |
if ($form->{makemodel}) { |
170 |
$query = qq|SELECT m.make, m.model FROM makemodel m | . |
|
171 |
qq|WHERE m.parts_id = ?|; |
|
170 |
#hli |
|
171 |
$query = qq|SELECT m.make, m.model,m.lastcost,m.lastcost,m.lastupdate,m.sortorder FROM makemodel m | . |
|
172 |
qq|WHERE m.parts_id = ? order by m.sortorder asc|; |
|
172 | 173 |
my @values = ($form->{id}); |
173 | 174 |
$sth = $dbh->prepare($query); |
174 | 175 |
$sth->execute(@values) || $form->dberror("$query (" . join(', ', @values) . ")"); |
175 | 176 |
|
176 | 177 |
my $i = 1; |
177 |
while (($form->{"make_$i"}, $form->{"model_$i"}) = $sth->fetchrow_array) |
|
178 |
|
|
179 |
while (($form->{"make_$i"}, $form->{"model_$i"}, $form->{"old_lastcost_$i"}, |
|
180 |
$form->{"lastcost_$i"}, $form->{"lastupdate_$i"}, $form->{"sortorder_$i"}) = $sth->fetchrow_array) |
|
178 | 181 |
{ |
179 | 182 |
$i++; |
180 | 183 |
} |
... | ... | |
493 | 496 |
|
494 | 497 |
# insert makemodel records |
495 | 498 |
unless ($form->{item} eq 'service') { |
499 |
my $lastupdate = ''; |
|
500 |
my $value = 0; |
|
496 | 501 |
for my $i (1 .. $form->{makemodel_rows}) { |
497 | 502 |
if (($form->{"make_$i"}) || ($form->{"model_$i"})) { |
498 |
|
|
499 |
$query = qq|INSERT INTO makemodel (parts_id, make, model) | . |
|
500 |
qq|VALUES (?, ?, ?)|; |
|
501 |
@values = (conv_i($form->{id}), conv_i($form->{"make_$i"}), $form->{"model_$i"}); |
|
503 |
#hli |
|
504 |
$value = $form->parse_amount($myconfig, $form->{"lastcost_$i"}); |
|
505 |
if ($value == $form->{"old_lastcost_$i"}) |
|
506 |
{ |
|
507 |
$lastupdate = $dbh->quote($form->{"lastupdate_$i"}); |
|
508 |
} else { |
|
509 |
$lastupdate = 'now()'; |
|
510 |
} |
|
511 |
$query = qq|INSERT INTO makemodel (parts_id, make, model, lastcost, lastupdate, sortorder) | . |
|
512 |
qq|VALUES (?, ?, ?, ?, ?, ?)|; |
|
513 |
@values = (conv_i($form->{id}), conv_i($form->{"make_$i"}), $form->{"model_$i"}, $value, $lastupdate, conv_i($form->{"sortorder_$i"}) ); |
|
502 | 514 |
|
503 | 515 |
do_query($form, $dbh, $query, @values); |
504 | 516 |
} |
... | ... | |
818 | 830 |
ordnumber => 'apoe.', make => 'mm.', |
819 | 831 |
quonumber => 'apoe.', model => 'mm.', |
820 | 832 |
invnumber => 'apoe.', partsgroup => 'pg.', |
821 |
lastcost => ' ', , soldtotal => ' ',
|
|
833 |
lastcost => 'p.', , soldtotal => ' ',
|
|
822 | 834 |
factor => 'pfac.', |
823 | 835 |
'SUM(ioi.qty)' => ' ', |
824 | 836 |
description => 'p.', |
Auch abrufbar als: Unified diff
EK-Preise in der makemodel hinterlegen mit Datum der letzten Änderung.
Reihenfolge der Lieferanten nach Wichtigkeit.