{
	"name": "table/manager/order/waybill.json",
	"table_name": "waybill",
	"table_prefix": "wbl",
	"record_type": ["waybill", "waybill_row"],
	"default_order": [
		{
			"field": "waybill_id",
			"order": ">"
		}
	],
	"save_script": [],
	"calculated_field": [],
	"field": [
		{
			"field_length": 20,
			"field_name": "currency_id",
			"foreign_key": [
				{
					"link_type": "prevent delete",
					"linked_field": "currency_id",
					"linked_record_type": "",
					"linked_table": "currency",
					"linking_record_type": ""
				}
			]
		},
		{
			"field_name": "date",
			"field_type": "date"
		},
		{
			"field_name": "info",
			"field_type": "text"
		},
		{
			"field_length": 40,
			"field_name": "receiver_id",
			"foreign_key": [
				{
					"link_type": "prevent delete",
					"linked_field": "company_id",
					"linked_record_type": "",
					"linked_table": "company",
					"linking_record_type": ""
				}
			]
		},
		{
			"constraint": ["primary key", "unique"],
			"field_length": 20,
			"field_name": "waybill_id"
		},
		{
			"field_length": 80,
			"field_name": "waybill_number"
		},
		{
			"field_length": 40,
			"field_name": "waybill_state"
		},
		{
			"field_length": 40,
			"field_name": "waybill_type"
		}
	],
	"default_field": "table/default_field.json",
	"extra_field": [
		{
			"field_name": "json_data.expiration_date",
			"field_type": "date"
		},
		{
			"field_length": 80,
			"field_name": "json_data.cash_on_deliv_reference"
		},
		{
			"field_name": "json_data.place_of_departure"
		},
		{
			"field_length": 80,
			"field_name": "json_data.customer_project"
		},
		{
			"field_name": "json_data.term_of_delivery"
		},
		{
			"field_name": "json_data.firm_id"
		},
		{
			"field_name": "json_data.transport_notes"
		},
		{
			"field_length": 80,
			"field_name": "json_data.freight_customer_number"
		},
		{
			"field_length": 160,
			"field_name": "json_data.sender_reference"
		},
		{
			"field_length": 80,
			"field_name": "json_data.sender_customer_number"
		},
		{
			"field_name": "json_data.transport_company"
		},
		{
			"field_name": "json_data.extra_instruction"
		},
		{
			"field_name": "json_data.reservation"
		},
		{
			"field_name": "json_data.cash_on_delivery"
		},
		{
			"field_name": "json_data.weight"
		},
		{
			"field_name": "json_data.receiver_address"
		},
		{
			"field_length": 510,
			"field_name": "json_data.customer_order_number"
		},
		{
			"field_name": "json_data.transfer_state"
		},
		{
			"field_length": 40,
			"field_name": "json_data.modifier_id"
		},
		{
			"field_name": "json_data.volume"
		},
		{
			"field_length": 40,
			"field_name": "json_data.sender_trade_number"
		},
		{
			"field_name": "json_data.total_price"
		},
		{
			"field_length": 80,
			"field_name": "json_data.receiver_deal_number"
		},
		{
			"field_name": "json_data.vat_percent"
		},
		{
			"field_name": "json_data.vat"
		},
		{
			"field_name": "json_data.number_of_pallets"
		},
		{
			"field_name": "json_data.extra_cost"
		},
		{
			"field_length": 80,
			"field_name": "json_data.freight_deal_number"
		},
		{
			"field_name": "json_data.freight_charger_payer"
		},
		{
			"field_length": 80,
			"field_name": "json_data.receiver_customer_number"
		},
		{
			"field_name": "json_data.sender_address"
		},
		{
			"field_length": 80,
			"field_name": "json_data.receiver_phone"
		},
		{
			"field_length": 80,
			"field_name": "json_data.cash_on_deliv_account"
		},
		{
			"field_length": 80,
			"field_name": "json_data.project_id"
		},
		{
			"field_name": "json_data.pallet_length"
		},
		{
			"field_name": "json_data.freight_cost"
		},
		{
			"field_length": 80,
			"field_name": "json_data.sender_deal_number"
		},
		{
			"field_name": "json_data.delivery_address"
		},
		{
			"field_length": 160,
			"field_name": "json_data.receiver_reference"
		},
		{
			"field_length": 120,
			"field_name": "json_data.transfer_id"
		},
		{
			"field_name": "json_data.waybill_row.additional_data",
			"field_type": "text"
		},
		{
			"field_name": "json_data.waybill_row.change_id",
			"field_type": "varchar"
		},
		{
			"field_name": "json_data.waybill_row.content",
			"field_type": "varchar"
		},
		{
			"field_name": "json_data.waybill_row.creator_id",
			"field_type": "varchar"
		},
		{
			"field_name": "json_data.waybill_row.customer_project",
			"field_type": "varchar"
		},
		{
			"field_name": "json_data.waybill_row.firm_id",
			"field_type": "integer"
		},
		{
			"field_name": "json_data.waybill_row.info",
			"field_type": "varchar"
		},
		{
			"field_name": "json_data.waybill_row.mark",
			"field_type": "varchar"
		},
		{
			"field_name": "json_data.waybill_row.modifier_id",
			"field_type": "varchar"
		},
		{
			"field_name": "json_data.waybill_row.number_of_pallets",
			"field_type": "integer"
		},
		{
			"field_name": "json_data.waybill_row.pallet_code",
			"field_type": "varchar"
		},
		{
			"field_name": "json_data.waybill_row.project_id",
			"field_type": "varchar"
		},
		{
			"field_name": "json_data.waybill_row.record_id",
			"field_type": "varchar"
		},
		{
			"field_name": "json_data.waybill_row.state",
			"field_type": "integer"
		},
		{
			"field_name": "json_data.waybill_row.transfer_id",
			"field_type": "varchar"
		},
		{
			"field_name": "json_data.waybill_row.transfer_state",
			"field_type": "integer"
		},
		{
			"field_name": "json_data.waybill_row.type",
			"field_type": "integer"
		},
		{
			"field_name": "json_data.waybill_row.type_of_pallet",
			"field_type": "varchar"
		},
		{
			"field_name": "json_data.waybill_row.volume",
			"field_type": "double"
		},
		{
			"field_name": "json_data.waybill_row.waybill_id",
			"field_type": "varchar"
		},
		{
			"field_name": "json_data.waybill_row.weight",
			"field_type": "double"
		},
		{
			"field_name": "json_data.waybill_row.additional_data",
			"field_type": "text"
		},
		{
			"field_name": "json_data.waybill_row.change_id",
			"field_type": "varchar"
		},
		{
			"field_name": "json_data.waybill_row.content",
			"field_type": "varchar"
		},
		{
			"field_name": "json_data.waybill_row.creator_id",
			"field_type": "varchar"
		},
		{
			"field_name": "json_data.waybill_row.customer_project",
			"field_type": "varchar"
		},
		{
			"field_name": "json_data.waybill_row.firm_id",
			"field_type": "integer"
		},
		{
			"field_name": "json_data.waybill_row.info",
			"field_type": "varchar"
		},
		{
			"field_name": "json_data.waybill_row.mark",
			"field_type": "varchar"
		},
		{
			"field_name": "json_data.waybill_row.modifier_id",
			"field_type": "varchar"
		},
		{
			"field_name": "json_data.waybill_row.number_of_pallets",
			"field_type": "integer"
		},
		{
			"field_name": "json_data.waybill_row.pallet_code",
			"field_type": "varchar"
		},
		{
			"field_name": "json_data.waybill_row.project_id",
			"field_type": "varchar"
		},
		{
			"field_name": "json_data.waybill_row.record_id",
			"field_type": "varchar"
		},
		{
			"field_name": "json_data.waybill_row.state",
			"field_type": "integer"
		},
		{
			"field_name": "json_data.waybill_row.transfer_id",
			"field_type": "varchar"
		},
		{
			"field_name": "json_data.waybill_row.transfer_state",
			"field_type": "integer"
		},
		{
			"field_name": "json_data.waybill_row.type",
			"field_type": "integer"
		},
		{
			"field_name": "json_data.waybill_row.type_of_pallet",
			"field_type": "varchar"
		},
		{
			"field_name": "json_data.waybill_row.volume",
			"field_type": "double"
		},
		{
			"field_name": "json_data.waybill_row.waybill_id",
			"field_type": "varchar"
		},
		{
			"field_name": "json_data.waybill_row.weight",
			"field_type": "double"
		},
		{
			"field_name": "json_data.invoicing_address",
			"field_type": "json"
		},
		{
			"field_name": "json_data.company_name",
			"field_type": "json"
		}
	],
	"field_change": [
		{
			"name": "waybill_state",
			"old_name": ["record_state"]
		},
		{
			"name": "waybill_type",
			"old_name": ["type"]
		}
	],
	"row_table": [
		{
			"field": [
				{
					"length": 80,
					"name": "mark",
					"field_type": "varchar"
				},
				{
					"name": "number_of_pallets",
					"field_type": "integer"
				},
				{
					"length": 80,
					"name": "type_of_pallet",
					"field_type": "varchar"
				},
				{
					"name": "content",
					"field_type": "text"
				},
				{
					"length": 80,
					"name": "pallet_code",
					"field_type": "varchar"
				},
				{
					"name": "weight",
					"field_type": "double"
				},
				{
					"name": "volume",
					"field_type": "double"
				},
				{
					"name": "info",
					"field_type": "text"
				}
			],
			"row_table_name": "waybill_row",
			"save_field": "wbl.json_data"
		}
	]
}
