if (($form->{"make_$i"}) || ($form->{"model_$i"})) {
#hli
$value = $form->parse_amount($myconfig, $form->{"lastcost_$i"});
- if ($value == $form->{"old_lastcost_$i"})
+ if ($value == $form->parse_amount($myconfig, $form->{"old_lastcost_$i"}))
{
if ($form->{"lastupdate_$i"} eq "") {
$lastupdate = 'now()';
}
my $placeholders = join ', ', ('?') x scalar(@part_ids);
- my $query = qq|SELECT mm.parts_id, mm.model, v.name AS make
+ my $query = qq|SELECT mm.parts_id, mm.model, mm.lastcost, v.name AS make
FROM makemodel mm
LEFT JOIN vendor v ON (mm.make = v.id)
WHERE mm.parts_id IN ($placeholders)|;
# parse pricegroups. and no, don't rely on check_form for this...
map { $form->{"price_$_"} = $form->parse_amount(\%myconfig, $form->{"price_$_"}) } 1 .. $form->{price_rows};
+ # same for lastcosts
+ map { $form->{"lastcost_$_"} = $form->parse_amount(\%myconfig, $form->{"lastcost_$_"}) } 1 .. $form->{"makemodel_rows"};
+
if ($form->{item} eq "assembly") {
my $i = $form->{assembly_rows};