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=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_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`