Audit Trail

Audit Trail Module - User Guide

ℹ️

πŸ›‘οΈ Business Impact

The Audit Trail module is your system’s “Black Box” recorder. Implementing this module ensures 100% data accountability, helping you identify unauthorized changes instantly and providing ironclad evidence for statutory audits (ISO, Tax, SOX). It turns “I didn’t do it” into “Let’s check the trail.”


⚑ Quick Start: 2-Minute Setup

For administrators who need to activate or check the trail:

  1. Enable: In System Parameters, ensure the parameter AuditTrail is set to “Yes” (the Company Details page also displays the current activation status).
  2. Action: Perform any master or transaction edit/deletion (e.g., Modify a Party, Voucher, Bill, or Invoice).
  3. Note: When prompted, enter a mandatory justification in the “Reason to Modify” / “Audit Trail Notes” field.
  4. View: Navigate to System Tools > Audit Trail (/audittrailindex) to inspect the timestamped logs, drill down into granular changes, or export reports to Excel.

πŸ—ΊοΈ Process Flow: Logging to Forensic Analysis

graph TD
    Trigger["User Modifies or Deletes Record"] --> Check{"Is Audit Trail Enabled in System Parameters?"}
    Check -- Yes --> Prompt["Mandatory 'Reason to Modify' Prompt"]
    Prompt --> Save["Record Saved + Audit Trail Entry Logged"]
    Check -- No --> SimpleSave["Record Saved (Standard Save Without Audit Log)"]
    Save --> Index["View Audit Trail Index (/audittrailindex)"]
    Index --> Details["Drill-Down: Field-Level Changes (/audittraildetails/{id})"]
    Index --> Export["Export Forensic Report to Excel (/audittrailxloption)"]
    
    style Save fill:#d4edda,stroke:#28a745,stroke-width:2px
    style Details fill:#cce5ff,stroke:#004085,stroke-width:1px

βœ… Prerequisites Checklist

Before you can effectively use the Audit Trail module, ensure:

  • System Parameter: The parameter AuditTrail has its condition set to “Yes” in System Parameters. (If set to “No”, the index screen displays an advisory notice to contact your System Administrator, and Excel export is deactivated).
  • User Role Permissions: Assigned roles have AuditTrailDetails permission (for index and drill-down views) and AuditTrailReport permission (for Excel report generation).
  • Active Financial Year: For Excel exports, document dates fall within the active fiscal year date range.

1. Introduction πŸ“

The Audit Trail module is a specialized forensic tool designed to maintain a transparent history of every significant action within the ERP. It captures the “Who, What, When, and Why” of every data change.

ℹ️

In the overall business flow:

  1. It runs in the background of transactions and masters (Sales Invoices, Bills, Journal Vouchers, Accounts, Debit/Credit Notes, Party Masters).
  2. It acts as a mandatory checkpoint requiring user justification during modifications and deletions.
  3. It serves as the primary source of truth for Internal and External Compliance Audits.

Typically, this module is used by Compliance Officers, Internal Auditors, Finance Heads, and System Administrators to ensure complete transparency and data integrity.


2. Getting Started with Audit Trail πŸš€

Accessing the Module

Navigate to System Tools > Audit Trail (/audittrailindex) from the main navigation menu.

The Index Page

The Index Page provides a searchable, filterable overview of all captured events:

  • Audit Trail No.: A unique reference number for every log entry. Click this number to open the full drill-down view.
  • Doc Type: The functional module or document involved (e.g., Accounts, Bill, Debit Credit, Invoice, Party Master, Voucher).
  • Year/Doc No: Links the entry to the document’s fiscal year and serial number (formatted as YYYY-YY/XXXXXX). Entries affecting mass records appear as "Bulk Operation".
  • Operation: Distinct color-coded status chips indicating the nature of the event:
    • Re-Create (Green Chip): Document re-creation or initial insertion.
    • Modify Main / Modify Line (Amber Chip): Edits to header data or item line rows.
    • Delete Main / Delete Line (Red Chip): Permanent removal of headers or line entries.
  • Performed By: User avatar showing the operator’s first initial alongside their login username.
  • Performed Date: Exact timestamp (dd-MMM-yy HH:mm) paired with a relative time indicator (e.g., “just now”, “15 mins ago”, “2 hours ago”, “3 days ago”).
⚠️
Feature Disabled Alert: If the AuditTrail parameter is inactive (N), the bottom of the grid displays:
To enable this feature, please contact the System Administrator. and the Export To Excel button remains hidden.

3. Drill-Down: Field-Level Audit Details πŸ”

Clicking any Audit Trail No. opens the Audit Trail Details page (/audittraildetails/{id}), structured into three dedicated cards:

