bober-bbq-bot/bober_bbq
byrsapty 1481332d3f Sync inventory restocks with the supplier ledger in both directions
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.
2026-08-26 19:40:35 +03:00
..
admin Sync inventory restocks with the supplier ledger in both directions 2026-08-26 19:40:35 +03:00
api Run Checkbox fiscalization in the background, start order numbers at 1 2026-08-13 18:06:41 +03:00
payments Make brand identity reusable for redeploying to other clients 2026-08-25 17:54:29 +03:00
static Add EU-14 allergen labeling to products 2026-08-25 15:52:21 +03:00
templates/admin Sync inventory restocks with the supplier ledger in both directions 2026-08-26 19:40:35 +03:00
utils Add owner-alerting on unhandled errors, backup integrity checks, and a client-provisioning script 2026-08-25 18:11:15 +03:00
__init__.py Initial commit: Bober BBQ Telegram bot + backend + admin + Mini App 2026-08-08 15:50:50 +03:00
app.py Add owner-alerting on unhandled errors, backup integrity checks, and a client-provisioning script 2026-08-25 18:11:15 +03:00
config.py Enable TEMPLATES_AUTO_RELOAD so template edits don't need a restart 2026-08-09 16:46:10 +03:00
extensions.py Login page: real logo/name, Ukrainian auth message, fix remaining tight spacing 2026-08-09 16:42:38 +03:00
migrate.py Link suppliers to inventory ingredients (main supplier per ingredient) 2026-08-26 18:56:47 +03:00
models.py Link suppliers to inventory ingredients (main supplier per ingredient) 2026-08-26 18:56:47 +03:00
seed.py Add dine-in orders and manual order creation for staff 2026-08-09 23:53:14 +03:00