1 (edited by incocare 04/05/2020 08:47:47 am)

Topic: Negative Inventory Adjustments not working anymore (2.4.8)

Since 2.4.8 any negative adjustments are booked as positive adjustments!
Was working fine in 2.4.7.

Seems as if one of these fixes broke something:
** Inventory Adjustment: fixed error in adjustment entry when inventory notifications are switched on.
** Inventory Adjustment: negative adjustment should always use current average item cost.

Downgraded temporarily to 2.4.7 to get end of business year stock adjustments done.
Would be great if this could be fixed soon.

https://www.dropbox.com/s/3iprw57lmi1xra4/Screenshot_2020-04-05%20Item%20Adjustments%20Note.png?dl=0
https://www.dropbox.com/s/tjv09kctyzhpt7k/Screenshot_2020-04-05%20View%20Inventory%20Adjustment.png?dl=0

Post's attachments

InventoryAdj.zip 55.1 kb, 10 downloads since 2020-04-12 

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

Re: Negative Inventory Adjustments not working anymore (2.4.8)

Hi to all. I have the same issue, but a little odd. I've instaled 2.4.8 from scratch, and did one negative adjustment and everything in the GL went well. The second adjustment (negative/egress) was booked as positive, and also positive income in the item movement. I dont know what to do.

Re: Negative Inventory Adjustments not working anymore (2.4.8)

@joe: is this a real issue?

Re: Negative Inventory Adjustments not working anymore (2.4.8)

A friend of mine that is  FA expert (Patricio) solved it!! just unchecking the "Location Notifications" at the System and General GL Setup page. It works fine now.

Re: Negative Inventory Adjustments not working anymore (2.4.8)

Hello all.

I have been looking at this and espect a PHP bug. The code is handling it correctly. Explanation:

In file /inventory/includes/db/item_adjust_db.inc, function add_stock_adjustment. The line_item->quantity is assigned to another variable,  $chg.
This variable is sent to another function calculate_reorder_level with the address of $chg (this variable has been changed to positive qty for calculation), but the original variable line_item->quantity should remain unchanged. But for some reason the address of both variables is shared. Strange!!
I have now saved the line_item->quantity in a $tmp variable during the calculate_reorder_level and restored after. Now it is working.

As mentioned by @dtejada this is only happening when the 'Location Notifications' was checked.

I will upload the corrected file, item_adj_db.inc, for replacement.
The fix will be committed to stable repo asap.

/Joe

Post's attachments

items_adjust_db.inc 4.5 kb, 11 downloads since 2020-07-31 

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

Re: Negative Inventory Adjustments not working anymore (2.4.8)

@joe: thanks for getting to the root cause of this bug.
Did you also check that the cost are correctly calculated, since they had been also wrong.