The details of what you need to do will differ slightly from case to case. If for example there is 1 transaction which should not be contributing towards the stock quantity you will need to delete it. You will need the transaction lines Unique ID for this. You can find this using the batch unique number. Run the below script:
SELECT Unique_ID, dbo.GetFMDate(Date_Booked) AS 'Date Booked', dbo.GetFMTime(Time_Booked) AS 'Time Booked', Stock_Qty, Receipt_Or_Issue, Transaction_Type FROM STKDETAIL WHERE UniqBatchLocatioo = [Batch Unique No from FM]
This will return all transaction lines for that batch of stock, You can identify the specific problem line using columns such as Date Booked, Time Booked and Quantity. Once you have the Unique ID Run the following Script.
Delete From STKDETAIL Where Unique_ID = [Unique ID from line found above]
Once you have done the above, edit the quantity below by the quantity on the transaction you have just deleted.
For example, if the transaction deleted above was a goods in for 5, the quantity below needs 5 subtracting from it.
Update PSBATCH Set Quantity = [X] Where Batch_Unique_No = [Batch Unique No from FM]
