How to use StockAsOf
Install it
- You need WordPress 6.5 or later, PHP 7.4 or later and WooCommerce.
- In your WordPress admin, go to Plugins, Add New, search for StockAsOf, install it and activate it.
- StockAsOf records every product and variation that manages its stock right away, in the background. Its settings page shows when this first check finished.
Read the report
Go to WooCommerce, Stock as of. Pick a day, or one of the last three month ends, and choose Show. For each product, the report shows:
- Quantity: the stock at the end of that day, in your store’s time zone.
- Unit cost: the cost recorded at the time, and where it came from.
- Value: quantity times unit cost. Negative quantities (backorders) count as zero, and are marked.
- Recorded: when that quantity and cost were written down.
Above the table: the total value, the units in stock, the number of products, and how many have no cost (they are left out of the total; “Show them” lists them). Search by name or SKU, and sort by name, quantity or value.
For a day before you installed StockAsOf, the report says when recording began. If StockAsOf was switched off for a while, the report warns on the days in between.
Unit costs
StockAsOf uses the first cost above zero, in this order:
- WooCommerce’s own cost of goods, if you turned it on (WooCommerce, Settings, Advanced, Features, “Cost of Goods Sold”). Its cost field is on each product’s General tab.
- A product field of your own, if you name it in StockAsOf’s settings (for example _purchase_price).
- The cost field of the Cost of Goods plugin (_wc_cog_cost) or of Cost of Goods for WooCommerce (_alg_wc_cog_cost).
- StockAsOf’s own “Cost for stock value” field, on each product’s Inventory tab and on each variation (shown while WooCommerce’s own cost of goods is off).
A variation without a cost of its own takes its parent product’s. The settings page shows how many products have a cost in each field. A cost you change today applies from today: past days keep the cost recorded then.
Download a CSV
On the report, choose “Download CSV for this day”. The file has one row per product: the day, product and parent ids, SKU, name, quantity, unit cost, value, where the cost came from, when it was recorded, whether it is an estimate, and a note. Numbers use a dot for decimals and no thousands separator, in your store’s currency.
Settings
- Daily check at: when StockAsOf checks every product each day, in store time (default 23:30). It records each change as it happens anyway; the check catches changes made some other way and changes of cost.
- Keep history for: 1 to 10 years, or always (default 7 years). Older changes are deleted, but each product keeps its last value from before, so every day you keep stays right.
- Your own cost field: see Unit costs, above.
- Check every product now: runs the check at once, in the background.
StockAsOf Pro
StockAsOf Pro is a separate plugin, sold on the WooCommerce Marketplace. Install it next to StockAsOf; it adds two tabs.
Before recording
Choose “Estimate past month ends”. StockAsOf Pro reads your orders’ notes in the background (WooCommerce writes the stock before and after each time an order changes it) and estimates each product’s stock at the 24 month ends before recording began. Each estimated row is marked “Estimate” and says what it rests on:
- notes before and after the month end that agree;
- a change by hand between them (a delivery or a count), with both numbers: the earlier one is shown;
- only a note after the month end, or none at all before recording began.
Costs for those days are the ones recorded on the first day of recording. You can estimate again, or remove the estimates, at any time.
Month-end email
Enter up to five addresses and tick “Email the month-end file on the 1st”. On the 1st of each month at 07:00 store time, your site emails the CSV for the last day of the month before, with the total in the subject. “Send last month’s now” sends it straight away, to check it arrives.
Turning it off or removing it
Deactivating StockAsOf pauses recording; when you switch it back on, it checks every product and the report warns about the days in between. Deleting it deletes its whole history and its own cost field, so download the CSV files you need first. Deleting StockAsOf Pro deletes its estimates and settings; StockAsOf’s own records stay.