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