How do you know where the item came from and how to fix so that there is stock in the WIP warehouse?
You can have a look at the source of the transaction by checking the jobline in the Invoicing tab of the job.
In the Source column there is a number and there should be a yellow arrow that you drill into that will open the source document.
If there are transactions on a jobline but 0 quantity sitting in the WIP warehouse, then at some point stock has been taken out of the WIP warehouse incorrectly.
You will need to reconcile the item to find out where the erroneous transaction has taken place and reverse the incorrect transaction to make the stock available on the job again.
The incorrect transaction will be one where it does not affect the jobline but reduces the WIP warehouse. One of the transactions to check is a Goods Issue out of the WIP warehouse, without having a Subjob ID or Line SeqNo entered.
Standard transactions from the front end (i.e. inventory transfers, receipting to the job, delivery, invoicing etc.) all transact at the job level and will probably not be a source of concern.