Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Default Bank Account
09-30-2015, 07:25 AM
Post: #1
Default Bank Account
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
Find all posts by this user
Quote this message in a reply
09-30-2015, 10:55 AM (This post was last modified: 09-30-2015 10:59 AM by TurboPT.)
Post: #2
RE: Default Bank Account
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.
Find all posts by this user
Quote this message in a reply
09-30-2015, 12:32 PM
Post: #3
RE: Default Bank Account
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>';
}
Find all posts by this user
Quote this message in a reply
09-30-2015, 07:30 PM
Post: #4
RE: Default Bank Account
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
Visit this user's website Find all posts by this user
Quote this message in a reply
09-30-2015, 11:05 PM (This post was last modified: 09-30-2015 11:05 PM by TurboPT.)
Post: #5
RE: Default Bank Account
@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.
Find all posts by this user
Quote this message in a reply
10-01-2015, 10:09 AM
Post: #6
RE: Default Bank Account
Thanks for the help works great.
Find all posts by this user
Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)