Commercial
Description
Commercial is the Enso business-flow package for purchases, sales, returns, inventory-side adjustments, and operational order documents.
The package exposes full API flows for purchases, purchase returns, sales, and sale returns, adds stock-adjustment and stock-audit endpoints on top of the inventory and product stacks, publishes printable order and note templates, sends operational notifications, and schedules recurring stock-value, stock-rotation, supplier-order, and expiring-lot maintenance jobs in production.
It is designed for private Enso deployments that need transactional commercial operations on top of the broader inventory, financials, and product ecosystem.
Installation
This is a proprietary package distributed through the private Enso registry.
Run the package migrations:
php artisan migrate
Optional publishes:
php artisan vendor:publish --tag=commercial-factories
php artisan vendor:publish --tag=commercial-views
The package also expects the matching frontend package in applications that render the commercial UI:
yarn add @enso-ui/commercial
Features
- Purchase, sale, purchase-return, and sale-return CRUD and lifecycle endpoints.
- Inventory-side stock adjustments, reservation lookups, stock-audit views, and per-product stock details.
- Printable purchase orders, goods-received notes, delivery notes, stock-removal documents, and related email flows.
- Invoice, payment, bundle, voucher, and line-item support inside the commercial order flows.
- Scheduled stock-value updates, stock-rotation refreshes, default-supplier recalculation, supplier-order generation, and expiring-lot notifications.
Usage
The package is mounted automatically through its service providers and route files once installed.
In production it schedules these maintenance commands:
php artisan enso:commercial:update-stock-values --daily
php artisan enso:commercial:update-stock-rotation --daily
php artisan enso:commercial:generate-supplier-orders
php artisan enso:commercial:expiring-lots-notification
php artisan enso:commercial:update-default-supplier
Automatic supplier-order generation runs only when Settings::autoRestock() is enabled, while expiring-lot notifications are scheduled only when product lots exist.
Commercial also registers observers for sale-status transitions and inventory stock updates, so order-state and stock-side calculations stay synchronized with the rest of the Enso domain.
API
Main route groups
Mounted under api/commercial:
partnerproductsservicesaddressespurchases.*purchaseReturns.*sales.*saleReturns.*audit.*stats.orderssettings.*
Mounted outside the commercial prefix:
inventory.adjustinventory.reservationsinventory.updateAdjustmentOrdersproducts.stocks.details
Order lifecycle endpoints
Purchases include transitions such as:
confirmshipreceivefulfillfinalizecancel
Sales include transitions such as:
fulfillprepareshipdeliverfinalizecancel
Purchase returns and sale returns expose the equivalent reverse-flow lifecycle endpoints plus printable document endpoints and email actions.
Artisan commands
enso:commercial:update-stock-values {--daily}enso:commercial:update-stock-rotation {--daily}enso:commercial:generate-supplier-ordersenso:commercial:expiring-lots-notificationenso:commercial:update-default-supplier
Depends On
Required Enso packages:
laravel-enso/addresses↗laravel-enso/comments↗laravel-enso/core↗laravel-enso/data-import↗laravel-enso/discounts↗laravel-enso/documents↗laravel-enso/dynamic-methods↗laravel-enso/enums↗laravel-enso/financials↗laravel-enso/forms↗laravel-enso/helpers↗laravel-enso/history-tracker↗laravel-enso/inventory↗laravel-enso/measurement-units↗laravel-enso/migrator↗laravel-enso/pdf↗laravel-enso/sale-channels↗laravel-enso/searchable↗laravel-enso/services↗laravel-enso/tables↗laravel-enso/versions↗laravel-enso/vouchers↗
Companion frontend package: