This manual provides a detailed step-by-step technical explanation of the
resources/views/backend/production/create.blade.php form, including its details, code
structure, related controller functions, models, database tables, and views.
The Production Form is designed to manage and track the manufacturing or fabrication process of finished goods. The form is conceptually divided into two major sections:
The form interacts with the following core database tables and Eloquent models to persist and validate production data:
| Model | Database Table | Description |
|---|---|---|
Production |
productions |
Stores the core master details of the production entry (e.g., date, total values, reference, status). |
StockOut |
stock_outs |
Stores the details of raw materials consumed (Item identity, quantity, rate, etc.). |
StockIn |
stock_ins |
Stores the details of the finished products generated along with their manufactured base rates. |
Inventory / ItemInventory |
inventories / item_inventories |
Tracks all items system-wide and maintains the stock ledger (transaction history for in/out operations). |
ProductPriceList |
product_price_lists |
Maintains specific pricing, barcodes, expirations, and available quantity logic for inventory control. |
ProductionFromSetting |
production_from_settings |
Configuration model deciding which specific columns (barcode, warranty, dates) be displayed on the form interface. |
The form orchestrates multiple blade templates to function correctly:
resources/views/backend/production/create.blade.php (The
primary interface).backend.layouts.app (Serves as the root UI wrapper displaying
headers, sidebars).backend.message.message (Used for alert boxes,
successes or errors).backend.common-modal.item_ledger_modal (Opens a popup for
instantly creating new items without leaving the page).backend.production.stock_out_script and
backend.production.stock_in_script which contain all complex jQuery/JS rules to handle row
appending, removal, mathematical calculations of Qty and Rates for Stock In/Out.The form is submitted via a POST request utilizing route('production.store'). Below
is a breakdown of the form's structural components.
_date): Input for specifying the effective date of production._type): Pre-set value, typically labeled "production"._referance): An optional manual entry text field for external
tracking references (chalan, work order, etc.).Displays an interactive table where the user adds raw items being heavily utilized. Powered by
backend.production.stock_out_script.
_search_item_id[] (Search Name) and
bounds it behind scenes to _item_id[]._base_unit_id[],
conversion_qty[]) that handle multi-unit stock normalization._qty[] (amount consumed), _rate[] (cost per
unit), and _value[] (calculated overall cost).Similarly interactive table mapping finished products. Defined and appended by
backend.production.stock_in_script.
_stock_in__search_item_id[] to binding _stock_in__item_id[]._stock_in__rate[], multiplied by quantities resulting in _stock_in__value[].
_note is used to log custom administrative comments regarding
production parameters._p_status._total
(Out) and _stock_in__total (In). Both normally must mathematically square up in standard
production setups.ProductionController.php) Logiccreate()Prepares data constants before injection into the standard web-view. It gathers all standard relations such
as Account Types, User-permitted branches, Voucher instances, Units, Categories, settings, and loads up
backend.production.create with necessary compact() data parameters.
store()Handles the primary POST logic ensuring ACID compliant DB manipulations via
DB::beginTransaction(). The processing procedure involves multiple steps:
Production model with overall
transaction summaries, statuses, and locations. Returns an inserted parent id._item_id[] objects.ProductPriceList.StockOut detail rows bridging with the new master production
id.ItemInventory. This step physically
decrements raw materials._stock_in__item_id[] finished entities.StockIn binding to the parent.ProductPriceList (assigning fresh generated barcodes
natively or utilizing previous).ItemInventory tracking up the stock count of
forged final goods.account_data_save() multiple times
based entirely on _p_status (for instance: moving value to a "Transit Account", or
migrating it securely between Inventory ledger hierarchies).
DB::commit() solidifies changes avoiding data corruption,
subsequently routing the user backwards with Success flash notifications.