X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=gl%2Fmanage%2Fbank_accounts.php;h=a3a59b3eb45a14563428c38dd87ee2b4a9209b88;hb=31629799f984d0237fe73f366d3d3d75448f1f34;hp=9cb5618055bf12d5c51c68f7f199ce0b544f1759;hpb=45e45a854c40a7a2f9cc8f11e07a259c6923babd;p=fa-stable.git diff --git a/gl/manage/bank_accounts.php b/gl/manage/bank_accounts.php index 9cb56180..a3a59b3e 100644 --- a/gl/manage/bank_accounts.php +++ b/gl/manage/bank_accounts.php @@ -1,5 +1,14 @@ . +***********************************************************************/ $page_security = 10; $path_to_root="../.."; include($path_to_root . "/includes/session.inc"); @@ -64,6 +73,14 @@ elseif( $Mode == 'Delete') $cancel_delete = 1; display_error(_("Cannot delete this bank account because transactions have been created using this account.")); } + $sql= "SELECT COUNT(*) FROM ".TB_PREF."sales_pos WHERE pos_account='$selected_id'"; + $result = db_query($sql,"check failed"); + $myrow = db_fetch_row($result); + if ($myrow[0] > 0) + { + $cancel_delete = 1; + display_error(_("Cannot delete this bank account because POS definitions have been created using this account.")); + } if (!$cancel_delete) { delete_bank_account($selected_id); @@ -111,7 +128,7 @@ while ($myrow = db_fetch($result)) label_cell($myrow["bank_account_number"], "nowrap"); label_cell($myrow["bank_address"]); edit_button_cell("Edit".$myrow["id"], _("Edit")); - edit_button_cell("Delete".$myrow["id"], _("Delete")); + delete_button_cell("Delete".$myrow["id"], _("Delete")); end_row(); }