X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=admin%2Fdb%2Ffiscalyears_db.inc;h=958338ef9ef0a97a81bb1fdfb96223077d0e14ab;hb=2aea99756a8c19766f0f9dfee56b27f7c1994f37;hp=893233c4120e825240bb44e30d1566a3f5e87df0;hpb=95ff74b5722826544743a01daf527aa3c9efe11a;p=fa-stable.git 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; } }