-check_db_has_gl_account_groups(_("There are no account groups defined. Please define at least one account group before entering accounts."));
-
-//-------------------------------------------------------------------------------------
-
-function exists_gl_budget($date_, $account, $dimension, $dimension2)
-{
- $sql = "SELECT account FROM ".TB_PREF."budget_trans WHERE account='$account' AND tran_date='$date_' AND
- dimension_id=$dimension AND dimension2_id=$dimension2";
- $result = db_query($sql, "Cannot retreive a gl transaction");
-
- return (db_num_rows($result) > 0);
-}
-
-function add_update_gl_budget_trans($date_, $account, $dimension, $dimension2, $amount)
-{
- $date = date2sql($date_);
-
- if (exists_gl_budget($date, $account, $dimension, $dimension2))
- $sql = "UPDATE ".TB_PREF."budget_trans SET amount=$amount WHERE account='$account' AND
- dimension_id=$dimension AND dimension2_id=$dimension2 AND tran_date='$date'";
- else
- $sql = "INSERT INTO ".TB_PREF."budget_trans (tran_date,
- account, dimension_id, dimension2_id, amount, memo_) VALUES ('$date',
- '$account', $dimension, $dimension2, $amount, '')";
-
- db_query($sql, "The GL budget transaction could not be saved");
-}
-
-function delete_gl_budget_trans($date_, $account, $dimension, $dimension2)
-{
- $date = date2sql($date_);
-
- $sql = "DELETE FROM ".TB_PREF."budget_trans WHERE account='$account' AND
- dimension_id=$dimension AND dimension2_id=$dimension2 AND tran_date='$date'";
- db_query($sql, "The GL budget transaction could not be deleted");
-}
-
-function get_only_budget_trans_from_to($from_date, $to_date, $account, $dimension=0, $dimension2=0)
-{