-
Notifications
You must be signed in to change notification settings - Fork 7.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: utility report to identify invalid ledger entries
(cherry picked from commit 832c4aa)
- Loading branch information
1 parent
e8aae50
commit 37b8715
Showing
4 changed files
with
84 additions
and
0 deletions.
There are no files selected for viewing
Empty file.
13 changes: 13 additions & 0 deletions
13
erpnext/accounts/report/invalid_ledger_entries/invalid_ledger_entries.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
// Copyright (c) 2024, Frappe Technologies Pvt. Ltd. and contributors | ||
// For license information, please see license.txt | ||
|
||
frappe.query_reports["Invalid Ledger Entries"] = { | ||
filters: [ | ||
// { | ||
// "fieldname": "my_filter", | ||
// "label": __("My Filter"), | ||
// "fieldtype": "Data", | ||
// "reqd": 1, | ||
// }, | ||
], | ||
}; |
23 changes: 23 additions & 0 deletions
23
erpnext/accounts/report/invalid_ledger_entries/invalid_ledger_entries.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
{ | ||
"add_total_row": 0, | ||
"columns": [], | ||
"creation": "2024-09-09 12:31:25.295976", | ||
"disabled": 0, | ||
"docstatus": 0, | ||
"doctype": "Report", | ||
"filters": [], | ||
"idx": 0, | ||
"is_standard": "Yes", | ||
"letterhead": null, | ||
"modified": "2024-09-09 12:31:25.295976", | ||
"modified_by": "Administrator", | ||
"module": "Accounts", | ||
"name": "Invalid Ledger Entries", | ||
"owner": "Administrator", | ||
"prepared_report": 0, | ||
"ref_doctype": "GL Entry", | ||
"report_name": "Invalid Ledger Entries", | ||
"report_type": "Script Report", | ||
"roles": [], | ||
"timeout": 0 | ||
} |
48 changes: 48 additions & 0 deletions
48
erpnext/accounts/report/invalid_ledger_entries/invalid_ledger_entries.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
# Copyright (c) 2024, Frappe Technologies Pvt. Ltd. and contributors | ||
# For license information, please see license.txt | ||
|
||
# import frappe | ||
from frappe import _ | ||
|
||
|
||
def execute(filters: dict | None = None): | ||
"""Return columns and data for the report. | ||
This is the main entry point for the report. It accepts the filters as a | ||
dictionary and should return columns and data. It is called by the framework | ||
every time the report is refreshed or a filter is updated. | ||
""" | ||
columns = get_columns() | ||
data = get_data() | ||
|
||
return columns, data | ||
|
||
|
||
def get_columns() -> list[dict]: | ||
"""Return columns for the report. | ||
One field definition per column, just like a DocType field definition. | ||
""" | ||
return [ | ||
{ | ||
"label": _("Column 1"), | ||
"fieldname": "column_1", | ||
"fieldtype": "Data", | ||
}, | ||
{ | ||
"label": _("Column 2"), | ||
"fieldname": "column_2", | ||
"fieldtype": "Int", | ||
}, | ||
] | ||
|
||
|
||
def get_data() -> list[list]: | ||
"""Return data for the report. | ||
The report data is a list of rows, with each row being a list of cell values. | ||
""" | ||
return [ | ||
["Row 1", 1], | ||
["Row 2", 2], | ||
] |