Suppliers→inventory (top up stock from a delivery) already worked, but
the reverse didn't: restocking directly from the ingredient's own page
just moved current_stock via a generic "adjustment" — no supplier
ledger entry, no debt, no traceability of who it came from. Professional
inventory systems (1C, Torgsoft) never let a stock increase appear from
nowhere when the item has a known supplier — it's always a receipt
document against that supplier.
The ingredient page's "Прихід/списання" now offers a real "🚚 Поставка
від <supplier>" operation (only when the ingredient has a main supplier)
alongside the existing adjustment/write-off. Submitting it creates a
SupplierDelivery row (same model, same ledger, same debt math as a
delivery entered from the supplier's own card) and reuses the existing
_apply_stock_topup (bober_bbq/admin/suppliers.py) to move stock — one
shared code path for both directions, not a parallel implementation.
Verified with a 24-check smoke test (no-supplier ingredients keep the
old behavior unchanged, a restock creates the exact right ledger row
and updates the supplier's debt, a bypass attempt without a supplier is
rejected) plus full regression of the prior supplier/inventory suites,
and end-to-end in a live browser: the reason-select JS toggle in both
directions, a real submission, and confirming the delivery appears
correctly on the supplier's own page afterward.