WFDASH-WEBAPP/scripts/migrations
Dave d3132ab7f6 feat(collection-confirm): collected stock orders go through Collection Confirm
The driver app records the full quantity as received when it collects a
stock pickup, and Collection Confirm only listed stock lines that were
not fully received — so collected stock orders skipped it and sat at
"sent", outside the accountant's booking queue, until someone clicked
Mark received (29 stuck on 2026-10-19).

- STOCK_ON_PAGE_FILTER / stockLineOnPage: a collected stock line stays on
  Collection Confirm until its stock order is received; cancelled orders
  never show. Shared by the list and the AI check (so those lines get
  photos read and ticks too).
- Confirm stock: markStockOrdersReceived flips each stock order to
  "received" once every line is collected/booked (→ booking queue);
  orders with lines still out stay open, reported as stillOpen. The
  route returns { updatedIds, received, stillOpen }; the toast says so.
- Stock photos: `npm run pb:migrate:stock-photos` makes
  stock_purchases.additional_attachments multi-file;
  addStockPurchaseAttachment, Move photo and Delete photo add/remove with
  `+`/`-` instead of replacing the single slot.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-19 17:03:33 +02:00
..
2026-06-23-add-quote-attachments-direction.ts
2026-06-23-add-quote-email-composition-fields.ts
2026-06-23-add-quote-outbound-email-fields.ts
2026-06-23-add-quote-template-fields.ts
2026-06-26-add-orders-rep.ts
2026-06-27-add-order-quote-match-fields.ts
2026-06-27-drop-orders-status-and-wipe.ts
2026-06-28-add-companies-coordinates.ts
2026-06-28-add-purchase-order-pdfs.ts
2026-06-28-convert-customer-fields.ts
2026-06-30-add-price-list-search-text.ts
2026-06-30-add-price-list-sku-normalised.ts
2026-06-30-add-price-list-source-file.ts
2026-06-30-add-pricelist-notes.ts
2026-06-30-add-quote-items-sku-and-pricing.ts
2026-06-30-add-raw-price-list.ts
2026-06-30-backfill-price-list-search-text.ts
2026-06-30-create-rfq-outbound.ts
2026-07-02-add-sprint-categories-and-claims.ts
2026-07-06-order-items-assigned-at.ts
2026-07-06-order-items-collection-pool-rename.ts
2026-07-06-order-items-nullable-numbers.ts
2026-07-06-order-items-pricing-fields.ts
2026-07-06-purchase-orders-documents-field.ts
2026-07-06-purchase-orders-send-fields.ts
2026-07-06-quote-attachments-quote-item-and-kind.ts
2026-07-07-backfill-assigned-rfc.ts
2026-07-07-order-items-collection-photo.ts
2026-07-07-order-items-ready-for-collection.ts
2026-07-09-po-additional-attachments.ts
2026-07-09-po-pdf-tokens.ts
2026-07-10-restore-counters.ts
2026-07-14-create-stock-purchases.ts
2026-07-14-create-stock.ts
2026-07-15-add-stock-items-target-qty.ts
2026-07-15-add-stock-line-drv-id.ts
2026-07-15-stock-purchase-line-state.ts
2026-07-16-add-stock-purchase-documents-history.ts
2026-07-16-add-stock-purchase-send-statuses.ts
2026-07-17-add-stock-purchase-problem-fields.ts
2026-07-19-create-delivery-notes.ts
2026-07-19-delivery-notes-signed-copy.ts
2026-07-19-delivery-notes-v3.ts
2026-07-20-delivery-tracking.ts
2026-07-24-partial-approval.ts
2026-07-25-add-ai-insights-fields.ts
2026-07-26-fix-quote-counter-and-reassign-numbers.ts
2026-08-03-add-stock-pricing-and-cost-history.ts
2026-08-04-add-order-items-item-status-index.ts
2026-08-04-add-quotes-status-index.ts
2026-08-06-add-stock-purchase-booked-fields.ts
2026-08-06-stock-purchases-additional-attachments.ts
2026-08-07-flip-stale-unprocessed-items.js
2026-08-07-renumber-duplicate-quotes.js
2026-08-07-stock-purchase-items-catalogue-fields.ts
2026-08-08-add-quotes-ai-status.ts
2026-08-09-add-ai-settings.ts
2026-08-09-add-ai-system-prompt.ts
2026-08-09-backfill-quote-validity-days.ts
2026-08-09-repair-stock-double-booking.ts
2026-08-13-fix-delivery-notes-relations.ts
2026-08-17-add-order-items-in-stock.ts
2026-08-29-add-order-delivery-note-match-fields.ts
2026-09-04-create-pos-slip-layouts.ts
2026-09-09-add-quotes-attachment-fields.ts
2026-09-09-fix-quote-attachment-fields-maxselect.ts
2026-09-09-migrate-quote-attachments-to-fields.ts
2026-09-25-backfill-invoice-reconcile.ts
2026-09-25-create-audit-log.ts
2026-09-28-create-place-overrides.ts
2026-09-28-create-rep-trip-legs.ts
2026-09-30-create-giellie-chats.ts feat(giellie): chat store and giellie_chats migration 2026-09-30 23:44:55 +02:00
2026-10-03-add-pos-sales-delivery-note.ts feat(pos): raise a system delivery note on an account sale 2026-10-04 13:15:29 +02:00
2026-10-07-add-pos-sales-refund-fields.ts feat(pos): refund a whole sale, put the goods back, print a credit slip 2026-10-07 23:41:09 +02:00
2026-10-16-add-quote-assistant-fields.ts feat(quote-assistant): data model, settings fields, migration 2026-10-16 19:07:52 +02:00
2026-10-17-add-collection-ai.ts feat(collection-ai): card check, tick and list passthrough 2026-10-17 02:14:53 +02:00
2026-10-19-po-number-unique-index.ts fix: number customer POs one at a time (duplicate PO numbers) 2026-10-19 15:08:12 +02:00
2026-10-19-stock-photos-multi.ts feat(collection-confirm): collected stock orders go through Collection Confirm 2026-10-19 17:03:33 +02:00
_env-loader.ts
add-pos-sale-discount-fields.ts
add-quote-items-user-edited.ts
broaden-quote-attachments-mime-types.ts
create-order-items-v2-and-collection-pool.ts
create-quote-attachments-and-replies.ts