X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=admin%2Fpayment_terms.php;h=a6aa77e77011570f350c40aa6a67594f3bb954a6;hb=cc9972b02f2bf4ece12da3431266e85e96872fb1;hp=c6a98794e792737d799370657f686972ef7cfe4d;hpb=9dab04be9d81766f1878d3688ee73d0bcf29f5d2;p=fa-stable.git diff --git a/admin/payment_terms.php b/admin/payment_terms.php index c6a98794..a6aa77e7 100644 --- a/admin/payment_terms.php +++ b/admin/payment_terms.php @@ -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")); }