This manual provides a detailed, step-by-step examination of the Voucher Create form located
at resources/views/backend/voucher/create.blade.php. This form is a crucial module for finance
and accounting, allowing authorized users to capture customized voucher entries seamlessly. It interfaces
directly with the backend structure dictated by VoucherMasterController.php.
The form is primarily divided into three segments: Header/Master Information, Transaction Line Items, and Footer Configurations.
The interface uses a dynamic tabular structure defining the debits and credits distribution:
Interactive Controls: Users can append additional lines via the [+] control or selectively purge lines via the [Trash] control. Total Debit/Credit calculation fields lock dynamically at the bottom of the table.
The structural Blade rendering and frontend DOM behaviors:
backend.layouts.app.Form::open() structure, emitting
a POST request to the voucher.store named route.Core client-side functionality dictates table interaction rules:
voucher_row_add(event): Triggers the concatenation of raw HTML containing new line inputs.
Appends them smoothly onto #area__voucher_details.$(document).on('keyup','._dr_amount', ...)
enforce mutual exclusivity. A row item cannot concurrently be debited and credited.Guiding the backend lifecycle, the VoucherMasterController.php enforces rigorous saving
practices utilizing database transactions.
create() MethodPrimarily responsible for rendering the template. It queries global lookup objects defining state:
AccountHead, AccountGroup, Branch, and lists of
VoucherType permitted for the active session User instances.
store() MethodThe brain engine processing the payload systematically:
Using strict DB::beginTransaction() routines, if an internal failure happens midway, the
framework averts corrupt/unbalanced system databases by firing DB::rollback() securely.
Understanding which structures collect and disperse this data natively:
| Eloquent Model | Structural Database Table | Main Function |
|---|---|---|
VoucherMaster |
voucher_masters |
Saves parent metadata representing the overall voucher shell (Dates, overall Note, Status matching reference). |
VoucherMasterDetail |
voucher_master_details |
Houses individual parsed transactional data (cost centers, single dr/cr balances). |
VoucharCheckInfo |
vouchar_check_infos |
Extension logic tracking checks/banking instrument numbers against master records. |
Accounts |
accounts |
Global aggregator accounting tables mirroring transactions natively against universal Chart of Accounts hierarchy frameworks. |
AccountLedger |
account_ledgers |
The core entity table indicating users/organizations receiving actions to affect total balances actively. |
VoucherType |
voucher_types |
The definitional rulesets of operations (flags indicating what constitutes a CR vs. JV action). |
To reduce duplication, the application breaks logic out uniformly:
backend.layouts.app: Main application skeleton wrapping system frames.backend.message.message: Interceptor interface exposing Session flashes / Toast alerts
cleanly for end users.basic.org_create and backend.voucher.voucher_check_info: Segmented partial
inputs embedded dynamically.backend.message.send_sms: Reusable component providing the SMS toggles efficiently across
multiple modules seamlessly.