StabisoDocs

Purchasing and stock

Delivery notes and cost of goods sold

A company that keeps stock ships goods on a delivery note and books their cost when they leave (ADR-0077, section 6). The revenue follows with the invoice.

A delivery note

  • A note is of one company, to one of its customers, from one of its warehouses (default: the default warehouse), with lines of stock items and quantities. A line may name the sales order line it delivers: a confirmed order of the same customer and product. What the notes of an order line and the invoices that ship its goods themselves add up to never exceeds what was ordered less what was closed: the goods of an order line leave once. An order with goods on a note is closed for the rest, not cancelled.
  • On the screen, Sales order in the new note picks one of the customer's open orders and fills the lines with what is left to ship on it, each naming its order line. The order's card shows, next to what is left to invoice, what is left to ship (left_to_ship_quantity, stock item lines only).
  • A draft changes freely (PATCH /v1/delivery-notes/{note}) and is cancelled, never deleted.
  • Posting (POST /v1/delivery-notes/{note}/post) gives the note its gap-free number (DN-2026-000001) and issues the goods on the delivery date at the moving average: Dr cost of goods sold / Cr inventory (in Switzerland 4200 / 1200). Each line keeps the value its goods left with (cost). The warehouse must hold the goods on that day and on every later day already booked; the delivery date is not after today.
  • An agent's note above its posting limit waits for a person (pending_approval); a rejection makes it a draft again, keeping its number. A posted note and its lines never change (the database refuses it); goods that come back come back with a credit note.
  • The PDF (GET /v1/delivery-notes/{note}/pdf) is in the customer's language (German, French, Italian or English): the company's letterhead, the customer's address, the warehouse the goods left, the items and quantities, no prices, and a line for the customer's signature.

Invoicing

  • An invoice line names the delivery note line it invoices (delivery_line); the goods left with the note, so the invoice moves no stock. What the invoices of a line add up to, less what came back on credit notes, never exceeds what was delivered less what came back. A credit note without the goods (a price allowance) does not make the quantity invoiceable again. The invoice is not dated before the delivery.
  • Invoice this delivery note (POST /v1/delivery-notes/{note}/invoice) drafts the invoice of everything delivered and not yet invoiced: at the sales order's price for a line of an order, else at the customer's price from its price list for the quantity, and else at the product's list price, in the customer's currency. Its order number (PO, BT-13) is the note's customer reference, else the sales order's; the invoice links the delivery notes it invoices on its own (delivery_notes).
  • Invoice the order (POST /v1/sales-documents/{document}/invoice) invoices what the order's delivery notes delivered from those notes (each invoice line names its note line) and ships only what is not yet delivered with the invoice.
  • A draft delivery note for an order line already reserves its quantity: an invoice or another note that would ship it too is refused (delivery_order_line_on_draft_note). The draft shipped nothing yet to invoice, so post the draft note, or cancel it, first.
  • An invoice that would ship an order line whose rest left on posted notes is refused with the notes named (delivery_order_line_shipped_on_notes): invoice their lines with "Invoice this delivery note".
  • An invoice line of a stock item that names no delivery note line ships with the invoice: when the invoice posts, its goods leave the line's warehouse (default: the default warehouse) on the invoice date, Dr cost of goods sold / Cr inventory. When the goods are not on hand the invoice is refused in words when it is submitted, before anything posts. There is no "bill now, ship later": such a line always ships on the invoice date (a recurring or subscription invoice of a stock item too); ship later on a delivery note and invoice the note.
  • The goods move under the invoice's decision: when their cost of goods sold would wait for a person (an agent's invoice whose goods are worth more than its limit), the invoice waits for a person with them, and when it is approved its goods post with it. An invoice and its cost of goods sold post together or not at all.
  • Cost is always in the company's own currency: a euro invoice of a Swiss company books its cost of goods sold in francs, at cost.

Goods returned

A credit note line of a stock item can say the goods came back (goods_returned, with the warehouse they come back to; default the default warehouse). It names the invoice line it credits. When the credit note posts the goods come back at the cost they left with, not at today's average: the delivery note line's cost, or the cost the invoice's own shipment booked, in proportion to the quantity (Dr inventory / Cr cost of goods sold). Without goods_returned no stock moves.

Goods that come back do not reopen the sales order: a returned order line does not ship again. What an order line has left to ship is what was ordered, less what was closed, less what left on delivery notes and with invoices; a credit note takes nothing off that, with or without the goods. To send the customer a replacement, put it on a new sales order (or a delivery note without an order line).

Delivered, not invoiced

GET /v1/entities/{entity}/delivered-not-invoiced (screen: Delivered, not invoiced) lists every line of a posted note with goods delivered and not yet invoiced, with what is left at cost: the revenue still to invoice at period end.

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