From: Janusz Dobrowolski Date: Mon, 10 Nov 2008 13:34:37 +0000 (+0000) Subject: Added check for POS relations before account removal. X-Git-Tag: v2.4.2~19^2~1776 X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=commitdiff_plain;h=15c3a6a29a0860038ac972d3f6dd40c49f994e3f;p=fa-stable.git Added check for POS relations before account removal. --- diff --git a/gl/manage/bank_accounts.php b/gl/manage/bank_accounts.php index 9cb56180..64cff25f 100644 --- a/gl/manage/bank_accounts.php +++ b/gl/manage/bank_accounts.php @@ -64,6 +64,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);