display_db_error("could not retreive the account name for $code", $sql, true);
}
-function gl_account_in_transactions($acc)
-{
- $sql= "SELECT COUNT(*) FROM ".TB_PREF."gl_trans WHERE account=$acc";
- $result = db_query($sql,"Couldn't test for existing transactions");
-
- $myrow = db_fetch_row($result);
- return ($myrow[0] > 0);
-}
-
function gl_account_in_company_defaults($acc)
{
$sql= "SELECT COUNT(*) FROM ".TB_PREF."company WHERE debtors_act=$acc
return ($myrow[0] > 0);
}
-function gl_account_in_bank_accounts($acc)
-{
- $sql= "SELECT COUNT(*) FROM ".TB_PREF."bank_accounts WHERE account_code=$acc";
- $result = db_query($sql,"Couldn't test for bank accounts");
-
- $myrow = db_fetch_row($result);
- return ($myrow[0] > 0);
-}
-
function gl_account_in_stock_category($acc)
{
$sql= "SELECT COUNT(*) FROM ".TB_PREF."stock_category WHERE