From d934ce3611ce9cd325d7398d143b17f7399655ff Mon Sep 17 00:00:00 2001 From: "G. Richardson" Date: Mon, 6 Feb 2012 15:41:07 +0100 Subject: [PATCH] =?utf8?q?division=20by=20zero=20Fehler=20bei=20GuV=20und?= =?utf8?q?=20E=C3=9CR?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Bei gemischten Rechnungen/Gutschriften, die in Summe 0 ergeben, kann es im EÜR-Modus der GuV zu einem division by zero Fehler kommen, der hier abgefangen wird. Vermutlich ist das der Code für die gewichtete Zuordnung nach Periode. --- SL/RP.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SL/RP.pm b/SL/RP.pm index d37191284..072c54bd4 100644 --- a/SL/RP.pm +++ b/SL/RP.pm @@ -521,7 +521,7 @@ sub get_accounts_g { FROM acc_trans acc INNER JOIN chart c ON (acc.chart_id = c.id AND c.link LIKE '%AR_paid%') WHERE 1=1 $inwhere AND acc.trans_id = ac.trans_id) - / (SELECT amount FROM ar WHERE id = ac.trans_id) + / COALESCE((SELECT amount FROM ar WHERE id = ac.trans_id and amount != 0 ), 1) ) AS amount, c.pos_eur FROM acc_trans ac LEFT JOIN chart c ON (c.id = ac.chart_id) -- 2.20.1