Topic: Direct Purchase Invoice Entry - Change the default payment Delayed

In Direct Purchase Invoice Entry  the default payment is "Delayed", how we can change such default to our desired bank account for payment.

The reason why we want to change is that the default payment is "Delayed" and we do not want to always change it to our bank account every time we do processing the Direct Purchase Invoice Entry.

Re: Direct Purchase Invoice Entry - Change the default payment Delayed

If you have Cash type Bank accounts, it will be available in the drop down next to Delayed

Try create Cash accounts from your Bank Accounts and check this again.

Subscription service based on FA
HRM CRM POS batch Themes

3 (edited by rafat 08/12/2023 04:22:49 am)

Re: Direct Purchase Invoice Entry - Change the default payment Delayed

@Marc
It is possible to do what you asked but you need to change the core a little bit.
in .../purchasing/po_entry_items.php around line 485 remove _('Delayed') so its like this:

 if ($_SESSION['PO']->trans_type == ST_SUPPINVOICE) {
    cash_accounts_list_row(_("Payment:"), 'cash_account', null, false,);
}

This will give you the list of your cash accounts with the default the first one in alphabetical order if you have more than one.
Beware the debit of the account is immediate and there is no need to go to Supplier Payment screen to pay your Suppliers.

Test it first and then use it if it serves your need.

Re: Direct Purchase Invoice Entry - Change the default payment Delayed

Hello Rafat,

I try to do that but it result to an error below

Parse error: syntax error, unexpected ') in  /xxxx/purchasing/po_entry_items.php on line 483

5 (edited by rafat 08/14/2023 07:25:41 am)

Re: Direct Purchase Invoice Entry - Change the default payment Delayed

You have a ' that needs to be removed. Paste line 483 here if you face troubles.
Also state your FA version and other environment parameters.

Re: Direct Purchase Invoice Entry - Change the default payment Delayed

Hello rafat,

Below is the line 483   and they do that in FA ver 2.4.11

-----------------------------------------------
display_po_items($_SESSION['PO']);

start_table(TABLESTYLE2);


if ($_SESSION['PO']->trans_type == ST_SUPPINVOICE) {
    cash_accounts_list_row(_("Payment:"), 'cash_account', null, _false,);
}

textarea_row(_("Memo:"), 'Comments', null, 70, 4

Re: Direct Purchase Invoice Entry - Change the default payment Delayed

Try false instead of _false (remove the underscore).
Depending on your PHP version this could be the problem.

Re: Direct Purchase Invoice Entry - Change the default payment Delayed

Hello rafat,

Thanks, its working, I also consider the PHP version

Re: Direct Purchase Invoice Entry - Change the default payment Delayed

@joe: is this _false to false dependency on PHP version going to affect FA in general? I cannot find _false anywhere in the latest codebase.

Re: Direct Purchase Invoice Entry - Change the default payment Delayed

Hello all.

There are missing items in your source.

I have

if ($_SESSION['PO']->trans_type == ST_SUPPINVOICE) {
    cash_accounts_list_row(_("Payment:"), 'cash_account', null, false, _('Delayed'));
}

So this should be      false, _('Delayed'));

I have never seen _false anywhere in the source. It should have cast an error. Also the function parameters are stopped after a , character after _false.

Joe

Re: Direct Purchase Invoice Entry - Change the default payment Delayed

Hello...

Excellent  improvement..!!. Will save time registering PO.

And how to do if I need to display besides cash account, all bank accounts??

So user could select from what account pay the PO.

Rafael