X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=admin%2Fdb%2Ffiscalyears_db.inc;h=958338ef9ef0a97a81bb1fdfb96223077d0e14ab;hb=8c1a0401f6ad9191f18e5caf68126dce94002736;hp=893233c4120e825240bb44e30d1566a3f5e87df0;hpb=60d0cd5ddc5baa456ca89672686569f154a63045;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; } }