{
	"name": "query/manager/product/product_work/order/fastems_new_order.json",
	"info": "query/manager/product/product_work/order/fastems_new_order.json",
	"table": [
		{
			"record_type": ["schedule"],
			"table": "product_work"
		}
	],
	"database": "4d",
	"parameter": {
		"rough_load_group": "FMS-SOLU",
		"show_sql": false,
		"work_order_open_state": ["EK", "KU", "AL"]
	},
	"field": [
		"prwo.production_lot",
		"prwo.json_data.production_lot__work_ph",
		"prwo.produced_amount",
		"prwo.product_work_state",
		"res.cell_resource_id"
	],
	"filter": [
		[
			"if",
			[
				["not", ["prevRec", "is empty"]],
				"or",
				[
					["rec.res.cell_resource_id", "<>", "fmsPrf.rough_load_group"]
				]
			],
			[
				["prevRec", "=", "rec"]
			],
			"else",
			[
				["if", [["prevRec.prwo.production_lot", "=", "rec.prwo.production_lot"], "and", ["prevRec.prwo.product_work_state", "<", "1"], "and", ["prevRec.prwo.produced_amount", ">", "0"]], [["filter_value", "=", "true"]]]
			]
		],
		["filter_value", "=", "false"]
	],
	"info2": "NOTE: parameters to this query comes from form/manager/fastems/fastems_default.json",
	"query": [
		["pr.json_data.parcel_code", "=", "rough_load_group"],
		"and",
		["pro.production_order_state", "in", "work_order_open_state"]
	]
}