Browse Source

Test kilometer mapping

master
venkataakhil 1 year ago
parent
commit
c9fa380195
  1. 19
      smart_service/apis/support.py

19
smart_service/apis/support.py

@ -424,3 +424,22 @@ def clear_procedures():
except Exception as e:
return e
@frappe.whitelist(allow_guest=1)
def circular_api():
api = frappe.db.sql(
'''SELECT name,title,status,description,circular_image as FileUrl,valid_till from `tabCircular` WHERE valid_till >='{}' '''.format(
frappe.utils.today()), as_dict=True)
for i in api:
if i["status"] == "Active":
i["status"] = True
else:
i["status"] = False
return api
@frappe.whitelist(allow_guest=1)
def get_kms_mapping(sub_system,variant):
try:
data = frappe.db.sql(f'''SELECT kilometer as kilometer_name, idx as kilometer_IDX, applicable as kilometers_applicable
FROM `tabKilometer Mapping_Items` where sub_systems="{sub_system}" and parent LIKE "{variant}" order by kilometer_IDX;''')
return data
except Exception as e:
return e
Loading…
Cancel
Save