StabisoDocs

Purchasing and stock

Goods received and the GR/IR account

When goods (or services that need a receipt) arrive before the vendor's bill, the books show the cost and the debt on the day they arrive, not on the day the bill is posted. The receipt books the goods against the GR/IR account (goods received, not invoiced; WE/RE-Konto, marchandises reçues non facturées, merci ricevute da fatturare). The bill then clears it. What stays on GR/IR at month end is the accrual for goods received and not yet billed, listed per order line by the GR/IR report. The design is section 7 of ADR-0077. The stock itself is described in Stock. The REST operations are under the tag "goods received" in the generated reference.

The accounts

Chart Inventory GR/IR
Swiss KMU (CH, LI) 1200 Handelswaren 2050 WE/RE-Verrechnung
German HGB 2000 Waren 4350 WE/RE-Verrechnung
US, Canada, IFRS, UK 1300 2310 Goods received not invoiced

The other charts are listed in Stock. GR/IR is a control account, so a manual journal entry cannot post to it. Every line posted to it names the purchase order line as its subledger (purchase_order_line).

A purchase order line for a stock item

A goods line of a purchase order can name a stock item (item: the product code). The stock item must belong to the order's company, and the line must be goods that need a receipt. A services line or a line without a receipt is refused (stock_item_line_goods).

The receipt

POST /v1/purchase-orders/{order}/receipts with warehouse (default: the company's default warehouse). POST .../receipts/preview shows what the receipt would post, without recording it.

Line Posts Value
Stock item Dr inventory / Cr GR/IR, through a stock posting into the warehouse Received quantity × the line's net unit price, converted at the rate of the receipt day
Other line that needs a receipt Dr the line's account / Cr GR/IR The same
Line without a receipt, or without an account Nothing —

A negative receipt (goods sent back) takes them out at the value they came in with: the line's average receipt value of what is still open. When the goods were already billed, it first clears back the bill's share (see below), then takes them out at that value. Goods can go back only once the receipt that brought them in is posted (return_before_receipt_posted); more than was received and posted cannot go back (return_beyond_received). A receipt or return is refused when it is dated before the item's latest stock posting (stock_backdated) or in a closed period: record receipts in date order.

A receipt whose posting is over the company's posting limit waits for a second person. Until it is approved, invoice matching does not count it: a bill for those goods shows "waits for approval of its receipt" and stays blocked (beyond_received_waiting). The order card lists the receipt as waiting. If the second person rejects it, the receipt no longer counts as received anywhere: the order's received quantity, its status and the matching drop it, and the card lists it as rejected. Record the goods again with a new receipt.

An order in euros in a Swiss company is converted at the receipt day's rate. The bill converts at its own rate, so the exchange difference is part of the price difference.

The bill clears GR/IR

When a bill (or credit note) that refers to the order is posted, a second entry clears the GR/IR account for each order line. The entry is booked by the system and audited as grni.clear on the order.

  • Dr GR/IR / Cr the bill line's account, at the receipt value of the quantity billed. The bill itself booked its own amount to that account. What remains there is the price (and exchange rate) difference: the bill's amount less the receipt value.
  • For a stock item, the bill line's account is cleared completely. The difference is a revaluation of the item: the share still in stock goes to the inventory account, and the share already sold goes to cost of goods sold. The stock value always equals the inventory account.
  • A revaluation is never dated before the item's latest stock posting (the stock rule stock_backdated). When the item moved after the bill's date, for example sold on a later day, the clearing entry and its revaluation are dated on that latest day, at the moving average then. The GR/IR report shows the line open until that day.
  • Bills clear first in, first out, at the average receipt value of what is still open. A bill that comes before the goods clears nothing until they arrive. The receipt then clears the bill that is waiting.
  • The clearing is dated on the bill's own date, also when the bill is dated ahead. Stock moves only up to today, so the revaluation of a bill dated ahead is dated today.
  • Over-billing clears only what was received. The quantity billed beyond that stays on the bill line's account, where invoice matching flags it. It is cleared when more goods arrive.

Credit notes: the rule

A credit note line that refers to a bill of the order is read by its unit price:

  • At the bill line's unit price, it is a quantity credit. The vendor takes back (or never delivered) that quantity. It clears back what the bill cleared (Dr the account / Cr GR/IR), from the last bill first, at the value cleared. The goods are open on GR/IR again until they are sent back with a negative receipt, or billed again.
  • At any other unit price, it is a price credit. The quantity stays billed. The credit lowers the cost of what was cleared: for a stock item, a revaluation of the share still in stock (and of cost of goods sold for the rest). It also lowers the cost of what later bills clear.

The billed quantity is always counted net of credit notes. One function in the code counts it (grni_ledger.credits).

Writing off what will never be billed

Some goods stay open on GR/IR because no bill will ever clear them: goods sent free of charge, or goods billed on a bill booked without the order's number. A person writes them off with POST /v1/purchase-orders/{order}/grni-write-off (screen: the order's "GR/IR account" tab, button "Write off what will never be billed"):

  • One journal entry takes each line's open value off GR/IR: Dr GR/IR (naming the order line) / Cr the chosen account. By default that is the line's own account, or else the account of the bills paired with the line, where a bill that still comes books its cost, so the two offset. Only a stock item with neither goes to the inventory changes account. A control account is refused (grni_write_off_control_account).
  • It is dated no earlier than the line's last receipt (grni_write_off_before_receipt) and no later than today (grni_write_off_future).
  • The stock is not touched. The goods stay in stock at the value they came in with.
  • The reason is required and kept on the entry and in the audit (grni.write_off).
  • The entry passes the posting approval like any of the person's postings: over the limit it waits for a second person. While it waits, the lines count as written off, so no bill clears them and they cannot be written off twice (grni_write_off_pending). A rejected write-off leaves the lines open, and the bills paired with them clear them again.
  • A write-off is final. A bill that still arrives books its cost on its own line's account and clears nothing. The order's GR/IR tab and the report name such a line ("Billed after the write-off"), and the period close warns of it: check with the vendor that the bill is right.
  • Goods written off are not sent back on the order: a negative receipt is refused (return_after_write_off, or return_while_write_off_waits while the write-off waits). Record their return as a stock adjustment.

