Skip to content

Commit

Permalink
feat: Audit-trail-report
Browse files Browse the repository at this point in the history
  • Loading branch information
asu1609 committed Jul 25, 2023
1 parent 1eedbbd commit 51fb887
Show file tree
Hide file tree
Showing 6 changed files with 458 additions and 0 deletions.
1 change: 1 addition & 0 deletions india_compliance/audit_trail/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ def is_audit_trail_enabled():
return bool(frappe.db.get_single_value("Accounts Settings", "enable_audit_trail"))


@frappe.whitelist()
def get_audit_trail_doctypes():
return set(frappe.get_hooks("audit_trail_doctypes"))

Expand Down
Empty file.
Empty file.
62 changes: 62 additions & 0 deletions india_compliance/vat_india/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",
reqd: 1,
},
{
label: __("Select Day"),
fieldtype: "Select",
fieldname: "date",
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){
var selected_value = report.get_filter_value("date");
var 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",
//reqd: 1
},
{
fieldname : "doctype",
label:__("Based On"),
fieldtype: "Autocomplete",
default: "",
"get_query": function () {
return {
query: "india_compliance.audit_trail.utils.get_audit_trail_doctypes",
filters: {}
};
}
},
]
};
29 changes: 29 additions & 0 deletions india_compliance/vat_india/report/audit_trail/audit_trail.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"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",
"letterhead": null,
"modified": "2023-07-14 18:21:43.133641",
"modified_by": "Administrator",
"module": "VAT India",
"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 51fb887

Please sign in to comment.