{
	"name": "form/manager/collect-delivery/save/save_purchase_order.json",
	"table": [
		{
			"aggregate_field": "ord.company_id",
			"data_structure": "flat",
			"record_type": "purchase",
			"row_number_field": [
				{
					"field": "ordr.row_number",
					"start_value": 0
				}
			],
			"row_table": ["order_row"],
			"table": "order"
		}
	],
	"database": "4d",
	"run_script": [
		{
			"find_linked_record": ["ordr.order_id"],
			"init_new_record": true,
			"script_field": ["ordr.product_id", "ordr.order_amount"],
			"table": "order_row"
		},
		{
			"script_field": ["ord.company_id"],
			"table": "order",
			"up_calculate": true
		}
	]
}
