X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=admin%2Fshipping_companies.php;h=f83fad5a7ee521d90c6cc363e79bfbcba7418666;hb=25379bdc9f10bda4aae4b37f04d16eb1bbe7e4f6;hp=9422d8464b461c395bf1ed42cd66962ac23ce93c;hpb=4221bf69f713a2fb0bb4c4cae6f8f4f819c3ec31;p=fa-stable.git diff --git a/admin/shipping_companies.php b/admin/shipping_companies.php index 9422d846..f83fad5a 100644 --- a/admin/shipping_companies.php +++ b/admin/shipping_companies.php @@ -53,7 +53,7 @@ if ($Mode == 'Delete') { // PREVENT DELETES IF DEPENDENT RECORDS IN 'sales_orders' - if (sales_orders_has_shipper($selected_id)) + if (key_in_foreign_table($selected_id, 'sales_orders', 'ship_via')) { $cancel_delete = 1; display_error(_("Cannot delete this shipping company because sales orders have been created using this shipper.")); @@ -61,8 +61,7 @@ if ($Mode == 'Delete') else { // PREVENT DELETES IF DEPENDENT RECORDS IN 'debtor_trans' - - if (debtor_trans_has_shipper($selected_id)) + if (key_in_foreign_table($selected_id, 'debtor_trans', 'ship_via')) { $cancel_delete = 1; display_error(_("Cannot delete this shipping company because invoices have been created using this shipping company.")); @@ -88,7 +87,7 @@ if ($Mode == 'RESET') $result = get_shippers(check_value('show_inactive')); start_form(); -start_table($table_style); +start_table(TABLESTYLE); $th = array(_("Name"), _("Contact Person"), _("Phone Number"), _("Secondary Phone"), _("Address"), "", ""); inactive_control_column($th); table_header($th); @@ -114,7 +113,7 @@ end_table(1); //---------------------------------------------------------------------------------------------- -start_table($table_style2); +start_table(TABLESTYLE2); if ($selected_id != -1) { @@ -148,4 +147,3 @@ submit_add_or_update_center($selected_id == -1, '', 'both'); end_form(); end_page(); -?>