{
	"name": "table/external/4d/product/work_order.json",
	"table_name": "work_order",
	"table_prefix": "wo",
	"main_table": "work",
	"record_type": [""],
	"local_table": "production_order",
	"local_record_type": "",
	"table_number": 44,
	"default_order": [
		{
			"field": "product_id",
			"order": ">"
		},
		{
			"field": "production_order_id",
			"order": ">"
		}
	],
	"field": [
		{
			"field_name": "act_finish_date",
			"local_field": "json_data.actual_end_date",
			"field_type": "date",
			"field_number": 8,
			"constraint": ["index"]
		},
		{
			"field_name": "act_finish_week",
			"local_field": "json_data.act_finish_week",
			"field_type": "integer",
			"field_number": 7,
			"constraint": ["index"]
		},
		{
			"field_name": "additional_data",
			"local_field": "json_data.additional_data",
			"field_type": "text",
			"field_number": 45,
			"length": 0
		},
		{
			"field_name": "change_id",
			"local_field": "modify_id",
			"field_type": "varchar",
			"field_length": 45,
			"field_number": 49,
			"length": 90
		},
		{
			"field_name": "company_id",
			"local_field": "company_id",
			"field_type": "varchar",
			"field_length": 12,
			"field_number": 11,
			"length": 24,
			"constraint": ["index"],
			"foreign_key": [
				{
					"link_type": "prevent delete",
					"linked_field": "company_id",
					"linked_table": "company"
				}
			],
			"nullable": true
		},
		{
			"field_name": "creation_date",
			"local_field": "create_time",
			"field_type": "date",
			"field_number": 37
		},
		{
			"field_name": "creator_id",
			"local_field": "json_data.create_user",
			"field_type": "varchar",
			"field_length": 20,
			"field_number": 50,
			"length": 40
		},
		{
			"field_name": "critical_date",
			"local_field": "json_data.critical_end_date",
			"field_type": "date",
			"field_number": 38,
			"constraint": ["index"]
		},
		{
			"field_name": "critical_date_delayed",
			"local_field": "json_data.critical_delayed_end_date",
			"field_type": "date",
			"field_number": 40,
			"constraint": ["index"]
		},
		{
			"field_name": "critical_date_real",
			"local_field": "json_data.critical_real_end_date",
			"field_type": "date",
			"field_number": 41
		},
		{
			"field_name": "critical_start_date",
			"local_field": "json_data.critical_start_date",
			"field_type": "date",
			"field_number": 43
		},
		{
			"field_name": "critical_start_difference",
			"local_field": "json_data.critical_start_difference",
			"field_type": "double",
			"field_number": 47
		},
		{
			"field_name": "critical_start_time",
			"field_type": "time",
			"field_number": 44
		},
		{
			"field_name": "delivery_date",
			"local_field": "json_data.delivery_date",
			"field_type": "date",
			"field_number": 17
		},
		{
			"field_name": "drawing_number",
			"local_field": "drawing_number",
			"field_type": "varchar",
			"field_length": 40,
			"field_number": 24,
			"length": 80,
			"constraint": ["index"]
		},
		{
			"field_name": "est_finish_date",
			"local_field": "json_data.est_finish_date",
			"field_type": "date",
			"field_number": 30
		},
		{
			"field_name": "est_finish_difference",
			"local_field": "json_data.est_finish_difference",
			"field_type": "double",
			"field_number": 48
		},
		{
			"field_name": "est_finish_time",
			"local_field": "json_data.est_finish_time",
			"field_type": "time",
			"field_number": 35
		},
		{
			"field_name": "est_finish_week",
			"local_field": "json_data.est_finish_week",
			"field_type": "integer",
			"field_number": 29
		},
		{
			"field_name": "failed_amount",
			"local_field": "failed_amount",
			"field_type": "double",
			"field_number": 39
		},
		{
			"field_name": "finished_work_phase",
			"local_field": "json_data.finished_work_phase",
			"field_type": "integer",
			"field_number": 26
		},
		{
			"field_name": "firm_id",
			"local_field": "json_data.firm_id",
			"field_type": "integer",
			"field_number": 27
		},
		{
			"field_name": "in_report",
			"local_field": "json_data.in_report",
			"field_type": "boolean",
			"field_number": 23,
			"constraint": ["index"]
		},
		{
			"field_name": "info",
			"local_field": "info",
			"field_type": "text",
			"field_number": 15,
			"length": 0
		},
		{
			"field_name": "material_act_arrival_date",
			"local_field": "json_data.material_actual_arrival_date",
			"field_type": "date",
			"field_number": 33
		},
		{
			"field_name": "material_est_arrival_date",
			"local_field": "json_data.material_estimated_arrival_date",
			"field_type": "date",
			"field_number": 34
		},
		{
			"field_name": "modifier_id",
			"local_field": "modify_user",
			"field_type": "varchar",
			"field_length": 20,
			"field_number": 51,
			"length": 40
		},
		{
			"field_name": "parent_production_lot",
			"local_field": "json_data.parent_production_lot",
			"field_type": "varchar",
			"field_length": 40,
			"field_number": 53,
			"length": 80
		},
		{
			"field_name": "partial_delivery_number",
			"local_field": "json_data.partial_delivery_number",
			"field_type": "integer",
			"field_number": 19
		},
		{
			"field_name": "pricing_state",
			"local_field": "json_data.pricing_state",
			"field_type": "integer",
			"field_number": 56
		},
		{
			"field_name": "print_date",
			"local_field": "json_data.print_date",
			"field_type": "date",
			"field_number": 16
		},
		{
			"field_name": "produced_amount",
			"local_field": "produced_amount",
			"field_type": "double",
			"field_number": 9
		},
		{
			"field_name": "production_lot",
			"local_field": "production_order_id",
			"field_type": "varchar",
			"field_length": 35,
			"field_number": 3,
			"length": 70,
			"constraint": ["primary key"]
		},
		{
			"field_name": "project_id",
			"local_field": "json_data.project_id",
			"field_type": "varchar",
			"field_length": 40,
			"field_number": 46,
			"length": 80,
			"constraint": ["index"]
		},
		{
			"field_name": "purchase_order_id",
			"local_field": "json_data.purchase_order_id",
			"field_type": "varchar",
			"field_length": 10,
			"field_number": 14,
			"length": 20
		},
		{
			"field_name": "record_id",
			"local_field": "record_id",
			"field_type": "varchar",
			"field_length": 45,
			"field_number": 36,
			"length": 90,
			"constraint": ["unique"]
		},
		{
			"field_name": "remaining_amount",
			"local_field": "remaining_amount",
			"field_type": "double",
			"field_number": 20
		},
		{
			"field_name": "row_number",
			"local_field": "row_number",
			"field_type": "integer",
			"field_number": 2
		},
		{
			"field_name": "sales_order_id",
			"local_field": "sales_order_id",
			"field_type": "varchar",
			"field_length": 10,
			"field_number": 13,
			"length": 20,
			"constraint": ["index"],
			"foreign_key_not_in_use": [
				{
					"link_type": "prevent delete",
					"linked_field": "so_sales_order_id",
					"linked_record_type": "",
					"linked_table": "sales_order",
					"linking_record_type": ""
				}
			]
		},
		{
			"field_name": "sales_order_row_id",
			"local_field": "sales_order_row",
			"field_type": "integer",
			"field_number": 28,
			"constraint": ["index"]
		},
		{
			"field_name": "sales_price__unit",
			"local_field": "json_data.sales_price__unit",
			"field_type": "double",
			"field_number": 25
		},
		{
			"field_name": "serial_number",
			"local_field": "json_data.serial_number",
			"field_type": "varchar",
			"field_length": 40,
			"field_number": 31,
			"length": 80
		},
		{
			"field_name": "start_date",
			"field_type": "date",
			"field_number": 5
		},
		{
			"field_name": "start_time",
			"local_field": "json_data.start_time",
			"field_type": "time",
			"field_number": 18
		},
		{
			"field_name": "start_week",
			"local_field": "json_data.start_week",
			"field_type": "integer",
			"field_number": 4
		},
		{
			"field_name": "started_amount",
			"info": "Means amount to produce also in 4D, 4D name is wrong",
			"local_field": "amount_to_produce",
			"field_type": "double",
			"field_number": 6
		},
		{
			"field_name": "state",
			"local_field": "production_order_state",
			"field_type": "varchar",
			"field_length": 2,
			"field_number": 10,
			"length": 4,
			"constraint": ["index"],
			"value_map": "table/external/4d/prf/constant-4d.json/production_order_state"
		},
		{
			"field_name": "stock_event_id",
			"local_field": "json_data.stock_event",
			"field_type": "text",
			"field_number": 22,
			"foreign_key": [
				{
					"linked_table": "stock_event",
					"linked_field": "stock_event_id",
					"link_type": "prevent delete"
				}
			],
			"length": 0
		},
		{
			"field_name": "track_time_status",
			"local_field": "json_data.track_time_status",
			"field_type": "integer",
			"field_number": 55
		},
		{
			"field_name": "transfer_id",
			"local_field": "json_data.transfer_id",
			"field_type": "varchar",
			"field_length": 60,
			"field_number": 42,
			"length": 120,
			"constraint": ["index"]
		},
		{
			"field_name": "transfer_info",
			"local_field": "json_data.transfer_info",
			"field_type": "text",
			"field_number": 32,
			"length": 0
		},
		{
			"field_name": "transfer_state",
			"local_field": "json_data.transfer_state",
			"field_type": "integer",
			"field_number": 52
		},
		{
			"field_name": "type_",
			"local_field": "json_data.type",
			"field_type": "varchar",
			"field_length": 10,
			"field_number": 21,
			"length": 20
		},
		{
			"field_name": "work__position_num_id",
			"local_field": "product_id",
			"field_type": "varchar",
			"field_length": 30,
			"field_number": 1,
			"length": 60,
			"constraint": ["index"],
			"foreign_key": [
				{
					"link_type": "prevent delete",
					"linked_field": "work__position_num_id",
					"linked_table": "work"
				},
				{
					"info": "work_order to product",
					"extra_link_field": [
						{
							"linked": "pr.work__position_num_id",
							"linking": "wo.work__position_num_id"
						}
					],
					"link_type": "prevent delete",
					"linked_field": "work__position_num_id",
					"linked_table": "product"
				}
			],
			"nullable": true
		},
		{
			"field_name": "work_order_id",
			"local_field": "json_data.production_order_number",
			"field_type": "varchar",
			"field_length": 10,
			"field_number": 12,
			"length": 20,
			"constraint": ["index"]
		},
		{
			"field_name": "work_order_type",
			"local_field": "json_data.work_order_type",
			"field_type": "integer",
			"field_number": 54
		}
	]
}
