Search only for not voided transactions.
[fa-stable.git] / admin / payment_terms.php
index c6a98794e792737d799370657f686972ef7cfe4d..4e07c6e4a95706d9fe7e76e13d537361dc8d891d 100644 (file)
@@ -74,13 +74,13 @@ if ($Mode=='ADD_ITEM' || $Mode=='UPDATE_ITEM')
 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"));
                } 
@@ -107,7 +107,7 @@ if ($Mode == 'RESET')
 $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);
@@ -151,7 +151,7 @@ end_table(1);
 
 //-------------------------------------------------------------------------------------------------
 
-start_table($table_style2);
+start_table(TABLESTYLE2);
 
 $day_in_following_month = $days_before_due = 0;
 if ($selected_id != -1)