X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=admin%2Fdb%2Ffiscalyears_db.inc;h=9ace5d195ee0b3c684a1f1a811dae7cb56803ed1;hb=7840540918bfd37c886877a5d52e3ba0b3373289;hp=8cb84044cc5c910c6d81ab643ea0ffd2ba32f0ee;hpb=78fe8cb8f56510ba3f6a1720b207a33b5828e071;p=fa-stable.git diff --git a/admin/db/fiscalyears_db.inc b/admin/db/fiscalyears_db.inc index 8cb84044..9ace5d19 100644 --- a/admin/db/fiscalyears_db.inc +++ b/admin/db/fiscalyears_db.inc @@ -337,10 +337,8 @@ function delete_this_fiscalyear($selected_id) db_query($sql, "Could not delete exchange rates"); $sql = "DELETE FROM ".TB_PREF."budget_trans WHERE tran_date <= '$to'"; db_query($sql, "Could not delete exchange rates"); - $sql = "SELECT account, SUM(amount) AS amount, person_type_id, person_id FROM " .TB_PREF."gl_trans WHERE tran_date <= '$to' GROUP by account, person_type_id, person_id"; - $sql = "SELECT account, SUM(amount) AS amount FROM ".TB_PREF."gl_trans WHERE tran_date <= '$to' GROUP by account"; $result = db_query($sql, "Could not retrieve gl trans"); $trans_no = get_next_trans_no(ST_JOURNAL); @@ -360,6 +358,7 @@ 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"); + $new = true; } } if ($new)