Skip to content

Allow Edit/Delete of Entry Even After Approval in Merciglobal Cloud ERP¶

In Merciglobal Cloud ERP, by default, once an entry is approved, it is locked from further edits or deletions to maintain data integrity. However, certain business scenarios may require an override of this restriction.

This guide provides a clean and developer-friendly method to allow editing or deleting an entry even after it has been approved.


Objective¶

Enable the functionality to edit or delete entries after approval for specific modules within Merciglobal Cloud ERP.


How It Works¶

The ERP framework allows developers to override default edit/delete restrictions using a specific hook function. By implementing a custom logic function in the backend, developers can control this behavior.


Implementation Steps¶

1. Locate libfuncs.php¶

Go to the corresponding module directory and open the file named libfuncs.php.

2. Declare the Function¶

Insert the following function in libfuncs.php:

function <tablename>_editdelete_after_approval($mode='edit/delete', $id=0) {
    // $mode can be 'edit' or 'delete'. Case-sensitive.
    // $id is the ID of the entry you wish to perform the operation on.

    return true;  // Set to true to ALLOW edit/delete after approval.
                  // Return false to RESTRICT edit/delete after approval.
}

3. Replace <tablename>¶

Substitute <tablename> with the actual name of the table or module you're customizing. Example:

function sales_invoice_editdelete_after_approval($mode='edit', $id=0) {
    return true;
}

🚨 Important Notes¶

  • This function must be explicitly declared per module. There is no global override.
  • Ensure proper access control and logging when allowing such critical operations.
  • Use this function cautiously as it can impact the audit trail and business validations.

💬 Example Use Cases¶

  • Rectifying data input errors post-approval
  • Admin override for urgent corrections
  • Custom workflow processes where approvals don’t restrict edits

📌 Summary¶

By using the editdelete_after_approval() function inside libfuncs.php, developers can enable or restrict the ability to edit or delete records post-approval in Merciglobal Cloud ERP. This feature adds flexibility for special business cases while maintaining control through conditional logic.


Stay compliant. Stay in control. Stay Merci. ✅