Browse Source

app log report renamed

master
Ubuntu 3 years ago
parent
commit
b3d0f729ac
  1. 0
      smart_service/add_ons/report/applog_translation/__init__.py
  2. 28
      smart_service/add_ons/report/applog_translation/applog_translation.js
  3. 26
      smart_service/add_ons/report/applog_translation/applog_translation.json
  4. 44
      smart_service/add_ons/report/applog_translation/applog_translation.py

0
smart_service/add_ons/report/applog_translation/__init__.py

28
smart_service/add_ons/report/applog_translation/applog_translation.js

@ -0,0 +1,28 @@
// Copyright (c) 2022, Hard n Soft Technologies Pvt Ltd and contributors
// For license information, please see license.txt
/* eslint-disable */
//frappe.require("assets/erpnext/js/financial_statements.js", function() {
frappe.query_reports["Applog Translation"] = {
"filters": [
{
"fieldname":"from_date",
"label": __("From Date"),
"fieldtype": "Date",
default: frappe.datetime.year_start(),
"reqd": 0
},
{
"fieldname":"to_date",
"label": __("To Date"),
"fieldtype": "Date",
default: frappe.datetime.year_end(),
"reqd": 0
},
]
};

26
smart_service/add_ons/report/applog_translation/applog_translation.json

@ -0,0 +1,26 @@
{
"add_total_row": 0,
"columns": [],
"creation": "2022-01-10 10:44:02.371299",
"disable_prepared_report": 0,
"disabled": 0,
"docstatus": 0,
"doctype": "Report",
"filters": [],
"idx": 0,
"is_standard": "Yes",
"modified": "2022-05-17 16:00:53.399914",
"modified_by": "Administrator",
"module": "Add Ons",
"name": "Applog Translation",
"owner": "Administrator",
"prepared_report": 0,
"ref_doctype": "App Log",
"report_name": "Applog Translation",
"report_type": "Script Report",
"roles": [
{
"role": "System Manager"
}
]
}

44
smart_service/add_ons/report/applog_translation/applog_translation.py

@ -0,0 +1,44 @@
# Copyright (c) 2013, Hard n Soft Technologies Pvt Ltd and contributors
# For license information, please see license.txt
# import frappe
from __future__ import unicode_literals
import frappe
from frappe.utils import cstr, cint, getdate
from frappe import msgprint, _
def execute(filters=None):
columns, data = [], []
columns = get_columns()
data = get_data(filters)
return columns, data
def get_data(filters):
data = frappe.db.sql("""select dealer.zone,au.user_id,concat_ws(' ',au.first_name,au.last_name) as user_name,dealer.dealer_code,dealer.area,dealer.dealer_name,ad.os,ad.os_version,
al.device,ad.device_id,ad.app_current_version,al.type,al.date_time_stamp,al.creation
from `tabApp Log` al,`tabApp Device` ad,`tabApp Users` au,`tabApp Dealer` dealer
where
al.device = ad.name and al.user = au.name and au.dealer = dealer.name and
(al.creation between %s and %s)""",(filters.get('from_date'), filters.get('to_date')), as_dict=1)
return data
def get_columns():
columns = [
{"label": _("<b>Zone</b>"), "fieldname": "zone", "fieldtype": "Data", "width": 150},
{"label": _("<b>Dealer Location</b>"), "fieldname": "area", "fieldtype":"Data","width": 150},
{"label": _("<b>Dealer Code</b>"), "fieldname": "dealer_code", "fieldtype": "Data", "width": 150},
{"label": _("<b>Dealer Name</b>"), "fieldname": "dealer_name", "fieldtype":"Data","width": 300},
{"label": _("<b>User ID</b>"), "fieldname": "user_id", "fieldtype": "Data", "width": 150},
{"label": _("<b>User Name</b>"), "fieldname": "user_name", "fieldtype": "Data", "width": 150},
{"label": _("<b>Device ID</b>"), "fieldname": "device_id", "fieldtype": "Data", "width": 150},
{"label": _("<b>Device OS</b>"), "fieldname": "os", "fieldtype": "Data", "width": 150},
{"label": _("<b>OS Version</b>"), "fieldname": "os_version", "fieldtype": "Data", "width": 150},
{"label": _("<b>Activity Type</b>"), "fieldname": "type", "fieldtype": "Data","width": 150},
{"label": _("<b>Activity Date</b>"), "fieldname": "date_time_stamp", "fieldtype": "DateTime","width": 150},
{"label": _("<b>App Version No</b>"), "fieldname": "app_current_version", "fieldtype": "Data", "width": 150},
{"label": _("<b>Installation</b>"), "fieldname": "device", "fieldtype": "Data", "width": 150},
]
return columns
Loading…
Cancel
Save