From dea9aaea2182221d62f88966d9ad8e4f85e3a3d6 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sven=20Sch=C3=B6ling?= Date: Wed, 3 Jun 2009 09:25:44 +0000 Subject: [PATCH] get_vendor war nicht hinreichend abgesichert gegen mehrfache aufrufe. bei mehrfachen aufrufen, konnte es passieren dass alte WHERE klauseln noch mitverwendet wurden. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Hoffentlich Fix für Bug 1028. --- SL/IR.pm | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/SL/IR.pm b/SL/IR.pm index e36b7f398..c59f9eee8 100644 --- a/SL/IR.pm +++ b/SL/IR.pm @@ -855,7 +855,8 @@ sub get_vendor { : "current_date"; # get vendor - @values = (); + my @values = (); + my $where = ''; if ($vid) { $where .= 'AND v.id = ?'; push @values, $vid; @@ -866,7 +867,7 @@ sub get_vendor { } my $query = qq|SELECT - v.id AS vendor_id, v.name AS vendor, v.discount as vendor_discount, + v.id AS vendor_id, v.name AS vendor, v.discount as vendor_discount, v.creditlimit, v.terms, v.notes AS intnotes, v.email, v.cc, v.bcc, v.language_id, v.payment_id, v.street, v.zipcode, v.city, v.country, v.taxzone_id, @@ -976,7 +977,7 @@ sub retrieve_item { $where .= qq| OR (NOT p.obsolete = '1' AND p.ean = ? )|; push @values, $form->{"partnumber_$i"}; } - + if ($form->{"description_$i"}) { $where .= " ORDER BY p.description"; } else { -- 2.20.1