From e33a252f4725047d717297044b218d075abca3d8 Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Thu, 29 Mar 2007 06:31:13 +0000 Subject: [PATCH] =?utf8?q?Falsche=20Verwendung=20einer=20neu=20eingef?= =?utf8?q?=C3=BChrten=20Datenbankhilfsfunktion,=20die=20zu=20einer=20Endlo?= =?utf8?q?sschleife=20gef=C3=BChrt=20hat.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- SL/IR.pm | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/SL/IR.pm b/SL/IR.pm index e99a108cf..9a6ca9ddc 100644 --- a/SL/IR.pm +++ b/SL/IR.pm @@ -1013,13 +1013,15 @@ sub get_vendor { $query = qq|SELECT o.amount, (SELECT e.sell FROM exchangerate e - WHERE e.curr = o.curr AND e.transdate = o.transdate) + WHERE e.curr = o.curr AND e.transdate = o.transdate) AS exch FROM oe o WHERE o.vendor_id = ? AND o.quotation = '0' AND o.closed = '0'|; - while (my ($amount, $exch) = selectfirst_array_query($form, $dbh, $query, $form->{vendor_id})) { + my $sth = prepare_execute_query($form, $dbh, $query, $form->{vendor_id}); + while (my ($amount, $exch) = $sth->fetchrow_array()) { $exch = 1 unless $exch; $form->{creditremaining} -= $amount * $exch; } + $sth->finish(); # get shipto if we do not convert an order or invoice if (!$form->{shipto}) { -- 2.20.1