## Stock Receipt preview + Returns product source — 2026-08-23

- Focused Stock Receipt/Returns/RMA/Checkout: 36 tests, 216 assertions, all passed.
- Full isolated Laravel suite: 149 tests, 826 assertions, all passed.
- Quick Accept does not post stock before Confirm and unresolved items block it.
- Discontinued and out-of-catalog master products resolve by SKU, barcode, and name without becoming generally sellable.

## Customer account unification and profile completion — 2026-08-16

Focused coverage verifies per-invoice ON ACCOUNT/CASH selection, immutable customer controls, owner isolation, private versioned uploads with expiry, deterministic completeness and that incomplete approved customers remain eligible. Production validation records pre/post account counts and confirms historical order types/totals are unchanged.

Result: Customer/Checkout 37 tests / 242 assertions; Returns/RMA 22 / 144; Import/Stock/QA 31 / 195; full Laravel 125 / 716 — all passed. Flutter analyze reported no issues and 22 tests passed. Physical SM X135G verified Profile Incomplete, ON ACCOUNT profile, editable completion sections, keyboard-safe actions, ON ACCOUNT default, CASH switching, and cancelled QA draft `ORD-20260816-000032` with no stock deduction.

## Stock Replenishment v1 closure — 2026-08-15

- Isolated SQLite/in-memory Stock + QA: 18 passed / 134 assertions.
- Returns/RMA: 22 passed / 144 assertions.
- Customer/Pricing plus relevant Sales/Orders: 33 passed / 212 assertions.
- Full Laravel: 104 passed / 606 assertions; only the pre-existing unrelated `PriceImportWorkflowTest` empty fake PDF case failed.
- Flutter analyze: no issues; Flutter tests: 13 passed.
- SM X135G salesman account: admin-only action controls absent on the installed debug build; production API approve attempt returned 403.
- Preparation and Receiving PDFs were opened from production and visually verified without clipping or overlap. The real camera barcode scan remains environment/manual blocked because the device could not be physically aimed at the second-screen barcode during automation.

## Stock Replenishment — 2026-08-15

Focused isolated suite: 10 tests / 58 assertions passed, including PDF snapshots, private line-scoped attachments, validation, Accepted Qty stock posting and duplicate receipt protection. Returns/RMA + Customer/Pricing + Stock Replenishment regression: 44 tests / 298 assertions passed. Full Laravel: 96 passed / 530 assertions, with only the unchanged unrelated `PriceImportWorkflowTest` empty fake PDF failure. Preparation and Receiving PDFs were rendered and visually verified as one-page A4 portrait/landscape reports without clipping. SM X135G verified runtime, scanner launch, portrait/landscape layout, and keyboard-safe Save Draft; transaction-changing physical scenarios remain intentionally unexecuted without a dedicated QA request.

Temporary QA Dataset: 4 focused tests passed. Combined QA/Stock/Returns/Customer regression: 48 passed / 332 assertions. Full suite: 100 passed / 564 assertions and the unchanged unrelated `PriceImportWorkflowTest` failure. Coverage proves owner/admin isolation, public exclusion, barcode lookup, customer/order protection, idempotent creation/receiving, normal-data safety, dry-run, reset and cleanup.

## Returns / RMA v1 Baseline - 2026-08-08

Validation completed:

- flutter analyze: PASS — No issues found
- flutter test: PASS — 9 tests passed

Next QA stage:

- Device UI validation
- Customer Return / Resellable workflow
- Accountant approval
- Defective / RMA workflow
- Direct replacement
- Opening RMA reclassification
- Warehouse handover
- Partial warehouse acceptance
- Rejected quantity restoration

## Full Laravel Visual Consistency Pass — 2026-08-09

- Browser-rendered production validation: 57 unique safe pages/states opened successfully.
- Desktop viewport: 1440×1000.
- Tablet viewport: 768×1024.
- Mobile viewport: 390×844.
- No relevant browser console errors or warnings.
- No page-level horizontal overflow remained in the representative desktop/tablet/mobile route sets.
- Mobile navigation drawer opened and exposed the application navigation correctly.
- Production PHP syntax checks and Blade compilation passed; route list contains 291 routes.
- Isolated tests: 18 passed with 144 assertions across `AllWebPagesSmokeTest`, `ReturnWorkflowTest`, `ReturnWorkflowCoverageTest`, and `RmaStockApiTest`.
## Customer workflow coverage

Run `CustomerDataIsolationTest`, `CustomerOnboardingWorkflowTest`, and `CustomerOrderPricingTest` for data isolation, ownership, territory, submit/freeze/resubmit, approval idempotency, rejection audit, Cash/On Account eligibility, Clearance exclusion, VAT snapshots and maximum-order enforcement. Run Orders and Returns/RMA regression suites after pricing changes.
## Customer onboarding + Cash / On Account QA — 2026-08-09

The authoritative 35-scenario matrix and validation evidence are recorded in the mobile repository `docs/TESTING.md`. Isolated results: Customer/Pricing 10 tests / 31 assertions passed; Returns/RMA 16 tests / 106 assertions passed; full suite 61 passed with only the pre-existing `PriceImportWorkflowTest` empty-fake-PDF failure. No production data was used or modified.
## Customer + Pricing QA coverage hardening — 2026-08-09

