Browse Source

Report date display in desc order in Feedback,installation, login, model hit n model download report

master
administrator 11 months ago
parent
commit
d41e17f04f
  1. 2
      smart_service/add_ons/report/feedback_report/feedback_report.py
  2. 22
      smart_service/add_ons/report/installation_report/installation_report.py
  3. 2
      smart_service/add_ons/report/login_report/login_report.py
  4. 2
      smart_service/add_ons/report/model_download_report/model_download_report.py
  5. 2
      smart_service/add_ons/report/model_hit_report/model_hit_report.py

2
smart_service/add_ons/report/feedback_report/feedback_report.py

@ -20,7 +20,7 @@ def get_data(filters):
uf.description,uf.feedback_type,dealer.dealer_code,dealer.zone,dealer.dealer_name,uf.closure_date,uf.closed_by, uf.description,uf.feedback_type,dealer.dealer_code,dealer.zone,dealer.dealer_name,uf.closure_date,uf.closed_by,
dealer.area,au.user_id,concat_ws(' ',au.first_name,au.last_name) as user_name from {0}.`tabUser Feedback` uf,{0}.`tabApp Dealer` dealer,{0}.`tabApp Users` au dealer.area,au.user_id,concat_ws(' ',au.first_name,au.last_name) as user_name from {0}.`tabUser Feedback` uf,{0}.`tabApp Dealer` dealer,{0}.`tabApp Users` au
where uf.user_name = au.name and where uf.user_name = au.name and
(date(uf.modified) between '{1}' and '{2}') group by uf.name""".format(current_db_name,filters.get('from_date'), filters.get('to_date')), as_dict=1) (date(uf.modified) between '{1}' and '{2}') group by uf.name ORDER BY uf.date DESC""".format(current_db_name,filters.get('from_date'), filters.get('to_date')), as_dict=1)
if data: if data:
return data return data
else: else:

22
smart_service/add_ons/report/installation_report/installation_report.py

@ -21,7 +21,7 @@ def get_data(filters):
from {0}.`tabApp Log` al, {0}.`tabApp Device` ad, {0}.`tabApp Users` au, {0}.`tabApp Dealer` dealer from {0}.`tabApp Log` al, {0}.`tabApp Device` ad, {0}.`tabApp Users` au, {0}.`tabApp Dealer` dealer
where where
al.device = ad.name and al.user = au.name and au.dealer = dealer.name and (al.type = 'Installed' or al.type = 'Reinstalled') and al.device = ad.name and al.user = au.name and au.dealer = dealer.name and (al.type = 'Installed' or al.type = 'Reinstalled') and
(date(al.modified) between '{1}' and '{2}')""".format(current_db_name,filters.get('from_date'), filters.get('to_date')), as_dict=1) (date(al.modified) between '{1}' and '{2}') ORDER BY ad.last_login DESC""".format(current_db_name,filters.get('from_date'), filters.get('to_date')), as_dict=1)
if data: if data:
return data return data
@ -44,23 +44,3 @@ def get_columns():
{"label": _("<b>App Last Accessed Date</b>"), "fieldname": "date", "fieldtype": "DateTime","width": 200} {"label": _("<b>App Last Accessed Date</b>"), "fieldname": "date", "fieldtype": "DateTime","width": 200}
] ]
return columns return columns
# def get_columns():
# columns = [
# {"label": _("<b>Zone</b>"), "fieldname": "zone", "fieldtype": "Data", "width": 100},
# {"label": _("<b>Area Office</b>"), "fieldname": "area", "fieldtype":"Data","width": 150},
# {"label": _("<b>Dealer Code</b>"), "fieldname": "dealer_code", "fieldtype": "Data", "width": 100},
# {"label": _("<b>Dealer Name</b>"), "fieldname": "dealer_name", "fieldtype":"Data","width": 150},
# {"label": _("<b>Installation</b>"), "fieldname": "device", "fieldtype": "Data","width": 100},
# {"label": _("<b>Device</b>"), "fieldname": "device_type", "fieldtype": "Data","width": 100},
# {"label": _("<b>Device ID</b>"), "fieldname": "device_id", "fieldtype": "Data", "width": 100},
# {"label": _("<b>Device OS</b>"), "fieldname": "os", "fieldtype": "Data", "width": 100},
# {"label": _("<b>OS Version</b>"), "fieldname": "os_version", "fieldtype": "Data", "width": 100},
# {"label": _("<b>User ID</b>"), "fieldname": "user_id", "fieldtype": "Data", "width": 100},
# {"label": _("<b>User Name</b>"), "fieldname": "user_name", "fieldtype": "Data", "width": 100},
# {"label": _("<b>Activity Type</b>"), "fieldname": "type", "fieldtype": "Data","width": 100},
# {"label": _("<b>App Installation Date</b>"), "fieldname": "date_time_stamp", "fieldtype": "DateTime","width": 200},
# {"label": _("<b>App Last Accessed Date</b>"), "fieldname": "date", "fieldtype": "DateTime","width": 200},
# {"label": _("<b>App Version No</b>"), "fieldname": "app_current_version", "fieldtype": "Data", "width": 150},
# ]
# return columns

