From: Sven Schöling Date: Fri, 6 Jan 2006 14:13:45 +0000 (+0000) Subject: Fix fuer Bug 214 und seine Nebenwirkungen X-Git-Tag: release-2.4.0^2~404 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=8c0aec94b3eb0fa5538be24b2880b59265d8c3e2;p=kivitendo-erp.git 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. --- 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)