From 9a7a811d2d254f95f3cf1664566ff4a5335eee31 Mon Sep 17 00:00:00 2001 From: Bernd Blessmann Date: Fri, 13 May 2011 08:55:17 +0200 Subject: [PATCH] Bug 1647 - Lieferanten-Einkaufspreise verlieren Nachkommastellen nicht mehr --- SL/IC.pm | 4 ++-- bin/mozilla/ic.pl | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/SL/IC.pm b/SL/IC.pm index b6007d9dc..cf7c99c36 100644 --- a/SL/IC.pm +++ b/SL/IC.pm @@ -502,7 +502,7 @@ sub save { 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()'; @@ -1663,7 +1663,7 @@ sub prepare_parts_for_printing { } 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)|; diff --git a/bin/mozilla/ic.pl b/bin/mozilla/ic.pl index e56178206..13e0a5ac2 100644 --- a/bin/mozilla/ic.pl +++ b/bin/mozilla/ic.pl @@ -1703,6 +1703,9 @@ sub update { # 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}; -- 2.20.1