Stock valuation and purchase returns
Receive goods on a bill, sell them, count them, return them to the supplier: how stock is valued, how the cost of sales posts, and what the purchase return does to the vendor credit and the VAT return.
Stock is counted and valued from a movement register: every receipt, issue, adjustment and return is one row that is never edited (a correction is a mirror row), and the quantity on hand is the sum of the rows. With the Inventory module on (Settings → Accounting → Modules), every movement that carries a cost also posts to the ledger, so the inventory account equals the register at every moment. This page walks through a trading month: two purchases, one sale, one return, a count and a reorder.
Before you start
- Items are tracked under Items → Add Item → Track inventory; a tracked item carries a reorder level (Low stock warning at), a cost price and, optionally, its own inventory and cost of sales accounts (the chart's
inventoryandcost_of_salesroles when it has none). - The valuation method is per organisation: weighted average (one running cost per item, the default) or FIFO (cost layers consumed oldest first). Change it under Settings → Accounting → Stock valuation from a date; nothing before that date is restated. See Add a product for how the count is kept.
- The ledger is enabled and the Inventory module is on. Without the module the register still counts quantities and costs; nothing posts.
1. Receive goods on a bill
Record the supplier's bill under Bills → New bill (or accept a received one). On each line, pick the item with the item button beside the description: a tracked item's line receives its quantity into stock the moment the bill is accepted, at the line's price converted to the base currency. Serial numbers received go in the field under the line, comma-separated.
What posts: the bill books the line to the item's inventory account (1500 in the Gulf chart) instead of an expense account, the input VAT to its box as always, and the supplier to payables. The register gains one receipt per line. Void the bill, or return it to draft, and the receipt is reversed with it.
Example: 100 units at 10 on one bill and 50 at 13 on another. Under weighted average the running cost is 11; under FIFO the layers are 100 at 10 and 50 at 13.
2. Sell the goods
Issue a tax invoice with the item on a line. When the invoice leaves draft, an issue movement takes the quantity out at the method's cost, and the invoice's own ledger entry carries the cost leg beside revenue and VAT: Dr Cost of sales / Cr Inventory at that cost. Selling 60 units costs 660 under weighted average (60 × 11) and 600 under FIFO (60 from the first layer).
A credit note for the goods brings them back: a return in at the cost the issue carried, and the credit note's entry carries the mirror leg (Dr Inventory / Cr Cost of sales).
The stock follows the invoice's lines as you save them. Issue on a new invoice or on a draft moves the quantities of that save. Save changes on an issued invoice with another quantity reverses the earlier movement, writes a new one and replaces the entry (the message names the new entry); a save that changes no stocked line moves nothing. An invoice returned to draft or archived gives its goods back.
The low-stock warning in the invoice editor and the allow / warn / block policy for negative stock (Settings → Workspace) read the same register.
3. Serial and batch numbers
Open a line's details in the invoice editor: Batch number and Serial numbers (comma-separated) travel onto the movement and print under the line on the PDF. A serial number that is out cannot be issued twice: a second invoice naming it is refused with serial_already_issued until a credit note brings it back.
4. Return goods to the supplier
On the accepted bill, choose More → Return goods. Pick the lines and quantities going back (never more than the line received, less what earlier returns took), the date and the reason, and record the return. It appears under Purchase returns with its number (PR-0001, the purchase_return series under Settings → Document numbering).
The return moves through five states:
- Draft: editable in the sense that it can be voided and recorded again.
- Confirmed: the goods are agreed to go back. Send it to the supplier by e-mail (the
purchase_returne-mail template, English or Arabic) or preview the PDF. - Fulfilled: the goods have left. The register gains one return out per line at the current cost, and a vendor credit is recorded for you at the bill's price with the bill's VAT, numbered like the return. Its entry: Dr Payables for the credit's total, Cr Inventory for the credit's base, Cr Input VAT with the correction negated in the pack's purchase box (box 9 on the UAE return, P1 on the Saudi one), and the difference between the credit's base and the cost the goods left at goes to Inventory adjustments. Returning 10 units bought at 10 while the running cost is 11 credits inventory 100 through the credit and moves 10 more from inventory to adjustments, so inventory carries exactly the 110 the goods left at.
- Closed: the paperwork is done. Reopen a closed return with a reason when the supplier asks again.
- Voided: from any state, with a reason: the goods come back into stock and the vendor credit is voided (refused while the credit is applied to a bill: remove the application first).
The vendor credit is a normal vendor credit: apply it to the bill, or take a refund.
5. Count the stock
Open Stock (under the catalogue): every tracked item with what is on hand, its reorder level, the cost the next issue carries and the value on hand; the footer names the valuation method and the total. Select the items you counted and choose Count selected:
- Type the counted quantity per item. The table shows the difference, the cost it carries and the amount; items that match are skipped.
- Preview and confirm: the preview shows the entries that would post (Dr Inventory adjustments / Cr Inventory for a shortage, the mirror for a surplus) and applies them on Confirm. A count found 78 against 80 at a cost of 11 posts 22 to adjustments.
- A count dated in a locked period is refused; propose it instead and an approver applies it.
6. Reorder
An item whose quantity on hand is below its reorder level shows the Below reorder level badge and the page's banner names the shortfall. Create purchase order opens a purchase order prefilled with those items and the shortfall as the quantity; send it to the supplier as usual.
7. Reports
Under Reports → Report library:
- Stock valuation: per item the quantity on hand, the unit cost, the value and the account; the totals show the value, the ledger's inventory balance and the difference. The difference is zero once every valued movement posted; an opening count carried over from before the module was on never posts (the opening balance import owns that figure), and the totals name its value.
- Stock movements: the register for a period with the document, the serial numbers and the entry of every row.
Both are available to the API (report_run) and the assistant (run_report).
8. Landed costs in the valuation
Freight, customs duty and other charges that bring goods in can be added to the cost of those goods after the bill that received them. The charge is recorded on its own bill line, switched to Landed cost, and an allocation spreads it over the received lines. Landed costs walks through it.
What the register and the reports show:
- A cost adjustment row. On the item's Movements, an allocation adds one row of the kind Cost adjustment. Its Quantity is blank, because no goods move. Its Total is the amount that landed on the stock still on hand, its Unit cost the rise per unit, and its Source, Landed cost, opens the allocation. Reversing the allocation adds a mirror row with the amount negated.
- The cost moves, the quantity does not. Under weighted average the item's running cost rises by that amount over the quantity on hand; under FIFO the cost of what is left of the receipt's layer rises. With 100 units received at 30, 30 of them sold and 420 of freight landed on the 70 left, the unit cost goes from 30 to 36.
- Stock already sold. The part of a charge that belongs to units already sold posts straight to cost of sales and adds no row to the register.
- The valuation still equals the inventory account. The allocation's entry debits the inventory account by exactly the amount of the cost adjustment rows. Stock valuation shows the higher value, the same ledger balance and a difference of zero, after an allocation and after its reversal. Stock movements lists the cost adjustment with its entry.
A charge not yet allocated is in neither figure: it waits in the clearing account and in the report Landed costs not yet allocated.
Over the API and the assistant
Bills take itemId and serialNumbers per line (POST /bills); GET /stock, GET /stock/movements, POST /stock/counts (preview with X-Preview: true), POST /stock/counts/preview and GET /stock/reorder serve the Stock page; POST /purchase-returns, POST /purchase-returns/{id}/status and POST /purchase-returns/{id}/send serve the returns. The assistant has count_stock, suggest_reorder, create_purchase_return, set_purchase_return_status, send_purchase_return, list_purchase_returns and get_purchase_return; every write shows a preview first and asks before it applies.
Refusals: item_not_tracked, stock_insufficient (the block policy), serial_already_issued, return_exceeds_received, purchase_return_not_fulfillable (not confirmed, or the bill no longer accepted), purchase_return_status_invalid, vendor_credit_applied, period_locked.