{
	"save_script": [],
	"field": [
		{
			"type": "varchar",
			"length": 20,
			"name": "production_order_id"
		},
		{
			"type": "varchar",
			"length": 40,
			"name": "production_order_state"
		},
		{
			"type": "varchar",
			"length": 80,
			"name": "product_id",
			"foreign_key": {
				"field": "product_id",
				"link_type": "prevent delete",
				"table": "product"
			}
		},
		{
			"name": "row_number",
			"type": "integer"
		},
		{
			"type": "varchar",
			"length": 40,
			"name": "production_lot",
			"constraint": [
				"primary key",
				"unique"
			]
		},
		{
			"type": "varchar",
			"length": 40,
			"name": "sales_order_id"
		},
		{
			"name": "sales_order_row",
			"type": "integer"
		},
		{
			"type": "varchar",
			"length": 40,
			"name": "company_id",
			"foreign_key": {
				"field": "company_id",
				"link_type": "prevent delete",
				"table": "company"
			}
		},
		{
			"type": "varchar",
			"length": 80,
			"name": "project_id"
		},
		{
			"type": "varchar",
			"length": 40,
			"name": "drawing_number"
		},
		{
			"name": "critical_date",
			"type": "date"
		},
		{
			"name": "critical_start_date",
			"type": "date"
		},
		{
			"name": "started_amount",
			"type": "double"
		},
		{
			"name": "produced_amount",
			"type": "double"
		},
		{
			"name": "failed_amount",
			"type": "double"
		},
		{
			"name": "remaining_amount",
			"type": "double"
		},
		{
			"name": "info",
			"type": "text"
		},
		{
			"name": "json_data",
			"type": "jsonb"
		}
	],
	"constraint": {
		"save": {
			"allow": [
				{
					"field": "pro_production_lot",
					"message": "Field '%s' may not be empty",
					"code": [
						[
							"pro_production_lot",
							"<>",
							""
						]
					]
				},
				{
					"field": "pro_company_id",
					"message": "Field '%s' may not be empty",
					"code": [
						[
							"pro_company_id",
							"<>",
							""
						]
					]
				}
			]
		}
	},
	"table_prefix": "pro",
	"extra_field": [
		{
			"type": "date",
			"name": "json_data.actual_end_date"
		},
		{
			"type": "date",
			"name": "json_data.creation_date"
		},
		{
			"type": "date",
			"name": "json_data.critical_end_date"
		},
		{
			"type": "date",
			"name": "json_data.critical_delayed_end_date"
		},
		{
			"type": "date",
			"name": "json_data.critical_real_end_date"
		},
		{
			"type": "date",
			"name": "json_data.critical_start_date"
		},
		{
			"type": "double",
			"name": "json_data.critical_start_difference"
		},
		{
			"type": "date",
			"name": "json_data.delivery_date"
		},
		{
			"type": "date",
			"name": "json_data.est_finish_date"
		},
		{
			"type": "double",
			"name": "json_data.est_finish_difference"
		},
		{
			"type": "time without time zone",
			"name": "json_data.est_finish_time"
		},
		{
			"type": "integer",
			"name": "json_data.finished_work_phase"
		},
		{
			"type": "integer",
			"name": "json_data.firm_id"
		},
		{
			"type": "boolean",
			"name": "json_data.in_report"
		},
		{
			"type": "date",
			"name": "json_data.material_actual_arrival_date"
		},
		{
			"type": "date",
			"name": "json_data.material_estimated_arrival_date"
		},
		{
			"type": "varchar",
			"length": 40,
			"name": "json_data.modifier_id"
		},
		{
			"type": "varchar",
			"length": 80,
			"name": "json_data.parent_production_lot"
		},
		{
			"type": "integer",
			"name": "json_data.partial_delivery_number"
		},
		{
			"type": "integer",
			"name": "json_data.pricing_state"
		},
		{
			"type": "date",
			"name": "json_data.print_date"
		},
		{
			"type": "varchar",
			"length": 20,
			"name": "json_data.purchase_order_id"
		},
		{
			"type": "double",
			"name": "json_data.sales_price__unit"
		},
		{
			"type": "varchar",
			"length": 80,
			"name": "json_data.serial_number"
		},
		{
			"type": "time without time zone",
			"name": "json_data.start_time"
		},
		{
			"type": "text",
			"name": "json_data.stock_event"
		},
		{
			"type": "integer",
			"name": "json_data.track_time_status"
		},
		{
			"type": "varchar",
			"length": 120,
			"name": "json_data.transfer_id"
		},
		{
			"type": "text",
			"name": "json_data.transfer_info"
		},
		{
			"type": "integer",
			"name": "json_data.transfer_state"
		},
		{
			"type": "varchar",
			"length": 20,
			"name": "json_data.type"
		},
		{
			"type": "varchar",
			"length": 60,
			"name": "json_data.work__position_num_id"
		},
		{
			"type": "integer",
			"name": "json_data.work_order_type"
		}
	],
	"calculated_field": [
		{
			"name": "json_data.actual_end_date",
			"type": "date"
		},
		{
			"name": "json_data.critical_start_date",
			"type": "date"
		},
		{
			"name": "json_data.critical_end_date",
			"type": "date"
		},
		{
			"name": "json_data.critical_real_end_date",
			"type": "date"
		},
		{
			"name": "json_data.critical_delayed_end_date",
			"type": "date"
		},
		{
			"name": "json_data.material_estimated_arrival_date",
			"type": "date"
		},
		{
			"name": "json_data.material_actual_arrival_date",
			"type": "date"
		}
	],
	"field_change": [
		{
			"name": "production_order_state",
			"old_name": [
				"state"
			]
		},
		{
			"name": "sales_order_row",
			"old_name": [
				"sales_order_row"
			]
		}
	],
	"name": "table/manager/product/production_order.json",
	"table_name": "production_order"
}