<?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");
$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);
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();
}
if($is_editing)
label_row(_("Bank Account GL Code:"), $_POST['account_code']);
else
- gl_all_accounts_list_row(_("Bank Account GL Code:"), 'account_code', null, false);
+ gl_all_accounts_list_row(_("Bank Account GL Code:"), 'account_code', null);
text_row(_("Bank Name:"), 'bank_name', null, 50, 60);
text_row(_("Bank Account Number:"), 'bank_account_number', null, 30, 60);