{
	"name": "table/local/company/company.json",
	"table_name": "company",
	"table_prefix": "co",
	"record_type": ["", "customer", "supplier"],
	"table_name_language": {
		"": "Company",
		"customer": "Customer",
		"supplier": "Supplier"
	},
	"default_field": "table/prf/default_field.json",
	"default_order": [
		{
			"field": "company_id",
			"order": ">"
		}
	],
	"save_script": [],
	"calculated_field": [],
	"field": [
		{
			"field_name": "company_id",
			"field_type": "varchar",
			"field_length": 40,
			"constraint": ["primary key"],
			"not_allowed_value": [""]
		},
		{
			"field_name": "address",
			"field_type": "varchar",
			"field_length": 120
		},
		{
			"field_name": "company_number",
			"field_type": "varchar",
			"field_length": 40
		},
		{
			"field_name": "company_state",
			"field_type": "integer"
		},
		{
			"field_name": "company_type",
			"field_type": "integer"
		},
		{
			"field_name": "country",
			"field_type": "varchar",
			"field_length": 80
		},
		{
			"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_company_id",
			"field_type": "varchar",
			"field_length": 80,
			"foreign_key": [
				{
					"default_link": true,
					"link_type": "prevent delete",
					"linked_field": "company_id",
					"linked_record_type": "customer",
					"linked_table": "company",
					"linking_record_type": "customer"
				}
			]
		},
		{
			"field_name": "email",
			"field_type": "varchar",
			"field_length": 80
		},
		{
			"field_name": "info",
			"field_type": "text"
		},
		{
			"field_name": "invoicing_company_id",
			"field_type": "varchar",
			"field_length": 80,
			"foreign_key": [
				{
					"link_type": "prevent delete",
					"linked_field": "company_id",
					"linked_record_type": "customer",
					"linked_table": "company",
					"linking_record_type": "customer"
				}
			]
		},
		{
			"field_name": "language",
			"field_type": "varchar",
			"field_length": 80
		},
		{
			"field_name": "name",
			"field_type": "varchar",
			"field_length": 120
		},
		{
			"field_name": "name_2",
			"field_type": "varchar",
			"field_length": 120
		},
		{
			"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": ""
				}
			]
		},
		{
			"field_name": "phone",
			"field_type": "varchar",
			"field_length": 80
		},
		{
			"field_name": "post_code",
			"field_type": "varchar",
			"field_length": 40
		},
		{
			"field_name": "post_office",
			"field_type": "varchar",
			"field_length": 120
		},
		{
			"field_name": "term_of_delivery",
			"field_type": "varchar",
			"field_length": 80
		},
		{
			"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": "text_address",
			"field_type": "text"
		},
		{
			"field_name": "way_of_delivery",
			"field_type": "varchar",
			"field_length": 80
		},
		{
			"field_name": "www",
			"field_type": "varchar",
			"field_length": 80
		},
		{
			"field_name": "your_reference",
			"field_type": "varchar",
			"field_length": 80
		}
	],
	"extra_field": [
		{
			"field_name": "json_data.is_company",
			"field_type": "text"
		},
		{
			"field_name": "json_data.covenant",
			"field_type": "varchar",
			"field_length": 160
		},
		{
			"field_name": "json_data.transfer_id",
			"field_type": "varchar",
			"field_length": 120
		},
		{
			"field_name": "json_data.fax_area_code",
			"field_type": "varchar",
			"field_length": 20
		},
		{
			"field_name": "json_data.area",
			"field_type": "varchar",
			"field_length": 80
		},
		{
			"field_name": "json_data.freight_charges_payer",
			"field_type": "varchar",
			"field_length": 160
		},
		{
			"field_name": "json_data.intermediator",
			"field_type": "varchar",
			"field_length": 80
		},
		{
			"field_name": "json_data.waybill_deal_number",
			"field_type": "varchar",
			"field_length": 80
		},
		{
			"field_name": "json_data.foreign_company",
			"field_type": "boolean"
		},
		{
			"field_name": "json_data.send_type",
			"field_type": "varchar",
			"field_length": 80
		},
		{
			"field_name": "json_data.is_collection_invoice",
			"field_type": "boolean"
		},
		{
			"field_name": "json_data.last_modification_date"
		},
		{
			"field_name": "json_data.vat_number",
			"field_type": "varchar",
			"field_length": 50
		},
		{
			"field_name": "json_data.allowed_delivery_delay",
			"field_type": "integer"
		},
		{
			"field_name": "json_data.firm_id",
			"field_type": "integer"
		},
		{
			"field_name": "json_data.cumulative_sales",
			"field_type": "double"
		},
		{
			"field_name": "json_data.type",
			"field_type": "varchar",
			"field_length": 4
		},
		{
			"field_name": "json_data.delivery_time",
			"field_type": "integer"
		},
		{
			"field_name": "json_data.supplier_number",
			"field_type": "varchar",
			"field_length": 30
		},
		{
			"field_name": "json_data.trade_registry_number",
			"field_type": "varchar",
			"field_length": 34
		},
		{
			"field_name": "json_data.stock_position",
			"field_type": "varchar",
			"field_length": 60
		},
		{
			"field_name": "json_data.price_group",
			"field_type": "varchar",
			"field_length": 160
		},
		{
			"field_name": "json_data.telephone_area_code",
			"field_type": "varchar",
			"field_length": 20
		},
		{
			"field_name": "json_data.telephone_number",
			"field_type": "varchar",
			"field_length": 40
		},
		{
			"field_name": "json_data.shelf_number",
			"field_type": "varchar",
			"field_length": 160
		},
		{
			"field_name": "json_data.row_discount_percentage",
			"field_type": "double"
		},
		{
			"field_name": "json_data.abc_class",
			"field_type": "varchar",
			"field_length": 40
		},
		{
			"field_name": "json_data.default_sales_person_id",
			"field_type": "varchar",
			"field_length": 24
		},
		{
			"field_name": "json_data.capacity_multiplier",
			"field_type": "double"
		},
		{
			"field_name": "json_data.customer_project",
			"field_type": "varchar",
			"field_length": 80
		},
		{
			"field_name": "json_data.employee_count",
			"field_type": "integer"
		},
		{
			"field_name": "json_data.order_discount_percentage",
			"field_type": "double"
		},
		{
			"info": "(company.json_data->company_type_key->>customer = true or company.json_data->company_type_key->>pavelvu = true)",
			"field_name": "json_data.company_type_key",
			"field_length": 40
		},
		{
			"field_name": "json_data.payment_delay",
			"field_type": "integer"
		},
		{
			"field_name": "json_data.add_packing_material",
			"field_type": "integer"
		},
		{
			"field_name": "json_data.company_number",
			"field_length": 24
		},
		{
			"field_name": "json_data.number",
			"field_type": "varchar",
			"field_length": 24
		},
		{
			"field_name": "json_data.invoice_number_serie",
			"field_type": "varchar",
			"field_length": 20
		},
		{
			"field_name": "json_data.waybill_customer_number",
			"field_type": "varchar",
			"field_length": 80
		},
		{
			"field_name": "json_data.group_1",
			"field_type": "varchar",
			"field_length": 24
		},
		{
			"field_name": "json_data.transfer_state",
			"field_type": "integer"
		},
		{
			"field_name": "json_data.extra_cost_to_invoice",
			"field_type": "double"
		},
		{
			"field_name": "json_data.bank_account",
			"field_type": "varchar",
			"field_length": 80
		},
		{
			"field_name": "json_data.accountable_person_id",
			"field_type": "varchar",
			"field_length": 24
		},
		{
			"field_name": "json_data.group_2",
			"field_type": "varchar",
			"field_length": 24
		},
		{
			"field_name": "json_data.work_advance_days",
			"field_type": "double"
		},
		{
			"field_name": "json_data.fax_number",
			"field_type": "varchar",
			"field_length": 40
		},
		{
			"field_name": "json_data.extra_time_multiplier",
			"field_type": "double"
		},
		{
			"field_name": "json_data.group_3",
			"field_type": "varchar",
			"field_length": 24
		},
		{
			"field_name": "json_data.cost_center",
			"field_type": "varchar",
			"field_length": 160
		},
		{
			"field_name": "json_data.bank_code",
			"field_type": "varchar",
			"field_length": 10
		},
		{
			"field_name": "json_data.credit_limit",
			"field_type": "double"
		},
		{
			"field_name": "json_data.electronic_invoice_address",
			"field_type": "varchar",
			"field_length": 160
		},
		{
			"field_name": "json_data.purchase_costs",
			"field_type": "double"
		},
		{
			"field_name": "json_data.project_id",
			"field_type": "varchar",
			"field_length": 80
		},
		{
			"field_name": "json_data.bank",
			"field_type": "varchar",
			"field_length": 40
		},
		{
			"field_name": "json_data.is_foreign_supplier",
			"field_type": "boolean"
		},
		{
			"field_name": "json_data.default_account_id",
			"field_type": "varchar",
			"field_length": 24
		},
		{
			"field_name": "json_data.allowed_delivery_advance",
			"field_type": "integer"
		},
		{
			"field_name": "json_data.add_packing_cost",
			"field_type": "integer"
		},
		{
			"field_name": "json_data.foreign_sales_price_in_use",
			"field_type": "boolean"
		},
		{
			"field_name": "json_data.links_collection_href",
			"field_type": "varchar"
		},
		{
			"field_name": "json_data.links_self_href",
			"field_type": "varchar"
		},
		{
			"field_name": "json_data.avatar_url",
			"field_type": "varchar"
		},
		{
			"field_name": "json_data.billing.address_2",
			"field_type": "varchar"
		},
		{
			"field_name": "json_data.billing.city",
			"field_type": "varchar"
		},
		{
			"field_name": "json_data.billing.country",
			"field_type": "varchar"
		},
		{
			"field_name": "json_data.billing.email",
			"field_type": "varchar"
		},
		{
			"field_name": "json_data.billing.first_name",
			"field_type": "varchar"
		},
		{
			"field_name": "json_data.billing.last_name",
			"field_type": "varchar"
		},
		{
			"field_name": "json_data.billing.phone",
			"field_type": "varchar"
		},
		{
			"field_name": "json_data.billing.postcode",
			"field_type": "varchar"
		},
		{
			"field_name": "json_data.billing.state",
			"field_type": "varchar"
		},
		{
			"field_name": "json_data.date_created",
			"field_type": "date"
		},
		{
			"field_name": "json_data.date_created_gmt",
			"field_type": "date"
		},
		{
			"field_name": "json_data.date_modified",
			"field_type": "date"
		},
		{
			"field_name": "json_data.date_modified_gmt",
			"field_type": "date"
		},
		{
			"field_name": "json_data.first_name",
			"field_type": "varchar"
		},
		{
			"field_name": "json_data.is_paying_customer",
			"field_type": "varchar"
		},
		{
			"field_name": "json_data.last_name",
			"field_type": "varchar"
		},
		{
			"field_name": "json_data.meta_data",
			"field_type": "varchar"
		},
		{
			"field_name": "json_data.orders_count",
			"field_type": "varchar"
		},
		{
			"field_name": "json_data.role",
			"field_type": "varchar"
		},
		{
			"field_name": "json_data.shipping.address_1",
			"field_type": "varchar"
		},
		{
			"field_name": "json_data.shipping.address_2",
			"field_type": "varchar"
		},
		{
			"field_name": "json_data.shipping.city",
			"field_type": "varchar"
		},
		{
			"field_name": "json_data.shipping.company",
			"field_type": "varchar"
		},
		{
			"field_name": "json_data.shipping.country",
			"field_type": "varchar"
		},
		{
			"field_name": "json_data.shipping.first_name",
			"field_type": "varchar"
		},
		{
			"field_name": "json_data.shipping.last_name",
			"field_type": "varchar"
		},
		{
			"field_name": "json_data.shipping.postcode",
			"field_type": "varchar"
		},
		{
			"field_name": "json_data.shipping.state",
			"field_type": "varchar"
		},
		{
			"field_name": "json_data.total_spent",
			"field_type": "varchar"
		},
		{
			"field_name": "json_data.store_id",
			"field_type": "integer"
		}
	],
	"field_change": [
		{
			"name": "company_state",
			"old_name": ["record_state"]
		}
	],
	"virtual_record_type": [
		{
			"invoicing customer": "customer"
		},
		{
			"delivery customer": "customer"
		}
	]
}
