{
	"name": "form/nc/nc-work-center/save/material-test.json",
	"organization_id": "",
	"save": [
		{
			"table": "stock",
			"record_type": ["virtual"]
		}
	],
	"parameter": {
		"combine_save": ["stock", ""],
		"finished_state": true,
		"show_sql": true
	},
	"query": [["co.json_data.state", "<>", "finished_state"]],
	"default_value": {
		"stock": {
			"code": [
				{
					"function": "currentUtcString",
					"result": "event_time"
				}
			]
		},
		"production_order": {
			"static": {
				"production_order_state": "started"
			},
			"copy_value-": {
				"product_id": "pr.product_id"
			},
			"code_update": [
				{
					"function": "concatWith",
					"result": "produced_amount",
					"parameter": [
						"+",
						{
							"value": "production_order.produced_amount"
						},
						{
							"tag": "prwo.produced_amount"
						}
					]
				},
				{
					"function": "concatWith",
					"result": "failed_amount",
					"parameter": [
						"+",
						{
							"value": "production_order.failed_amount"
						},
						{
							"tag": "prwo.failed_amount"
						}
					]
				},
				{
					"function": "concatWith",
					"result": "remaining_amount",
					"parameter": [
						"-",
						{
							"value": "production_order.remaining_amount"
						},
						{
							"tag": "prwo.produced_amount"
						}
					]
				}
			]
		}
	}
}
