From: Jan Büren Date: Tue, 12 Nov 2019 08:31:42 +0000 (+0100) Subject: Bugfix (teil) #406 abzurechnender Betrag bei Aufträgen manchmal falsch falls Gutschriften X-Git-Tag: release-3.5.6.1~442 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=4c8c615a3268dc328f748cc8efe20fc2dc6cb8c5;p=kivitendo-erp.git Bugfix (teil) #406 abzurechnender Betrag bei Aufträgen manchmal falsch falls Gutschriften S.a. Kommentar redmine --- diff --git a/SL/OE.pm b/SL/OE.pm index ab0eb9444..1d064505b 100644 --- a/SL/OE.pm +++ b/SL/OE.pm @@ -100,6 +100,12 @@ sub transactions { FROM record_links rl1 LEFT JOIN record_links rl2 ON (rl1.to_table = rl2.from_table AND rl1.to_id = rl2.from_id) WHERE rl1.from_table = 'oe' AND rl2.to_table = 'ar' + UNION + SELECT rl1.from_id, rl3.to_id + FROM record_links rl1 + JOIN record_links rl2 ON (rl1.to_table = rl2.from_table AND rl1.to_id = rl2.from_id) + JOIN record_links rl3 ON (rl2.to_table = rl3.from_table AND rl2.to_id = rl3.from_id) + WHERE (rl1.from_table = 'oe') AND rl2.to_table = 'ar' ) rl LEFT JOIN ar ON ar.id = rl.to_id