SNYT Catalog - Returns / RMA v1
================================

PURPOSE
- Installs the Laravel Returns / RMA module.
- Adds Resellable Customer Returns and non-sellable RMA / Defective returns.
- Adds direct exchange from van sellable stock.
- Adds accounting review / manual pricing / settlement records.
- Adds RMA stock and warehouse handover / confirmation / A4 PDF.
- Adds Opening RMA Reclassification for defective goods already counted in van stock.
- Updates existing Laravel docs and the live /docs hub (when Documentation Hub v2 is installed).
- Refreshes the Flutter docs snapshot used by /docs.

IMPORTANT ORDER
1. Install this Laravel package first.
2. Verify migration and Returns pages/API.
3. Install the Flutter package second.

INSTALL
Upload/extract this package somewhere on the server, then run:

  bash snyt_returns_rma_laravel_v1/install.sh /FULL/PATH/TO/Catalog

If you extracted it next to the project and you are already inside the Catalog root:

  bash ../snyt_returns_rma_laravel_v1/install.sh "$(pwd)"

The installer:
- creates a timestamped source backup,
- attempts a database backup when mariadb-dump/mysqldump is available,
- copies the new module files,
- patches existing routes/models/navigation idempotently,
- updates existing docs,
- validates PHP syntax,
- clears Laravel caches,
- runs php artisan migrate --force unless disabled.

ENVIRONMENT FLAGS (optional)
  SNYT_SKIP_DB_BACKUP=1   Skip automatic SQL backup.
  SNYT_SKIP_MIGRATE=1     Install source only; do not run migration.

POST-INSTALL CHECKS
  /returns
  /returns/opening-rma
  /return-handovers
  /docs/returns-rma
  /docs-assets/returns-rma-workflow-v1.png

Then verify:
  php artisan route:list | grep -E 'returns|return-handovers'
  php artisan migrate:status

NOTES
- Current Admin/Supervisor role performs accountant review and warehouse confirmation.
- Fine-grained permissions are intentionally deferred to a future phase.
- Prices are manually approved by accounting in this Returns version because complete historical invoice data is not yet available.
- This installer does not implement the future Cash / On Account invoice pricing feature.
