diff --git a/smart_service/add_ons/report/model_download_report/model_download_report.py b/smart_service/add_ons/report/model_download_report/model_download_report.py
index a397f3b..0887f61 100644
--- a/smart_service/add_ons/report/model_download_report/model_download_report.py
+++ b/smart_service/add_ons/report/model_download_report/model_download_report.py
@@ -21,21 +21,20 @@ def get_data(filters):
from_date=filters['from_date']
to_date=filters['to_date']
modelfilter=filters['model']
- # try:
- # vId=frappe.db.sql("""SELECT myid FROM _d6463952657fa86c.tabVehicle where vehicle='{0}';""".format(modelfilter), as_dict=1)
- # vId=vId[-1]
- # vId=vId['myid']
- # except:
- # frappe.msgprint('Vehicle ID Mismatching.')
- data = frappe.db.sql("""SELECT date(date) as date, device_id, device_type, app_version, download_vehicle_id, download_vehicle_version, download_vehicle_date, download_vehicle_language_id, download_vehicle_current_version, user_id
- FROM {0}.`tabModel Hit` WHERE download_vehicle_id='{1}' and (date(date) between '{2}' and '{3}');""".format(current_db_name, modelfilter, from_date, to_date), as_dict=1)
+
+ data = frappe.db.sql("""SELECT date(date) as date, device_id, device_type, app_version, download_vehicle_id, download_vehicle_version,
+ download_vehicle_date, download_vehicle_language_id, download_vehicle_current_version, user_id
+ FROM {0}.`tabModel Hit` WHERE download_vehicle_id='{1}' and (date(date) between '{2}' and '{3}') order by download_vehicle_id;""".format(current_db_name,
+ modelfilter, from_date, to_date), as_dict=1)
+
for d in data:
d['download_vehicle_id']=modelfilter
if d['user_id']:
try:
dealer_info=frappe.db.sql("""SELECT dealer FROM {0}.`tabApp Users` where user_id='{1}';""".format(current_db_name, d['user_id']), as_dict=1)
dealer_info=dealer_info[-1]['dealer']
- dealer_details=frappe.db.sql("""SELECT dealer_name,dealer_code,area as location,zone FROM {0}.`tabApp Dealer` where name='{1}';""".format(current_db_name, dealer_info), as_dict=1)
+ dealer_details=frappe.db.sql("""SELECT dealer_name,dealer_code,area as location,zone FROM {0}.`tabApp Dealer`
+ where name='{1}';""".format(current_db_name, dealer_info), as_dict=1)
dealer_details=dealer_details[-1]
d['dealer_code']=dealer_details['dealer_code']
d['dealer_name']=dealer_details['dealer_name']
@@ -53,16 +52,16 @@ def get_data(filters):
def get_columns():
columns = [
{"label": _("Date"), "fieldname": "date", "fieldtype": "Date", "width": 100},
+ {"label": _("Downloaded Vehicle"), "fieldname": "download_vehicle_id", "fieldtype": "Data", "width": 170},
+ {"label": _("Downloaded Version"), "fieldname": "download_vehicle_current_version", "fieldtype": "Data", "width": 150},
+ {"label": _("Downloaded Language"), "fieldname": "download_vehicle_language_id", "fieldtype": "Data", "width": 150},
+ {"label": _("App Version"), "fieldname": "app_version", "fieldtype": "Data", "width": 150},
{"label": _("Zone"), "fieldname": "zone", "fieldtype": "Data", "width": 100},
{"label": _("Area Office"), "fieldname": "area", "fieldtype": "Data", "width": 150},
{"label": _("Dealer Code"), "fieldname": "dealer_code", "fieldtype": "Data", "width": 150},
{"label": _("Dealer Name"), "fieldname": "dealer_name", "fieldtype": "Data", "width": 150},
{"label": _("Device"), "fieldname": "device_id", "fieldtype": "Data", "width": 100},
- {"label": _("Device Type"), "fieldname": "device_type", "fieldtype": "Data", "width": 130},
- {"label": _("Downloaded Vehicle"), "fieldname": "download_vehicle_id", "fieldtype": "Data", "width": 170},
- {"label": _("Downloaded Version"), "fieldname": "download_vehicle_current_version", "fieldtype": "Data", "width": 150},
- {"label": _("Downloaded Language"), "fieldname": "download_vehicle_language_id", "fieldtype": "Data", "width": 150},
- {"label": _("App Version"), "fieldname": "app_version", "fieldtype": "Data", "width": 150}
+ {"label": _("Device Type"), "fieldname": "device_type", "fieldtype": "Data", "width": 130}
]
return columns
\ No newline at end of file
diff --git a/smart_service/add_ons/report/model_hit_report/model_hit_report.py b/smart_service/add_ons/report/model_hit_report/model_hit_report.py
index ab687b5..1c5a4c0 100644
--- a/smart_service/add_ons/report/model_hit_report/model_hit_report.py
+++ b/smart_service/add_ons/report/model_hit_report/model_hit_report.py
@@ -119,22 +119,22 @@ def get_data(filters):
def get_columns():
columns = [
{"label": _("Date"), "fieldname": "date", "fieldtype": "Date", "width": 150},
- {"label": _("Zone"), "fieldname": "zone", "fieldtype": "Data", "width": 150},
- {"label": _("Area Office"), "fieldname": "area", "fieldtype": "Data", "width": 150},
- {"label": _("Dealer Code"), "fieldname": "dealer_code", "fieldtype": "Data", "width": 150},
- {"label": _("Dealer Name"), "fieldname": "dealer_name", "fieldtype": "Data", "width": 150},
- {"label": _("Device"), "fieldname": "device_id", "fieldtype": "Data", "width": 150},
- {"label": _("Device Type"), "fieldname": "device_type", "fieldtype": "Data", "width": 150},
{"label": _("Module"), "fieldname": "module_id", "fieldtype": "Data", "width": 150},
{"label": _("Model"), "fieldname": "vehicle_id", "fieldtype": "Data", "width": 150},
{"label": _("Variant Mapping"), "fieldname": "variant_mapping_id", "fieldtype": "Data", "width": 150},
- {"label": _("Variant"), "fieldname": "variant_id", "fieldtype": "Data", "width": 150},
+ {"label": _("Variant"), "fieldname": "variant_id", "fieldtype": "Data", "width": 80},
{"label": _("System"), "fieldname": "system_id", "fieldtype": "Data", "width": 150},
{"label": _("Sub System"), "fieldname": "sub_system_id", "fieldtype": "Data", "width": 150},
{"label": _("Procedure"), "fieldname": "procedure_id", "fieldtype": "Data", "width": 150},
{"label": _("Steps"), "fieldname": "steps_id", "fieldtype": "Data", "width": 150},
- {"label": _("Language"), "fieldname": "language", "fieldtype": "Data", "width": 150},
- {"label": _("Count"), "fieldname": "count", "fieldtype": "Data", "width": 150}
+ {"label": _("Language"), "fieldname": "language", "fieldtype": "Data", "width": 80},
+ {"label": _("Count"), "fieldname": "count", "fieldtype": "Data", "width": 80},
+ {"label": _("Zone"), "fieldname": "zone", "fieldtype": "Data", "width": 150},
+ {"label": _("Area Office"), "fieldname": "area", "fieldtype": "Data", "width": 150},
+ {"label": _("Dealer Code"), "fieldname": "dealer_code", "fieldtype": "Data", "width": 150},
+ {"label": _("Dealer Name"), "fieldname": "dealer_name", "fieldtype": "Data", "width": 150},
+ {"label": _("Device"), "fieldname": "device_id", "fieldtype": "Data", "width": 150},
+ {"label": _("Device Type"), "fieldname": "device_type", "fieldtype": "Data", "width": 150}
]
return columns
diff --git a/smart_service/apis/addon_api.py b/smart_service/apis/addon_api.py
index 32fbd68..455d697 100644
--- a/smart_service/apis/addon_api.py
+++ b/smart_service/apis/addon_api.py
@@ -257,12 +257,8 @@ def model_hit(args=None, request=None):
val = input_validation(args=args, request=request)
if val != '':
return {"status": 0, "error": "Input parameter Missing: " + val}
- # if args == None and request == None:
- # return {"status": 0, "error": "Parameter's missing: args & request"}
- # if args == None:
- # return {"status": 0, "error": "Parameter missing: args"}
- # if request == None:
- # return {"status": 0, "error": "Parameter missing: request"}
+
+
if args and request:
if args == "model_hit":
try:
diff --git a/smart_service/transactions/report/procedure_report/procedure_report.js b/smart_service/transactions/report/procedure_report/procedure_report.js
index 5caca7b..8b52c4d 100644
--- a/smart_service/transactions/report/procedure_report/procedure_report.js
+++ b/smart_service/transactions/report/procedure_report/procedure_report.js
@@ -126,21 +126,21 @@ frappe.query_reports["Procedure Report"] = {
}
- if(data && String(column.fieldname).slice(3)=='workflow_state'){
- if (value !== undefined){
+ if (data && String(column.fieldname).slice(3) == 'workflow_state') {
+ if (value !== undefined) {
value = `
   ${value} `
- var langCode = String(column.fieldname).slice(0,2)
- var proc = String(data.procedure).slice(0,-2)
- column.link_onclick = "frappe.query_reports['_Procedure Report'].set_route(" + JSON.stringify(proc+langCode) + ")"
+ var langCode = String(column.fieldname).slice(0, 2)
+ var proc = String(data.procedure).slice(0, -2)
+ column.link_onclick = "frappe.query_reports['_Procedure Report'].set_route(" + JSON.stringify(proc + langCode) + ")"
}
}
- if(data && String(column.fieldname).slice(2) == '_active_status'){
- switch(data.indent){
- case 2:
- if(value !== undefined){
+ if (data && String(column.fieldname).slice(2) == '_active_status') {
+ switch (data.indent) {
+ case 2:
+ if (value !== undefined) {
newValue = ""
val = String(value).split(' / ');
switch (val[0]) {
@@ -151,12 +151,12 @@ frappe.query_reports["Procedure Report"] = {
newValue = ` ${val[0]} `
break;
}
- value = newValue +" / "+ ` ${val[1]} `
+ value = newValue + " / " + ` ${val[1]} `
}
break;
case 3:
- column.align= 'center'
- if (value !==undefined){
+ column.align = 'center'
+ if (value !== undefined) {
value = ` ${value}`
}
break;