Topic: Can't Add Direct Invoice Item for some customers

For some customers mostly but not always customers with many transactions I can't add new item to the direct invoice and receive only
warning triangle without response to the request and leave no logs or footprint in php logs or nginx or php-fpm

https://i.ibb.co/vcWQknV/ibba.png

after debugging the issue seems to appear in the line containing

unset($_POST['_stock_id_edit'], $_POST['stock_id']);

in the function handle_new_item() while the $_POST['_stock_id_edit'], $_POST['stock_id'] are defined and I could print them with
display_error and such and also this unset() call work on some customers and didn't work on others

I tried to change my php version from 8.2 to 7.4 and it worked for while but then it stopped and never worked even when I clear the cache

I'm using nginx and php 8.2 in rocky linux 8

do anyone face same issue?

Re: Can't Add Direct Invoice Item for some customers

Your URL is not reachable in India as the major ISP has blocked ibb.co hosted at 213.174.132.224

3 (edited by DrCard 04/07/2024 07:32:06 am)

Re: Can't Add Direct Invoice Item for some customers

This image in the attachment

Post's attachments

ibba.png 201.6 kb, file has never been downloaded. 

You don't have the permssions to download the attachments of this post.

Re: Can't Add Direct Invoice Item for some customers

Compare the DB structures of the good and erroneous instances.
Compare the file and folder permissions of the web facing files.
Try to make the unset command into two separate commands, one for each variable, preferably after checking if it exists.
Compare the php.ini files across both installations.

In the file sales/sales_order_entry.php, at line 603, the unset appears as:

    unset($_POST['_stock_id_edit'], $_POST['stock_id']);

Wonder what the subsequent page_modified() does after the above statement that causes the error.

Re: Can't Add Direct Invoice Item for some customers

It seems you are using the select2 feature in every drop down. It's not core of FA. You might use a modified the version of it.

So when you choose certain customers. The drop down or the items list might be directly connected to the sales price.

Or there can be the custom query which is failed to get results..

Or if any drop down or the list might be oversized. And it fails to load. 

Or may be timeout. Increase the time if it.

Looks like you are a developer to modify the theme. So  check those perspectives.


Try something more on that to elaborate the error

Subscription service based on FA
HRM CRM POS batch Themes

Re: Can't Add Direct Invoice Item for some customers

apmuthu wrote:

Compare the DB structures of the good and erroneous instances.
Compare the file and folder permissions of the web facing files.
Try to make the unset command into two separate commands, one for each variable, preferably after checking if it exists.
Compare the php.ini files across both installations.

In the file sales/sales_order_entry.php, at line 603, the unset appears as:

    unset($_POST['_stock_id_edit'], $_POST['stock_id']);

Wonder what the subsequent page_modified() does after the above statement that causes the error.

I tried separating unset without any success also when this issue happen page_modified() is not reached it stuck and unset and that's it.

Re: Can't Add Direct Invoice Item for some customers

kvvaradha wrote:

It seems you are using the select2 feature in every drop down. It's not core of FA. You you might modified the version of it.

So when you choose certain customers. The drop down or the items list might be directly connected to the sales price.

Or there can be the custom query which is failed to get results..

Or if any drop down or the list might be oversized. And it fails to load. 

Or may be timeout. Increase the time if it.

Looks like you are a developer to modify the theme..So  check those perspective.


Try something more on that to elaborate the error

Theme seems to be unrelated I tried disabling and it doesn't solve the issue.

Temporary solution is to use customer not affected by this issue and then switch to effected one and then I'm able to proceed.

Re: Can't Add Direct Invoice Item for some customers

this video in attachment demonstrate the issue and the temporary fix while using default theme without select2

https://drive.google.com/file/d/1CnI922 … sp=sharing

Re: Can't Add Direct Invoice Item for some customers

Any updates guys?