{
	"name": "form/nc/nc-warehouse/column/product.json",
	"option": {
		"grid_option": {
			"row_class_rules": {
				"red": "data.calc?.error"
			}
		},
		"paper_type": "A4 landscape",
		"null_allowed": ["pr.calc.warehouse_balance", "pr.calc.average_unit_price", "pr.calc.error"],
		"subtotal": {
			"total": {
				"calculate": [["pr.calc.warehouse_value", "+"]]
			},
			"subtotal": [
				{
					"field": "pr.product_type",
					"sort_direction": ">",
					"calculate": [["pr.calc.warehouse_value", "+"]],
					"page_break": false
				},
				{
					"field": "pr.product_group",
					"sort_direction": ">",
					"calculate": [["pr.calc.warehouse_value", "+"]],
					"page_break": false
				}
			],
			"order": [{ "field": "pr.product_id", "sort_direction": ">" }]
		}
	},
	"column": [
		{
			"icon": "nc-link-icon",
			"link_field": "pr.product_id",
			"name": "Row",
			"record_type": "",
			"variable": "idx"
		},
		{
			"field": "pr.product_type",
			"width": 50,
			"name": "Type"
		},
		{
			"field": "pr.product_group",
			"width": 100,
			"name": "Group"
		},
		{
			"field": "pr.product_id",
			"width": 190,
			"name": "Product id"
		},
		{
			"field": "pr.name",
			"width": 400,
			"name": "Name"
		},
		{
			"variable": "pr.calc.warehouse_balance",
			"width": 115,
			"name": "warehouse balance",
			"format": "%'.-2f"
		},
		{
			"field": "pr.warehouse_unit",
			"width": 50,
			"name": "Unit"
		},
		{
			"variable": "pr.calc.warehouse_value",
			"width": 125,
			"name": "warehouse value",
			"format": "%'.2f"
		},
		{
			"variable": "pr.calc.target_currency",
			"width": 55,
			"name": "Cur."
		},
		{
			"variable": "pr.calc.average_unit_price",
			"width": 115,
			"name": "Avg. unit price",
			"format": "%'.2f"
		},
		{
			"variable": "pr.calc.last_stock_event_time",
			"width": 150,
			"name": "Last event"
		},
		{
			"variable": "pr.calc.error",
			"hide_print": false,
			"width": 400,
			"print_width": 200,
			"name": "Error",
			"cell_class_rules": {
				"red": "x"
			}
		},
		{
			"field": "pr.info",
			"hide_print": true,
			"width": 1500,
			"print_width": 50,
			"name": "Info"
		},
		{
			"variable": "warehouse_location",
			"hide_print": true,
			"export": false,
			"width": 700,
			"name": "warehouse events"
		},
		{
			"field": "pr.purchase_price",
			"hide": true,
			"width": 120,
			"name": "Purchase price",
			"format": "%'.2f"
		},
		{
			"field": "pr.purchase_multiplier",
			"hide": true,
			"width": 140,
			"name": "Purchase multiplier",
			"format": "%'.2f"
		},
		{
			"field": "pr.cost_price",
			"hide": true,
			"width": 120,
			"name": "Cost price",
			"format": "%'.2f"
		},
		{
			"field": "pr.sales_price",
			"hide": true,
			"width": 120,
			"name": "Sales price",
			"format": "%'.2f"
		},
		{
			"field": "pr.json_data.warehouse_balance",
			"hide": true,
			"width": 115,
			"name": "warehouse balance",
			"format": "%'.-2f"
		},
		{
			"field": "pr.json_data.last_stock_event_time",
			"hide": true,
			"width": 95,
			"name": "Last event",
			"type": "date"
		}
	]
}
