My guess it may have smth to do with UpdateGoodsReceiptsAvailQty(). (I am not sure why is the purpose of this)
You can probably comment out it and see what happens.
Thank you for your post Lilian. I see this post has been submitted twice and the second post is being addressed so I will close this duplicate.
Thank you. ...