Commit graph

2 commits

Author SHA1 Message Date
ebe88d40e7 feat: keep stock pickup photos on the stock order
Stock pickup photos were dropped: the Collect window ignored the photo
for a pickup, and the PO header's Invoice button didn't show for stock
orders (stock_purchase_items has no file field).

- Photos for a stock order go on the stock purchase
  (stock_purchases.additional_attachments, multi-file after WFDASH's
  `npm run pb:migrate:stock-photos`), always added with `field+`.
- Invoice button works on stock orders (pages counted from the stock
  purchase's invoice_ files); the Collect window uploads a pickup's photo
  there too, and warns if it didn't upload.
- poDocs: one PhotoTarget (order line or stock purchase) behind
  invoicePhotoTarget / uploadInvoicePage / uploadStockPickupPhoto.

Run the WFDASH stock-photos migration before deploying this.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-19 17:02:06 +02:00
de16082ff7 feat: one invoice photo per PO, one-tap PO PDF, save lock, sharper photos
- Confirm Collection locks while saving ("Saving…") and the page drops a
  second collect for an item already in flight. Repeat taps on slow data
  re-ran the save and re-uploaded the photo (7 identical copies on one
  item on 2026-10-16).
- PO headers (and a single-PO supplier's list) get an Invoice button:
  photograph the supplier invoice once per PO, then "add pg 2", "pg 3".
  Pages go onto one customer line of the PO as invoice-<PO>-p<N>.jpg;
  WFDASH Collection Confirm already gathers photos per PO card. The page
  count is also kept on the device so it survives lines dropping off.
- PO button opens the PO PDF in one tap (shared buildPoFileUrl in
  lib/poDocs.ts, also used by the item detail modal).
- Collect modal says whether the PO's invoice is already uploaded, so
  the per-item photo is only for problems with the item.
- Photos now upload at 2000px / q0.8 (was 1200px / q0.7) so small print
  on invoices stays readable for the AI checks.
- Supplier header counts and detailed view now include items in PO
  grouping mode (they showed 0 items before).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17 17:43:35 +02:00