Skip to content

[Backport version-16-hotfix] feat: add Material Request Procurement Audit report - #161

Open
github-actions[bot] wants to merge 4 commits into
version-16-hotfixfrom
backport-159-to-version-16-hotfix
Open

github-actions[bot] wants to merge 4 commits into
version-16-hotfixfrom
backport-159-to-version-16-hotfix

Conversation

@github-actions

Copy link
Copy Markdown

Backport of #159 to version-16-hotfix.


Summary

Adds a standard ERPNext v15 Script Report, Material Request Procurement Audit, to provide a complete audit trail from Material Request through ordering and receipt.

Unlike the standard open-request style reports, this report deliberately keeps fully ordered and fully received Material Request Items visible so historical procurement can be audited.

What the report shows

  • Requested quantity from submitted Purchase-type Material Requests
  • ERPNext-maintained ordered quantity
  • Independently reconstructed quantity from submitted Purchase Orders
  • Pending quantity to order
  • ERPNext-maintained received quantity
  • Accepted quantity traced from submitted Purchase Receipts
  • Direct stock receipt quantity from submitted Purchase Invoices with update_stock = 1
  • Rejected quantity
  • Pending quantity to receive
  • Requested quantity not yet received
  • PO and receipt audit differences
  • Suppliers, Purchase Orders, Purchase Receipts, and stock Purchase Invoices
  • Procurement lifecycle status
  • Audit exception messages

All quantity comparisons are performed in Stock UOM.

Audit controls

The report compares ERPNext's maintained ordered_qty / received_qty values against independently traced submitted procurement documents. This helps identify broken links, over-ordering, over-receipt, rejected stock, or quantity inconsistencies.

Stock Purchase Invoices that already reference a Purchase Receipt are excluded from the direct-PI receipt trace to prevent double-counting the same physical receipt.

Filters

  • Company
  • Semantic MR date range (Today, Week, Month, Year, custom Period, or All)
  • Material Request
  • Item
  • Warehouse
  • Project
  • Procurement Status
  • Show Only Audit Exceptions

Files

  • material_request_procurement_audit.py
  • material_request_procurement_audit.js
  • material_request_procurement_audit.json
  • report package __init__.py

Validation

  • Python syntax compilation passed
  • JavaScript syntax check passed
  • Report JSON validation passed
  • Branch comparison: only the new report package is changed

Target: version-15-hotfix

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant