IMS. ← All docs

Manufacture — business logic

The document for producing a finished item from components — the only
document type where receiving and expenditure happen at once, in a single
action: components are written off stock by recipe (bill of materials), the
finished item is received. A product is an item that itself consists of
other items (see Concept, "Products — recipes
(BOM)"
).

A component is picked from real stock

Just like on expenditure, a component is written off from a specific
warehouse lot — the pick fixes the item, quantity, and price at the moment
the line is added. Adding a product by its recipe unfolds the bill of
materials all at once: the product line (receiving) and all of its
component lines (expenditure) are added in one action. Adding the same
product again in the same document doesn't create duplicates — the old set
of components is removed and rebuilt from the current recipe.

A shortage doesn't block production

If there aren't enough components in stock, production is still allowed.
The system doesn't refuse to process — it simply records the fact of the
shortage; the decision to restock components is left to the user. This
follows the system's general principle — record reality rather than
enforce the "correct" order of actions (see Concept, "the main
principle"

on manufacturing from components that aren't in stock).

What happens on processing

Rolling back manufacture

A rollback returns the components to their lots (with the reservations and
serial numbers they used up) and removes the produced item from stock,
also reducing the project's "made" quantity if the line was produced for a
project. It's refused if the produced item has already been sold or used
further — first roll back the documents that took it.

A stock correction is formally the same document type as manufacture, but
it is processed and rolled back by its own rules ("was/became" for a lot);
the system won't process a correction as manufacture.

The price mode is fixed for the whole document

The first product added to a document determines the price mode for the
entire document, not for an individual line:

The mode isn't reset even if every product on the document is deleted and
re-added — otherwise the manual-mode rule could be bypassed by recreating
the line with the same price through a different path.