]> wagnertech.de Git - kivitendo-erp.git/blobdiff - SL/OE.pm
TODO-Liste: Preisanfragen und Angebote richtig anzeigen.
[kivitendo-erp.git] / SL / OE.pm
index 7f25833668ff66a8e65b5fccdeaed68cf98d881a..5c6cec6581cb45fd56cff6e7e54591e124e100f3 100644 (file)
--- a/SL/OE.pm
+++ b/SL/OE.pm
@@ -201,10 +201,13 @@ sub transactions_for_todo_list {
 
   $query       =
     qq|SELECT oe.id, oe.transdate, oe.reqdate, oe.quonumber, oe.transaction_description, oe.amount,
+         CASE WHEN (COALESCE(0, oe.customer_id) = 0) THEN 'vendor' ELSE 'customer' END AS vc,
          c.name AS customer,
+         v.name AS vendor,
          e.name AS employee
        FROM oe
        LEFT JOIN customer c ON (oe.customer_id = c.id)
+       LEFT JOIN vendor v   ON (oe.vendor_id   = v.id)
        LEFT JOIN employee e ON (oe.employee_id = e.id)
        WHERE (COALESCE(quotation, FALSE) = TRUE)
          AND (COALESCE(closed,    FALSE) = FALSE)