webERP Forum
Default Bank Account - Printable Version

+- webERP Forum (http://www.weberp.org/forum)
+-- Forum: webERP Discussion (/forumdisplay.php?fid=1)
+--- Forum: Development Discussion & Specification (/forumdisplay.php?fid=10)
+--- Thread: Default Bank Account (/showthread.php?tid=2585)



Default Bank Account - daveparrish - 09-30-2015 07:25 AM

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


RE: Default Bank Account - TurboPT - 09-30-2015 10:55 AM

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.


RE: Default Bank Account - daveparrish - 09-30-2015 12:32 PM

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>';
}


RE: Default Bank Account - falkoner - 09-30-2015 07:30 PM

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


RE: Default Bank Account - TurboPT - 09-30-2015 11:05 PM

@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.


RE: Default Bank Account - daveparrish - 10-01-2015 10:09 AM

Thanks for the help works great.