WFDASH-WEBAPP/scripts
David 74cde03142 fix(order-process): stamp qty_collected when marking items in stock
In-stock rows were toggled to `item_status="ready_invoice"` without
setting `qty_collected`, so the Invoicing page's `min(qty_collected,
quantity)` rule pushed a 0-qty line to QuickBooks for every in-stock
row. The operator couldn't invoice — the goods were physically on
the shelf but the system thought nothing had been received.

Single-row `toggleInStock` and bulk `markInStockReady` now both stamp
`qty_collected = quantity` on the flip. In-stock rows still don't go
through a supplier PO (`purchase_order=""`) — the fix is purely on
the "we have these on our shelves" signal that feeds invoicing.

Backfill: ran `scripts/nss-backfill-in-stock-qty.ts` across the org.
Found 316 stale `in_stock=true` rows out of 324, stamped
`qty_collected=quantity` on each. Idempotent (second run reports 0
to do). ZA10PO26011801 (Master Drilling, M16 rod) and Q202609445
(Denmar Steel — 8 lines including nuts/washers at qty 170) verified
in PB.

Companion fix to the earlier in-stock totals exclusion: the
Invoicing page now gets the full qty for each in-stock row, while the
process-page PO totals still exclude them (since no PO is sent). Both
behaviours line up.
2026-09-18 08:07:38 +02:00
..
__pycache__ feat(mcp): enhance API documentation and add new tools 2026-08-15 00:06:40 +02:00
dev
fixes feat(quotes): split attachments into internal vs outbound with operator upload UI 2026-09-09 13:43:56 +02:00
migrations feat(quotes): split attachments into internal vs outbound with operator upload UI 2026-09-09 13:43:56 +02:00
perf feat: add new order, invoice, and dashboard management tools 2026-08-05 23:00:54 +02:00
smoke feat(item-intel): add new item intel popover and backend workflows 2026-08-11 02:57:57 +02:00
utils
2026-08-03-load-husqvarna-cart.ts chore(scripts): one-time stock-order loaders + source screenshots 2026-08-03 17:33:28 +02:00
2026-08-03-load-yg1-quote-soq078608.ts chore(scripts): one-time stock-order loaders + source screenshots 2026-08-03 17:33:28 +02:00
2026-08-03-merge-yg1-drafts.ts chore(scripts): one-time stock-order loaders + source screenshots 2026-08-03 17:33:28 +02:00
2026-08-13-heal-item-intel.ts feat(tv): add TV dashboard + refine workflows 2026-08-13 20:55:22 +02:00
2026-08-21-backfill-order-duplicates.ts feat(orders): enhance order handling with email_message_id deduplication and displayContactName utility 2026-08-21 19:18:02 +02:00
_env.ts feat(tv): add TV dashboard + refine workflows 2026-08-13 20:55:22 +02:00
apply-default-markup.test.ts feat(stock): inline qty editing + column sort + pricing-gap operator scripts 2026-09-14 13:04:26 +02:00
apply-default-markup.ts feat(stock): inline qty editing + column sort + pricing-gap operator scripts 2026-09-14 13:04:26 +02:00
audit-pb-fields.py chore: add logos, opencode config and build assets 2026-07-27 08:21:20 +02:00
backfill-item-intel.ts feat(item-intel): add new item intel popover and backend workflows 2026-08-11 02:57:57 +02:00
backfill-po-items.mjs
backfill-stock-prices.test.ts feat(stock): seed pricing fields on create + sync price_list to stock_items 2026-09-14 13:04:08 +02:00
backfill-stock-prices.ts feat(stock): seed pricing fields on create + sync price_list to stock_items 2026-09-14 13:04:08 +02:00
build_v5_workflow.py
deploy_v5_to_n8n.py
fleetai-probe.mjs feat(rep-visits): FleetAI tracker adapter, nearby-customer matching, stop detection 2026-09-06 14:22:28 +02:00
import-data.ts
list-irda-stock.ts feat(stock): inline qty editing + column sort + pricing-gap operator scripts 2026-09-14 13:04:26 +02:00
mcp-doc-gen.py feat(mcp): enhance API documentation and add new tools 2026-08-15 00:06:40 +02:00
mrbxnim4-telegram-cloud-photo-size-4-6016860144018328845-y.jpg
n8n-v2-error.ts
n8n-v2-main.ts
nss-add-invoice-columns.ts fix(invoicing): bill only what's collected, support partial pickups + kit splits 2026-09-17 13:53:36 +02:00
nss-backfill-in-stock-qty.ts fix(order-process): stamp qty_collected when marking items in stock 2026-09-18 08:07:38 +02:00
nss-fasteners-pb-import.json feat(stock): implement auto-markup for selling price and markup on stock item creation and updates 2026-09-16 09:49:52 +02:00
nss-fasteners-pb-transform.ts feat(stock): implement auto-markup for selling price and markup on stock item creation and updates 2026-09-16 09:49:52 +02:00
nss-fasteners-pilot.csv feat(stock): implement auto-markup for selling price and markup on stock item creation and updates 2026-09-16 09:49:52 +02:00
nss-fasteners-single-pieces.csv feat(stock): implement auto-markup for selling price and markup on stock item creation and updates 2026-09-16 09:49:52 +02:00
nss-fix-kusasalethu-inv10924.ts fix(invoicing): bill only what's collected, support partial pickups + kit splits 2026-09-17 13:53:36 +02:00
nss-scrape-bundle.js feat(stock): implement auto-markup for selling price and markup on stock item creation and updates 2026-09-16 09:49:52 +02:00
quotes.pb.js
recent-stock-movements.ts feat(stock): implement auto-markup for selling price and markup on stock item creation and updates 2026-09-16 09:49:52 +02:00
regenerate-delivery-note-pdfs.ts feat: add driverless collection confirm and new order tooling 2026-08-12 01:13:46 +02:00
seed-gielie-quotes.py
setup-pocketbase.ts
verify_v5.py