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.

Key Objective: To maintain an accurate balance between material consumption (Stock Out) and product creation (Stock In), while reflecting the financial impact on company ledgers.

Step-by-Step Workflow

1

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.

2

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).

3

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.

4

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.

5

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(): HasMany StockIn (Produced items).
    • _stock_out(): HasMany StockOut (Materials used).
  • StockIn/StockOut Models:
    • _items(): BelongsTo Inventory.
    • _units(): BelongsTo Units.

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.