Selling — business logic
Selling is a shipment to a customer with revenue recorded. Technically it's
the same mechanism as expenditure (see Expenditure and
transfer — stock check, lot write-off, splitting
across several lots), but with a different business meaning: here the goods
leave the company for good, and this very shipment is a source of income,
not just an asset moving around.
How it differs from expenditure
- No destination warehouse. The goods leave the business — there's
nowhere left to receive them, unlike expenditure, which can be a transfer
between the company's own warehouses. - Reservation is always released. If the item had a reservation for
this customer or order, it's released in full for the shipped quantity,
with no further conditions (on expenditure, reservation release only
happens for a credit shipment to a specific partner). - The two prices on a line are always meaningfully different: the
write-off price (the lot's cost basis in stock) and the selling price
(the retail/customer price) — the difference between them is exactly the
line's gross margin.
An order closes automatically
If a selling line was picked against an open order position, the
corresponding order position closes automatically after processing (fully
or partially, based on the quantity actually shipped). The user doesn't
need to separately mark the order as fulfilled — that's a consequence of
the sale itself, not a separate action.
Debt or payment
If an account is specified in the header, a cash document twin is
automatically created on processing for the sale amount: money is
considered received right away, with no separate "record payment" step, and
the customer's balance isn't adjusted. If no account is specified but a
customer is, the sale amount is subtracted from their balance, creating a
debt ("sale on credit").
A receipt isn't a separate entity
A receipt or invoice to the customer is a printed form of an already-saved
sale document, not an independent physical object with its own state. If a
customer loses their paper receipt, there's no "restore" operation needed —
the same document is printed again, as many times as needed, from the same
data. This is a direct consequence of the "reports are computed, not
stored" principle (see Concept):
a printed form is just another way to display data that already exists in
the document.