{
	"name": "table/external/cxml/order/order.json",
	"table_name": "order",
	"table_prefix": "ord",
	"record_type": ["sales", "purchase", "accounts_payable", "dispatch_note", "invoice", "confirmation"],
	"local_table": "order",
	"local_record_type": ["sales", "purchase", "accounts_payable", "dispatch_note", "invoice", "confirmation"],
	"default_field": "table/prf/default_field.json",
	"default_order": [
		{
			"field": "order_id",
			"order": ">"
		}
	],
	"field": [
		{
			"field_name": "order_id",
			"field_type": "varchar",
			"field_length": 40,
			"constraint": ["primary key"],
			"not_allowed_value": [""]
		},
		{
			"field_name": "company_id",
			"field_type": "varchar",
			"field_length": 40,
			"foreign_key": [
				{
					"link_type": "prevent delete",
					"linked_field": "company_id",
					"linked_record_type": "customer",
					"linked_table": "company",
					"linking_record_type": "sales"
				},
				{
					"link_type": "prevent delete",
					"linked_field": "company_id",
					"linked_record_type": "supplier",
					"linked_table": "company",
					"linking_record_type": "purchase"
				},
				{
					"link_type": "prevent delete",
					"linked_field": "company_id",
					"linked_record_type": "supplier",
					"linked_table": "company",
					"linking_record_type": "accounts_payable"
				}
			],
			"not_allowed_value": [""]
		},
		{
			"field_name": "company_reference_number",
			"field_type": "varchar",
			"field_length": 80
		},
		{
			"field_name": "confirmation_date",
			"field_type": "date"
		},
		{
			"field_name": "currency_id",
			"field_type": "varchar",
			"field_length": 20,
			"foreign_key-": [
				{
					"link_type": "prevent delete",
					"linked_field": "currency_id",
					"linked_record_type": "",
					"linked_table": "currency",
					"linking_record_type": ""
				}
			],
			"not_allowed_value": [""]
		},
		{
			"field_name": "delivery_address",
			"field_type": "text"
		},
		{
			"field_name": "delivery_company_id",
			"field_type": "varchar",
			"field_length": 40,
			"foreign_key": [
				{
					"link_type": "prevent delete",
					"linked_field": "company_id",
					"linked_record_type": "",
					"linked_table": "company",
					"linking_record_type": "dispatch_note"
				}
			],
			"record.tag": "co_deliv"
		},
		{
			"field_name": "discount_price",
			"field_type": "double"
		},
		{
			"field_name": "due_date",
			"field_type": "date"
		},
		{
			"field_name": "exchange_rate",
			"field_type": "double"
		},
		{
			"field_name": "info",
			"field_type": "text"
		},
		{
			"field_name": "invoicing_address",
			"field_type": "text"
		},
		{
			"field_name": "invoicing_company_id",
			"field_type": "varchar",
			"field_length": 40,
			"foreign_key": [
				{
					"link_type": "prevent delete",
					"linked_field": "company_id",
					"linked_record_type": "",
					"linked_table": "company",
					"linking_record_type": "invoice"
				}
			],
			"record.tag": "co_inv"
		},
		{
			"field_name": "local_price_without_vat",
			"field_type": "double"
		},
		{
			"field_name": "note",
			"field_type": "text"
		},
		{
			"field_name": "order_address",
			"field_type": "text"
		},
		{
			"field_name": "order_date",
			"field_type": "date"
		},
		{
			"field_name": "order_state",
			"field_type": "varchar",
			"field_length": 20,
			"value_array": "order_state_array.json"
		},
		{
			"field_name": "order_type",
			"field_type": "varchar",
			"field_length": 30,
			"not_allowed_value": [""],
			"value_array": "order_type_array.json"
		},
		{
			"field_name": "our_reference",
			"field_type": "varchar",
			"field_length": 40
		},
		{
			"field_name": "person_id",
			"field_type": "varchar",
			"field_length": 80,
			"foreign_key-": [
				{
					"link_type": "prevent delete",
					"linked_field": "person_id",
					"linked_record_type": "",
					"linked_table": "person",
					"linking_record_type": ""
				}
			],
			"not_allowed_value": [""]
		},
		{
			"field_name": "price_with_vat",
			"field_type": "double"
		},
		{
			"field_name": "price_without_vat",
			"field_type": "double"
		},
		{
			"field_name": "term_of_delivery",
			"field_type": "varchar",
			"field_length": 120
		},
		{
			"field_name": "terms_of_payment_id",
			"field_type": "varchar",
			"field_length": 40,
			"foreign_key-": [
				{
					"link_type": "prevent delete",
					"linked_field": "terms_of_payment_id",
					"linked_record_type": "",
					"linked_table": "terms_of_payment",
					"linking_record_type": ""
				}
			],
			"not_allowed_value": [""]
		},
		{
			"field_name": "vat_price",
			"field_type": "double"
		},
		{
			"field_name": "voucher_id",
			"field_type": "varchar",
			"field_length": 20,
			"foreign_key-": [
				{
					"link_type": "prevent delete",
					"linked_field": "voucher_id",
					"linked_record_type": "",
					"linked_table": "bookkeeping_voucher",
					"linking_record_type": ""
				}
			]
		},
		{
			"field_name": "way_of_delivery",
			"field_type": "varchar",
			"field_length": 120
		},
		{
			"field_name": "your_reference",
			"field_type": "varchar",
			"field_length": 40
		}
	],
	"extra_field": [
		{
			"field_name": "json_data.html_text",
			"field_type": "text"
		},
		{
			"field_name": "json_data.import_text",
			"field_type": "text"
		},
		{
			"field_name": "json_data.error",
			"field_type": "text"
		},
		{
			"field_name": "json_data.delivery_address",
			"field_type": "text"
		},
		{
			"field_name": "json_data.invoicing_address",
			"field_type": "text"
		},
		{
			"field_name": "json_data.mark",
			"field_type": "text"
		},
		{
			"field_name": "json_data.confirm_id",
			"field_type": "text"
		},
		{
			"field_name": "json_data.order_action",
			"field_type": "text"
		},
		{
			"field_name": "json_data.order_type",
			"field_type": "text"
		},
		{
			"field_name": "json_data.order_version",
			"field_type": "integer"
		},
		{
			"field_name": "json_data.company_code",
			"field_type": "text"
		},
		{
			"field_name": "json_data.purchase_group",
			"field_type": "text"
		},
		{
			"field_name": "json_data.purchase_organization",
			"field_type": "text"
		},
		{
			"field_name": "json_data.ship_to_code",
			"field_type": "text"
		},
		{
			"field_name": "json_data.storage_location_id",
			"field_type": "text"
		},
		{
			"field_name": "json_data.invoicing_allowed",
			"field_type": "text"
		},
		{
			"field_name": "json_data.party_additional_id",
			"field_type": "text"
		},
		{
			"field_name": "json_data.payment_term_description",
			"field_type": "text"
		},
		{
			"field_name": "json_data.buyer_email",
			"field_type": "text"
		},
		{
			"field_name": "json_data.buyer_name",
			"field_type": "text"
		},
		{
			"field_name": "json_data.document_type",
			"field_type": "text"
		},
		{
			"field_name": "json_data.shipping_date",
			"field_type": "date"
		},
		{
			"field_name": "json_data.shipment_id",
			"field_type": "text"
		},
		{
			"field_name": "json_data.carrier_code",
			"field_type": "text"
		},
		{
			"field_name": "json_data.tracking_number",
			"field_type": "text"
		}
	]
}
