{
	"name": "table/external/cxml/order/order_row.json",
	"table_name": "order_row",
	"table_prefix": "ordr",
	"main_table": "order",
	"record_type": ["sales", "purchase", "invoice", "accounts_payable", "credit_note"],
	"local_table": "order_row",
	"local_record_type": ["sales", "purchase", "invoice", "accounts_payable", "credit_note"],
	"table_name_language": {
		"accounts_payable": "Accounts payable row",
		"credit_note": "Credit note row",
		"invoice": "Invoice row",
		"production": "Production order row",
		"purchase": "Purchase order row",
		"sales": "Sales order row"
	},
	"default_field": "table/prf/default_field.json",
	"default_order": [
		{
			"field": "order_id",
			"order": "<"
		},
		{
			"field": "row_number",
			"order": ">"
		}
	],
	"save_script": [],
	"calculated_field": [],
	"field": [
		{
			"field_name": "order_id",
			"field_type": "varchar",
			"field_length": 40,
			"foreign_key-": [
				{
					"link_type": "prevent delete",
					"linked_field": "order_id",
					"linked_record_type": "sales",
					"linked_table": "order",
					"linking_record_type": "sales"
				},
				{
					"link_type": "prevent delete",
					"linked_field": "order_id",
					"linked_record_type": "purchase",
					"linked_table": "order",
					"linking_record_type": "purchase"
				},
				{
					"link_type": "prevent delete",
					"linked_field": "order_id",
					"linked_record_type": "accounts_payable",
					"linked_table": "order",
					"linking_record_type": "accounts_payable"
				},
				{
					"link_type": "prevent delete",
					"linked_field": "order_id",
					"linked_record_type": "credit_note",
					"linked_table": "order",
					"linking_record_type": "credit_note"
				}
			],
			"not_allowed_value": [""]
		},
		{
			"field_name": "invoice_id",
			"field_type": "varchar",
			"field_length": 40,
			"foreign_key-": [
				{
					"link_type": "prevent delete",
					"linked_field": "order_id",
					"linked_record_type": "invoice",
					"linked_table": "order",
					"linking_record_type": "invoice"
				}
			]
		},
		{
			"field_name": "price_with_vat",
			"field_type": "double"
		},
		{
			"field_name": "price_without_vat",
			"field_type": "double"
		},
		{
			"field_name": "product_id",
			"field_type": "varchar",
			"field_length": 80,
			"foreign_key-": [
				{
					"link_type": "prevent delete",
					"linked_field": "product_id",
					"linked_record_type": "",
					"linked_table": "product",
					"linking_record_type": ""
				}
			],
			"not_allowed_value": [""]
		},
		{
			"field_name": "account_id",
			"field_type": "varchar",
			"field_length": 20,
			"foreign_key-": [
				{
					"info": "aga, check",
					"default_link": true,
					"link_type": "prevent delete",
					"linked_field": "account_id",
					"linked_record_type": "",
					"linked_table": "bookkeeping_account",
					"linking_record_type": ""
				}
			]
		},
		{
			"field_name": "actual_delivery_date",
			"field_type": "date"
		},
		{
			"field_name": "collected_amount",
			"field_type": "varchar",
			"field_length": 20
		},
		{
			"field_name": "confirmed_delivery_date",
			"field_type": "date"
		},
		{
			"field_name": "contra_account_id",
			"field_type": "varchar",
			"field_length": 20,
			"foreign_key-": [
				{
					"link_type": "prevent delete",
					"linked_field": "account_id",
					"linked_record_type": "",
					"linked_table": "bookkeeping_account",
					"linking_record_type": ""
				}
			]
		},
		{
			"field_name": "delivered_before",
			"field_type": "double"
		},
		{
			"field_name": "delivery_amount",
			"field_type": "double"
		},
		{
			"field_name": "delivery_date",
			"field_type": "date"
		},
		{
			"field_name": "delivery_state",
			"field_type": "varchar",
			"field_length": 20
		},
		{
			"field_name": "description",
			"field_type": "text"
		},
		{
			"field_name": "discount_percent",
			"field_type": "double"
		},
		{
			"field_name": "discount_price",
			"field_type": "double"
		},
		{
			"field_name": "dispatch_note_id",
			"field_type": "varchar",
			"field_length": 40,
			"foreign_key-": [
				{
					"link_type": "prevent delete",
					"linked_field": "order_id",
					"linked_record_type": "dispatch_note",
					"linked_table": "order",
					"linking_record_type": "dispatch_note"
				}
			]
		},
		{
			"field_name": "info",
			"field_type": "text"
		},
		{
			"field_name": "local_price_without_vat",
			"field_type": "double"
		},
		{
			"field_name": "order_amount",
			"field_type": "double"
		},
		{
			"field_name": "order_code_id",
			"field_type": "varchar",
			"field_length": 40,
			"foreign_key-": [
				{
					"link_type": "prevent delete",
					"linked_field": "order_code_id",
					"linked_record_type": "",
					"linked_table": "order_code",
					"linking_record_type": ""
				}
			],
			"not_allowed_value": [""]
		},
		{
			"field_name": "production_order_id",
			"field_type": "varchar",
			"field_length": 40,
			"foreign_key-": [
				{
					"link_type": "clear linking field",
					"linked_field": "production_order_id",
					"linked_record_type": "",
					"linked_table": "production_order",
					"linking_record_type": ""
				}
			]
		},
		{
			"field_name": "row_number",
			"field_type": "integer"
		},
		{
			"field_name": "stock_event_id",
			"field_type": "varchar",
			"field_length": 40,
			"foreign_key-": [
				{
					"link_type": "prevent delete",
					"linked_field": "stock_id",
					"linked_record_type": "",
					"linked_table": "stock",
					"linking_record_type": ""
				}
			]
		},
		{
			"field_name": "unit",
			"field_type": "varchar",
			"field_length": 20
		},
		{
			"field_name": "unit_price",
			"field_type": "double"
		},
		{
			"field_name": "vat_percent",
			"field_type": "double"
		},
		{
			"field_name": "vat_price",
			"field_type": "double"
		},
		{
			"field_name": "waiting_for_delivery",
			"field_type": "double"
		}
	],
	"extra_field": [
		{
			"field_name": "json_data.customer_row_number",
			"field_type": "varchar",
			"field_length": 20
		},
		{
			"field_name": "json_data.supplier_product_code",
			"field_type": "varchar",
			"field_length": 100
		},
		{
			"field_name": "json_data.conversion_factor",
			"field_type": "double"
		},
		{
			"field_name": "json_data.commodity_code",
			"field_type": "text"
		},
		{
			"field_name": "json_data.commodity_description",
			"field_type": "text"
		},
		{
			"field_name": "json_data.planned_acceptance_days",
			"field_type": "integer"
		},
		{
			"field_name": "json_data.receiving_type",
			"field_type": "integer"
		},
		{
			"field_name": "json_data.tax_category",
			"field_type": "text"
		},
		{
			"field_name": "json_data.buyer_planner_code",
			"field_type": "text"
		},
		{
			"field_name": "json_data.buyer_planner_name",
			"field_type": "text"
		},
		{
			"field_name": "json_data.confirmation_instruction",
			"field_type": "text"
		},
		{
			"field_name": "json_data.ship_notice_instruction",
			"field_type": "text"
		},
		{
			"field_name": "json_data.invoice_instruction",
			"field_type": "text"
		},
		{
			"field_name": "json_data.schedule_line_number",
			"field_type": "text"
		},
		{
			"field_name": "json_data.requires_batch",
			"field_type": "text"
		},
		{
			"field_name": "json_data.project_id",
			"field_type": "varchar",
			"field_length": 80
		},
		{
			"field_name": "json_data.partial_delivery_number",
			"field_type": "integer"
		}
	],
	"field_change": [
		{
			"name": "production_order_id",
			"old_name": ["production_lot"]
		}
	],
	"record_type-not-in-use": ["accounts_payable", "dispatch_note", "invoice", "purchase", "sales"]
}
