projects
/
fa-stable.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
1aba32c
)
Minor fix
author
Joe Hunt
<joe.hunt.consulting@gmail.com>
Sun, 27 Dec 2009 08:44:25 +0000
(08:44 +0000)
committer
Joe Hunt
<joe.hunt.consulting@gmail.com>
Sun, 27 Dec 2009 08:44:25 +0000
(08:44 +0000)
gl/manage/bank_accounts.php
patch
|
blob
|
history
diff --git
a/gl/manage/bank_accounts.php
b/gl/manage/bank_accounts.php
index 97a5dbba252aad596f8e5a37efe76245860f0d9a..09f07b04b91121b9d1f1d9409ceca0f77c01316c 100644
(file)
--- a/
gl/manage/bank_accounts.php
+++ b/
gl/manage/bank_accounts.php
@@
-26,19
+26,18
@@
if ($Mode=='ADD_ITEM' || $Mode=='UPDATE_ITEM')
//initialise no input errors assumed initially before we test
$input_error = 0;
$curr = get_company_currency();
//initialise no input errors assumed initially before we test
$input_error = 0;
$curr = get_company_currency();
- if ($curr != $_POST['BankAccountCurrency'])
+ $sql = "SELECT account_code FROM ".TB_PREF."bank_accounts
+ WHERE account_code = '".$_POST['account_code']."'";
+ if ($curr == $_POST['BankAccountCurrency'])
+ $sql .= " AND bank_curr_code <> '".$_POST['BankAccountCurrency']."'";
+ $sql .= " AND id <> $selected_id";
+ $result = db_query($sql,"could not get bank accounts");
+ if (db_num_rows($result) > 0)
{
{
- $sql = "SELECT account_code FROM ".TB_PREF."bank_accounts
- WHERE account_code = '".$_POST['account_code']."'
- AND id <> $selected_id";
- $result = db_query($sql,"could not get bank accounts");
- if (db_num_rows($result) > 0)
- {
- $input_error = 1;
- display_error(_("The GL account is already in use."));
- set_focus('account_code');
- }
- }
+ $input_error = 1;
+ display_error(_("The GL account is already in use."));
+ set_focus('account_code');
+ }
//first off validate inputs sensible
if ($input_error == 0 && strlen($_POST['bank_account_name']) == 0)
{
//first off validate inputs sensible
if ($input_error == 0 && strlen($_POST['bank_account_name']) == 0)
{