jeffersongoncalves / laravel-erp-selling
ERP selling — customers, quotations and sales orders for the Laravel ERP ecosystem
Package info
github.com/jeffersongoncalves/laravel-erp-selling
pkg:composer/jeffersongoncalves/laravel-erp-selling
Requires
- php: ^8.2
- illuminate/contracts: ^11.0|^12.0|^13.0
- illuminate/database: ^11.0|^12.0|^13.0
- illuminate/events: ^11.0|^12.0|^13.0
- illuminate/support: ^11.0|^12.0|^13.0
- jeffersongoncalves/laravel-erp-accounting: dev-main
- jeffersongoncalves/laravel-erp-core: dev-main
- jeffersongoncalves/laravel-erp-stock: dev-main
- spatie/laravel-package-tools: ^1.15
Requires (Dev)
- larastan/larastan: ^2.9|^3.0
- laravel/pint: ^1.0
- nunomaduro/collision: ^8.0
- orchestra/testbench: ^9.0|^10.0|^11.0
- pestphp/pest: ^3.0|^4.0
- pestphp/pest-plugin-laravel: ^3.0|^4.0
This package is auto-updated.
Last update: 2026-06-28 02:34:33 UTC
README
Laravel ERP Selling
ERP selling — customers, quotations and sales orders for the Laravel ERP ecosystem.
This package is the selling / sales module of an ERPNext-native rebuild. It owns the customer master and the pre-sales documents (quotations and sales orders) and converts them into the downstream stock and accounting documents. It depends on jeffersongoncalves/laravel-erp-core, jeffersongoncalves/laravel-erp-accounting and jeffersongoncalves/laravel-erp-stock.
Features
- Customer masters — Customers (with customer group, territory, type, default currency, default price list, credit limit and tax id), a tree of customer groups, sales partners and product bundles. Customers reuse the core address/contact morphs.
- Quotations — A submittable pre-sales document with line items and its own workflow status (
Draft → Open → Ordered → Lost → Expired → Cancelled). - Sales Orders — A submittable commitment with line items, delivery/billing progress (
per_delivered/per_billed) and an ERPNext-style status (To Deliver and Bill,To Deliver,To Bill,Completed,Closed). - Conversion services —
QuotationServiceturns an accepted quotation into a sales order;SalesOrderServiceturns a sales order into a stock delivery note or an accounting sales invoice, wiring the selling module into the stock and general-ledger engines. - Commitment documents — Quotations and sales orders are commitments: submitting one posts nothing to the ledger. Stock and ledger impact happens only on conversion.
- Customizable Models — Override any model via config (ModelResolver pattern);
CustomerandCustomerGroupship swappable contracts. - Translations — English and Brazilian Portuguese.
Compatibility
| Package | PHP | Laravel |
|---|---|---|
^1.0 |
^8.2 |
^11.0 | ^12.0 | ^13.0 |
Installation
composer require jeffersongoncalves/laravel-erp-selling
Publish and run the migrations (the core, accounting and stock package migrations must be published too):
php artisan vendor:publish --tag="erp-core-migrations" php artisan vendor:publish --tag="erp-accounting-migrations" php artisan vendor:publish --tag="erp-stock-migrations" php artisan vendor:publish --tag="erp-selling-migrations" php artisan migrate
Publish the config (optional):
php artisan vendor:publish --tag="erp-selling-config"
Conversion
SalesOrderService and QuotationService are registered as singletons.
use JeffersonGoncalves\Erp\Selling\Services\QuotationService; use JeffersonGoncalves\Erp\Selling\Services\SalesOrderService; // Quotation -> Sales Order (the quotation is marked Ordered) $salesOrder = app(QuotationService::class)->createSalesOrder($quotation); // Sales Order -> Delivery Note (draft; set the COGS account and submit to post SLE + GL) $deliveryNote = app(SalesOrderService::class)->createDeliveryNote($salesOrder); $deliveryNote->counterAccountId = $cogsAccount->id; $deliveryNote->submit(); // Sales Order -> Sales Invoice (draft; caller supplies the Receivable + income accounts) $invoice = app(SalesOrderService::class)->createSalesInvoice($salesOrder, $receivable->id, $income->id); $invoice->submit();
- createDeliveryNote copies the party/company onto a stock
DeliveryNote, then for each order line still to deliver resolves the stockItembyitem_codeand adds a delivery line (item_id, remaining qty, rate, warehouse). Saved as a draft; submitting it posts the stock ledger entries and the COGS general-ledger pair. - createSalesInvoice copies the party/company onto an accounting
SalesInvoice, then for each order line still to bill adds an invoice line (item_code, remaining qty, rate, income account). Saved as a draft; submitting it posts the balanced receivable/income general-ledger entries.
Database Tables
All tables use the configured prefix shared across the ERP ecosystem (default: erp_): customer_groups, customers, sales_partners, product_bundles, product_bundle_items, quotations, quotation_items, sales_orders, sales_order_items.
Testing
composer test
Changelog
Please see CHANGELOG for what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
License
The MIT License (MIT). Please see License File for more information.
