Topic: Can't Enter Supplier Invoice

The price being invoiced is more than the purchase order price by more than the allowed over-charge percentage. The system is set up to prohibit this. See the system administrator to modify the set up parameters if necessary.The over-charge percentage allowance is :10%

The message appears when I will click add items in Supplier Invoice.
Please help to resolve this.

Thanks

Re: Can't Enter Supplier Invoice

Which version of FA are you using - v2.3.x or v2.4.x?
What is your OS platform / MySQL / PHP for the server and version?
Which client browser and version are you using?

The said message emanates from Line 273 of purchasing/supplier_invoice.php.
If you want to brute force it then comment out the lines 266-279 in it.
Check the settings in your sys_prefs table / config settings for the real fix.

Re: Can't Enter Supplier Invoice

I use FA 2.4.1 version.

Supplier Invoice.png

Post's attachments

Supplier Invoice.png 72.6 kb, 1 downloads since 2017-07-24 

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

Re: Can't Enter Supplier Invoice

If you want to turn off this warning, then in your config.php file, set the variable:

    $check_price_charged_vs_order_price = false;

The function over_charge_allowance() (in the file includes/prefs/sysprefs.inc) returns the margin (default = 10%) using the per company variable po_over_charge in the sys_prefs table.

Re: Can't Enter Supplier Invoice

I have done according to the above steps, but I still can't make Supplier Invoice.
Now if I hit Enter Invoice, then nothing happen. Just move from the bottom to the top of the same page.

Re: Can't Enter Supplier Invoice

Clear all browser cache and try it.
That is the setting that should do it unless it is a scope / visibility issue.
@joe?

Re: Can't Enter Supplier Invoice

What is the presumption to include this way the zero price in this check???

if ($_POST['order_price'.$n]==0 ||
                input_num('ChgPrice'.$n)/$_POST['order_price'.$n] >
                (1 + ($margin/ 100)))

Isn't it better like this

if ($_POST['order_price'.$n] !=0 &&
                input_num('ChgPrice'.$n)/$_POST['order_price'.$n] >
                (1 + ($margin/ 100)))

The original way you are stuck if the order is with zero price...

Re: Can't Enter Supplier Invoice

In the original code, if $_POST['order_price'.$n] == 0, then a divide by zero error would still not occur as the second part is not evaluated at all. But the error stated in the first post here would occur.

In your code, what if a negative order_price got in along with a negative ChgPrice?

The "!=0" should be ">0" in your code with a possible abs() for the LHS of the second check.

Re: Can't Enter Supplier Invoice

Now I can click the add button and the items will automatically be selected to enter the invoice.
But Quantity Received and Quantity Invoiced be zero. I force to click enter invoice button, but nothing to happens.

Please advice


Supplier Invoice 2.png