webERP Forum

Full Version: Default Bank Account
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi All
I would like to make a default bank account be listed in the Bank Account drop down for Payments.php I have tried to change the line 793 without much success.
Any help would be greatly appreciated.
Thanks
Dave
What version do you have? For me, line 793 is located in an if block that would be printed if you have not yet setup any bank accounts.

However, in the else block, just before the blank option echo, you could add this:

PHP Code:
if( !array_key_exists('BankAccount'$_POST) ) {
    
$_POST['BankAccount'] = 'your bank code here'


So that the option matching that code will be set to 'selected' within the loop that creates all the options.
It is version 4.11.3
Here is the current code
/*list the bank account names */
if (isset($_POST['BankAccount']) AND $_POST['BankAccount']==$myrow['accountcode']){
echo '<option selected="selected" value="' . $myrow['accountcode'] . '">' . $myrow['bankaccountname'] . ' - ' . $myrow['currcode'] . '</option>';
} else {
echo '<option value="' . $myrow['accountcode'] . '">' . $myrow['bankaccountname'] . ' - ' . $myrow['currcode'] . '</option>';
}
It would be nice to have a default bank account per user that the payments/receipts scripts pointed to. This could either be part of www_users table or the bankaccountusers table.

Tim
@Tim: yes, that would be a good idea.

@Dave: Understood, but the idea is still the same. Place the suggested block of code before the first blank option. The blank option output should be just above the loop, and the code would go before that line.
Thanks for the help works great.
Reference URL's