{
	"name": "plugin/nc-calc-server/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": "Row",
			"name_fi": "Rivi",
			"link_field": "wos.record_id",
			"link_data_field": "prwo.record_id",
			"record_type": "schedule"
		},
		{
			"field": "prwo.production_order_id",
			"width": 160,
			"name": "Production order",
			"name_fi": "Tuotantotilaus"
		},
		{
			"field": "prwo.work_phase_number",
			"width": 80,
			"name": "Phase",
			"name_fi": "Vaihe"
		},
		{
			"field": "prwo.resource_id",
			"width": 95,
			"name": "group",
			"name_fi": "ryhmä"
		},
		{
			"field": "prwo.json_data.employee_id",
			"width": 95,
			"name": "Employee",
			"name_fi": "Työntekijä"
		},
		{
			"field": "prwo.description",
			"width": 120,
			"name": "Description",
			"name_fi": "Kuvaus"
		},
		{
			"field": "prwo.info",
			"width": 95,
			"name": "Info",
			"name_fi": "Info"
		},
		{
			"field": "prwo.work_phase_state",
			"width": 85,
			"name": "State",
			"name_fi": "Tila"
		},
		{
			"field": "prwo.json_data.substate",
			"width": 80,
			"name": "Substate",
			"name_fi": "Alatila"
		},
		{
			"field": "prwo.produced_amount",
			"width": 85,
			"name": "Produced",
			"name_fi": "Tuotettu",
			"format": "%'.0f"
		},
		{
			"field": "prwo.failed_amount",
			"width": 80,
			"name": "Failed",
			"name_fi": "Epäonnistunut",
			"format": "%'.0f"
		},
		{
			"variable": "prwo.calc.fixed",
			"width": 80,
			"name": "Fixed",
			"name_fi": "Kiinteä",
			"format": "%'.0f",
			"cell_class": "nc-grid-cell-highlight"
		},
		{
			"field": "prwo.json_data.remaining_amount",
			"width": 120,
			"name": "Remaining",
			"name_fi": "Jäljellä",
			"format": "%'.0f"
		},
		{
			"variable": "prwo.calc.reserved",
			"width": 140,
			"name": "Reserved",
			"name_fi": "Varattu",
			"format": "%'.0f",
			"cell_class": "nc-grid-cell-highlight"
		},
		{
			"field": "prwo.json_data.can_be_manufactured",
			"width": 130,
			"name": "Can be manufactured",
			"name_fi": "Voidaan valmistaa",
			"format": "%'.0f"
		},
		{
			"variable": "prwo.json_data.can_be_manufactured_old",
			"width": 130,
			"name": "(Can be manufactured)",
			"name_fi": "(Voidaan valmistaa)",
			"format": "%'.0f"
		},
		{
			"field": "prwo.json_data.manufacturing_state",
			"width": 120,
			"name": "Manufacturing state",
			"name_fi": "Valmistustila",
			"format": "%'d"
		},
		{
			"variable": "prwo.calc.manufacturing_state_old",
			"width": 120,
			"name": "(Manufacturing state)",
			"name_fi": "(Valmistustila)",
			"format": "%'d"
		},
		{
			"variable": "prwo.calc.used_material_idx",
			"width": 100,
			"name": "Material used",
			"name_fi": "Materiaali käytetty",
			"cell_class": "nc-grid-linked-table"
		},
		{
			"width": 90,
			"field": "prwo.work_hours",
			"name": "Work hrs",
			"name_fi": "Työtunnit",
			"footerValue": "==Sum"
		},
		{
			"width": 41,
			"field": "prwo.setup_hours",
			"name": "Setup time",
			"name_fi": "Asetusaika",
			"footerValue": "==Sum"
		},
		{
			"width": 90,
			"field": "prwo.extra_hours",
			"name": "Extra time",
			"name_fi": "Lisäaika",
			"footerValue": "==Sum"
		},
		{
			"field": "prwo.json_data.critical_start_date",
			"width": 120,
			"name": "Critical start date",
			"name_fi": "Kriittinen aloituspäivä"
		},
		{
			"field": "prwo.json_data.critical_start_time",
			"width": 120,
			"name": "Critical start time",
			"name_fi": "Kriittinen aloitusaika"
		},
		{
			"field": "prwo.json_data.critical_end_date",
			"width": 120,
			"name": "Critical end date",
			"name_fi": "Kriittinen päättymispäivä"
		},
		{
			"field": "prwo.json_data.critical_end_time",
			"width": 120,
			"name": "Critical end time",
			"name_fi": "Kriittinen päättymisaika"
		},
		{
			"field": "prwo.json_data.critical_extra_end_date",
			"width": 130,
			"name": "Critical extra end date",
			"name_fi": "Kriittinen lisäpäättymispäivä"
		},
		{
			"field": "prwo.json_data.critical_extra_end_time",
			"width": 130,
			"name": "Critical extra end time",
			"name_fi": "Kriittinen lisäpäättymisaika"
		},
		{
			"field": "prwo.record_id",
			"name": "Record ID",
			"name_fi": "Tietue ID",
			"width": 110
		},
		{
			"field": "prwo.modify_id",
			"name": "Modify id",
			"width": 110
		}
	],
	"column-": [
		{
			"field": "prwo.json_data.start__date",
			"width": 52,
			"name": "Start date",
			"name_fi": "Alkupäivä"
		},
		{
			"field": "prwo.json_data.start_time",
			"width": 52,
			"name": "Start time",
			"name_fi": "Alkuaika"
		},
		{
			"field": "prwo.json_data.end_date",
			"width": 59,
			"name": "End date",
			"name_fi": "Loppupäivä"
		},
		{
			"field": "prwo.json_data.end_time",
			"width": 59,
			"name": "End time",
			"name_fi": "Loppuaika"
		},
		{
			"field": "prwo.json_data.extra_end_time",
			"width": 55,
			"name": "Extra end time",
			"name_fi": "Lisäaika"
		},
		{
			"field": "prwo.json_data.subcontract",
			"width": 27,
			"name": "Subcontract",
			"name_fi": "Alihankinta"
		},
		{
			"field": "prwo.json_data.critical_delayed_end_date",
			"width": 80,
			"name": "Critical delayed end date",
			"name_fi": "Kriittinen viivästynyt päättymispäivä"
		},
		{
			"variable": "material_idx",
			"width": 85,
			"name": "Material index",
			"name_fi": "Materiaalin indeksi",
			"cell_class": "nc-grid-linked-table"
		},
		{
			"variable": "pr.product_id",
			"width": 100,
			"name": "Work",
			"name_fi": "Työ",
			"hide": false
		},
		{
			"variable": "pr.product_id",
			"width": 180,
			"name": "Product",
			"name_fi": "Tuote",
			"cell_class": "nc-grid-linked-table"
		},
		{
			"variable": "pr.work_id",
			"width": 180,
			"name": "Work",
			"name_fi": "Työ",
			"cell_class": "nc-grid-linked-table"
		},
		{
			"variable": "pr.name",
			"width": 120,
			"name": "Name",
			"name_fi": "Nimi",
			"cell_class": "nc-grid-linked-table"
		},
		{
			"variable": "pro.production_order_state",
			"width": 35,
			"name": "State",
			"name_fi": "Tila",
			"cell_class": "nc-grid-linked-table"
		},
		{
			"field": "pro.amount_to_produce",
			"info": "4D does not work without at least one pro- field",
			"width": 120,
			"name": "To produce",
			"name_fi": "Tuotettava",
			"cell_class": "nc-grid-linked-table"
		},
		{
			"variable": "pro.produced_amount",
			"width": 140,
			"name": "Produced",
			"name_fi": "Tuotettu",
			"cell_class": "nc-grid-linked-table"
		},
		{
			"variable": "pro.failed_amount",
			"width": 80,
			"name": "Failed",
			"name_fi": "Epäonnistunut",
			"cell_class": "nc-grid-linked-table"
		},
		{
			"field": "prwo.json_data.remaining_amount",
			"cell_class": "gridGraph",
			"name": "Remaining",
			"name_fi": "Jäljellä",
			"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.track_time_status",
			"cell_class": "gridGraph",
			"name": "Tracking",
			"name_fi": "Seuranta",
			"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>"
			}
		},
		{
			"headerBackColor": -2,
			"width": 63,
			"lineBackColor": -2,
			"variable": "pro.company_id",
			"lineForeColor": -2,
			"name": "Customer",
			"name_fi": "Asiakas",
			"headerForeColor": -2
		},
		{
			"field-": ["prwo.json_data.critical_delayed_end_date", "-", "prwo.json_data.end_time"],
			"field": "prwo.json_data.urgency_index",
			"name": "Urgency",
			"name_fi": "Kiireellisyys",
			"width": 55
		}
	],
	"field_not_working": [
		{
			"field": "wos_mat_sub_coming_amount",
			"width": 68,
			"name": "Available",
			"name_fi": "Av."
		},
		{
			"field": "wos_mat_est_arrival_date",
			"width": 68,
			"name": "Est. arrival",
			"name_fi": "Arv. tulop."
		},
		{
			"field": "ordr.order_id",
			"width": 68,
			"name": "Purchase order",
			"name_fi": "Ostotilaus"
		},
		{
			"field": "ordr.json_data.confirmation_state",
			"width": 68,
			"name": "Order confirmation",
			"name_fi": "OTR v."
		},
		{
			"field": "ordr.order_amount",
			"width": 68,
			"name": "Ordered",
			"name_fi": "Til."
		},
		{
			"field": "ord.company_id",
			"width": 68,
			"name": "Supplier",
			"name_fi": "Toimittaja"
		}
	]
}
