if ($Mode == 'Delete')
{
// PREVENT DELETES IF DEPENDENT RECORDS IN debtors_master
- if (customer_has_terms($selected_id))
+ if (key_in_foreign_table($selected_id, 'debtors_master', 'payment_terms'))
{
display_error(_("Cannot delete this payment term, because customer accounts have been created referring to this term."));
}
else
{
- if (supplier_has_terms($selected_id))
+ if (key_in_foreign_table($selected_id, 'suppliers', 'payment_terms'))
{
display_error(_("Cannot delete this payment term, because supplier accounts have been created referring to this term"));
}
$result = get_payment_terms_all(check_value('show_inactive'));
start_form();
-start_table($table_style);
+start_table(TABLESTYLE);
$th = array(_("Description"), _("Following Month On"), _("Due After (Days)"), "", "");
inactive_control_column($th);
table_header($th);
//-------------------------------------------------------------------------------------------------
-start_table($table_style2);
+start_table(TABLESTYLE2);
$day_in_following_month = $days_before_due = 0;
if ($selected_id != -1)