Stock write paths
In Inklura, no stock change is free-form: every action that changes a product's stock follows the same rule, so that the ledger stock always equals the sum of the journal's movements. This page lists every action that writes stock, what triggers it and what it records. For the model itself, see The stock ledger.
The back office is in French: screen and button names are given here in English, with the French label in brackets.
The common rule
A reminder of the model:
- the ledger stock is the signed authority: it can go negative when a delivery is confirmed before the reception that covers it;
- the displayed stock is its mirror:
displayed stock = max(0, ledger stock); - a movement is planned (projection, no effect), applied (counted) or cancelled. Only applied movements change stock.
Every stock write respects four points:
- The product must be tracked. A product whose stock is not managed has no movements. For receptions and deliveries, a product from a just-in-time supplier has no movement either, unless you validated its stock (count or entry).
- One journal entry per movement, with its origin, reference and signed change.
- One operation: the journal entry and the ledger stock are always written together. For receptions, deliveries, counts and manual movements, the displayed stock is updated in the same operation. The daily checks flag any gap between the two values.
- The change is computed from the ledger stock, never from the displayed number. A delivery of 10 on a stock of 0 does record −10.
The typical movement, from the back office to the journal:
sequenceDiagram
autonumber
participant UI as Back office
participant APP as Inklura
participant LED as Movement journal
UI->>APP: action (delivery, reception, correction…)
APP->>APP: checks your permissions and stock tracking
APP->>LED: reads the current ledger stock
APP->>APP: computes the signed change
APP->>LED: records the applied movement
APP->>APP: updates ledger stock and displayed stock
APP-->>UI: result (before / after)
Summary table
| Action | Where | Guard | Origin in the journal |
|---|---|---|---|
| Stock pencil (list or sheet) | Stock grid, product sheet | Refused on products without their own stock; enables tracking if needed | Manual correction |
| Bulk edit | Multi-select in the stock grid | Same as the pencil | Manual correction |
| Saving the product sheet | Full product sheet | Stock saved only if you changed it | Manual correction |
| Creating a product with an initial stock | Product sheet (creation) | Only if stock is tracked and the value is not zero | Opening balance |
| Manual movement (inflow or outflow with a reason) | Stock movement button on the Stock status screen, Adjust stock button on the My stock screen | Refused on an untracked product | Manual correction |
| Stock gap correction | Stock gaps, Outflows without inflow and My stock screens | Refused on an untracked product | Inventory count |
| Journal reconciliation | Reconcile button on the Stock status screen | Preview before applying; negative stock is not erased | Inventory count |
| Physical count (finalize) | Counts screen | Untracked products skipped | Inventory count |
| Supplier reception | Confirm delivery on a supplier order | Per line, based on product tracking | Supplier reception (+) |
| Reception undo | Cancel on a delivery of the order, or the Assumed receptions panel | Only that delivery's movements | Movements deleted |
| Customer delivery | Shipment confirmation of an order, or Validate today's round | Per line, based on product tracking | Customer delivery (−) |
| Delivery or order cancellation | Customer order | Only puts back what was actually removed | Customer delivery (+) |
| Automatic validation | Scheduled task, every 2 h | 12 h grace; a later count is respected | Supplier reception (+) or customer delivery (−), with an automatic-validation note |
| Movement deletion | Movements screen, a product's timeline in Stock status | Exact reversal for an applied movement | Deletion |
On the Movements screen (« Mouvements »), these origins are shown as « Manuel », « Ajustement inventaire », « Livraison fournisseur » and « Mise à jour commande » (for customer deliveries).
The following sections detail each family.
Manual corrections
Stock pencil (list and sheet)
- Trigger: inline editing in the stock grid (
/manage/ecommerce/vendors/stocks, the Supplier stocks screen, « Stocks fournisseurs ») or the pencil on the product sheet's stock tab. Bulk edit applies the same rules to each selected product. - Products without their own stock (generic products, composites, formulas, set menus) are refused: their stock derives from the products linked to them.
- Entering stock on a simple product that was not tracked automatically enables stock tracking for it.
- The change is computed against the ledger stock, not the displayed number. Entering a value equal to the ledger stock produces no movement; on a product at −3 (0 displayed), entering 0 therefore does create a +3 movement.
- From the product sheet, the movement carries the reason « Ajustement de stock » (stock adjustment); from the stock grid, it carries the reason you type, or « Mise à jour manuelle » (manual update).
- Your entry counts as stock validation: a just-in-time product is then subtracted normally by reordering, and the product leaves the list of gaps to review. The affected supplier is then recalculated.
Full product sheet
- Trigger: saving the product sheet.
- Stock is only saved if you changed its value. Saving the sheet to change a price therefore does not overwrite stock that moved in the meantime (reception, delivery, scheduled task). If you change the stock while it has moved since the sheet was opened, the save is refused and asks you to refresh.
- Enabling stock tracking and entering a value in the same save does create the matching movement.
- The product update and the stock movement are saved together.
Creating a product
- Trigger: creating a product whose stock is tracked, with an initial stock other than 0.
- The inflow carries the reason « Stock initial à la création du produit » (initial stock at product creation) and starts from 0.
- A product without its own stock (generic, composite, formula, set menu) gets neither stock nor a movement.
Manual movement
- Trigger: an inflow or outflow entered by hand with a reason (breakage, gift, downgraded product, stock in…), from the Stock movement button (« Mouvement de stock ») on the Stock status screen (« État de Stock ») or a product's Adjust stock button (« Ajuster le stock ») on the My stock screen (« Mon stock »).
- Unlike the pencil, the movement adds or removes a quantity; it does not set a value. The quantity is a strictly positive integer and the reason is required. An outflow can take the ledger stock below zero.
- An untracked product returns an error.
- You can date the movement; by default it carries today's date.
- The movement also counts as stock validation.
Stock gap correction
- Trigger: the Stock gaps screen (« Écarts de stock »,
/manage/ecommerce/vendors/orders/phantom-stock; the links to it from Supplier orders and Outflows without inflow are still labelled « Stock fantôme »). The same correction is offered on the Outflows without inflow (« Sorties sans entrée ») and My stock screens. - You enter the real stock, a number of zero or more (rounded to the unit).
- An untracked product returns an error instead of being silently skipped.
- The change is computed on the signed ledger stock. Example: a product at −6 ledger stock (0 displayed), recounted at 4, receives a movement of +10 so the ledger stock does land on 4.
- The entered stock is marked as validated.
Journal reconciliation
- Trigger: the Reconcile button (« Réconcilier ») on the Stock status screen. A dialog first lists the products whose displayed stock differs from their ledger stock; you apply to the whole list or to a selection.
- For each selected product, a movement of
displayed stock − ledger stockaligns the ledger stock with the number on the product sheet. - A product whose displayed stock is 0 because its ledger stock is negative is not a gap: it is left out, so that stock still owed is not erased.
- Values are re-read when the reconciliation is applied: a stale preview cannot write a wrong change.
Disabling tracking
Disabling stock tracking for a product from the My stock screen resets its displayed stock to 0 without a journal movement. The movement history is kept; if you enable tracking again, enter or count the real stock.
Physical count
- Trigger: finalizing a count on the Counts screen (« Comptages »,
/manage/ecommerce/inventory/counts). - Only lines with an entered counted quantity are applied; a count with no entered line is
refused. For each counted line:
- untracked products are skipped (no movement);
- the change is
counted − ledger stock, and both values land on the counted number. Example: ledger stock −5, displayed 0, counted 3 → movement of +8, ledger stock 3, displayed 3; - if the ledger stock already equals the counted number, no movement is created;
- the movement is linked to the count line, and the stock is marked as validated.
- The whole count is applied in a single operation, based on stock at finalization time: a movement that happened during the count is not overwritten.
- A finalized or cancelled count cannot be finalized a second time.
- Lines on a variation update the variation's stock, which is kept separately from the product's stock.
Supplier reception
Confirming a delivery
- Trigger: Confirm delivery (« Confirmer la livraison ») on a supplier order.
- Supplier-order quantities are expressed in packs; the stock increase is
quantity received × pack size. Received quantities are integers of zero or more, and the total received over several deliveries cannot exceed the quantity ordered. - Each tracked line creates a "supplier reception" inflow. Lines of a generic product are spread over the real products linked to it. A line from a just-in-time supplier whose stock is not validated is recorded without a stock movement. A reception first nets out negative stock: −5 then +10 gives 5.
- The order's planned inflows are then adjusted: a complete reception closes them, a partial reception leaves only the remainder planned. A fully received order becomes confirmed. The supplier is then recalculated. See Supplier orders.
Undoing a delivery
The Cancel button (« Annuler ») on a delivery recorded on the order (or the Assumed receptions panel, « Réceptions supposées », on the Stock status screen for an assumed reception) finds exactly the inflows created by that delivery, then, in a single operation:
- deletes each of them, removing its change from the ledger stock;
- recomputes the displayed stock from the resulting ledger stock;
- recreates the planned inflows for what remains to be received on the order;
- deletes the delivery record; a confirmed order goes back to sent, unless the remaining deliveries still cover the whole order.
If the cancelled reception had been assumed by automatic validation, automatic validation does not recreate it.
Customer delivery
Stock only decreases on delivery. Taking an order and syncing orders never change it. Your confirmation is the normal path; automatic validation is only a safety net.
- Trigger: confirming an order's shipment in the back office, or the bulk Validate today's round button (« Valider la tournée du jour »; « Valider une tournée préparée » for a round prepared in advance).
- For each line: if the product is tracked, a "customer delivery" outflow of the delivered quantity is recorded (on the variation when one is specified). A line from a just-in-time supplier whose stock is not validated is delivered without a stock movement. Stock reservations are consumed at the same time.
- A line on a generic product is subtracted from the real product linked to it. If that link is missing or ambiguous, the whole delivery is refused: nothing is recorded until the link is fixed.
- A delivered quantity cannot exceed what is left to deliver on the line, and only a draft, sent or paid order can be delivered.
- The order's planned outflows are cancelled.
The delivery and the stock outflow are recorded together: if the stock write fails, the delivery is not recorded either, and you can try again. With Validate today's round, each order is processed separately: one failing order does not stop the others from being validated.
Cancelling a delivery or an order
- Cancelling a customer delivery puts back exactly what that delivery removed. Only a delivery that is not yet shipped or delivered can be cancelled.
- Cancelling a paid order whose items were already delivered only puts back the quantities actually delivered. In every case, the order's planned outflows are cancelled.
Automatic validation
- Trigger: a scheduled task that runs every 2 hours. See Daily timeline.
- It catches what nobody confirmed; in normal operation it has almost nothing to do.
- Forgotten receptions: a sent or confirmed supplier order, with no recorded delivery, whose planned reception date (or, failing that, planned send date) is at least 12 hours in the past (a planned date is not proof). Inklura creates the delivery and the matching inflows, with an automatic-validation note.
- Forgotten customer deliveries: draft, sent or paid orders with unconfirmed items whose delivery date is past the same grace period. Inklura creates the delivery and one outflow per item.
- Never twice: only the quantity still to deliver is taken into account; an item already confirmed, by you or by an earlier pass, is not removed a second time.
- Counts respected: if you counted or entered a product's stock after the event's planned date, the line is closed without a movement, because your number already includes it.
- A line that was in none of the emails sent to the supplier, although it already existed at the last send, is closed without a stock inflow: the supplier never saw it. A line added after the last send is credited normally. Products from just-in-time suppliers are handled as elsewhere: no movement unless their stock is validated.
- Only events from the last 12 days are examined.
A wrongly assumed reception can be cancelled from the Assumed receptions panel on the Stock status screen.
Deleting a movement
Deleting a movement from the Movements screen (/manage/ecommerce/inventory/stock-actions)
or from a product's timeline on the Stock status screen must undo exactly what it did.
sequenceDiagram
autonumber
participant UI as Movement journal
participant APP as Inklura
UI->>APP: delete the movement
APP->>APP: reads status and change
alt applied movement on a tracked product
APP->>APP: ledger stock − change
APP->>APP: displayed stock = max(0, ledger stock)
APP->>APP: deletes the row
else planned or cancelled movement
APP->>APP: deletes the row (no stock effect)
end
APP-->>UI: stock before / after
- An applied movement is reversed by its exact change, then the displayed stock is recomputed. Example: ledger stock 2 → correction −5 → ledger stock −3, displayed 0. Deleting that correction brings stock back to 2, not 5.
- A planned or cancelled movement is simply removed.
- On the Movements screen, you can also delete a row without stock effect: the displayed stock does not change, and the ledger stock stays equal to the sum of the remaining movements. Keep this option for cleaning up rows you know are wrong.
- A bulk deletion processes movements one by one. If some fail, the others are applied and the result tells you which ones could not be.
What never changes stock
- taking a customer order, whether from the storefront or the back office;
- the order sync: it only creates planned outflows for tracked products;
- the storefront product sync (scheduled or real time): it updates product records and their supplier, not stock. A product it creates starts at 0; enter or count its real stock. See PrestaShop sync;
- calculating, staging or sending a supplier order;
- planned movements, as long as they are not applied.
See also
- The stock ledger: the signed model and the movement journal
- Supplier orders: the reordering that reads these writes
- Daily timeline: when each scheduled task writes
- PrestaShop sync: the product and order import
- Safety nets: consistency checks and catch-ups
- Back office: the
/managescreens that trigger these actions - Configuration: stock and ordering settings