Clear warehouse data

How to I clear the Warehouse SQL data? I want to reset all the inventory count to zero.

Edit: is it in this link?

It will clear much more than just your Inventory. It will clear all Sales data as well. It clears every Transaction of every type and resets all Accounts to zero.

But if you are not worried about that either, you can use that method.

I have not tested this, so use at your own risk.

:warning: Backup your DB first!

Theoretically, this will clear only Inventory Purchases and Consumption.
It does not clear any other Transaction data such as Sales.
It does not clear configuration data such as Products, Inventory Items, or Recipes.

DELETE FROM [CostItems]
GO
DELETE FROM [InventoryTransactionDocuments]
GO
DELETE FROM [InventoryTransactions]
GO
DELETE FROM [PeriodicConsumptionItems]
GO
DELETE FROM [PeriodicConsumptions]
GO
DELETE FROM [WarehouseConsumptions]
GO
1 Like

i’m sorry but where should i write these commands?

In SQL manager query.
As said backup first. There is database task in samba to clear all. That is untested to clear just inventory.

1 Like

I wouldn’t touch SQL manager if you don’t know what you’re doing.

1 Like

Hi, i tried this script, its working but cant clear negative figures from warehouse. any suggestion?