projects
/
fa-stable.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Rerun. Stuff forgotten.
[fa-stable.git]
/
taxes
/
tax_groups.php
diff --git
a/taxes/tax_groups.php
b/taxes/tax_groups.php
index ea61fd3444f0fb71ecd96d8a6952fb30d6579d74..13990c38bb4bdafce31e6257a1c508fb71d886cb 100644
(file)
--- a/
taxes/tax_groups.php
+++ b/
taxes/tax_groups.php
@@
-14,7
+14,7
@@
$path_to_root = "..";
include($path_to_root . "/includes/session.inc");
include($path_to_root . "/includes/session.inc");
-page(_("Tax Groups"));
+page(_(
$help_context =
"Tax Groups"));
include_once($path_to_root . "/includes/data_checks.inc");
include_once($path_to_root . "/includes/ui.inc");
include_once($path_to_root . "/includes/data_checks.inc");
include_once($path_to_root . "/includes/ui.inc");
@@
-99,21
+99,15
@@
function can_delete($selected_id)
{
if ($selected_id == -1)
return false;
{
if ($selected_id == -1)
return false;
- $sql = "SELECT COUNT(*) FROM ".TB_PREF."cust_branch WHERE tax_group_id=".db_escape($selected_id);
- $result = db_query($sql, "could not query customers");
- $myrow = db_fetch_row($result);
- if ($myrow[0] > 0)
+ if (key_in_foreign_table($selected_id, 'cust_branch', 'tax_group_id'))
{
{
- display_
note
(_("Cannot delete this tax group because customer branches been created referring to it."));
+ display_
error
(_("Cannot delete this tax group because customer branches been created referring to it."));
return false;
}
return false;
}
- $sql = "SELECT COUNT(*) FROM ".TB_PREF."suppliers WHERE tax_group_id=".db_escape($selected_id);
- $result = db_query($sql, "could not query suppliers");
- $myrow = db_fetch_row($result);
- if ($myrow[0] > 0)
+ if (key_in_foreign_table($selected_id, 'suppliers', 'tax_group_id'))
{
{
- display_
note
(_("Cannot delete this tax group because suppliers been created referring to it."));
+ display_
error
(_("Cannot delete this tax group because suppliers been created referring to it."));
return false;
}
return false;
}