{
	"name": "form/nc/nc-storage/column/product_work-schedule.json",
	"option": {
		"suppress_menu": true,
		"grid_option": {
			"cell_class_rules": {
				"nc-grid-cell-highlight": "colDef.field === 'prwo.json_data.can_be_manufactured' && colDef.field === 'prwo.json_data.manufacturing_state' && x !== data.prwo.calc.manufacturing_state_old"
			}
		}
	},
	"column": [
		{
			"variable": "idx",
			"width": 120,
			"name_fi": "",
			"link_field": "wos.record_id",
			"link_data_field": "prwo.record_id",
			"record_type": "schedule"
		},
		{
			"field": "prwo.production_order_id",
			"width": 160,
			"name_fi": "Valm. erä"
		},
		{
			"field": "prwo.work_phase_number",
			"width": 30,
			"name_fi": "Va."
		},
		{
			"field": "prwo.resource_id",
			"width": 95,
			"name_fi": "Kuorm. ryhmä"
		},
		{
			"variable": "pr.product_id",
			"width": 180,
			"name_fi": "Tuote",
			"cell_class": "nc-grid-linked-table"
		},
		{
			"variable": "pr.name",
			"width": 120,
			"name_fi": "Nimi",
			"cell_class": "nc-grid-linked-table"
		},
		{
			"field": "pro.production_order_state",
			"width": 35,
			"name_fi": "Tila",
			"cell_class": "nc-grid-linked-table"
		},
		{
			"field": "pro.amount_to_produce",
			"width": 120,
			"name_fi": "Valmistettava",
			"cell_class": "nc-grid-linked-table"
		},
		{
			"field": "pro.produced_amount",
			"width": 120,
			"name_fi": "Tehty",
			"cell_class": "nc-grid-linked-table"
		},
		{
			"field": "pro.failed_amount",
			"width": 80,
			"name_fi": "Hylätty",
			"cell_class": "nc-grid-linked-table"
		},
		{
			"field": "pro.remaining_amount",
			"width": 55,
			"name_fi": "Jäljellä",
			"cell_class": "nc-grid-linked-table"
		},
		{
			"field": "prwo.work_phase_state",
			"width": 65,
			"name_fi": "Tila"
		},
		{
			"field": "prwo.json_data.substate",
			"width": 70,
			"name_fi": "Alatila"
		},
		{
			"field": "prwo.produced_amount",
			"width": 65,
			"name_fi": "Tehty",
			"format": "%'.0f"
		},
		{
			"field": "prwo.failed_amount",
			"width": 80,
			"name_fi": "Hylätty",
			"format": "%'.0f"
		},
		{
			"variable": "prwo.calc.fixed",
			"width": 140,
			"name_fi": "Kiinnitetty",
			"format": "%'.0f",
			"cell_class": "nc-grid-cell-highlight"
		},
		{
			"field": "prwo.json_data.remaining_amount",
			"width": 80,
			"name_fi": "Jäljellä",
			"format": "%'.0f"
		},
		{
			"variable": "prwo.calc.reserved",
			"width": 120,
			"name_fi": "Varattu",
			"format": "%'.0f",
			"cell_class": "nc-grid-cell-highlight"
		},
		{
			"field": "prwo.can_be_manufactured",
			"width": 110,
			"name_fi": "Valmistettavissa",
			"format": "%'.0f"
		},
		{
			"variable": "prwo.calc.can_be_manufactured_old",
			"width": 55,
			"name_fi": "(Valm.)",
			"format": "%'.0f"
		},
		{
			"field": "prwo.json_data.manufacturing_state",
			"width": 65,
			"name_fi": "Valm. tila",
			"format": "%'d"
		},
		{
			"variable": "prwo.calc.manufacturing_state_old",
			"width": 65,
			"name_fi": "(Tila)",
			"format": "%'d"
		},
		{
			"field": "pro.json_data.critical_start_date",
			"width": 85,
			"name_fi": "Kriitt. alkupv",
			"type": "date"
		},
		{
			"field": "pro.json_data.critical_end_date",
			"width": 85,
			"name_fi": "Kriittinen pv",
			"type": "date"
		},
		{
			"variable": "prwo.calc.used_material_idx",
			"width": 65,
			"name_fi": "Mat. käyt",
			"cell_class": "nc-grid-linked-table"
		},
		{
			"variable": "material_idx",
			"width": 85,
			"name_fi": "Mat. rivit",
			"cell_class": "nc-grid-linked-table"
		},
		{
			"variable": "pr.product_id",
			"width": 100,
			"name_fi": "Työ",
			"hide": false
		},
		{
			"field": "prwo.record_id",
			"width": 120,
			"name_fi": "Id"
		}
	],
	"column-": [
		{
			"field": "prwo.work_phase_number",
			"width": 10,
			"name_fi": "Vaihe",
			"editable": true
		},
		{
			"width": 65,
			"cell_graph_formatter": {
				"percent_max": 30,
				"html": "<svg class='nc-cell-graph'><rect x='{{x}}%' y='5%' height='90%' width='{{size}}%' fill='{{color}}'></rect><text dy='75%'>{{value}}</text></svg>",
				"percent_color": [
					{
						"end": 0,
						"color": "red"
					},
					{
						"start": 0,
						"end": 7,
						"color": "orange"
					},
					{
						"start": 7,
						"end": 30,
						"color": "lightgreen"
					},
					{
						"start": 30,
						"color": "MediumSeaGreen"
					}
				],
				"negative_from_end": true
			},
			"field": "prwo.json_data.remaining_amount",
			"cell_class": "gridGraph",
			"name_fi": "Jäljellä"
		},
		{
			"width": 26,
			"cell_graph_formatter": {
				"value_color": [
					{
						"end": 0,
						"color": "none"
					},
					{
						"start": 0,
						"end": 1,
						"color": "none"
					},
					{
						"start": 1,
						"end": 2,
						"color": "orange"
					},
					{
						"start": 2,
						"end": 3,
						"color": "lightgreen"
					},
					{
						"start": 3,
						"end": 4,
						"color": "DarkGrey"
					},
					{
						"start": 4,
						"color": "red"
					}
				],
				"html": "<svg width='100%' height='100%'><circle cx='50%' cy='50%' r='0.5em' fill='{{color}}'></circle></svg>"
			},
			"field": "prwo.json_data.track_time_status",
			"cell_class": "gridGraph",
			"name_fi": "Ohja."
		},
		{
			"field": "prwo.json_data.start_time",
			"width": 65,
			"name_fi": "Alku pv",
			"editable": true
		},
		{
			"field": "prwo.json_data.end_time",
			"width": 65,
			"name_fi": "Loppu pv",
			"editable": true
		},
		{
			"field": "prwo.json_data.critical_delayed_end_date",
			"width": 80,
			"name_fi": "Vaih. eräpv",
			"editable": true
		},
		{
			"field": "prwo.json_data.remaining_amount",
			"width": 65,
			"name_fi": "Jälj.",
			"editable": true
		},
		{
			"field": "prwo.extra_hours",
			"width": 55,
			"name_fi": "Lisäaika",
			"editable": true
		},
		{
			"field": "prwo.work_hours",
			"width": 55,
			"name_fi": "Työaika",
			"editable": true
		},
		{
			"field": "prwo.setup_hours",
			"width": 55,
			"name_fi": "Asetusaika",
			"editable": true
		},
		{
			"headerBackColor": -2,
			"width": 63,
			"lineBackColor": -2,
			"field": "pro.company_id",
			"lineForeColor": -2,
			"name_fi": "Asiakas",
			"headerForeColor": -2
		},
		{
			"field-": ["prwo.json_data.critical_delayed_end_date", "-", "prwo.json_data.end_time"],
			"editable": true,
			"field": "prwo.json_data.urgency_index",
			"name_fi": "Kiireellisyys",
			"width": 55
		}
	],
	"field_not_working": [
		{
			"field": "prwo.json_data.subcontract",
			"width": 20,
			"name_fi": "AH.",
			"editable": true
		},
		{
			"field": "wos_mat_sub_coming_amount",
			"width": 68,
			"name_fi": "Av.",
			"editable": true
		},
		{
			"field": "wos_mat_est_arrival_date",
			"width": 68,
			"name_fi": "Arv. tulop.",
			"editable": true
		},
		{
			"field": "ordr.order_id",
			"width": 68,
			"name_fi": "Ostotilaus",
			"editable": true
		},
		{
			"field": "ordr.json_data.confirmation_state",
			"width": 68,
			"name_fi": "OTR v.",
			"editable": true
		},
		{
			"field": "ordr.order_amount",
			"width": 68,
			"name_fi": "Til.",
			"editable": true
		},
		{
			"field": "ord.company_id",
			"width": 68,
			"name_fi": "Toimittaja",
			"editable": true
		}
	],
	"old": [
		{
			"field": "prwo.description",
			"width": 77,
			"name_fi": "Työnkuvaus",
			"editable": true
		},
		{
			"headerBackColor": -2,
			"width": 48,
			"lineBackColor": -2,
			"field": "pro.production_order_state",
			"lineForeColor": -2,
			"name_fi": "Tm tila",
			"headerForeColor": -2
		},
		{
			"width": 65,
			"editable": true,
			"field": "prwo.json_data.production_lot__work_ph",
			"name_fi": "Tm/työvaihe",
			"footerValue": "/O1"
		},
		{
			"field": "prwo.work_phase_number",
			"width": 65,
			"name_fi": "Työvaihe",
			"editable": true
		},
		{
			"field": "prwo.work_phase_state",
			"width": 21,
			"name_fi": "Tila",
			"editable": true
		},
		{
			"width": 47,
			"editable": true,
			"field": "prwo.json_data.remaining_amount",
			"name_fi": "Jäljellä",
			"footerValue": "==Sum"
		},
		{
			"field": "prwo.json_data.critical_start_time",
			"width": 62,
			"name_fi": "Kr. alkupv",
			"editable": true
		},
		{
			"width": 66,
			"editable": true,
			"field": "prwo.json_data.critical_start_time",
			"name_fi": "Kr. alkuaika",
			"format": "time"
		},
		{
			"field": "prwo.json_data.critical_end_time",
			"width": 58,
			"name_fi": "Kr. pv",
			"editable": true
		},
		{
			"width": 57,
			"editable": true,
			"field": "prwo.json_data.critical_end_time",
			"name_fi": "Kr. aika",
			"format": "time"
		},
		{
			"field": "prwo.json_data.critical_extra_end_time",
			"width": 69,
			"name_fi": "Kr. lisäajan pv",
			"editable": true
		},
		{
			"width": 58,
			"editable": true,
			"field": "prwo.json_data.critical_extra_end_time",
			"name_fi": "Kr. lisäaika",
			"format": "time"
		},
		{
			"field": "prwo.json_data.critical_delayed_end_date",
			"width": 62,
			"name_fi": "Kr. pv. viiv.",
			"editable": true
		},
		{
			"field": "prwo.json_data.critical_date_difference",
			"width": 64,
			"name_fi": "Kr. pv:n ero",
			"editable": true
		},
		{
			"field": "prwo.json_data.subcontract",
			"width": 27,
			"name_fi": "Alih.",
			"editable": true
		},
		{
			"width": 43,
			"editable": true,
			"field": "prwo.extra_hours",
			"name_fi": "Lisäaika",
			"footerValue": "==Sum"
		},
		{
			"field": "prwo.json_data.start_time",
			"width": 52,
			"name_fi": "Alkupäivä",
			"editable": true
		},
		{
			"width": 46,
			"editable": true,
			"field": "prwo.json_data.start_time",
			"name_fi": "Alkuaika",
			"format": "time"
		},
		{
			"field": "prwo.json_data.end_time",
			"width": 59,
			"name_fi": "Loppupäivä",
			"editable": true
		},
		{
			"width": 53,
			"editable": true,
			"field": "prwo.json_data.end_time",
			"name_fi": "Loppuaika",
			"format": "time"
		},
		{
			"field": "prwo.json_data.extra_end_time",
			"width": 55,
			"name_fi": "Lis. lop pv",
			"editable": true
		},
		{
			"width": 52,
			"editable": true,
			"field": "prwo.json_data.extra_end_time",
			"name_fi": "Lis. l. aika",
			"format": "time"
		}
	]
}
