- Upgraded all plain `require` to `require_once` across 172 api/engine
and api/engine_report files to prevent class-redeclaration errors
- Added issue button, issue_invoice() with GL toastr, and delete_invoice()
to expense/manage_purchase_invoice.php, bringing it in line with
po/manage_purchase_invoice.php
- Added can_delete role guard (admin/owner only) to trash icons on
revenue/invoice.php and expense/purchase_invoice.php, matching the
existing pattern in finance/receipt.php and finance/payment.php
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Creates wms + wms2 databases and all 54 tables from scratch using
CREATE TABLE IF NOT EXISTS. Reads credentials from app/config.php.
Safe to re-run (idempotent). CLI-only guard prevents web access.
Dynamic td_stock_<warehouse_id> tables are excluded — the app creates
them automatically on first warehouse use.
Run: php setup.php
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- StockManager: coerce lot_number/serial_number to trimmed string (fixes
Array-to-string warnings); validate quantity > 0 on insert; tighten
transfer pair lookup to match in/out side by column value
- PostingWindowGuard: strip time component from datetime strings before
date-format validation
- docs/tests/doc_flow_test.php: 32-assertion document flow suite covering
Stock In create + approve, Sales Order draft/confirm, Invoice from Order
(with duplicate-block check), PO create/confirm, Quotation create, and
usage increment wiring check; all 32/32 PASS against wms_codex_test
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>