From 8c0aec94b3eb0fa5538be24b2880b59265d8c3e2 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sven=20Sch=C3=B6ling?= Date: Fri, 6 Jan 2006 14:13:45 +0000 Subject: [PATCH] Fix fuer Bug 214 und seine Nebenwirkungen Derselbe Bug tritt auch in Verbindung mit Einkaufsrechnungen auf, und verfaelscht die Bilanz, wenn mit einer Datumsmaske gesucht wird. --- SL/CA.pm | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/SL/CA.pm b/SL/CA.pm index a96386063..ac64c37fc 100644 --- a/SL/CA.pm +++ b/SL/CA.pm @@ -234,7 +234,7 @@ sub all_transactions { UNION - SELECT SUM(ac.sellprice) + SELECT SUM(ac.qty * ac.sellprice) FROM invoice ac JOIN ar a ON (ac.trans_id = a.id) JOIN parts p ON (ac.parts_id = p.id) @@ -248,7 +248,7 @@ sub all_transactions { UNION - SELECT SUM(ac.sellprice) + SELECT SUM(ac.qty * ac.sellprice) FROM invoice ac JOIN ap a ON (ac.trans_id = a.id) JOIN parts p ON (ac.parts_id = p.id) @@ -280,7 +280,7 @@ sub all_transactions { UNION - SELECT SUM(ac.sellprice) + SELECT SUM(ac.qty * ac.sellprice) FROM invoice ac JOIN ar a ON (ac.trans_id = a.id) JOIN parts p ON (ac.parts_id = p.id) @@ -294,7 +294,7 @@ sub all_transactions { UNION - SELECT SUM(ac.sellprice) + SELECT SUM(ac.qty * ac.sellprice) FROM invoice ac JOIN ap a ON (ac.trans_id = a.id) JOIN parts p ON (ac.parts_id = p.id) @@ -371,7 +371,7 @@ sub all_transactions { UNION ALL SELECT a.id, a.invnumber, c.name, a.transdate, - a.invoice, ac.sellprice, 'ar' as module + a.invoice, ac.qty * ac.sellprice AS sellprice, 'ar' as module FROM ar a JOIN invoice ac ON (ac.trans_id = a.id) JOIN parts p ON (ac.parts_id = p.id) @@ -386,7 +386,7 @@ sub all_transactions { UNION ALL SELECT a.id, a.invnumber, v.name, a.transdate, - a.invoice, ac.sellprice, 'ap' as module + a.invoice, ac.qty * ac.sellprice AS sellprice, 'ap' as module FROM ap a JOIN invoice ac ON (ac.trans_id = a.id) JOIN parts p ON (ac.parts_id = p.id) -- 2.20.1