Skip to content

Commit

Permalink
Merge pull request #842 from resilient-tech/audit-trail-report
Browse files Browse the repository at this point in the history
  • Loading branch information
vorasmit authored Jul 26, 2023
2 parents da09f00 + e1eaa54 commit ee46f7c
Show file tree
Hide file tree
Showing 7 changed files with 460 additions and 1 deletion.
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

0 comments on commit ee46f7c

Please sign in to comment.