{
	"name": "form/nc/report/nc-report/delivery-reliability/query/delivery-reliability-purchase.json",
	"table": [
		{
			"record_type": ["purchase"],
			"table": "order_row"
		},
		{
			"record_type": ["purchase"],
			"table": "order"
		},
		{
			"record_type": ["supplier"],
			"table": "company"
		}
	],
	"parameter": {
		"show_sql": false,
		"order_row_state_delivered": "plugin/nc-calc-server/constant.json/order_row_state_delivered",
		"start_date": "2020-01-01",
		"end_date": "2020-01-01",
		"packing_material_type": "plugin/nc-calc-server/constant.json/product_type.packing_material",
		"packing_cost_type": "plugin/nc-calc-server/constant.json/product_type.packing_cost"
	},
	"query": [
		["ordr.delivery_state", "in", "order_row_state_delivered"],
		"and",
		["pr.product_type", "<>", "packing_material_type"],
		"and",
		["pr.product_type", "<>", "packing_cost_type"],
		"and",
		[
			[["ordr.delivery_date", ">=", "start_date"], "and", ["ordr.delivery_date", "<=", "end_date"]],
			"or",
			[["ordr.actual_delivery_date", ">=", "start_date"], "and", ["ordr.actual_delivery_date", "<=", "end_date"]],
			"or",
			[["ordr.confirmed_delivery_date", ">=", "start_date"], "and", ["ordr.confirmed_delivery_date", "<=", "end_date"]],
			"or",
			[["ordr.json_data.first_confirmed_delivery_date", ">=", "start_date"], "and", ["ordr.json_data.first_confirmed_delivery_date", "<=", "end_date"]]
		]
	]
}
