RLP Approval Chain Manual

Comprehensive Documentation for Managing Requisition Level Approval Chains.

Module Overview

The RLP Approval Chain module is designed to define the sequence of approvals required for a Requisition Level Process (RLP). It allows administrators to create dynamic approval workflows based on organization, branch, and cost center, assigning specific users and groups in a predefined order.

Primary Goal: To ensure that every requisition follows a strict and auditable path of authorization, maintaining organizational control over expenditures and processes.

Step-by-Step Workflow

1

Access Approval Chain List

Navigate to the 'Approval Chain' menu. This view displays all active approval chains filtered by your permitted organizations and branches.

2

Initiate New Chain Creation

Click the 'Add New' button. Provide a clear Chain Name (e.g., "Standard Procurement") and select the Chain Type.

3

Configure Organizational Scope

Select the Organization, Branch, and Cost Center to which this chain applies. This ensures the correct workflow is triggered for requisitions originating from these units.

4

Assign Approval Hierarchy

Add users who will act as approvers. For each user, specify their User Group (e.g., Management, Finance) and their Order in the approval sequence (1, 2, 3, etc.).

5

Finalize and Save

Review the sequence and click 'Save'. The chain is now active and will be used automatically for relevant RLPs. Note: Deletion is restricted to maintain history; use status updates for changes.

Database Schema

The module relies on three primary tables to manage chains and user assignments:

Table Name Key Columns Purpose
rlp_access_chains id, chain_name, chain_type, organization_id, _branch_id, _cost_center_id Stores the main header information for an approval chain.
rlp_access_chain_users id, chain_id, user_id, user_row_id, user_group, _order Maps users to specific chains with their group and sequence order.
rlp_user_groups id, _name, _order, _status Defines the groups for RLP participants (e.g., Reviewer, Recommender, Approver).

Model Relationships

Eloquent models in app/Models/RLP/ handle data relationships:

  • RlpAccessChain:
    • _branch(): BelongsTo Branch.
    • _cost_center(): BelongsTo CostCenter.
    • _organization(): BelongsTo Company (HRM).
    • _chain_user(): HasMany AccessChainUser (Ordered by _order).
    • _entry_by(): BelongsTo User (Admin who created).
  • AccessChainUser:
    • _user_group(): BelongsTo RlpUserGroup.
    • _user_info(): BelongsTo HrmEmployees (Employee details).

View File Mapping

Blade templates located in resources/views/rlp-module/approval-chain/:

Blade View Usage / Purpose
index.blade.php The main list of chains with filtering and search capabilities.
create.blade.php Form to define a new chain and its multi-user sequence.
edit.blade.php Interface to modify existing chain settings or users.
show.blade.php A summary view of the chain's hierarchy and organizational linkage.
print.blade.php Optimized print layout for documentating the approval process.

Controller Function Details

Technical breakdown of RlpChainController.php methods:

Method Action Technical Logic
index List Chains Retrieves chains based on the authenticated user's permitted branches and organizations. Supports detail print view.
create Load Form Fetches permitted branches, cost centers, and RlpUserGroup list for the creation UI.
store Save New Performs validation, wraps logic in a database transaction. Saves the header record then iterates through user arrays to save child records in rlp_access_chain_users.
show / edit Retrive One Loads the chain with all relationships (branch, cost center, organization, and sorted chain users) for viewing/editing.
update Modify Existing Uses a transaction to update header info. It sets _status = 0 for previous users and then saves/updates the new sequence to ensure data consistency.
destroy Delete Restricted: Throws a warning message. Deleting chains is prohibited to prevent breaking the audit trail of existing RLPs.