On the order card and in the report

GET /v1/purchase-orders/{order}/goods-received gives, per line, the quantity and value received, the quantity billed (net of credit notes), the value cleared, the value written off and what is open. The purchase order screen shows these figures in its "GR/IR account" tab.

GET /v1/entities/{entity}/grni?as_of= (screen: Reports › Goods received not invoiced) lists every order line that has something open at the end of the day: the order, vendor, last receipt, receipt value, value cleared, value written off and value open. The report gives the total, the balance of the GR/IR account in the ledger on that day, and the difference, which must be zero. Only receipts, their clearing and write-offs post to GR/IR, so the list ties to the ledger to the cent. Use the report at period end to review the accrual and chase the missing bills.

The period close checks the same (grni_reconciled): it fails when the list and the GR/IR accounts differ, naming both totals and the difference, also when the GR/IR accounts hold a balance with no goods received at all. A wrong opening GR/IR balance (an opening entry that put an amount on GR/IR with no receipt behind it) is cleared by reversing that opening entry. It warns while order lines are open, naming each one's order and line, vendor, last receipt and open value, and of lines billed after their write-off.

A company without a GR/IR account gets it from its chart with its first receipt, as a warehouse brings the stock accounts. The system adds it, in the audit trail, so a receipt does not need the right to manage accounts.

Who can do what

A receipt needs the right to draft (draft); a write-off the right to post (post). An agent can do neither: the approval policy reserves receipts and write-offs for people (action record_receipt), like the approval of orders. The clearing entries are booked by the system when the bill posts.

Stabiso, the Enterprise System of Record · generated from the code and its guides · release 6f03a5e846b3