Back to portfolio
PlatformClient work

ERP/Accounting for a Butcher Shop

An ERP for a butcher shop, built around stock batches and movements: receiving from invoices, recipes and production, carcass cutting, transfers between warehouses, orders, sales, PDF documents, and pulling supplier invoices via e-Factura.

ERP/Accounting for a Butcher Shop

Core stack

PHP 8.1+
Laravel 10
Eloquent ORM
Blade
JavaScriptjQueryBootstrapDataTablesSelect2SweetAlert2Vite 5MySQLLaravel SanctumDomPDFiApp APIe-FacturacURLFont AwesomePHPUnit 10

The challenge

The challenge was maintaining a coherent record when the same stock passes through receiving, production, cutting, transfer between warehouses, and sales. For a butcher shop, a simple product CRUD is not enough: operations have to account for batch, unit of measure, warehouse, price, VAT, shelf life, and provenance, and cutting turns a single raw material into multiple resulting products while introducing weight and value differences.

The solution

The solution models the product as stock identifiable through logistics attributes and links movements to their source via inbound, outbound, and provenance registers. Production, cutting, transfer, and invoicing update multiple entities within SQL transactions and preserve the operation's details. Recipes structure consumption, cutting creates resulting batches and tracks differences, transfers preserve the product's characteristics across warehouses, and the iApp integration brings supplier invoices from e-Factura into the same operational model.

Notable complexity

ERP/Accounting for a Butcher Shop centralizes, in a single web application, the flows between procurement, warehouse, production, and sales. The product model keeps quantity, unit of measure, internal batch and supplier batch, warehouse, prices, VAT, markup, manufacturing date, expiration, temperature, and the accounting account, so goods can be tracked as a stock variant by batch and warehouse.

Receiving can start from an invoice entered into the app or from supplier invoices pulled via the iApp/e-Factura API. Imported invoices are mapped to suppliers, services, or products, and for stock products, links are created to the invoice, the warehouse entry, and the product's source. The same provenance tracking is used for production, cutting, and transfers, so inbound and outbound movements can be reported by the process that generated them.

In production, recipes define the required products and the source warehouses, and an operation consumes the selected stock, records the outbound movements, and creates the resulting product in the destination warehouse. The butcher shop's specific flow has a separate cutting module: a carcass is consumed from stock, the resulting pieces become products with an internal batch and a warehouse, and the system keeps the differences between the processed weight/value and the resulting total. Standard pieces can be configured based on the carcass type.

Internal transfers move a specific product variant between two warehouses, preserving the batch and price characteristics. If the same variant exists at the destination, the quantity is accumulated; otherwise the product is cloned for the new warehouse. Orders check the stock of the selected variant and include a business rule that does not allow selling at a price lower than or equal to the purchase price. The app generates PDF documents for invoices, cuttings, and transfers, and provides inbound and outbound registers built from the provenance of each movement.

The architecture is a Laravel 10 monolith with Blade and browser JavaScript, MySQL via Eloquent, and SQL transactions in flows that modify multiple entities. The fiscal integration is isolated in a client for the iApp API, and documents are rendered server-side with DomPDF. The code represents a product customization on top of the Laravel skeleton and an admin interface, with domain logic implemented in controllers, models, services, and module-specific scripts.

Key results

  • Unified web application for products, product types, warehouses, suppliers, customers, and stock movements
  • Operational traceability via internal batch, supplier batch, warehouse, manufacturing/expiration dates, and product source
  • Goods receiving associated with invoices and an inbound register grouped by provenance
  • Recipes with ingredients, quantities, product types, and source warehouses
  • Production flow that consumes raw materials and creates the resulting product in the destination warehouse
  • Carcass-cutting flow, with resulting products, internal batches, and quantity/value differences
  • Internal transfers between warehouses preserving batch and price characteristics
  • Customer orders with stock verification and enforcement of the selling-vs-purchase price relationship
  • iApp integration for listing, viewing, and importing supplier invoices from e-Factura
  • Creating suppliers and mapping e-Factura line items to services or stock products
  • Server-side PDF documents for invoices, cuttings, and transfers
  • Distinct inbound and outbound registers, correlated with the process that generated them

Related projects

Want something similar?

Start with the estimate wizard — answer a few questions and get a realistic price range and timeline.