2
smart_service/add_ons/report/login_report/login_report.py

@ -41,7 +41,7 @@ def get_data(filters):
and mal.user=au.name and mal.user=au.name
and au.dealer = dealer.name and au.dealer = dealer.name
and al.device = ad.name and al.device = ad.name
and mal.date_time_stam=al.date_time_stamp; """.format(current_db_name = current_db_name,from_date= from_date,to_date=to_date), as_dict=1) and mal.date_time_stam=al.date_time_stamp ORDER BY date DESC; """.format(current_db_name = current_db_name,from_date= from_date,to_date=to_date), as_dict=1)
if data: if data:
return data return data
else: else:

2
smart_service/add_ons/report/model_download_report/model_download_report.py

@ -27,7 +27,7 @@ def get_data(filters):
login_name,concat(first_name,' ',last_name) as user_name login_name,concat(first_name,' ',last_name) as user_name
FROM `tabModel Hit` mh FROM `tabModel Hit` mh
left join `tabApp Users` au on mh.user_id = au.user_id left join `tabApp Users` au on mh.user_id = au.user_id
WHERE download_vehicle_id='{1}' and (date(date) between '{2}' and '{3}') order by download_vehicle_id;""".format(current_db_name, WHERE download_vehicle_id='{1}' and (date(date) between '{2}' and '{3}') order by download_vehicle_id ORDER BY date DESC;""".format(current_db_name,
modelfilter, from_date, to_date), as_dict=1) modelfilter, from_date, to_date), as_dict=1)
for d in data: for d in data:

2
smart_service/add_ons/report/model_hit_report/model_hit_report.py

@ -31,7 +31,7 @@ def get_data(filters):
count(*) as count, user_id, language FROM {0}.`tabModel Usage` WHERE vehicle_id='{1}' and variant_id='{2}' and (date(date) between '{3}' and '{4}') count(*) as count, user_id, language FROM {0}.`tabModel Usage` WHERE vehicle_id='{1}' and variant_id='{2}' and (date(date) between '{3}' and '{4}')
GROUP BY date(date), user_id, module_id, device_id, vehicle_id, variant_id, variant_mapping_id, system_id, sub_system_id, procedure_id, steps_id, GROUP BY date(date), user_id, module_id, device_id, vehicle_id, variant_id, variant_mapping_id, system_id, sub_system_id, procedure_id, steps_id,
language language
order by module_id,vehicle_id, variant_id, variant_mapping_id, system_id, sub_system_id, procedure_id, steps_id,language; order by module_id,vehicle_id, variant_id, variant_mapping_id, system_id, sub_system_id, procedure_id, steps_id,language ORDER BY date DESC;
""".format(current_db_name, modelfilter, variantfilter[1], from_date, to_date), as_dict=1) """.format(current_db_name, modelfilter, variantfilter[1], from_date, to_date), as_dict=1)
for d in data: for d in data:

Loading…
Cancel
Save