X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;ds=sidebyside;f=gl%2Fincludes%2Fdb%2Fgl_db_currencies.inc;h=0efa42076564cf2773919ae73a172399e70a77a8;hb=c7fa25a75b6a5c51aac91dec186217b134d7bcbc;hp=69b4e4a5cb938d99b2aa2a7413db18773a5bf0bc;hpb=54d84ff9a67620ab38c676cdbcf87853632724f0;p=fa-stable.git diff --git a/gl/includes/db/gl_db_currencies.inc b/gl/includes/db/gl_db_currencies.inc index 69b4e4a5..0efa4207 100644 --- a/gl/includes/db/gl_db_currencies.inc +++ b/gl/includes/db/gl_db_currencies.inc @@ -11,23 +11,28 @@ ***********************************************************************/ //--------------------------------------------------------------------------------------------- -function update_currency($curr_abrev, $symbol, $currency, $country, $hundreds_name) +function update_currency($curr_abrev, $symbol, $currency, $country, + $hundreds_name, $auto_update) { - $sql = "UPDATE ".TB_PREF."currencies SET currency=" - .db_escape($currency).", curr_symbol=".db_escape($symbol).", - country=".db_escape($country).", hundreds_name=".db_escape($hundreds_name) - ." WHERE curr_abrev = ".db_escape($curr_abrev); + $sql = "UPDATE ".TB_PREF."currencies SET currency=".db_escape($currency) + .", curr_symbol=".db_escape($symbol).", country=".db_escape($country) + .", hundreds_name=".db_escape($hundreds_name) + .",auto_update = ".db_escape($auto_update) + ." WHERE curr_abrev = ".db_escape($curr_abrev); db_query($sql, "could not update currency for $curr_abrev"); } //--------------------------------------------------------------------------------------------- -function add_currency($curr_abrev, $symbol, $currency, $country, $hundreds_name) +function add_currency($curr_abrev, $symbol, $currency, $country, + $hundreds_name, $auto_update) { - $sql = "INSERT INTO ".TB_PREF."currencies (curr_abrev, curr_symbol, currency, country, hundreds_name) + $sql = "INSERT INTO ".TB_PREF."currencies (curr_abrev, curr_symbol, currency, + country, hundreds_name, auto_update) VALUES (".db_escape($curr_abrev).", ".db_escape($symbol).", " - .db_escape($currency).", ".db_escape($country).", ".db_escape($hundreds_name).")"; + .db_escape($currency).", ".db_escape($country).", " + .db_escape($hundreds_name).",".db_escape($auto_update).")"; db_query($sql, "could not add currency for $curr_abrev"); } @@ -56,12 +61,10 @@ function get_currency($curr_code) //--------------------------------------------------------------------------------------------- -function get_currencies() +function get_currencies($all=false) { $sql = "SELECT * FROM ".TB_PREF."currencies"; + if (!$all) $sql .= " WHERE !inactive"; return db_query($sql, "could not get currencies"); } -//--------------------------------------------------------------------------------------------- - -?> \ No newline at end of file