StockAsOf

How to use StockAsOf

Install it

  1. You need WordPress 6.5 or later, PHP 7.4 or later and WooCommerce.
  2. In your WordPress admin, go to Plugins, Add New, search for StockAsOf, install it and activate it.
  3. 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:

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:

  1. 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.
  2. A product field of your own, if you name it in StockAsOf’s settings (for example _purchase_price).
  3. The cost field of the Cost of Goods plugin (_wc_cog_cost) or of Cost of Goods for WooCommerce (_alg_wc_cog_cost).
  4. 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

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:

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.