I think we need another attribute adding to the receiving API, we need to know the previous quantity received, if the receiving is "Suspended".
For example, we create a Purchase Order with an item quantity of 10 required.
Later only 6 are received, we find the purchase order and edit "Quantity received" to 6 and Suspend the PO. The image shows 6 are added in to stock.
Later the remaining 4 items come in to stock. We find the purchase order, and click Finish.
The image shows (-6) are deducted from stock. At the same time the full 10 are received in to stock. Hence php POS item stock is correct.
The problem is when using the receiving get API, the first edit receiving web hook shows "quantity_received":6. The next API call to edit receiving web hook, shows "quantity_received":10. Hence 16 in total are received according to the API.
The problem is the quantity previously received quantity (-6) is not show in the API, it is too late to get the that information from the original RECV 54 as it has already been overwritten. I think that, if the receiving is suspended, the API should show the quantity previously received.
As far as i understand the only option would be: If the edit receiving web hook API is not suspended, "suspended":"0", and it is not a Purchase Order "is_po":false, we have to use the item API to get the current quantity.
Or am I doing something wrong?
Please sign in to leave a comment.