@ -202,10 +202,15 @@ def json_grouping(args, language):
subsys [ ' Config Kilometer ' ] = kms
subsys [ ' Config Kilometer ' ] = kms
for k in docs_child :
for k in docs_child :
if k [ ' variant_mapping ' ] == d and k [ ' system ' ] == i and k [ ' sub_system ' ] == j :
if k [ ' variant_mapping ' ] == d and k [ ' system ' ] == i and k [ ' sub_system ' ] == j :
proc_details = frappe . db . sql ( ''' select procedure_name, step_name, content_type, GROUP_CONCAT(case when content_type= ' Link ' Then system_id else content end) as content,
# proc_details = frappe.db.sql('''select procedure_name, step_name, content_type, GROUP_CONCAT(case when content_type='Link' Then system_id else content end) as content,
GROUP_CONCAT ( file ) as file , GROUP_CONCAT ( DISTINCT idx order by idx ) as display_order , idx from { } . tabProcedure_Details
# GROUP_CONCAT(file) as file,GROUP_CONCAT(DISTINCT idx order by idx) as display_order, idx from {}.tabProcedure_Details
where parent = ' {} ' group by procedure_name , step_name , content_type , content order by idx asc ; ''' .format(
# where parent ='{}' group by procedure_name,step_name,content_type,content order by idx asc; '''.format(
current_db_name , k [ ' procedure_link ' ] ) , as_dict = True )
# current_db_name, k['procedure_link']), as_dict=True)
proc_details = frappe . db . sql ( ''' select procedure_name, step_name, content_type, content,
file , idx as display_order from { } . tabProcedure_Details
where parent = ' {} ' order by idx asc ; ''' .format(current_db_name, k[ ' procedure_link ' ]), as_dict=True)
proc_data = get_parent_map (
proc_data = get_parent_map (
proc_details , ' procedure_name ' )
proc_details , ' procedure_name ' )
total_count + = len ( proc_data )
total_count + = len ( proc_data )