# Logic of quantity required calculation in fulfillment workbench

This is true for Kinetic as well.

Scenario
You have an order that has a quantity of 100 EA. Because of the nature of the item, you have to break this up into multiple truck shipments.

Initially, 25 EA are released, picked and packed, but not marked as shipped. The warehouse team then goes in to reserve the rest to go on another truck.

Problem
When they go into the fulfillment workbench, they get the following error when they type 75 EA as the quantity: “The reserved quantity is greater than the required quantity”. I figured out by trial and error that the max I can reserve is 50 EA.

Research
I looked at the Erp.Services.BO.OrderAlloc under the OrderAllocSupplyUpdate method and determined the system is following the formula:
`(num2 + (this.ttOrderAllocSupply.ReservedQuantity - num3) > num1)`

• num1 is the remaining order quantity
• num2 is the amount already reserved/allocated/picking/picked = 25 EA
• num3 is original amount reserved on this record (this is to account when changing the reserved amount before processing)

So for this example, I would expect it to yield:
`25 + (75-0) > 100` yielding false so I wouldn’t get the error. It should be 100 because the original 25 isn’t out of inventory yet.

*`25 + (75-0) > 75` giving me the error.

If we mark the original shipment as shipped it would yield:
`0 + (75-0) > 75` no error…

*The reason num1=75 is happening is because the packed items are still showing as picked. But the system is removing that from the remaining order requirement which is essentially double accounting for that amount.

Question
Aside from assigning the original 25 and remaining 75 to separate releases (which also resolves this issue), does Epicor’s logic on the calculation for the remaining order quantity make sense? I’m trying to divine the logic…

Breaking them up into releases is quite challenging at shipment time depending on the order and amount of space left on the trucks.

1 Like

Was the initial 25 that were packed put through the FWB process?

Yes.

I’m trying to recreate it and I can’t seem to. My qty stays in ‘Picked’ after creating the pack, then closing it. It then moves to ‘Shipped’ when I mark it shipped. The whole way, my Fulfilled and To Fulfill quantities stay accurate. Although I am reserving not allocating.

Do you use PCIDs? I remember this setting in Site Config having some unexpected effects:

Yes. When we leave it in packed, that’s when we’re getting the
`25 + (75-0) > 75`

So it’s counting the 25 as being picked, but it’s also decreasing the remaining order amount by 25. By doing so we can only pick a maximum of 50 until it’s marked as shipped.

If it’s going to count the 25 as being picked but still in inventory, then I would think it wouldn’t decrease the required amount by 25. There’s a flag in the logic for “ExcludeNotShipped” but that’s set to false.