webERP Forum

Full Version: MRP Planned Work Orders
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I am using version 4.14.1, (have not upgraded this instance yet). However, I didn't see that any changers were made to the MRP system in the new version.

When I run the MRP, I only have "Use Reorder Level Demands" selected. I have a part, that is not part of any bill of material, that has

35 Open Order
107 in stock
250 Reorder level
The part is a manufactured part.

I would think the system would tell me I need to make 35 to cover the open order and then 143 to get to my reorder level of 250. However, the system tells me I need to make 35 for the open order and 36 for the reorder level. This is exactly 107 wrong, (which is what I have in stock.)

Then, I invoiced the 35, now I have a stock of 72. I ran the MRP again, same parameters, and now it says I need to make 106 to fulfill reorder level. (Exactly 72 off).

It seems that they system is subtracting the current inventory twice when calculating the quantity to make for the reorder level?

I tried to follow the script to see where the calculation occurs, but it seems a bit over my head. I did see in the table mrprequirements table, the quantity for this part is 178, with a MRPdemandtype of REORD
But, in the mrpplannedorders, it shows supplyquantity 106, with an ordertype REORD
I did a little more digging and found that when inserting the data into mrprequirements table, on line 326 it inserts the data for reorder level as
(locstock.reorderlevel - locstock.quantity)
Which is the reorder level minus the stock on hand.

then on line 724 it sets the planned orders quantity to what I believe, is the total from the mrprequirments table minus the total supply.

$Requirements[$reqi]['quantity'] -= $TotalSupply;

The total supply seems to be calculated from mrpsupplies table and has entries based on quantity on hand, open PO, open WO, etc. So when summing the total supply, it includes the quantity in stock (QOH).

So, to me, it looks like for reorder levels, we are subtracting the amount in stock twice? If I change line 326 in MRP.php to (locstock.reorderlevel), basically not subtract out the existing stock in the mrprequirements table, it seems to be working?
Can anyone "closer" to MRP usage (which means, more knowledgeable than me Smile ) check this handling to see if it appears to be ok?

If so, I'll commit the proposed fix to the bug_fixes and HEAD.
BrianTMG is correct. The reorder quantity should not be reduced by the quantity on hand.
Thanks Brian! (...and to Phil for the validation)

Change committed to bug_fixes_only and HEAD, credited to BrianTMG.
It looks like this never got worked in to the latest version or was perhaps reverted?

Addressed here and then lost?
(11-07-2018 06:39 AM)VortecCPI Wrote: [ -> ]It looks like this never got worked in to the latest version or was perhaps reverted?

Addressed here and then lost?

That change was after the May 4.15 release (in June), but will be in 4.15.1.
Reference URL's