Skip to content

Commit

Permalink
feat: utility report to identify invalid ledger entries
Browse files Browse the repository at this point in the history
  • Loading branch information
ruthra-kumar committed Sep 9, 2024
1 parent d8b988d commit 832c4aa
Show file tree
Hide file tree
Showing 4 changed files with 84 additions and 0 deletions.
Empty file.
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,
// },
],
};
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
}
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],
]

0 comments on commit 832c4aa

Please sign in to comment.