{
	"name": "table/external/4d/order/purchase_order.json",
	"table_name": "purchase_order",
	"table_prefix": "po",
	"record_type": ["purchase"],
	"local_table": "order",
	"local_record_type": "purchase",
	"table_number": 29,
	"default_value": {
		"static": {
			"order_state": "AV",
			"order_type": "RA"
		},
		"copy_value": {
			"delivery_company_id": "company_id",
			"invoicing_company_id": "company_id"
		}
	},
	"field": [
		{
			"field_name": "change_id",
			"local_field": "modify_id",
			"field_type": "varchar",
			"field_length": 45,
			"field_number": 32,
			"constraint": ["index"]
		},
		{
			"field_name": "supplier_id",
			"local_field": "company_id",
			"field_type": "varchar",
			"field_length": 12,
			"field_number": 2,
			"constraint": ["index"],
			"foreign_key": [
				{
					"default_link": true,
					"link_type": "prevent delete",
					"linked_field": "supplier_id",
					"linked_table": "supplier"
				}
			],
			"nullable": true
		},
		{
			"field_name": "company_id",
			"local_field": "json_data.company_id",
			"field_type": "varchar",
			"field_length": 12,
			"field_number": 19,
			"constraint": ["index"],
			"foreign_key": [
				{
					"link_type": "prevent delete",
					"linked_field": "company_id",
					"linked_table": "company"
				}
			],
			"nullable": true
		},
		{
			"field_name": "cost_center",
			"local_field": "json_data.cost_center",
			"field_type": "varchar",
			"field_length": 80,
			"field_number": 29
		},
		{
			"field_name": "creator_id",
			"local_field": "json_data.create_user",
			"field_type": "varchar",
			"field_length": 20,
			"field_number": 33
		},
		{
			"field_name": "currency_id",
			"local_field": "currency_id",
			"field_type": "varchar",
			"field_length": 6,
			"field_number": 16,
			"constraint": ["index"],
			"foreign_key": [
				{
					"link_type": "prevent delete",
					"linked_field": "currency_id",
					"linked_table": "currency"
				}
			],
			"nullable": true
		},
		{
			"field_name": "customer_project",
			"local_field": "json_data.customer_project",
			"field_type": "varchar",
			"field_length": 40,
			"field_number": 28
		},
		{
			"field_name": "delivery_address",
			"local_field": "delivery_address",
			"field_type": "text",
			"field_number": 21
		},
		{
			"field_name": "delivery_to_customer",
			"local_field": "json_data.delivery_to_customer",
			"field_type": "integer",
			"field_number": 38
		},
		{
			"field_name": "exchange_rate",
			"local_field": "exchange_rate",
			"field_type": "double",
			"field_number": 17
		},
		{
			"field_name": "firm_id",
			"local_field": "json_data.firm_id",
			"field_type": "integer",
			"field_number": 23,
			"constraint": ["index"]
		},
		{
			"field_name": "first_delivery_date",
			"local_field": "json_data.first_delivery_date",
			"field_type": "date",
			"field_number": 5,
			"constraint": ["index"]
		},
		{
			"field_name": "freight_charges",
			"local_field": "json_data.freight_charges",
			"field_type": "double",
			"field_number": 26
		},
		{
			"field_name": "info",
			"local_field": "info",
			"field_type": "text",
			"field_number": 9
		},
		{
			"field_name": "invoice_address",
			"local_field": "json_data.invoicing_address",
			"field_type": "text",
			"field_number": 20
		},
		{
			"field_name": "invoicing_state",
			"local_field": "json_data.invoicing_state",
			"field_type": "integer",
			"field_number": 37
		},
		{
			"field_name": "mark",
			"local_field": "json_data.mark",
			"field_type": "varchar",
			"field_length": 80,
			"field_number": 27
		},
		{
			"field_name": "modifier_id",
			"local_field": "modify_user",
			"field_type": "varchar",
			"field_length": 20,
			"field_number": 34
		},
		{
			"field_name": "order_address",
			"local_field": "order_address",
			"field_type": "text",
			"field_number": 10
		},
		{
			"field_name": "order_date",
			"local_field": "order_date",
			"field_type": "date",
			"field_number": 11,
			"constraint": ["index"]
		},
		{
			"field_name": "order_text",
			"local_field": "note",
			"field_type": "text",
			"field_number": 8
		},
		{
			"field_name": "orderer_id",
			"local_field": "person_id",
			"field_type": "varchar",
			"field_length": 12,
			"field_number": 12,
			"constraint": ["index"],
			"foreign_key": [
				{
					"link_type": "prevent delete",
					"linked_field": "employee_id",
					"linked_table": "employee"
				}
			],
			"nullable": true
		},
		{
			"field_name": "our_reference",
			"local_field": "our_reference",
			"field_type": "varchar",
			"field_length": 35,
			"field_number": 14,
			"constraint": ["index"]
		},
		{
			"field_name": "project_id",
			"local_field": "json_data.project_id",
			"field_type": "varchar",
			"field_length": 40,
			"field_number": 31
		},
		{
			"field_name": "purchase_order_id",
			"local_field": "order_id",
			"field_type": "varchar",
			"field_length": 10,
			"field_number": 1,
			"constraint": ["unique"]
		},
		{
			"field_name": "purchase_price",
			"local_field": "price_without_vat",
			"field_type": "double",
			"field_number": 18
		},
		{
			"field_name": "receiver_id",
			"local_field": "json_data.receiver_id",
			"field_type": "varchar",
			"field_length": 12,
			"field_number": 13,
			"constraint": ["index"],
			"foreign_key": [
				{
					"link_type": "prevent delete",
					"linked_field": "supplier_id",
					"linked_table": "supplier"
				}
			],
			"nullable": true
		},
		{
			"field_name": "record_id",
			"local_field": "record_id",
			"field_type": "varchar",
			"field_length": 45,
			"field_number": 24,
			"constraint": ["unique"]
		},
		{
			"field_name": "shipping_date",
			"local_field": "json_data.shipping_date",
			"field_type": "date",
			"field_number": 25
		},
		{
			"field_name": "state",
			"local_field": "order_state",
			"field_type": "varchar",
			"field_length": 2,
			"field_number": 7,
			"constraint": ["index"]
		},
		{
			"field_name": "term_of_delivery",
			"local_field": "term_of_delivery",
			"field_type": "varchar",
			"field_length": 30,
			"field_number": 3
		},
		{
			"field_name": "terms_of_payment_id",
			"local_field": "terms_of_payment_id",
			"field_type": "varchar",
			"field_length": 12,
			"field_number": 6,
			"constraint": ["index"],
			"foreign_key": [
				{
					"link_type": "prevent delete",
					"linked_field": "terms_of_payment_id",
					"linked_table": "terms_of_payment"
				}
			],
			"nullable": true
		},
		{
			"field_name": "transfer_id",
			"local_field": "json_data.transfer_id",
			"field_type": "varchar",
			"field_length": 60,
			"field_number": 30,
			"constraint": ["index"]
		},
		{
			"field_name": "transfer_state",
			"local_field": "json_data.transfer_state",
			"field_type": "integer",
			"field_number": 35
		},
		{
			"field_name": "type_",
			"local_field": "order_type",
			"field_type": "varchar",
			"field_length": 2,
			"field_number": 22,
			"constraint": ["index"]
		},
		{
			"field_name": "way_of_delivery",
			"local_field": "way_of_delivery",
			"field_type": "varchar",
			"field_length": 30,
			"field_number": 4
		},
		{
			"field_name": "waybill_id",
			"local_field": "json_data.waybill_id",
			"field_type": "varchar",
			"field_length": 20,
			"field_number": 36,
			"constraint": ["index"]
		},
		{
			"field_name": "your_reference",
			"local_field": "your_reference",
			"field_type": "varchar",
			"field_length": 35,
			"field_number": 15
		}
	]
}
