{
	"name": "table/local/order/order_row.json",
	"table_name": "order_row",
	"table_prefix": "ordr",
	"main_table": "order",
	"record_type": ["sales", "purchase", "invoice", "accounts_payable", "credit_note", "test"],
	"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",
		"test": "Test order"
	},
	"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.transfer_state",
			"field_type": "integer"
		},
		{
			"field_name": "json_data.units__packet",
			"field_type": "double"
		},
		{
			"field_name": "json_data.final_payment",
			"field_type": "boolean"
		},
		{
			"field_name": "json_data.price_confirmation",
			"field_type": "integer"
		},
		{
			"field_name": "json_data.commission__unit",
			"field_type": "double"
		},
		{
			"field_name": "json_data.sales_margin",
			"field_type": "double"
		},
		{
			"field_name": "json_data.firm_id",
			"field_type": "integer"
		},
		{
			"field_name": "json_data.delivery_customer",
			"field_type": "varchar",
			"field_length": 24
		},
		{
			"field_name": "json_data.in_accounts_payable",
			"field_type": "boolean"
		},
		{
			"field_name": "json_data.material_stock_state",
			"field_type": "integer"
		},
		{
			"field_name": "json_data.price_group",
			"field_type": "varchar",
			"field_length": 40
		},
		{
			"field_name": "json_data.employee_id",
			"field_type": "varchar",
			"field_length": 24
		},
		{
			"field_name": "json_data.marketing_support_percent",
			"field_type": "double"
		},
		{
			"field_name": "json_data.debet_price",
			"field_type": "double"
		},
		{
			"field_name": "json_data.kredit_sum",
			"field_type": "double"
		},
		{
			"field_name": "json_data.purchase_order",
			"field_type": "varchar",
			"field_length": 12
		},
		{
			"field_name": "json_data.target",
			"field_type": "varchar",
			"field_length": 60
		},
		{
			"field_name": "json_data.delivery_time",
			"field_type": "varchar",
			"field_length": 100
		},
		{
			"field_name": "json_data.order_date",
			"field_type": "date"
		},
		{
			"field_name": "json_data.price__unit_2",
			"field_type": "double"
		},
		{
			"field_name": "json_data.po_row_record_number",
			"field_type": "integer"
		},
		{
			"field_name": "json_data.calc_sales_price_total",
			"field_type": "double"
		},
		{
			"field_name": "json_data.tariff_heading",
			"field_type": "varchar",
			"field_length": 30
		},
		{
			"field_name": "json_data.make_invoice",
			"field_type": "boolean"
		},
		{
			"field_name": "json_data.est_manufacture_time",
			"field_type": "time"
		},
		{
			"field_name": "json_data.work__position_number_id",
			"field_type": "varchar",
			"field_length": 60
		},
		{
			"field_name": "json_data.work_phase_number",
			"field_type": "integer"
		},
		{
			"field_name": "json_data.order_state",
			"field_type": "varchar",
			"field_length": 4
		},
		{
			"field_name": "json_data.no_printing",
			"field_type": "boolean"
		},
		{
			"field_name": "json_data.critical_start_date",
			"field_type": "date"
		},
		{
			"field_name": "json_data.pricing_state",
			"field_type": "integer"
		},
		{
			"field_name": "json_data.order_type",
			"field_type": "varchar",
			"field_length": 4
		},
		{
			"field_name": "json_data.parcel_code",
			"field_type": "varchar",
			"field_length": 60
		},
		{
			"field_name": "percent",
			"field_type": "double"
		},
		{
			"field_name": "json_data.purchase_order_code_id",
			"field_type": "varchar",
			"field_length": 20
		},
		{
			"field_name": "json_data.marketing_support",
			"field_type": "double"
		},
		{
			"field_name": "json_data.est_finish_difference",
			"field_type": "double"
		},
		{
			"field_name": "json_data.sales_price",
			"field_type": "double"
		},
		{
			"field_name": "json_data.delivery_to_customer",
			"field_type": "integer"
		},
		{
			"field_name": "json_data.confirmation_state",
			"field_type": "integer"
		},
		{
			"field_name": "json_data.parcel_type",
			"field_type": "varchar",
			"field_length": 60
		},
		{
			"field_name": "json_data.customer_project",
			"field_type": "varchar",
			"field_length": 80
		},
		{
			"field_name": "json_data.sales_margin_percentage",
			"field_type": "double"
		},
		{
			"field_name": "json_data.volume",
			"field_type": "double"
		},
		{
			"field_name": "json_data.units__y_packet",
			"field_type": "double"
		},
		{
			"field_name": "json_data.units__x_packet",
			"field_type": "double"
		},
		{
			"field_name": "json_data.unit_total",
			"field_type": "double"
		},
		{
			"field_name": "json_data.unit_price__volume",
			"field_type": "double"
		},
		{
			"field_name": "json_data.critical_start_difference",
			"field_type": "double"
		},
		{
			"field_name": "json_data.unit_2",
			"field_type": "varchar",
			"field_length": 10
		},
		{
			"field_name": "json_data.stock_position",
			"field_type": "text"
		},
		{
			"field_name": "json_data.number_of_packets",
			"field_type": "double"
		},
		{
			"field_name": "json_data.material_margin_percentage",
			"field_type": "double"
		},
		{
			"field_name": "json_data.amount_to_collect",
			"field_type": "varchar",
			"field_length": 40
		},
		{
			"field_name": "json_data.type",
			"field_type": "varchar",
			"field_length": 4
		},
		{
			"field_name": "json_data.transfer_id",
			"field_type": "varchar",
			"field_length": 120
		},
		{
			"field_name": "json_data.subcontract_sent_date",
			"field_type": "date"
		},
		{
			"field_name": "json_data.purchase_order__row",
			"field_type": "varchar",
			"field_length": 40
		},
		{
			"field_name": "json_data.state",
			"field_type": "varchar",
			"field_length": 4
		},
		{
			"field_name": "json_data.serial_number",
			"field_type": "varchar",
			"field_length": 50
		},
		{
			"field_name": "json_data.sales_probability",
			"field_type": "double"
		},
		{
			"field_name": "json_data.sales_order_id",
			"field_type": "varchar",
			"field_length": 20
		},
		{
			"field_name": "json_data.cost_price_total",
			"field_type": "double"
		},
		{
			"field_name": "json_data.waybill_id",
			"field_type": "varchar",
			"field_length": 40
		},
		{
			"field_name": "json_data.remove_from_stock",
			"field_type": "boolean"
		},
		{
			"field_name": "json_data.partial_delivery_number",
			"field_type": "integer"
		},
		{
			"field_name": "json_data.purchase_cost",
			"field_type": "double"
		},
		{
			"field_name": "json_data.in_dispatch_note",
			"field_type": "boolean"
		},
		{
			"field_name": "json_data.project_id",
			"field_type": "varchar",
			"field_length": 80
		},
		{
			"field_name": "json_data.in_enclosure",
			"field_type": "boolean"
		},
		{
			"field_name": "json_data.production_state",
			"field_type": "varchar",
			"field_length": 4
		},
		{
			"field_name": "json_data.dimension",
			"field_type": "double"
		},
		{
			"field_name": "json_data.supplier_product_code",
			"field_type": "varchar",
			"field_length": 100
		},
		{
			"field_name": "json_data.commission_percent",
			"field_type": "double"
		},
		{
			"field_name": "json_data.pallet_number",
			"field_type": "varchar",
			"field_length": 100
		},
		{
			"field_name": "json_data.position",
			"field_type": "varchar",
			"field_length": 40
		},
		{
			"field_name": "json_data.xml_value",
			"field_type": "text"
		},
		{
			"field_name": "json_data.material_cost",
			"field_type": "double"
		},
		{
			"field_name": "json_data.material_act_arrival_date",
			"field_type": "date"
		},
		{
			"field_name": "json_data.marketing_support__unit",
			"field_type": "double"
		},
		{
			"field_name": "json_data.packet__length",
			"field_type": "double"
		},
		{
			"field_name": "json_data.critical_start_time",
			"field_type": "time"
		},
		{
			"field_name": "json_data.postcalc_date",
			"field_type": "date"
		},
		{
			"field_name": "json_data.material_margin",
			"field_type": "double"
		},
		{
			"field_name": "json_data.cost_center",
			"field_type": "varchar",
			"field_length": 160
		},
		{
			"field_name": "json_data.cost_price__unit",
			"field_type": "double"
		},
		{
			"field_name": "json_data.first_confirmed_delivery_date",
			"field_type": "date"
		},
		{
			"field_name": "json_data.material_est_arrival_date",
			"field_type": "date"
		},
		{
			"field_name": "json_data.lme_price",
			"field_type": "double"
		},
		{
			"field_name": "json_data.order_amount_2",
			"field_type": "double"
		},
		{
			"field_name": "json_data.company_id",
			"field_type": "varchar",
			"field_length": 24
		},
		{
			"field_name": "json_data.commission",
			"field_type": "double"
		},
		{
			"field_name": "json_data.customer_row_number",
			"field_type": "varchar",
			"field_length": 20
		},
		{
			"field_name": "json_data.est_manufacture_date",
			"field_type": "date"
		},
		{
			"field_name": "json_data.method_id",
			"field_type": "varchar"
		},
		{
			"field_name": "json_data.sku",
			"field_type": "double"
		},
		{
			"field_name": "json_data.subtotal",
			"field_type": "double"
		},
		{
			"field_name": "json_data.subtotal_tax",
			"field_type": "double"
		},
		{
			"field_name": "json_data.tax_class",
			"field_type": "varchar"
		},
		{
			"field_name": "json_data.subtotal_id",
			"field_type": "varchar"
		},
		{
			"field_name": "json_data.total",
			"field_type": "varchar"
		},
		{
			"field_name": "json_data.variation_id",
			"field_type": "varchar"
		},
		{
			"field_name": "json_data.product_name",
			"field_type": "varchar"
		},
		{
			"field_name": "json_data.customer_name",
			"field_type": "varchar"
		},
		{
			"field_name": "json_data.project_number",
			"field_type": "varchar"
		},
		{
			"field_name": "json_data.erp_status",
			"field_type": "integer"
		},
		{
			"field_name": "json_data.mes_status",
			"field_type": "integer"
		},
		{
			"field_name": "json_data.id",
			"field_type": "bigint"
		},
		{
			"field_name": "json_data.mark",
			"field_type": "varchar"
		},
		{
			"field_name": "json_data.additional_data",
			"field_type": "text"
		}
	],
	"field_change": [
		{
			"name": "production_order_id",
			"old_name": ["production_lot"]
		}
	],
	"record_type-not-in-use": ["accounts_payable", "dispatch_note", "invoice", "purchase", "sales"]
}
