Nama ERP Approvals System - User Guide
Overview
The Nama ERP Approvals System provides a comprehensive workflow management solution that allows organizations to define approval processes for various business operations. This system ensures proper authorization and control over critical business transactions before they are finalized.
Key Benefits
- Flexible Workflow Design: Create custom approval workflows for any entity type
- Multi-step Approvals: Support for complex, multi-level approval processes
- Rule-based Logic: Apply approval rules based on specific business conditions
- Real-time Notifications: Automatic notifications via email, SMS, and in-app messages
- Audit Trail: Complete tracking of approval decisions and comments
Core Concepts
Approval Definition (تعريف موافقه)
An Approval Definition is the master configuration that defines when, how, and who should approve specific business transactions. Each definition contains:
- Target Entity: Which type of record requires approval (invoices, purchase orders, etc.)
- Approval Steps: Sequential or parallel approval stages
- Responsible Parties: Who can approve at each step
- Conditions: When the approval should be triggered
- Notification Templates: How approvers are notified
Approval Case
When a transaction meets approval criteria, an Approval Case is automatically created. This represents an active approval request that tracks:
- Current Status: In Progress, Approved, Rejected, or Returned
- Approval Steps: History of decisions made by each approver
- Next Candidates: Who needs to act next
- Summary Information: Key details about the transaction requiring approval
Getting Started
Accessing Approval Definitions
Navigate to: Basic > Settings > Approval Definition (الأساسيات > الإعدادات > تعريف موافقه)
Creating Your First Approval Definition
Basic Information
- Code: Unique identifier for the approval definition
- Name: Descriptive name (e.g., "Invoice Approval Above 10,000")
- Target Entity: Select the entity type that requires approval
Approval Conditions
- Use With Insert: Apply when creating new records
- Use With Update: Apply when modifying existing records
- Use With Delete: Apply when deleting records
- Use With Budget Exceeded: Apply when transactions exceed budget limits
- Apply When Query: SQL query to determine when approval is needed
Define Approval Steps
- Add sequential approval steps
- Assign responsible employees or roles
- Set escalation timeframes
- Configure decision options (Approve, Reject, Return, etc.)
Special Approval Options
Require Execution
When Require Execution is enabled, the system automatically adds a final execution step after all approval steps are completed. This step requires the original Approval Initiator (the person who created/modified the record) to confirm final execution.
Execution Step Behavior
- Automatic Addition: System adds execution step with sequence number after the last approval step
- Responsible Party: Always assigned to the approval initiator (original requester)
- Purpose: Ensures the person who requested the approval confirms final execution
- Use Case: Common in scenarios where approved transactions need final confirmation before processing
Example Flow with Require Execution:
1. User creates Invoice → Approval triggered
2. Manager approves → Next step
3. Finance Director approves → All approvals complete
4. System creates "Execution Step" → Assigns back to original user
5. Original user confirms execution → Document is committed
Confirm Before Starting
When Confirm Before Starting is enabled, the system displays a confirmation dialog before initiating the approval process. This gives users a final opportunity to review their input and cancel if they made an error.
Confirmation Dialog Features
- Tempo Language: Use
arabicConfirmation
andenglishConfirmation
fields with Tempo template syntax - Dynamic Content: Support for field references from the approved element (e.g.,
{totalAmount}
,{code}
,{department}
) - User Choice: Users can click "Confirm" to proceed or "Cancel" to abort the approval process
- Language Support: Displays appropriate message based on user's language preference
Example Confirmation Messages with Dynamic Content:
Arabic Confirmation:
"تأكيد: هل أنت متأكد من طلب الموافقة على {entityType} رقم {code} بمبلغ {totalAmount} للقسم {department.name1}؟"
English Confirmation:
"Confirmation: Are you sure you want to request approval for {entityType} #{code} with amount {totalAmount} for department {department.name2}?"
Static Example:
Arabic: "تأكيد: هذا المبلغ كبير، هل تريد المتابعة؟"
English: "Confirmation: This is a large amount, do you want to proceed?"
Available Dynamic Fields:
- Entity Fields: Any field from the record being approved (e.g.,
{totalAmount}
,{customerName}
) - System Fields: Built-in fields like
{code}
,{entityType}
,{creationDate}
- Related Entity Fields: Referenced entity fields using dot notation (e.g.,
{department.name1}
,{customer.creditLimit}
) - Calculated Values: Custom calculations or formatted values
Revise On Completion
When Revise On Completion is enabled, the system automatically marks the record as "revised" after the approval process is successfully completed. This provides an additional layer of data integrity and audit control.
Modify While Under Approval
By default, records awaiting approval cannot be edited to maintain data integrity during the approval process. However, the system provides flexible options to allow modifications under specific conditions.
Configuration Options:
Allow Modify While Under Approval (Global Setting):
- When disabled (default): Records cannot be edited during approval process
- When enabled: Records can be modified based on the policy settings below
Modify While Under Approval Policy (Per Step): The system supports three different policies for controlling modifications during approval:
Modify Policies
Allow For Authorized Users (Default)
- Users with
EditUnderApproval
capability can modify the record - Requires specific security permission
- Most flexible option for authorized personnel
- Users with
Allow For Authorized And Can Approve
- Users must have
EditUnderApproval
capability AND be eligible to approve current step - More restrictive - only current step approvers can modify
- Ensures modifications are made by those responsible for approval
- Users must have
Prevent Modify
- No modifications allowed regardless of user permissions
- Highest security level for critical approval steps
- Overrides the global
allowModifyWhileUnderApproval
setting
Field-Level Editing Control
Beyond the global allowModifyWhileUnderApproval
setting, the system provides granular field-level control over what can be edited during approval. This allows organizations to permit modifications to specific fields while keeping others locked.
Configuration Options:
Allow Editing Fields (Per Step):
- Field Name:
allowEditingFields
- Format: Comma-separated list of field IDs
- Scope: Applies to the specific approval step
- UI Behavior: Only listed fields remain editable; all others are disabled
How Field-Level Control Works:
Field Editing Logic
User attempts to edit field during approval:
1. Check if approval is pending
2. Check if current step has allowEditingFields configured
3. If configured:
- Listed fields → Remain editable
- Unlisted fields → Become disabled
4. If not configured:
- Fall back to modifyWhileUnderApprovalPolicy
5. Apply security validation for authorized users
OTP (One-Time Password) Security
The system provides enhanced security through OTP verification for approval decisions. This feature ensures that approval actions are performed by the intended person and adds an extra layer of authentication.
Configuration Options:
Require OTP For All Steps (Global Setting):
- When enabled: All approval steps require OTP verification
- Applies to every step in the approval definition
- Overrides individual step settings
Require OTP (Per Step Setting):
- When enabled: Specific approval step requires OTP verification
- Allows selective OTP requirement for sensitive steps
Advanced Configuration
Conditional Approvals
Use Criteria Definition and Apply When Query to create sophisticated approval triggers:
-- Example: Approve invoices above 50,000 SAR
SELECT case when {totalAmount} > 50000 then 1 else 0 end
Approval Rules
Approval Rules are pre-built business logic components that automatically detect when approval is needed based on specific business conditions. These rules can be attached to approval definitions to trigger approvals for scenarios that require complex validation logic.
How Approval Rules Work
- Rule Evaluation: When a document is saved, attached rules are evaluated
- Applicability Check: Each rule determines if it applies to the current transaction
- Line Detection: Rules can identify specific lines that triggered the approval
- Approval Triggering: If any rule applies, the approval process starts
- Context Information: The triggering lines are stored in
$map.approvalRuleLines
for use in templates
Available Built-in Rules
Common Approval Rules
The system includes several pre-built rules for sales and purchasing scenarios:
Sales Price Rules:
- BelowMinSalesPriceApprovalRule: Triggers when selling below minimum allowed price
- BelowDefaultSalesPriceApprovalRule: Triggers when selling below standard price
- AboveMaxSalesPriceApprovalRule: Triggers when price exceeds maximum limit
- MaxUserDiscountPercentageApprovalRule: Triggers when discount exceeds user's allowed percentage
Purchase Price Rules:
- AboveLastPricePurchasesApprovalRule: Triggers when purchase price exceeds last purchase price
Configuring Approval Rules
Step 1: Add Rules to Approval Definition In the approval definition, add rules in the "Rules" section:
- Select from available rules for your entity type
- Rules are evaluated in sequence
- All rules must pass for approval to be skipped
Using Rule Information in Templates
When a rule triggers approval, the affected lines are available in templates:
{if($map.approvalRuleLines)}
<h3>Lines Requiring Approval:</h3>
<table>
<tr><th>Item</th><th>Price</th><th>Reason</th></tr>
{loop($map.approvalRuleLines)}
<tr>
<td>{link($map.approvalRuleLines.item.item)}</td>
<td>{$map.approvalRuleLines.price.unitPrice}</td>
<td>Price below minimum threshold</td>
</tr>
{endloop}
</table>
{endif}
Budget Exceeded Approvals
The system supports automatic approval requirements when financial transactions exceed predefined budget limits. This feature integrates with the accounting module to monitor budget consumption in real-time.
How Budget Approvals Work
- Budget Validation: When a document is saved, the system checks if it generates accounting entries that exceed budget limits
- Account-Level Configuration: Each account can be configured with budget exceeded behavior:
- Prevent Saving: Block the transaction entirely
- Request Approval: Allow saving but require approval before commitment
- Dynamic Checking: Budget validation considers multiple dimensions (department, branch, fiscal period, etc.)
Configuration Requirements
Prerequisites
For budget approvals to function, ensure the following are configured:
- Enable Budget Approvals: Set
Enable Approvals For Budgets
totrue
in global configuration - Budget Definitions: Create budget records in the system for relevant accounts
- Account Configuration: Set
budgetExceededBehavior
on accounts to "Request Approval" - Approval Definition: Create approval definition with
useWithBudgetExceeded = true
Budget Validation Process
The system performs these checks when documents are saved:
Budget validation logic
- Generate pseudo accounting entries for the document
- Compare against existing budget allocations
- Check if transaction will exceed budget limits
- Consider account's budgetExceededBehavior setting
- If "Request Approval" → trigger approval workflow
- If "Prevent Saving" → block transaction with error
Budget Dimensions Considered
Budget validation can consider multiple organizational dimensions:
- Legal Entity: Company-level budgets
- Fiscal Year/Period: Time-based budget allocation
- Department: Departmental spending limits
- Branch: Location-based budgets
- Sector: Division-level controls
- Analysis Set: Custom analytical groupings
- Account Subsidiaries: Sub-account level budgets
Dynamic Responsible Parties
Configure approval routing based on:
- Organizational Hierarchy: Supervisor approval chains
- Department-based: Route to department managers
- Field-based: Use employee fields from the transaction
- Custom Selectors: Advanced logic for approver selection
Alternate Approvers
The system provides flexibility by allowing alternate approvers who can act on ANY step of the approval process, regardless of the specific step assignments. This ensures approvals can proceed even when primary approvers are unavailable.
Types of Alternates
1. Alternate (Single Employee)
- Configuration: Select a single employee as global alternate
- Scope: Can approve any step in the approval process
- Use Case: Designate a deputy or backup approver for the entire workflow
2. Other Alternates (Dynamic List)
- Configuration: Use SpecialResponsible selectors to dynamically determine alternates
- Scope: Can approve any step based on dynamic criteria
- Options:
- Initiator: The person who created/modified the document
- Supervisor: Direct supervisor of the initiator
- Field-based: Employees referenced in document fields
- Custom Logic: Dynamic selection based on business rules
Difference from Fallback
Important Distinction
- Fallback: Only used when system cannot determine regular approver (error handling)
- Alternate: Always available to approve alongside regular approvers (business flexibility)
- Other Alternates: Dynamically determined alternates based on context
Consider Request Date As Creation Date
By default, the system sets the record's creationDate
when the final approval step is completed and the record is committed. However, the considerRequestDateAsCreationDate
option changes this behavior to use the approval request date instead.
Approval Summary Configuration
The system can generate customized summaries for approval requests that provide approvers with essential information about what they're approving. These summaries appear in approval lists and can be included in notification emails.
Summary Generation Options:
1. Default Entity Summary
- If no custom summary is configured, the system uses the entity's built-in
summaryForApproval()
method - Provides basic information about the record
- Standard format across all entities of the same type
2. Custom Summary Template
- summaryTemplate: Uses Tempo language to create formatted summaries
- Access to all entity fields and related data
- Flexible formatting with HTML support
- Dynamic content based on record data
3. Query-Based Summary
- summaryQuery: SQL query to gather specific data for the summary
- summaryTemplate: Template that processes query results
- Powerful for complex summaries requiring calculated data or aggregations
4. Flush Before Summary
- flushBeforeSummary: Forces database commit before generating summary
- Ensures all changes are persisted before summary calculation
- Required when summary depends on data that might not be saved yet
- Use only with summaryQuery
Step-by-Step Configuration Guide
Step 1: Define Basic Settings
Field | Description |
---|---|
Approval Entity | Type of record to approve |
Priority | Processing order when multiple definitions match |
Use With Insert | Trigger on new records |
Use With Update | Trigger on modifications |
Comment Required | Force approvers to add comments |
Require Execution | Add final execution step for initiator |
Confirm Before Starting | Show confirmation dialog before starting approval |
Revise On Completion | Mark record as revised after approval (locks editing/deletion) |
Allow Modify While Under Approval | Allow editing records during approval process |
Require OTP For All Steps | Require OTP verification for all approval decisions |
Fallback | Employee to handle system errors (required) |
Alternate | Employee who can approve any step |
Other Alternates | Dynamic alternates (supervisor, field-based, etc.) |
Consider Request Date As Creation Date | Use approval request date as record creation date |
Summary Template | Tempo template for custom approval summaries |
Summary Query | SQL query to gather data for summary generation |
Flush Before Summary | Commit changes to database before generating summary |
Step 2: Configure Approval Steps
Add Approval Steps
- Step Sequence: 1, 2, 3, etc.
- Step Name: "Department Manager Approval"
- Required Status: All candidates must approve
Assign Responsibilities
- Direct Assignment: Specific employee
- Role-based: Job title or department role
- Dynamic: Based on transaction data
Set Decision Options
- Approve: Move to next step
- Reject: Stop process and reject
- Return: Send back for modifications
- Escalate: Forward to supervisor
Step 3: Notification Configuration
Email Templates
Configure automated email notifications with:
- Email Template: HTML template for approval requests
- Email Subject: Dynamic subject line
- Additional Recipients: CC other stakeholders
SMS Notifications
- SMS Template: Text message format
- Mobile Number Source: Employee contact info
In-App Notifications
- Notification Template: In-system message format
- FCM Templates: Push notifications for mobile apps
Step 4: Advanced Features
Critical Fields Monitoring
Track specific field changes that require re-approval:
- Amount changes beyond tolerance
- Key date modifications
- Status field updates
Auto-escalation
Set time limits for approval steps:
- Auto Escalate After: Time period (hours/days)
- Escalation Target: Supervisor or specific employee
Task Schedule Required
For auto-escalation to work, you must create a Task Schedule with the following configuration:
- Schedule Type: Action
- Class Name: Choose one of:
EAAutoEscalateApprovalToSupervisor
- Escalates to the approver's direct supervisorEAAutoEscalateApprovalToFallBackEmployee
- Escalates to the fallback employee defined in the approval definition
- Schedule Frequency: Recommended to run every 15-30 minutes to check for overdue approvals
User Workflow
For Transaction Creators
- Create/Modify Record: Enter transaction data normally
- Save Record: System checks approval requirements
- Approval Triggered: If criteria met, approval case is created
- Notification Sent: Approvers receive notifications
- Track Status: Monitor approval progress in transaction
For Approvers
- Receive Notification: Email, SMS, or in-app alert
- Review Request: Access approval details and transaction summary
- Make Decision: Approve, Reject, Return, or Escalate
- Add Comments: Provide reasoning for decision
- Submit: Decision is recorded and workflow continues
Approval Actions Available
Action | Description | Next Step |
---|---|---|
Approve | Accept the request | Move to next approval step |
Reject | Deny the request | Stop workflow, notify creator |
Return | Send back for changes | Allow modifications, restart approval |
Escalate to Supervisor | Forward to manager | Manager becomes next approver |
Escalate to Specific Employee | Forward to chosen person | Specific employee approves |
Notification System
Notification Types
- Email Notifications
- Embedded approval links
- Attachment support
- SMS Messages
- In-App Notifications
- Push Notifications
- Mobile app alerts
Notification Templates
Templates use Tempo language for dynamic content rendering. The templates have access to the $notificationInfo
object containing:
$notificationInfo.employee
- The employee who should approve$notificationInfo.approvalCase
- The full approval case details$notificationInfo.otp
- The approval OTP (if configured)
Email Template Example:
<h2>Approval Required: {entityType} #{code}</h2>
<p>Dear {$notificationInfo.employee.name2},</p>
<p>Please review and approve the following {entityType}:</p>
<ul>
<li><strong>Document:</strong> {link(this)} (#{code})</li>
<li><strong>Amount:</strong> {totalAmount}</li>
<li><strong>Department:</strong> {department.name2}</li>
<li><strong>Date:</strong> {$creationDate}</li>
<li><strong>Current Step:</strong> {$notificationInfo.approvalCase.nextStepName2}</li>
</ul>
{if($notificationInfo.otp)}
<p><strong>Security Code (OTP):</strong> {$notificationInfo.otp}</p>
{endif}
<h3>Summary:</h3>
<p>{$notificationInfo.approvalCase.summary}</p>
<h3>Actions:</h3>
<table>
<tr>
<td>{approvelink}</td>
<td>{rejectlink}</td>
<td>{returnlink}</td>
</tr>
</table>
SMS Template Example:
{$notificationInfo.employee.name2}: Approval needed for {entityType} #{code}
Amount: {totalAmount}
OTP: {$notificationInfo.otp}
{approvelink}
{rejectlink}
In-App Notification Template:
<strong>Approval Request</strong>{enter}
{entityType} #{code} requires your approval{enter}
Amount: {totalAmount}{enter}
Department: {department.name1}{enter}
{enter}
{titledlink("View Details", this)}
Available Tempo Variables for Approval Templates
Context Variables
All notification templates have access to the following context objects and variables:
Document Fields:
- Direct field access:
{code}
,{totalAmount}
,{creationDate}
, etc. - Related entity fields:
{customer.name1}
,{department.code}
, etc. - System fields:
{entityType}
,{firstAuthor}
,{currentVersion}
NotificationInfo Object ($notificationInfo
):
$notificationInfo.employee
- The employee who should approve$notificationInfo.approvalCase
- The full approval case object$notificationInfo.approvalCase.summary
- Approval summary$notificationInfo.approvalCase.requestedBy
- Who requested approval$notificationInfo.approvalCase.nextStepName1
- Current step Arabic name$notificationInfo.approvalCase.nextStepName2
- Current step English name$notificationInfo.otp
- The OTP code (if configured)$notificationInfo.concernedLines
- Lines requiring approval
Approval Action Links:
{approvelink}
- Link/button to approve{rejectlink}
- Link/button to reject{returnlink}
- Link/button to return for modifications{escalatelink}
- Link/button to escalate
Budget-Based Approvals
Account Setup:
- Expense Accounts → budgetExceededBehavior = "Request Approval"
- Budget Limits → Department/Branch level allocation
- Approval Flow → Department Head → Finance Manager
Process:
Document Creation → Budget Check → Approval (if exceeded) → Commitment
Multi-criteria Approvals
IF (Amount > 50,000 OR Customer = "High Risk" OR Payment Terms > 60 days)
THEN Require: Credit Manager + Finance Director approval
Performance Tips
- Optimize Queries: Ensure Apply When Query performs efficiently
- Batch Processing: Group similar approvals for efficiency
- Archive Old Cases: Maintain system performance with data retention policies
- Monitor Bottlenecks: Identify and resolve approval delays
Troubleshooting
Common Issues
Problem | Cause | Solution |
---|---|---|
Approval not triggered | Criteria not met | Review Apply When Query and conditions |
Wrong approver assigned | Incorrect responsible party setup | Check step responsibilities configuration |
Notifications not sent | Template or contact info issues | Verify email templates and employee contacts |
Approval stuck | Missing approver or system error | Check approval case status and escalation rules |
Budget approval not working | Configuration missing | Verify budget settings, account configuration, and global config |
System Administration
Monitoring Approvals
- Regular review of pending approval cases
- Performance monitoring of approval queries
- Audit trail analysis for compliance
- Budget vs actual spending analysis
Maintenance Tasks
- Archive completed approval cases
- Update employee responsibilities
- Refresh approval definition cache
- Review and optimize notification templates
- Update budget allocations periodically
Integration Points
External Systems
The approval system can integrate with:
- Email Servers: SMTP configuration for notifications
- SMS Gateways: Third-party SMS providers
- Mobile Apps: Push notification services
- BI Systems: Approval metrics and reporting
- Budget Systems: Real-time budget consumption tracking
API Access
Programmatic access for:
- Creating approval cases
- Querying approval status
- Submitting approval decisions
- Generating approval reports
- Budget validation checks
Security Considerations
Access Control
- Role-based Permissions: Control who can create/modify approval definitions
- Approver Validation: Verify approver authorization for each step
- Audit Logging: Track all approval activities
- Data Segregation: Respect organizational boundaries
- Budget Access: Control budget information visibility
Compliance Features
- Digital Signatures: Support for electronic signature integration
- Retention Policies: Maintain approval records per regulatory requirements
- Audit Reports: Generate compliance documentation
- Version Control: Track changes to approval definitions
- Segregation of Duties: Ensure proper separation of financial controls
Conclusion
The Nama ERP Approvals System provides a robust foundation for implementing organizational approval workflows, including sophisticated budget control mechanisms. By following this guide, you can create effective approval processes that improve control, compliance, and operational efficiency while maintaining flexibility to adapt to changing business needs.
The integration with budget management ensures financial discipline while providing the flexibility to handle exceptional circumstances through the approval process.
Next Steps
- Start with simple approval definitions for high-impact transactions
- Configure budget approvals for critical expense accounts
- Train key users on both standard and budget approval processes
- Monitor system performance and user feedback
- Gradually expand to cover additional business processes
- Regular review and optimization of approval workflows and budget allocations
For additional support or advanced configuration questions, consult your system administrator or contact Nama ERP support.