Production Module Manual
Comprehensive Documentation for Finished Goods Fabrication & Inventory Management.
Module Overview
The Production Module handles the conversion of raw materials into finished goods. It is a critical component for manufacturing and fabrication businesses, ensuring that inventory levels are accurately adjusted for both input components and output products.
Step-by-Step Workflow
Navigate to Fabrication List
Access the main index via the sidebar menu. Here you can view all past production records, filter by date, branch, or cost center, and monitor fabrication statuses.
Initiate Production Entry
Click the 'Fabrication Create' button. Fill in Header details: Date, Reference, From Branch (Origin of raw materials), and To Branch (Destination of finished goods).
Define Raw Material Consumption (Stock Out)
In the Raw Materials section, add the items being consumed. The system will pull current batch prices. Specify quantities used.
Define Produced Goods (Stock In)
In the Finished Goods section, add the items created. Set the 'Cost Rate' (value added) and 'Sales Rate' for the new batches.
Verify & Save
Review total values. Click 'Save'. This triggers a transactional database commit that updates stock counts and generates accounting vouchers.
Configuration Settings
The Production Form can be customized via the 'Form Settings' modal to suit specific business needs.
| Setting | Description |
|---|---|
Default Inventory |
The main ledger where stock value is held. |
Production Account |
The expense/WIP account for fabrication. |
Display Toggles |
Show/Hide Barcode, Store, Shelf, or Warranty fields in the entry form. |
Unit Conversion |
Enable calculation for base units vs. transaction units. |
Database Schema
The following tables work in orchestration to store production data:
| Table Name | Primary Columns | Purpose |
|---|---|---|
productions |
_date, _reference, _total,
_p_status |
Stores the header/master record of the fabrication event. |
stock_outs |
_item_id, _qty, _rate, _no |
Links consumed raw materials to a production master ID (_no). |
stock_ins |
_item_id, _qty, _rate, _no |
Links created finished products to a production master ID (_no). |
item_inventories |
_transection_ref, _qty, _status |
Real-time ledger for stock adjustments (positive and negative). |
accounts |
_ref_master_id, _dr_amount, _cr_amount |
Financial journal entries generated from production. |
Model Relationships
The system uses Eloquent relationships to traverse production data.
- Production Model:
_stock_in(): HasManyStockIn(Produced items)._stock_out(): HasManyStockOut(Materials used).
- StockIn/StockOut Models:
_items(): BelongsToInventory._units(): BelongsToUnits.
View File Mapping
UI components located in resources/views/backend/production/:
| Blade View | Action / Target |
|---|---|
index.blade.php |
Displaying the searchable table of productions. |
create.blade.php |
The complex form for multi-row stock entry. |
edit.blade.php |
Modification of existing fabrication records. |
form_setting_modal.blade.php |
Configuration of form fields and default accounts. |
print.blade.php |
Print template for the fabrication invoice. |
stock_out_script.blade.php |
Includes heavy JS logic for dynamic material selection. |
Controller Function Details
ProductionController.php manages the core business logic using several key methods:
| Method | Route Action | Logic Breakdown |
|---|---|---|
| index | View List | Applies filters (Dates, Branches, Ref) and returns paginated data with relations. |
| store | Save Data | Encapsulated in a DB Transaction. It saves the master record, iterates all stock-out rows (deducting qty from price lists), iterates all stock-in rows (creating new batch price lists), and finalizes accounting ledgers. |
| update | Modify Data | Implements "Reversed-Update" logic: It first reinstates the stock for previously consumed items and deletes previous entries before reapplying the new state. |
| Settings | Global Config | Updates persistence for ProductionFromSetting which dictates form
behavior across the module. |