StabisoDocs

Purchasing and stock

Stock: warehouses, stock items, movements, counts and valuation

A company that sells goods keeps them in stock: in one or more warehouses, valued at the moving average cost of the company (IAS 2.25; the same as SAP's price control V and Oracle's average costing). Every change of stock is a stock posting with its journal entry, so the inventory accounts of the ledger always equal the stock valued at moving average, to the cent. The design is ADR-0077; this guide is the first slice as built: warehouses, stock items, adjustments, transfers, counts and the valuation. Delivery notes with the cost of goods sold, goods received with the GR/IR account and price lists follow in their own slices.

Everything is a REST operation first (/v1, tag "inventory" in the generated reference).

Accounts

Every chart template names four accounts for stock; a company created before them gets them when it adds its first warehouse or stock item (adding accounts needs the right to manage accounts). An account its chart already has under the template's code takes the role of cost of goods sold or inventory changes; it is never made the inventory or GR/IR account, which only stock postings book: the code in use is named (409 account_codes_in_use), and the account is added under another code with its role.

Chart Inventory Cost of goods sold Inventory changes and count differences Goods received not invoiced
Swiss KMU (CH, LI) 1200 Handelswaren 4200 Handelswarenaufwand 4280 Bestandesänderungen und Inventurdifferenzen 2050 WE/RE-Verrechnung
German HGB 2000 Waren 6110 Wareneinsatz 6120 Bestandsveränderungen und Inventurdifferenzen 4350 WE/RE-Verrechnung
French PCG 370000 Stocks de marchandises 603700 Variation des stocks de marchandises 603710 Écarts d'inventaire 408110 Fournisseurs, réceptions non facturées
Italian 2000 Prodotti finiti e merci 6500 Variazioni delle rimanenze 6510 Differenze inventariali di merci 4302 Merci ricevute, fatture da ricevere
Spanish PGC 300000 Mercaderías 610000 Variación de existencias de mercaderías 610900 Variación de existencias 400900 Proveedores, facturas pendientes de recibir
UK FRS 102 1300 Stock 5000 Cost of sales 5010 Stock adjustments and count differences 2310 Goods received not invoiced
US, Canada, IFRS 1300 Inventory 5000 Cost of goods sold 5010 Inventory adjustments 2310 Goods received not invoiced

The inventory and GR/IR accounts are control accounts: only stock postings book them, so a journal entry by hand cannot put the ledger out of step with the stock.

Warehouses

POST  /v1/warehouses                {entity, code?, name, address?, is_default?}
GET   /v1/warehouses                ?entity&active
PATCH /v1/warehouses/{warehouse_id} name, address, is_default: true, active

A company's first warehouse is its default: goods move in and out of it when nothing else is said. Without a code, the warehouse gets one made from its name (Lager Zürich is LAGER-ZURICH, then LAGER-ZURICH-2); the screen proposes the same code as you type the name, and a new warehouse is in the company's country. A warehouse is never deleted. It cannot be deactivated while it is the default or holds stock.

Stock items

POST  /v1/stock-items                {product, entity?, inventory_account?, cogs_account?}
GET   /v1/stock-items                ?entity&in_stock
GET   /v1/stock-items/{product_id}
PATCH /v1/stock-items/{product_id}   inventory_account (only while nothing is in stock), cogs_account

A stock item is a product sold per unit that is goods. It shows the quantity in each warehouse, the value of the stock and the moving average cost of one unit.

Adjustments and transfers

POST /v1/stock-adjustments   {entity, posting_date?, reason, offset_account?, lines: [{item, warehouse?, quantity, unit_cost?}]}
POST /v1/stock-transfers     {entity, posting_date?, from_warehouse, to_warehouse, note?, lines: [{item, quantity}]}

An adjustment books goods in or out without a document: damaged, lost or found goods, or stock taken over. Goods going out leave at the moving average (the last unit takes what is left, so no rounding stays behind); goods coming in at the unit cost given, or the moving average. The value is booked against the inventory adjustment account, or the account named. A reason is required. An agent's adjustment waits for a person: its stock changes only when the entry is approved, and an agent cannot record goods in at no value (that posts no entry for a person to approve).

A transfer moves goods between two warehouses of the company. The value stays the company's, so nothing is posted to the ledger.

No stock goes negative, in a warehouse or in the company: the posting is refused in plain words, with the quantity on hand. A posting that moves value (an adjustment, a count's differences) is not dated before the item's latest posting, posted or waiting for approval: goods leave at the moving average of now, which is not that of an earlier day. A transfer may be dated earlier, and leaves enough in the warehouse on every later day already booked. Nothing moves in a warehouse before its latest posted count: the books would no longer say what the count found. Stock moves only in an open period, a transfer and a count without differences too.

Stock postings

GET /v1/stock-postings              ?entity&kind&status&item&warehouse&start&end
GET /v1/stock-postings/{posting_id}

Every change of stock: its number (STK-2026-000001, gap-free per company and year), kind, day, the movements with quantity, value and unit cost, and its journal entry. A posting is never changed or deleted, and its entry cannot be reversed by hand: a correction is a new posting.

Stock counts

POST /v1/stock-counts                    {entity, warehouse, count_date?, items?, note?}
GET  /v1/stock-counts                    ?entity&status
GET  /v1/stock-counts/{count_id}
PUT  /v1/stock-counts/{count_id}/lines   {lines: [{item, counted_quantity}]}
POST /v1/stock-counts/{count_id}/post
POST /v1/stock-counts/{count_id}/cancel

A count of a warehouse on a day lists every item to count with what the books hold. Once every line is counted, posting it books the differences at the moving average against the inventory adjustment account (goods found when none are held: at the item's last cost in). One count of a warehouse is open at a time. A count is refused once goods have moved in the warehouse after its day (cancel it and count again), and while a posting of the warehouse waits for approval (approve or reject it first): its goods would otherwise be booked twice. Goods sold or moved out of other warehouses after the count's day leave the average as it was, so a count is posted on its own day also later (a year-end count posted in January); once goods came in at a cost or the item changed value after that day, the count is refused (cancel it and count again).

Valuation

GET /v1/entities/{entity}/stock-valuation   ?as_of&warehouse

Each item's quantity and value at moving average at the end of a day, the total, the balance of the inventory accounts in the ledger and the difference, which is zero. The period close checks the same tie (Stock = inventory accounts): a difference fails the close, and a count of the period not yet posted is a warning.

Stabiso, the Enterprise System of Record · generated from the code and its guides · release 20b7dd5b0c4d