Fiscal year delete leads to undefined variable $total. Fixed.
authorJoe Hunt <joe.hunt.consulting@gmail.com>
Wed, 11 Jul 2018 19:06:43 +0000 (21:06 +0200)
committerJoe Hunt <joe.hunt.consulting@gmail.com>
Wed, 11 Jul 2018 19:06:43 +0000 (21:06 +0200)
admin/db/fiscalyears_db.inc

index 893233c4120e825240bb44e30d1566a3f5e87df0..958338ef9ef0a97a81bb1fdfb96223077d0e14ab 100644 (file)
@@ -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;
                }
        }