Revision 4076 hat bei den Funktionen quote und unquote dafür gesorgt, dass nur "1...
[kivitendo-erp.git] / SL / IR.pm
index 043e846..4c57f85 100644 (file)
--- a/SL/IR.pm
+++ b/SL/IR.pm
@@ -866,7 +866,8 @@ sub get_vendor {
   }
   my $query =
     qq|SELECT
-         v.id AS vendor_id, v.name AS vendor, v.creditlimit, v.terms, v.notes AS intnotes,
+         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,
          $duedate + COALESCE(pt.terms_netto, 0) AS duedate,
@@ -970,7 +971,12 @@ sub retrieve_item {
     $where .= " AND lower(${table_column}) LIKE lower(?)";
     push @values, '%' . $form->{"${field}_${i}"} . '%';
   }
-
+  #Es soll auch nach EAN gesucht werden, ohne Einschränkung durch Beschreibung
+  if ($form->{"partnumber_$i"} && !$form->{"description_$i"}) {
+      $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 {