mirror of
https://github.com/frappe/erpnext.git
synced 2026-03-19 18:25:32 +00:00
feat: utility report to identify invalid ledger entries
(cherry picked from commit 832c4aaf82)
This commit is contained in:
@@ -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,
|
||||||
|
// },
|
||||||
|
],
|
||||||
|
};
|
||||||
@@ -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
|
||||||
|
}
|
||||||
@@ -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],
|
||||||
|
]
|
||||||
Reference in New Issue
Block a user