{
	"name": "plugin/nc-calc-server/query/order_row-sales-estimate-need.json",
	"table": [
		{
			"record_type": ["sales"],
			"table": "order_row"
		},
		{
			"record_type": ["sales"],
			"table": "order"
		},
		{
			"record_type": [""],
			"table": "product"
		}
	],
	"parameter": {
		"show_sql": true,
		"remove_empty_aggregate_row": true,
		"aggregate": { "sum": ["ordr.delivery_amount"], "group by": ["ordr.product_id", "ordr.actual_delivery_date"] },
		"estimate_need_start_date": "2024-01-01",
		"estimate_need_end_date": "2026-01-01",
		"order_type_order": "plugin/nc-calc-server/constant.json/order_type_order",
		"order_row_state_delivered": "plugin/nc-calc-server/constant.json/order_row_state_delivered"
	},
	"field": ["ordr.product_id", "ordr.delivery_state", "ordr.delivery_amount", "ordr.waiting_for_delivery", "ordr.actual_delivery_date"],
	"query": [
		["ordr.actual_delivery_date", ">=", "estimate_need_start_date"],
		"and",
		["ordr.actual_delivery_date", "<", "estimate_need_end_date"],
		"and",
		["ord.order_type", "in", "order_type_order"],
		"and",
		["ordr.delivery_state", "in", "order_row_state_delivered"]
	]
}
