
## Stock Replenishment

SNYT Enterprise UI v1 provides Main/Clearance search, barcode scan plus manual SKU/barcode verification, Draft/Submit, compact `SKU : qty` copy, three authenticated PDFs, status detail, and receiving with Received and Accepted shown separately. Discrepancies can include camera/gallery evidence; a failed post-receipt upload remains visible with Retry and never repeats the receipt.

Protected attachment types are `prepared_photo`, `dispatch_receipt`, and line-scoped `receiving_discrepancy`. Existing evidence stays in the history. Warehouse Preparation PDF preserves requested/approved/prepared quantities and preparation reasons; Receiving PDF preserves shipped/received/accepted quantities, discrepancies, receipt metadata, and the rule that only Accepted Qty enters sellable VAN stock.

Temporary QA products are server-scoped to their designated salesman and display `QA · TEST DATA`. They never appear to another salesman or a public catalog. QA requests cannot mix QA and production products, and their PDFs carry a visible QA warning.

## My Van Page

The Flutter app now includes a My Van page.

It loads real van stock from:

GET /api/mobile/van-stock

Features:

- Search by SKU
- Search by barcode
- Search by product name
- Show quantity
- Show match status

## My Van Improvements

Added:

- Live search with debounce.
- Product photos from Laravel API.
- Grouped duplicate stock rows in Laravel.
- Better product name display.
- Dynamic van title from Laravel.

## Product Details Page

Added product details page from My Van.

The salesman can tap any item to see:

- Product photo
- Name
- SKU
- Barcode
- Category
- Quantity
- Price

## Barcode Scanner

Added barcode scanner screen using camera.

Flow:

- User opens Scan Product
- Camera scans barcode
- Flutter calls GET /api/mobile/products/barcode/{barcode}
- Laravel returns product
- Flutter opens Product Details page

## Barcode Manual Entry

Added manual barcode entry for simulator and cases where the camera cannot scan.

My Van search bar scanner icon now opens the Barcode Scanner page.

## Flutter Inventory Check

Added Inventory Check page.

Features:

- Load current inventory check
- Start inventory check
- Mark item correct
- Mark item wrong
- Mark item missing
- Finish inventory check
- Show progress percentage

## Inventory Check Qty Dialog

Inventory Check now shows the expected system quantity clearly.

When the salesman taps a product:

- The app shows Expected Qty
- The counted quantity is pre-filled with the expected quantity
- Salesman only changes it if actual quantity is different
- If counted qty equals expected qty, status becomes correct
- If counted qty is different, status becomes wrong
- Missing button saves counted qty as 0

<!-- SNYT_RETURNS_RMA_FLUTTER_V1_START -->
## Returns / RMA v1

Status: **Implemented in source; device QA required**

### Navigation and UI

- `Returns` is a top-level bottom-navigation destination for salesman and manager/admin layouts.
- Team chat remains available from the More page.
- The global app theme now uses the approved SNYT dark visual system: deep navy/black backgrounds, cyan primary actions, teal success states, amber accounting states, red RMA states, subtle borders, rounded enterprise cards, and compact mobile-first spacing.
- Existing business-specific report sheets keep their required company document appearance while app chrome follows the dark SNYT system.

### Returns Screens

- Returns list with search and filters.
- Create Return with mandatory saved customer.
- Customer Return / Resellable and RMA / Defective type selection. Types cannot be mixed in one document.
- Partial SKU/name/barcode search and barcode scanner.
- Multiple items per return.
- Optional photos.
- Direct exchange from sellable van stock on RMA items.
- Return details with separate operational and financial status.
- Accounting Review for admin/supervisor accounts.
- RMA warehouse handover list/create/details.
- Dispatch to warehouse.
- Full / partial / rejected warehouse confirmation.
- Only outstanding rejected quantity is offered again after a partial warehouse handover; previously accepted quantity is not duplicated.
- Print A4 handover PDF.
- Customer profile includes Sales / Returns / Payments tabs.

### Stock Behavior

- Resellable items do not enter sellable stock until accountant approval.
- RMA/Defective items enter a separate non-sellable RMA stock bucket.
- Direct exchange shows current sellable VAN availability, adds the defective unit to RMA, and deducts the replacement from sellable van stock.
- Flutter never performs authoritative stock math locally; Laravel confirms all stock-changing operations.

### API

Returns APIs are exposed under the existing mobile API base and include returns, product search, accountant review, opening RMA reclassification, handover batches, warehouse confirmation, and handover PDF.
<!-- SNYT_RETURNS_RMA_FLUTTER_V1_END -->
## Return review workflow

- Save Draft keeps the Return editable.
- Submit for Review freezes salesman editing and sets Pending Accountant.
- Admin can Approve or Reject; rejection requires and displays a reason.
- Draft RMA items cannot enter warehouse handover.
## RMA Stock screen

Open `Returns → RMA Stock`. Search supports SKU, barcode, and product name. Summary cards show SKUs, total assigned pieces, ready-for-warehouse pieces, and pieces in transit. The handover action opens the existing warehouse workflow.
## Customer onboarding and pricing

Salesmen can save customer drafts, upload private legal documents, submit for review and respond to requested changes. Territory choices come from Laravel. Only approved active customers are invoice eligible. Cash and On Account rules, discounts, Clearance exclusion and VAT-inclusive totals are finalized by Laravel.

The On Account step includes the Security Cheque bank, number, account holder, amount, dated/undated choice, conditional date, private image upload/camera and notes. Switching back to Cash removes cheque validation from the active form. Laravel revalidates all conditional requirements on submission.

New Customer now offers existing editable drafts for resume or a deliberate Start New Customer action. Each Next action and Save Draft persists server-side; resuming restores business, contact, location, legal/VAT, account, cheque, notes and uploaded-document metadata without re-uploading current documents.

## Opening RMA barcode workflow

Opening RMA reclassifies defective goods already physically in the salesman's van: Sellable VAN decreases and non-sellable RMA increases by the same quantity, so physical total never changes. Selection supports SKU/name/barcode search, manual barcode entry, and the shared stable scanner. Laravel validates fresh own-van availability and performs both movements atomically and idempotently. Two direct `opening_rma_reclass` audit rows are created without fabricating a Customer Return.
## Checkout stabilization — 2026-08-16

## Stock Receipts

Salesmen can open Stock Receipts from Dashboard or Profile, upload the official warehouse PDF, review parsed totals, explicitly link a possible request, scan or type SKU/barcode with a thumb-friendly quantity stepper, pause/resume counting, review variances, and confirm accepted stock. The screen separates Document, Counted, Damaged, Accepted, and Remaining quantities. Flutter never posts stock independently.

Cart persistence retains the explicit master product ID. Checkout no longer falls back to catalog membership IDs, performs a server-authoritative preflight, and gives the salesperson a readable refresh/remove message when price, source, availability, or customer eligibility changed.
