{
	"field": [
		{
			"type": "varchar",
			"length": 20,
			"name": "record_type"
		},
		{
			"type": "varchar",
			"length": 40,
			"name": "order_id",
			"foreign_key": {
				"field": "order_id",
				"link_type": "prevent delete",
				"table": "order"
			}
		},
		{
			"type": "varchar",
			"length": 40,
			"name": "dispatch_note_id",
			"foreign_key": {
				"field": "order_id",
				"link_type": "prevent delete",
				"record_type": "dispatch_note",
				"table": "order"
			}
		},
		{
			"type": "varchar",
			"length": 40,
			"name": "invoice_id",
			"foreign_key": {
				"field": "order_id",
				"link_type": "prevent delete",
				"record_type": "invoice",
				"table": "order"
			}
		},
		{
			"type": "varchar",
			"length": 80,
			"name": "product_id",
			"foreign_key": {
				"field": "product_id",
				"link_type": "prevent delete",
				"table": "product"
			}
		},
		{
			"type": "varchar",
			"length": 40,
			"name": "order_code_id",
			"foreign_key": {
				"field": "order_code_id",
				"link_type": "prevent delete",
				"table": "order_code"
			}
		},
		{
			"type": "varchar",
			"length": 40,
			"name": "stock_event_id",
			"foreign_key": {
				"field": "stock_id",
				"link_type": "prevent delete",
				"table": "stock"
			}
		},
		{
			"type": "varchar",
			"length": 20,
			"name": "account_id",
			"foreign_key": {
				"field": "account_id",
				"link_type": "prevent delete",
				"table": "bookkeeping_account"
			}
		},
		{
			"type": "varchar",
			"length": 20,
			"name": "contra_account_id",
			"foreign_key": {
				"field": "account_id",
				"link_type": "prevent delete",
				"table": "bookkeeping_account"
			}
		},
		{
			"type": "varchar",
			"length": 80,
			"name": "project_id"
		},
		{
			"name": "row_number",
			"type": "integer"
		},
		{
			"type": "varchar",
			"length": 20,
			"name": "unit"
		},
		{
			"name": "order_amount",
			"type": "double"
		},
		{
			"name": "delivery_amount",
			"type": "double"
		},
		{
			"name": "waiting_for_delivery",
			"type": "double"
		},
		{
			"name": "delivered_before",
			"type": "double"
		},
		{
			"name": "collected_amount",
			"type": "double"
		},
		{
			"type": "varchar",
			"length": 20,
			"name": "delivery_state"
		},
		{
			"name": "unit_price",
			"type": "double"
		},
		{
			"name": "discount_percent",
			"type": "double"
		},
		{
			"name": "discount_price",
			"type": "double"
		},
		{
			"name": "price_without_vat",
			"type": "double"
		},
		{
			"name": "vat_percent",
			"type": "double"
		},
		{
			"name": "vat_price",
			"type": "double"
		},
		{
			"name": "price_with_vat",
			"type": "double"
		},
		{
			"name": "local_price_without_vat",
			"type": "double"
		},
		{
			"name": "delivery_date",
			"type": "date"
		},
		{
			"name": "confirmed_delivery_date",
			"type": "date"
		},
		{
			"name": "actual_delivery_date",
			"type": "date"
		},
		{
			"type": "varchar",
			"length": 40,
			"name": "production_lot"
		},
		{
			"name": "description",
			"type": "text"
		},
		{
			"name": "info",
			"type": "text"
		},
		{
			"name": "json_data",
			"type": "jsonb"
		}
	],
	"table_prefix": "ordr",
	"save_script": [],
	"extra_field": [
		{
			"type": "varchar",
			"length": 80,
			"name": "json_data.customer_project"
		},
		{
			"type": "double",
			"name": "json_data.debet_price"
		},
		{
			"type": "boolean",
			"name": "json_data.final_payment"
		},
		{
			"type": "integer",
			"name": "json_data.firm_id"
		},
		{
			"type": "double",
			"name": "json_data.kredit_sum"
		},
		{
			"type": "varchar",
			"length": 40,
			"name": "json_data.modifier_id"
		},
		{
			"type": "integer",
			"name": "json_data.po_row_record_number"
		},
		{
			"type": "varchar",
			"length": 80,
			"name": "json_data.project_id"
		},
		{
			"type": "varchar",
			"length": 4,
			"name": "json_data.state"
		},
		{
			"type": "varchar",
			"length": 60,
			"name": "json_data.target"
		},
		{
			"type": "varchar",
			"length": 120,
			"name": "json_data.transfer_id"
		},
		{
			"type": "integer",
			"name": "json_data.transfer_state"
		},
		{
			"type": "double",
			"name": "json_data.commission"
		},
		{
			"type": "varchar",
			"length": 160,
			"name": "json_data.cost_center"
		},
		{
			"type": "double",
			"name": "json_data.cost_price__unit"
		},
		{
			"type": "varchar",
			"length": 20,
			"name": "json_data.customer_row_number"
		},
		{
			"type": "varchar",
			"length": 24,
			"name": "json_data.delivery_customer"
		},
		{
			"type": "double",
			"name": "json_data.dimension"
		},
		{
			"type": "varchar",
			"length": 24,
			"name": "json_data.employee_id"
		},
		{
			"type": "double",
			"name": "json_data.marketing_support"
		},
		{
			"type": "boolean",
			"name": "json_data.no_printing"
		},
		{
			"type": "double",
			"name": "json_data.order_amount"
		},
		{
			"type": "varchar",
			"length": 60,
			"name": "json_data.parcel_code"
		},
		{
			"type": "varchar",
			"length": 40,
			"name": "json_data.position"
		},
		{
			"type": "varchar",
			"length": 12,
			"name": "json_data.purchase_order"
		},
		{
			"type": "varchar",
			"length": 20,
			"name": "json_data.purchase_order_code_id"
		},
		{
			"type": "varchar",
			"length": 60,
			"name": "json_data.sales_order"
		},
		{
			"type": "double",
			"name": "json_data.sales_price"
		},
		{
			"type": "varchar",
			"length": 50,
			"name": "json_data.serial_number"
		},
		{
			"type": "varchar",
			"length": 30,
			"name": "json_data.tariff_heading"
		},
		{
			"type": "double",
			"name": "json_data.price_with_vat"
		},
		{
			"type": "varchar",
			"length": 4,
			"name": "json_data.type"
		},
		{
			"type": "double",
			"name": "json_data.unit_total"
		},
		{
			"type": "varchar",
			"length": 24,
			"name": "json_data.company_id"
		},
		{
			"type": "integer",
			"name": "json_data.confirmation_state"
		},
		{
			"type": "integer",
			"name": "json_data.delivery_to_customer"
		},
		{
			"type": "date",
			"name": "json_data.first_confirmed_delivery_date"
		},
		{
			"type": "boolean",
			"name": "json_data.in_accounts_payable"
		},
		{
			"type": "double",
			"name": "json_data.lme_price"
		},
		{
			"type": "integer",
			"name": "json_data.material_stock_state"
		},
		{
			"type": "double",
			"name": "json_data.order_amount_2"
		},
		{
			"type": "date",
			"name": "json_data.order_date"
		},
		{
			"type": "varchar",
			"length": 4,
			"name": "json_data.order_state"
		},
		{
			"type": "varchar",
			"length": 60,
			"name": "json_data.parcel_type"
		},
		{
			"type": "integer",
			"name": "json_data.partial_delivery_number"
		},
		{
			"type": "integer",
			"name": "json_data.price_confirmation"
		},
		{
			"type": "double",
			"name": "json_data.purchase_cost"
		},
		{
			"type": "varchar",
			"length": 20,
			"name": "json_data.sales_order_id"
		},
		{
			"type": "text",
			"name": "json_data.stock_position"
		},
		{
			"type": "date",
			"name": "json_data.subcontract_sent_date"
		},
		{
			"type": "varchar",
			"length": 100,
			"name": "json_data.company_product_code"
		},
		{
			"type": "varchar",
			"length": 4,
			"name": "json_data.order_type"
		},
		{
			"type": "varchar",
			"length": 60,
			"name": "json_data.work__position_number_id"
		},
		{
			"type": "integer",
			"name": "json_data.work_phase_number"
		},
		{
			"type": "text",
			"name": "json_data.xml_value"
		},
		{
			"type": "varchar",
			"length": 40,
			"name": "json_data.amount_to_collect"
		},
		{
			"type": "double",
			"name": "json_data.calc_sales_price_total"
		},
		{
			"type": "double",
			"name": "json_data.commission__unit"
		},
		{
			"type": "double",
			"name": "json_data.commission_percent"
		},
		{
			"type": "double",
			"name": "json_data.cost_price_total"
		},
		{
			"type": "date",
			"name": "json_data.critical_start_date"
		},
		{
			"type": "double",
			"name": "json_data.critical_start_difference"
		},
		{
			"type": "time without time zone",
			"name": "json_data.critical_start_time"
		},
		{
			"type": "varchar",
			"length": 100,
			"name": "json_data.delivery_time"
		},
		{
			"type": "double",
			"name": "json_data.est_finish_difference"
		},
		{
			"type": "date",
			"name": "json_data.est_manufacture_date"
		},
		{
			"type": "time without time zone",
			"name": "json_data.est_manufacture_time"
		},
		{
			"type": "date",
			"name": "json_data.first_confirmed_delivery_date"
		},
		{
			"type": "boolean",
			"name": "json_data.in_dispatch_note"
		},
		{
			"type": "boolean",
			"name": "json_data.in_enclosure"
		},
		{
			"type": "boolean",
			"name": "json_data.make_invoice"
		},
		{
			"type": "double",
			"name": "json_data.marketing_support__unit"
		},
		{
			"type": "double",
			"name": "json_data.marketing_support_percent"
		},
		{
			"type": "date",
			"name": "json_data.material_act_arrival_date"
		},
		{
			"type": "double",
			"name": "json_data.material_cost"
		},
		{
			"type": "date",
			"name": "json_data.material_est_arrival_date"
		},
		{
			"type": "double",
			"name": "json_data.material_margin"
		},
		{
			"type": "double",
			"name": "json_data.material_margin_percentage"
		},
		{
			"type": "double",
			"name": "json_data.number_of_packets"
		},
		{
			"type": "double",
			"name": "json_data.packet__length"
		},
		{
			"type": "varchar",
			"length": 100,
			"name": "json_data.pallet_number"
		},
		{
			"type": "date",
			"name": "json_data.postcalc_date"
		},
		{
			"type": "double",
			"name": "json_data.price__unit_2"
		},
		{
			"type": "varchar",
			"length": 40,
			"name": "json_data.price_group"
		},
		{
			"type": "double",
			"name": "json_data.price_with_vat__unit"
		},
		{
			"type": "integer",
			"name": "json_data.pricing_state"
		},
		{
			"type": "varchar",
			"length": 4,
			"name": "json_data.production_state"
		},
		{
			"type": "varchar",
			"length": 40,
			"name": "json_data.purchase_order__row"
		},
		{
			"type": "boolean",
			"name": "json_data.remove_from_stock"
		},
		{
			"type": "double",
			"name": "json_data.sales_margin"
		},
		{
			"type": "double",
			"name": "json_data.sales_margin_percentage"
		},
		{
			"type": "double",
			"name": "json_data.sales_probability"
		},
		{
			"type": "varchar",
			"length": 10,
			"name": "json_data.unit_2"
		},
		{
			"type": "double",
			"name": "json_data.unit_price__volume"
		},
		{
			"type": "double",
			"name": "json_data.units__packet"
		},
		{
			"type": "double",
			"name": "json_data.units__x_packet"
		},
		{
			"type": "double",
			"name": "json_data.units__y_packet"
		},
		{
			"type": "double",
			"name": "percent"
		},
		{
			"type": "double",
			"name": "json_data.volume"
		},
		{
			"type": "varchar",
			"length": 40,
			"name": "json_data.waybill_id"
		}
	],
	"calculated_field": [],
	"constraint": {
		"save": {
			"allow": [
				{
					"field": "ordr_order_id",
					"message": "Field '%s' may not be empty",
					"code": [
						[
							"ordr_order_id",
							"<>",
							""
						]
					]
				},
				{
					"field": "ordr_product_id",
					"message": "Field '%s' may not be empty",
					"code": [
						[
							"ordr_product_id",
							"<>",
							""
						]
					]
				},
				{
					"field": "ordr_order_code_id",
					"message": "Field '%s' may not be empty",
					"code": [
						[
							"ordr_order_code_id",
							"<>",
							""
						]
					]
				}
			]
		}
	},
	"name": "table/manager/order/order_row.json",
	"table_name": "order_row"
}