Allowed full edition of not used bank account.
authorJanusz Dobrowolski <janusz@frontaccounting.eu>
Mon, 11 Oct 2010 07:01:59 +0000 (07:01 +0000)
committerJanusz Dobrowolski <janusz@frontaccounting.eu>
Mon, 11 Oct 2010 07:01:59 +0000 (07:01 +0000)
CHANGELOG.txt
gl/manage/bank_accounts.php

index 6a8a768f58b4470aae83d1da1888f7e8ebf98d60..244fbabde8f8d98a0c8de0d00bc4f2360091839b 100644 (file)
@@ -33,6 +33,8 @@ $ /includes/types.inc
 ! Added terms category parameter to sale_payment_list
 $ /includes/ui/ui_lists.inc
   /sales/customer_invoice.php
+! Allowed full edition of bank account if not used yet
+$ /gl/manage/bank_accounts.php
 # Fixed point of sale handling and terms selection.
 $ /sales/sales_order_entry.php
   /sales/includes/cart_class.inc
index fa441ef09435628b56a9e24924f7540971b92e33..634283b421d52a46c65be3eb70b8be49e0ea45b9 100644 (file)
@@ -131,11 +131,11 @@ while ($myrow = db_fetch($result))
 inactive_control_row($th);
 end_table(1);
 
-$is_editing = $selected_id != -1; 
+$is_used = $selected_id != -1 && key_in_foreign_table($selected_id, 'bank_trans', 'bank_act', true);
 
 start_table(TABLESTYLE2);
 
-if ($is_editing
+if ($selected_id != -1
 {
   if ($Mode == 'Edit') {       
        $myrow = get_bank_account($selected_id);
@@ -158,7 +158,7 @@ if ($is_editing)
 
 text_row(_("Bank Account Name:"), 'bank_account_name', null, 50, 100);
 
-if ($is_editing
+if ($is_used
 {
        label_row(_("Account Type:"), $bank_account_types[$_POST['account_type']]);
 } 
@@ -166,7 +166,7 @@ else
 {
        bank_account_types_list_row(_("Account Type:"), 'account_type', null); 
 }
-if ($is_editing
+if ($is_used
 {
        label_row(_("Bank Account Currency:"), $_POST['BankAccountCurrency']);
 } 
@@ -177,7 +177,7 @@ else
 
 yesno_list_row(_("Default currency account:"), 'dflt_curr_act');
 
-if($is_editing)
+if($is_used)
        label_row(_("Bank Account GL Code:"), $_POST['account_code']);
 else 
        gl_all_accounts_list_row(_("Bank Account GL Code:"), 'account_code', null);