From: Janusz Dobrowolski Date: Mon, 7 Jul 2008 21:35:19 +0000 (+0000) Subject: Changed selector for fiscal year functions to id X-Git-Tag: v2.4.2~19^2~1924 X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=commitdiff_plain;h=9d9b1c4d24f7bc0ab4a0706be6e6b2e761c78faf;p=fa-stable.git Changed selector for fiscal year functions to id --- diff --git a/admin/db/company_db.inc b/admin/db/company_db.inc index e288e1aa..ea99d872 100644 --- a/admin/db/company_db.inc +++ b/admin/db/company_db.inc @@ -107,12 +107,10 @@ function add_fiscalyear($from_date, $to_date, $closed) db_query($sql, "could not add fiscal year"); } -function update_fiscalyear($from_date, $closed) +function update_fiscalyear($id, $closed) { - $from = date2sql($from_date); - $sql = "UPDATE ".TB_PREF."fiscal_year SET closed=$closed - WHERE begin=".db_escape($from); + WHERE id=".db_escape($id); db_query($sql, "could not update fiscal year"); } @@ -124,11 +122,9 @@ function get_all_fiscalyears() return db_query($sql, "could not get all fiscal years"); } -function get_fiscalyear($from_date) +function get_fiscalyear($id) { - $from = date2sql($from_date); - - $sql = "SELECT * FROM ".TB_PREF."fiscal_year WHERE begin=".db_escape($from); + $sql = "SELECT * FROM ".TB_PREF."fiscal_year WHERE id=".db_escape($id); $result = db_query($sql, "could not get fiscal year"); @@ -146,12 +142,11 @@ function get_current_fiscalyear() return db_fetch($result); } -function delete_fiscalyear($from_date) +function delete_fiscalyear($id) { - $from = date2sql($from_date); begin_transaction(); - $sql="DELETE FROM ".TB_PREF."fiscal_year WHERE begin=".db_escape($from); + $sql="DELETE FROM ".TB_PREF."fiscal_year WHERE id=".db_escape($id); db_query($sql, "could not delete fiscal year");