Fixed AltGr hotkeys system issue.
[fa-stable.git] / gl / manage / bank_accounts.php
index 9cb5618055bf12d5c51c68f7f199ce0b544f1759..a3a59b3eb45a14563428c38dd87ee2b4a9209b88 100644 (file)
@@ -1,5 +1,14 @@
 <?php
-
+/**********************************************************************
+    Copyright (C) FrontAccounting, LLC.
+       Released under the terms of the GNU Affero General Public License,
+       AGPL, as published by the Free Software Foundation, either version 
+       3 of the License, or (at your option) any later version.
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+    See the License here <http://www.gnu.org/licenses/agpl-3.0.html>.
+***********************************************************************/
 $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(); 
 }