{
	"name": "form/nc/nc-work-center/column/work_phase-actual-open.json",
	"option": {
		"grid_option": {
			"row_class_rules": {
				"red": "data.work_phase_state === 'stopped'",
				"blue": "data.work_phase_state === 'started'",
				"grey": "data.work_phase_state === 'done'",
				"green": "data.calc?.can_start_amount && data.calc.can_start_amount > 0 && data.work_phase_state === 'confirmed'"
			}
		}
	},
	"column": [
		{
			"name": "",
			"width": 65,
			"variable": "idx",
			"link_field-": "prwo.record_id",
			"record_type": "schedule"
		},
		{
			"name": "db",
			"name_fi": "tk",
			"variable": "from_db",
			"width": 43
		},
		{
			"name": "Serie",
			"field": "prwo.serie",
			"width": 65,
			"name_fi": "Sarja",
			"organization_id": { "4d": { "load": false } }
		},
		{
			"name": "Person",
			"field": "prwo.json_data.start_person_id",
			"width": 65,
			"name_fi": "Henkilo"
		},
		{
			"name": "Resource",
			"field": "prwo.resource_id",
			"width": 90,
			"name_fi": "Kuorm."
		},
		{
			"name": "State",
			"field": "prwo.work_phase_state",
			"name_fi": "Tila",
			"value_map": "plugin/nc-calc-server/constant.json/phase_state_view",
			"width": 120
		},
		{
			"name": "Active",
			"field": "prwo.active_state",
			"name_fi": "Akt.",
			"width": 80,
			"organization_id": { "4d": { "load": false } }
		},
		{
			"name": "Start time",
			"field": "prwo.start_time",
			"width": 165,
			"type": "timestamp",
			"organization_id": { "4d": { "load": false } }
		},
		{
			"name": "End time",
			"field": "prwo.end_time",
			"width": 165,
			"type": "timestamp",
			"organization_id": { "4d": { "load": false } }
		},
		{
			"name": "Product",
			"field": "prwo.product_id",
			"width": 120,
			"name_fi": "Tuote"
		},
		{
			"name": "Prod. ord.",
			"field": "prwo.production_order_id",
			"width": 90,
			"name_fi": "Valm.erä"
		},
		{
			"name": "Ph.",
			"field": "prwo.work_phase_number",
			"width": 40,
			"name_fi": "Va."
		},
		{
			"name": "Need",
			"name_fi": "Tarve",
			"type": "integer",
			"field": "pro.amount_to_produce",
			"width": 60
		},
		{
			"name": "Started",
			"width": 70,
			"field": "prwo.started_amount",
			"name_fi": "Aloit.",
			"type": "integer"
		},
		{
			"name": "Done",
			"width": 55,
			"field": "prwo.produced_amount",
			"name_fi": "Tehty",
			"type": "integer"
		},
		{
			"name": "Failed",
			"width": 60,
			"field": "prwo.failed_amount",
			"name_fi": "Susia",
			"type": "integer"
		},
		{
			"name": "Info",
			"field": "prwo.info",
			"width": 200,
			"name_fi": "Lisätietoja"
		},
		{
			"name": "Setup time",
			"width": 90,
			"field": "prwo.setup_hours",
			"name_fi": "As. aika",
			"format": "%'.2f"
		},
		{
			"name": "Time/pcs",
			"width": 95,
			"field": "prwo.work_hours",
			"name_fi": "Aika/kpl",
			"format": "%'.2f"
		},
		{
			"name": "Mach. time",
			"width": 95,
			"field": "prwo.machine_hours",
			"name_fi": "Koneaika",
			"format": "%'.2f"
		},
		{
			"name": "Description",
			"field": "prwo.description",
			"width": 180,
			"name_fi": "Työnkuvaus"
		},
		{
			"name": "Json data",
			"field": "prwo.json_data",
			"width": 350
		},
		{
			"name": "ID",
			"field": "prwo.record_id",
			"width": 360
		},
		{
			"name": "Change ID",
			"field": "prwo.modify_id",
			"width": 360,
			"name_fi": "Muutos ID"
		}
	],
	"columns-": [
		{
			"name": "Type",
			"field": "prwo.json_data.work_phase_type",
			"width": 65,
			"name_fi": "Tyyppi",
			"type": "integer"
		},
		{
			"name": "Start date 4d",
			"field": "prwo.json_data.start_date",
			"field2": "prwo.json_data.start_time",
			"type": "datetime",
			"format": "datetime",
			"width": 125,
			"name_fi": "Alku pv"
		},
		{
			"name": "Start time",
			"field": "prwo.json_data.start_time",
			"type": "time",
			"hide": true
		},
		{
			"name": "End by 4d",
			"field": "prwo.person_id",
			"width": 65,
			"name_fi": "Henkilö"
		},
		{
			"name": "End date 4d",
			"field": "prwo.json_data.end_date",
			"field2": "prwo.json_data.end_time",
			"type": "datetime",
			"format": "datetime",
			"width": 125,
			"name_fi": "Loppu pv"
		},
		{
			"name": "End time",
			"field": "prwo.json_data.end_time",
			"type": "time",
			"hide": true
		}
	],
	"column-": [
		{
			"field": "prwo.json_data.substate",
			"width": 96,
			"name_fi": "Alatyyppi"
		},
		{
			"field": "prwo.json_data.start_subtype",
			"width": 92,
			"name_fi": "Al. alat."
		},
		{
			"field": "prwo.json_data.start_person_id",
			"width": 79,
			"name_fi": "Aloittaja"
		},
		{
			"field": "prwo.person_id",
			"width": 74,
			"name_fi": "Työnt."
		},
		{
			"field": "prwo.json_data.program_id",
			"width": 107,
			"name_fi": "Ohj. numero"
		},
		{
			"field": "prwo.json_data",
			"width": 180,
			"name_fi": "Lisädata"
		},
		{
			"field": "prwo.json_data.start_work_shift",
			"width": 78,
			"name_fi": "Al.v."
		},
		{
			"field": "prwo.json_data.work_shift",
			"width": 77,
			"name_fi": "Lop.v."
		},
		{
			"width": 79,

			"field": "prwo.work_hours",
			"name_fi": "Työaika",
			"footerValue": "==Sum"
		},
		{
			"width": 81,

			"field": "prwo.machine_hours",
			"name_fi": "Konetunnit",
			"footerValue": "==Sum"
		},
		{
			"width": 100,

			"field": "prwo.json_data.unpaid_hours",
			"name_fi": "Palkattomat",
			"footerValue": "==Sum"
		},
		{
			"width": 91,
			"field": "prwo.json_data.evening_work_hours",
			"name_fi": "Iltalisätunnit",
			"footerValue": "==Sum"
		},
		{
			"width": 92,

			"field": "prwo.json_data.night_work_hours",
			"name_fi": "Yölisätunnit",
			"footerValue": "==Sum"
		},
		{
			"width": 81,

			"field": "prwo.cost_price",
			"name_fi": "Työ OK",
			"footerValue": "==Sum"
		},
		{
			"field": "prwo.json_data.track_time_status",
			"width": 94,
			"name_fi": "OA tila"
		}
	]
}