Final matrix: 28 PASS, 7 PARTIAL, 0 FAIL. Automated coverage includes private uploads/security, VAT/TRN, returns/documents isolation, pricing boundaries and immutable snapshots, suspension/reactivation, duplicates, location, and deterministic invoice Blade data.

## Security Cheque completion — 2026-08-09

- Cash without cheque: passed.
- On Account without cheque document: rejected.
- Undated cheque with null date: passed.
- Dated cheque with null date: rejected.
- Dated cheque with valid date and metadata persistence: passed.
- Admin API/view metadata and authorized document stream: passed.
- Customer/Pricing: 25 tests / 160 assertions passed.
- Returns/RMA regression: 11 tests / 77 assertions passed.
- Full Laravel suite: 76 passed / 401 assertions; only the explicitly excluded, pre-existing empty-fake-PDF failure in `PriceImportWorkflowTest` remains.

## Customer onboarding workflow completion — 2026-08-09

- Admin queue/detail/actions, protected document review and salesman 403: passed.
- Server Draft create/reload/update/submit with complete fields and current document metadata: passed.
- Explicit requested/final account type, Cash stale-credit cleanup and duplicate approval stability: passed.
- Customer/Pricing: 29 tests / 193 assertions; Returns/RMA: 11 / 77.
- Full suite: 80 passed / 434 assertions; the excluded PriceImport fake-PDF failure is unchanged.

## Opening RMA repair — 2026-08-11

- Focused Opening RMA: 6 passed / 37 assertions.
- Returns/RMA regression: 22 passed / 144 assertions.
- Full Laravel: 86 passed / 472 assertions; excluded PriceImport fake-PDF failure unchanged.
- Coverage includes normal/existing/full quantity, rollback, ownership, idempotency, barcode balances, unknown barcode, physical invariant, audit rows and absence of synthetic returns.
# Stock replenishment production E2E — 15 Aug 2026

The isolated QA dataset was exercised from draft through approval, preparation, release, dispatch and receipt on the SM X135G. Normal receipt moved QA stock from `10/5` to `12/6`; replaying the same receipt made no further movement. A short-preparation request displayed the review warning and posted only the shipped quantity. A damaged receipt accepted only one unit and retained a camera image bound to the exact request, receipt and receipt item. The dataset remains active for later QA.

Laravel navigation was checked at 390×844 with no horizontal overflow. Admin navigation now exposes Stock Requests, Warehouse Preparation, Awaiting Release, Receiving Issues and QA Dataset.
# Import Center stabilization — 2026-08-16

The isolated Laravel environment covered duplicate detection/resolution, edit/skip, partial completion, Main/Clearance atomic replacement, Price Update partial semantics, controlled activation rollback, replay idempotency, unknown Price Update products, centralized Shipment and Salesman Van Stock parsing, legacy uploader redirects, route listing, Blade compilation, and the corrected PriceImportWorkflow regression. Focused Import Center: 8 tests / 37 assertions. PriceImportWorkflow: 3 / 10. Full Laravel: 113 / 647, all passing. Production data was not used by automated tests.

## Async large-file stabilization — 2026-08-16

Production evidence showed 79,444,200-byte XLSX uploads stored successfully before synchronous PhpSpreadsheet analysis hit the web-SAPI 30-second limit and returned origin HTTP 500. The isolated queue analyzed the representative 79 MB workbook in 36 seconds: 478 rows, 472 Ready, 6 Needs Review, no failed job. Focused Import Center: 10 tests / 51 assertions, covering request-token/session/job idempotency, close/reload state, background failure UX, small/duplicate files, Shipment/Van Stock, and atomic activation. Full Laravel: 115 tests / 661 assertions, all passing.
## Invoice / checkout stabilization — 2026-08-16

`InvoiceCheckoutStabilizationTest` covers replaced Main and Clearance lists, discontinued-but-current products, mixed carts, stable master IDs, Cash/On Account rules, structured invalid-item errors, price refresh, and van-stock limits. Flutter catalog tests verify master `product_id` survives Cart serialization.
## Stock Receipts v1 validation

Focused coverage parses both real PDF fixtures, validates multi-page totals, rejects duplicate documents, verifies matching and ownership, aggregates repeated scans idempotently, preserves variance, proves Finish Counting has no stock effect, and proves Confirm Receipt posts accepted quantity exactly once. Stock Replenishment and Returns/RMA remain mandatory regressions.
# Visits + Daily Route + DWR v1

Focused coverage is in `DailyWorkWorkflowTest`: start/resume/idempotency, break intervals/no overlap, route add/remove/reorder, unplanned visit, visit overlap protection, collection retry protection, automatic results, end day, active-break transition, exact confirmed-sales calculation, cancelled exclusion, operational collection total, generated company-format text, ownership 403s, and admin/salesman page access. Flutter coverage verifies Start Working Day, restored active-day metrics, route/customer visibility, active Visit hub, DWR preview, and Copy/Share integration boundaries.
