{
	"name": "table/external/nestix/product/nxorderpos.json",
	"table_name": "nxorderpos",
	"table_prefix": "nxord",
	"record_type": ["nxorderpos"],
	"local_table": "production_order",
	"local_record_type": "nxorderpos",
	"default_order": [
		{
			"field": "record_id",
			"order": ">"
		}
	],
	"field": [
		{
			"info": "needed by 4D",
			"field_name": "nxorderposid",
			"local_field": "work_number_id",
			"field_type": "integer"
		},
		{
			"info": "ordr.description",
			"field_name": "nxcustmark",
			"local_field": "production_order_id",
			"field_type": "text"
		},
		{
			"field_name": "nxcustorder",
			"local_field": "json_data.product_name",
			"field_type": "text"
		},
		{
			"info": "ord.company_reference_number",
			"field_name": "nxcustordernmb",
			"local_field": "json_data.company_reference_number",
			"field_type": "text"
		},
		{
			"field_name": "nxworknmb",
			"local_field": "sales_order_id",
			"field_type": "text"
		},
		{
			"info": "needed for emf printing",
			"field_name": "nxdetailid",
			"local_field": "json_data.nxdetailid",
			"field_type": "integer",
			"foreign_key": [
				{
					"link_type": "prevent delete",
					"join_type-": "INNER JOIN",
					"linked_field": "nxdetailid",
					"linked_table": "nxdetail"
				}
			]
		},
		{
			"field_name": "nxdelivdate",
			"local_field": "json_data.delivery_date",
			"field_type": "timestamp without time zone"
		},
		{
			"field_name": "nxduedate",
			"local_field": "json_data.critical_end_date",
			"field_type": "timestamp without time zone"
		},
		{
			"field_name": "nxordercount",
			"local_field": "amount_to_produce",
			"field_type": "integer"
		},
		{
			"info": "ord.order_date",
			"field_name": "nxorderdate",
			"local_field": "json_data.order_date",
			"field_type": "timestamp without time zone"
		},
		{
			"field_name": "nxprice",
			"local_field": "json_data.price",
			"field_type": "integer",
			"default_value": 0
		},
		{
			"field_name": "nxprintmatercert",
			"local_field": "json_data.print_material_certificate",
			"field_type": "integer",
			"default_value": 0
		},
		{
			"field_name": "nxprintsmeltnmb",
			"local_field": "json_data.print_smelting_number",
			"field_type": "integer",
			"default_value": 0
		},
		{
			"info": "pr.quality",
			"field_name": "nxquality",
			"local_field": "json_data.quality",
			"field_type": "text"
		},
		{
			"info": "pr.subgroup",
			"field_name": "nxthickness",
			"local_field": "json_data.thickness",
			"field_type": "integer"
		},
		{
			"field_name": "nxworkphase1",
			"local_field": "json_data.work_phase1",
			"field_type": "text"
		},
		{
			"field_name": "nxworkphase2",
			"local_field": "json_data.work_phase2",
			"field_type": "text"
		},
		{
			"field_name": "nxworkphase3",
			"local_field": "json_data.work_phase3",
			"field_type": "text"
		},
		{
			"field_name": "nxworkphase4",
			"local_field": "json_data.work_phase4",
			"field_type": "text"
		},
		{
			"field_name": "nxworkphase5",
			"local_field": "json_data.work_phase5",
			"field_type": "text"
		},
		{
			"field_name": "nxworkphase6",
			"local_field": "json_data.work_phase6",
			"field_type": "text"
		},
		{
			"field_name": "nxworkphase7",
			"local_field": "json_data.work_phase7",
			"field_type": "text"
		},
		{
			"field_name": "nxworkphase8",
			"local_field": "json_data.work_phase8",
			"field_type": "text"
		},
		{
			"field_name": "nxworkphase9",
			"local_field": "json_data.work_phase9",
			"field_type": "text"
		},
		{
			"field_name": "nxworkphase10",
			"local_field": "json_data.work_phase10",
			"field_type": "text"
		},
		{
			"field_name": "rowid",
			"local_field": "record_id",
			"field_type": "integer",
			"constraint": ["primary key"]
		},
		{
			"field_name": "status",
			"local_field": "production_order_state",
			"field_type": "integer"
		}
	]
}
