{
  "name": "dialog/lead_time/lead_time_init.json",
	"rec": "dialog/lead_time/lead_time_rec.json",
	"data_query": [
		{"run": [["showSql", [true]]]},
		{"tag": "ordr", "query": "query/manager/order/order_row/sales/sales_lead_time_grid.json"},
		{"run": [["data.ordr", "=", "data.ordr.data"]]},
		{"run": [["setRecordArrConcatField", ["data.ordr", "order_with_row", ["sor_sales_order_id", ".", "sor_row_number"]]]]},
		{"run": [["parameter.order_with_row", "=", ["arrayUnique", ["data.ordr", "order_with_row"]]]]},
		{"tag": "pro_all", "query": "query/manager/product/production_order/lead_time_grid.json"},
		{"run": [["data.pro", "=", ["reduce", ["leadTimeProData", "data.pro_all.data"]]]]},
		{"run": [[["map", ["leadTimeOrdrData", "data.ordr", "data.pro"]]]]},
    {"run": [["showSql", [false]]]}
	],

	"data_queryX": [
	
		{"run": [["printTable", ["data.pro_all", "*** lead time rec : "]]]},
		{"run": [["printTable", ["data.pro", "*** lead time rec : "]]]},
		{"run": [["setRecordArrConcatField", ["data.pro", "order_with_row", ["wo_sales_order_id", ".", "wo_sales_order_row_id"]]]]},

		{"run": [["ordr", "=", "data.ordr.data"]]},
    {"tag": "sales_order_row_qry", "query": "query/af/document/document_query_sales_order_row.json"},
    {"run": [["parameter.product2", "=", ["reduce", ["arrayFirstKey", "data.sales_order_row_qry.data", "pr_product_id", ""]]]]},
    {"run": [["if", ["parameter.product2", "<>", ""], [["parameter.product", "=", "parameter.product2"]]]]},
    {"run": [["parameter.link1", "=", ["map", ["documentLink1", "data.sales_order_row_qry.data", "sor_record_id", "sor_"]]]]},
    {"tag": "sales_order_row", "query": "query/af/document/document_query_link1.json", "columns": "output/af/document/document_column.json"},
    {"run": [["parameter.link1", "=", ["map", ["documentLink1", "data.sales_order_row_qry.data", "so_record_id", "so_"]]]]}    
  ]
}
