Unable to Process Stocktake : Stocktake has not been started in location

Problem

This issue related to a Head Office/Site Manage setup where stocktakes were unable to be processed as a location from another site was visible in the process stocktake screen.

Note:  This solution will also work if the Pocket Stock data was uploaded to the wrong location.

Error displays - 'Stocktake has not been started in location'

For example:
Location 1 below is from another site:


A stocktake had been sent from a handheld with the wrong location – the target back office does not contain that particular location, for example:


Solution

Query their PdeStocktake table from an  SQL command prompt.  If it displays the expected data, you can then update the location. 
Note: by doing this, you will modify the Stocktake Location for ALL PENDING STOCKTAKE ITEMS IN that LOCATION to the new location.

For example; in the case used in this example, change all pending stock items from location 1 to location 5:

In IPS Utils > Advanced > SqlCmdLine - query that the data is there...

USE IPSTransaction
GO
SELECT * FROM PdeStockTake
GO

Example of result:


From the above example, now change the pending stock item/s in Location 1 to Location 5 with the following SQLCMD:

UPDATE PdeStockTake
SET Location = ‘5’
WHERE LOCATION = ‘1’
GO

Additional information on the PDE / Stock Manage process:

The Stock Manage app uploads information to the \ProgramData\POSserver\stockdata folder. 

Idealpos then converts that to an XML file in the \Idealpos 6.0\PDE or \ProgramData\Idealpos Solutions\Idealpos\PDE folder. 

From there, the data is loaded into the Access [PDEStocktake] table (in 6.0) or the SQL [PDEStocktake] table (in 7.0 and above). This prompts the green Process icon on the terminal licensed for Stock Manage.

if, for some reason, the Stocktake is not processed correctly, the XML files can be moved from the \PDE folder to the \stockdata folder and Idealpos will read and present them again