From 8c1a0401f6ad9191f18e5caf68126dce94002736 Mon Sep 17 00:00:00 2001 From: Joe Hunt Date: Wed, 11 Jul 2018 21:06:43 +0200 Subject: [PATCH] Fiscal year delete leads to undefined variable $total. Fixed. --- admin/db/fiscalyears_db.inc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/admin/db/fiscalyears_db.inc b/admin/db/fiscalyears_db.inc index 893233c4..958338ef 100644 --- a/admin/db/fiscalyears_db.inc +++ b/admin/db/fiscalyears_db.inc @@ -350,6 +350,7 @@ function delete_this_fiscalyear($selected_id) $last_account=''; $new = false; + $total = 0.0; while ($row = db_fetch($result)) { if ($last_account != $row['account']) // deletes all subledgers postings, so do it once for account @@ -364,6 +365,8 @@ function delete_this_fiscalyear($selected_id) (".ST_JOURNAL.", $trans_no, '$to', '{$row['account']}', '$ref', {$row['amount']}, " .db_escape($row['person_type_id'], true).", ".db_escape($row['person_id'], true).")"; db_query($sql, "Could not insert gl trans"); + if ($row['amount'] > 0.0) + $total += $row['amount']; $new = true; } } -- 2.30.2