A. General Information

Displays top-level document tracking metadata alongside the colored operation badge:

  • Audit Trail No: System sequence identifier.
  • Doc Type: Source transaction type.
  • Year/Doc No: Fiscal year and voucher number.

B. Execution Details

Captures operator accountability:

  • Performed By: User avatar and username of the operator who executed the change.
  • Performed Date: Exact date and time stamp (dd-MMM-yy HH:mm).
  • Notes: The mandatory explanation submitted by the user when saving the modification or deletion.

C. Field-Level Changes

Features multi-expansion accordion panels organized by document level:

  • Main Level Changes: Changes affecting the master/header record.
  • Line Level Changes 1, Line Level Changes 2, etc.: Granular changes affecting individual line-item rows.

Each panel contains a detailed comparison table:

ColumnDescriptionVisual Appearance
FieldUser-friendly name of the attributeBold text (DisplayName)
Old ValueValue before the changeMuted secondary color
New ValueValue after the changeBold green text
SourceOriginator of the updateDisplays "User" or "System"

4. Export to Excel (/audittrailxloption) πŸ“Š

For external audits or offline forensic reviews, authorized users can download an audit report:

  1. Click the green Export To Excel button on the Audit Trail index.
  2. Select the From Date and To Date:
    • Use the built-in “Today” quick-action button in each date picker for immediate selection.
    • Date Boundary Lock: Dates are automatically restricted to the active financial year (fyStart to fyEnd) and cannot be selected into the future (dt > DateTime.Now).
  3. Click Print to generate the spreadsheet.
  4. The system produces a formatted file named Audit_Trail_Report.xlsx:
    • Company name, report title, generation date, and selected date range in the header.
    • Columns include: Trail No, Document Type, Document Level, Year, Ref No/Code, Operation (INSERT / UPDATE / DELETE), Field Name, Old Value, New Value, User, Date & Time, and Notes.
    • Frozen header row, autowidened columns, and text-wrapping enabled on change values and notes for clean printing.

5. Validations and Business Rules ⚠️

Validation / ConditionTrigger PointSystem Rule & Feedback
Mandatory Audit NotesModifying or deleting any existing record while Audit Trail is active.Cannot save if left blank. Shows validation error: "Audit Trail Notes must be filled".
Invalid Date RangeExporting Audit Trail where To Date < From Date.Blocks generation and displays: "Invalid Date Range".
Fiscal Year BoundariesSelecting dates outside active fiscal year or in the future.Date picker disables invalid dates (dt < fyStart || dt > fyEnd || dt > DateTime.Now).
Inactive System ParameterAccessing index while parameter AuditTrail is set to "N".Disables Excel export button and displays: “To enable this feature, please contact the System Administrator.”
Access Control (Views)Accessing index or details without AuditTrailDetails role.System redirects immediately to /accessdenied/1.
Access Control (Report)Accessing Excel options without AuditTrailReport role.System redirects immediately to /accessdenied/1.
Session IntegrityAccessing pages with mismatched browser session.Redirects immediately to /invaliduser/5.

6. Pre-Settings and Configurations βš™οΈ

  1. System Parameters:
    • Navigate to System Tools > Utilities > System Parameters.
    • Locate the parameter with Short Name AuditTrail.
    • Set Sys Condition to Yes to enforce logging and mandatory reason prompts across the ERP.
  2. Company Master / Details:
    • Review Company Details (/companymstdetails) to verify that Enable Audit Trail Feature reflects “Yes”.
  3. User Group & Role Management:
    • Under User Group Management, allocate AuditTrailDetails to auditors, department heads, and managers who need to inspect logs.
    • Allocate AuditTrailReport to users authorized to export audit files.

7. Best Practices & Operational Tips πŸ’‘

  • Meaningful Justifications: Encourage staff to provide precise reasons (e.g., “Rate revised as per Vendor Email ref #482 dated 14-Oct”) rather than vague words like “Updated” or “Corrected”.
  • Regular Deletion Audits: Periodically filter the index for the red Delete Main and Delete Line chips to investigate unexpected record purges and safeguard against accidental data loss.
  • Cross-User Verification: When reviewing discrepancies in financial vouchers, inspect the Performed By user on line modifications to see if someone other than the original creator revised values.
  • Archival Compliance: Generate and save quarterly Excel exports to your internal document repository as permanent audit trail evidence for statutory and ISO compliance.

8. Critical Observations πŸ”

⚠️
  • Immutable Logs: Once recorded, audit trail entries cannot be modified, deleted, or cleared by any user, including System Administrators.
  • Selective Property Tracking: The forensic engine tracks only specific business-critical fields defined in the system metadata, eliminating noise from system maintenance timestamps and display flags.