Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: audit-trail-report #842

Merged
merged 4 commits into from
Jul 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Empty file.
Empty file.
62 changes: 62 additions & 0 deletions india_compliance/audit_trail/report/audit_trail/audit_trail.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
// Copyright (c) 2023, Resilient Tech and contributors
// For license information, please see license.txt
/* eslint-disable */

frappe.query_reports["Audit Trail"] = {
filters: [
{
fieldname: "report",
label: __("Report"),
fieldtype: "Select",
options: "Detailed\nSummary by Doctype\nSummary by User",
default: "Detailed",
reqd: 1,
},
{
label: __("Select Day"),
fieldtype: "Select",
fieldname: "date_option",
default: "Today",
options:
"Today\nYesterday\nThis Week\nThis Month\nThis Quarter\nThis Year\nLast Week\nLast Month\nLast Quarter\nLast Year\nCustom",
reqd: 1,
on_change: function (report) {
let selected_value = report.get_filter_value("date_option");
let date_range = report.get_filter("date_range");

if (selected_value === "Custom") {
date_range.df.hidden = false;
} else {
date_range.df.hidden = true;
}
date_range.refresh();
report.refresh();
},
},
{
fieldname: "date_range",
label: __("Select Date"),
fieldtype: "DateRange",
hidden: true,
},
{
fieldname: "user",
label: __("User"),
fieldtype: "Link",
default: "",
options: "User",
},
{
fieldname: "doctype",
label: __("Based On"),
fieldtype: "Autocomplete",
default: "",
get_query: function () {
return {
query: "india_compliance.audit_trail.utils.get_audit_trail_doctypes",
filters: {},
};
},
},
],
};
28 changes: 28 additions & 0 deletions india_compliance/audit_trail/report/audit_trail/audit_trail.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"add_total_row": 0,
"columns": [],
"creation": "2023-07-14 18:21:29.788627",
"disabled": 0,
"docstatus": 0,
"doctype": "Report",
"filters": [],
"idx": 0,
"is_standard": "Yes",
"modified": "2023-07-25 16:35:23.470355",
"modified_by": "Administrator",
"module": "Audit Trail",
"name": "Audit Trail",
"owner": "Administrator",
"prepared_report": 0,
"ref_doctype": "Version",
"report_name": "Audit Trail",
"report_type": "Script Report",
"roles": [
{
"role": "System Manager"
},
{
"role": "Administrator"
}
]
}
Loading
Loading