{
	"name": "table/external/4d/order/order-invoice.json",
	"info": "Tag table_prefix can't be 'in' like in 4D because 'in' is reserved word in sql. If real 4d prefix is needed use system/4d.json.table_prefix_change",
	"table_name": "invoice",
	"table_prefix": "inv",
	"record_type": ["invoice", "credit_note"],
	"local_table": "order",
	"local_record_type": ["invoice", "credit_note"],
	"table_number": 17,
	"field": [
		{
			"field_name": "cash_discount_due_date",
			"local_field": "json_data.cash_discount_due_date",
			"field_type": "date",
			"field_number": 37
		},
		{
			"field_name": "change_id",
			"local_field": "modify_id",
			"field_type": "varchar",
			"field_length": 45,
			"field_number": 61
		},
		{
			"field_name": "collection_invoice_id",
			"local_field": "json_data.collection_invoice_id",
			"field_type": "varchar",
			"field_length": 10,
			"field_number": 54,
			"constraint": ["index"]
		},
		{
			"field_name": "collection_started",
			"local_field": "json_data.collection_started",
			"field_type": "date",
			"field_number": 49
		},
		{
			"field_name": "coming_total",
			"local_field": "json_data.coming_price",
			"field_type": "double",
			"field_number": 30,
			"constraint": ["index"]
		},
		{
			"field_name": "company_id",
			"local_field": "invoicing_company_id",
			"field_type": "varchar",
			"field_length": 12,
			"field_number": 1,
			"constraint": ["index"],
			"foreign_key": [
				{
					"default_link": true,
					"link_type": "prevent delete",
					"linked_field": "company_id",
					"linked_table": "company",
					"linking_record_type": "invoice"
				},
				{
					"default_link": false,
					"link_type": "prevent delete",
					"linked_field": "company_id",
					"linked_table": "company",
					"linking_record_type": "credit_note"
				}
			],
			"nullable": true
		},
		{
			"field_name": "creator_id",
			"local_field": "json_data.create_user",
			"field_type": "varchar",
			"field_length": 20,
			"field_number": 62
		},
		{
			"field_name": "credit_note",
			"local_field": "json_data.credit_note",
			"field_type": "varchar",
			"field_length": 10,
			"field_number": 47,
			"constraint": ["index"]
		},
		{
			"field_name": "currency_id",
			"local_field": "currency_id",
			"field_type": "varchar",
			"field_length": 6,
			"field_number": 14,
			"constraint": ["index"],
			"foreign_key": [
				{
					"link_type": "prevent delete",
					"linked_field": "currency_id",
					"linked_table": "currency"
				}
			],
			"nullable": true
		},
		{
			"field_name": "customer_order_number",
			"local_field": "company_reference_number",
			"field_type": "varchar",
			"field_length": 80,
			"field_number": 56,
			"constraint": ["index"]
		},
		{
			"field_name": "customer_project",
			"local_field": "json_data.customer_project",
			"field_type": "varchar",
			"field_length": 40,
			"field_number": 45
		},
		{
			"field_name": "date_",
			"local_field": "order_date",
			"field_type": "date",
			"field_number": 5,
			"constraint": ["index"]
		},
		{
			"field_name": "delivery_address",
			"local_field": "delivery_address",
			"field_type": "text",
			"field_number": 35
		},
		{
			"field_name": "delivery_company_id",
			"local_field": "delivery_company_id",
			"field_type": "varchar",
			"field_length": 12,
			"field_number": 34,
			"constraint": ["index"],
			"foreign_key": [
				{
					"link_type": "prevent delete",
					"linked_field": "company_id",
					"linked_table": "company"
				}
			],
			"nullable": true
		},
		{
			"field_name": "description_of_the_goods",
			"local_field": "json_data.description_of_the_goods",
			"field_type": "text",
			"field_number": 43
		},
		{
			"field_name": "destination_date",
			"local_field": "json_data.destination_date",
			"field_type": "date",
			"field_number": 48,
			"constraint": ["index"]
		},
		{
			"field_name": "discount_amount",
			"local_field": "discount_price",
			"field_type": "double",
			"field_number": 25
		},
		{
			"field_name": "discount_percentage",
			"local_field": "json_data.discount_percentage",
			"field_type": "double",
			"field_number": 26
		},
		{
			"field_name": "discount_total",
			"local_field": "json_data.payment_discount_price",
			"field_type": "double",
			"field_number": 23
		},
		{
			"field_name": "divided",
			"local_field": "json_data.divided",
			"field_type": "varchar",
			"field_length": 6,
			"field_number": 27
		},
		{
			"field_name": "due_date",
			"local_field": "due_date",
			"field_type": "date",
			"field_number": 10,
			"constraint": ["index"]
		},
		{
			"field_name": "eur_1_no",
			"local_field": "json_data.eur_1_no",
			"field_type": "varchar",
			"field_length": 40,
			"field_number": 38
		},
		{
			"field_name": "exchange_rate",
			"local_field": "exchange_rate",
			"field_type": "double",
			"field_number": 44
		},
		{
			"field_name": "exported_to_ar",
			"local_field": "json_data.exported_to_ar",
			"field_type": "boolean",
			"field_number": 9,
			"constraint": ["index"]
		},
		{
			"field_name": "firm_id",
			"local_field": "json_data.firm_id",
			"field_type": "integer",
			"field_number": 46,
			"constraint": ["index"]
		},
		{
			"field_name": "footnote",
			"local_field": "json_data.footnote",
			"field_type": "text",
			"field_number": 2
		},
		{
			"field_name": "gross_weight",
			"local_field": "json_data.gross_weight",
			"field_type": "double",
			"field_number": 40
		},
		{
			"field_name": "handler_id",
			"local_field": "json_data.handler_id",
			"field_type": "varchar",
			"field_length": 12,
			"field_number": 20
		},
		{
			"field_name": "info",
			"local_field": "info",
			"field_type": "text",
			"field_number": 15
		},
		{
			"field_name": "invoice_address",
			"local_field": "invoicing_address",
			"field_type": "text",
			"field_number": 3
		},
		{
			"field_name": "invoice_id",
			"local_field": "order_id",
			"field_type": "varchar",
			"field_length": 10,
			"field_number": 4,
			"constraint": ["unique"]
		},
		{
			"field_name": "invoice_text",
			"local_field": "note",
			"field_type": "text",
			"field_number": 8
		},
		{
			"field_name": "last_collection_date",
			"local_field": "json_data.last_collection_date",
			"field_type": "date",
			"field_number": 50
		},
		{
			"field_name": "mark",
			"local_field": "json_data.mark",
			"field_type": "varchar",
			"field_length": 80,
			"field_number": 33
		},
		{
			"field_name": "modifier_id",
			"local_field": "modify_user",
			"field_type": "varchar",
			"field_length": 20,
			"field_number": 63
		},
		{
			"field_name": "net_weight",
			"local_field": "json_data.net_weight",
			"field_type": "double",
			"field_number": 41
		},
		{
			"field_name": "no_interest_invoice",
			"field_type": "boolean",
			"field_number": 66
		},
		{
			"field_name": "order_discount_percentage",
			"local_field": "json_data.order_discount_percentage",
			"field_type": "double",
			"field_number": 21
		},
		{
			"field_name": "order_discount_total",
			"local_field": "json_data.order_discount_total",
			"field_type": "double",
			"field_number": 22
		},
		{
			"field_name": "our_reference",
			"local_field": "our_reference",
			"field_type": "varchar",
			"field_length": 35,
			"field_number": 18
		},
		{
			"field_name": "paid_total",
			"local_field": "json_data.paid_price",
			"field_type": "double",
			"field_number": 29
		},
		{
			"field_name": "penalty_interest",
			"local_field": "json_data.penalty_interest_percent",
			"field_type": "double",
			"field_number": 12
		},
		{
			"field_name": "price_total",
			"local_field": "price_without_vat",
			"field_type": "double",
			"field_number": 6
		},
		{
			"field_name": "printed",
			"local_field": "json_data.printed",
			"field_type": "boolean",
			"field_number": 24
		},
		{
			"field_name": "project_id",
			"local_field": "json_data.project_id",
			"field_type": "varchar",
			"field_length": 40,
			"field_number": 60
		},
		{
			"field_name": "record_id",
			"local_field": "record_id",
			"field_type": "varchar",
			"field_length": 45,
			"field_number": 55,
			"constraint": ["unique"]
		},
		{
			"field_name": "reference_number",
			"local_field": "json_data.bank_reference_number",
			"field_type": "varchar",
			"field_length": 20,
			"field_number": 31,
			"constraint": ["index"]
		},
		{
			"field_name": "remark_time",
			"local_field": "json_data.remark_time",
			"field_type": "varchar",
			"field_length": 35,
			"field_number": 17
		},
		{
			"field_name": "send_state",
			"local_field": "json_data.send_state",
			"field_type": "varchar",
			"field_length": 40,
			"field_number": 58
		},
		{
			"field_name": "send_type",
			"local_field": "json_data.send_type",
			"field_type": "varchar",
			"field_length": 40,
			"field_number": 57
		},
		{
			"field_name": "state",
			"local_field": "order_state",
			"field_type": "integer",
			"field_number": 51,
			"constraint": ["index"]
		},
		{
			"field_name": "supplier_invoice_date",
			"local_field": "json_data.supplier_invoice_date",
			"field_type": "date",
			"field_number": 53
		},
		{
			"field_name": "supplier_invoice_number",
			"local_field": "json_data.supplier_invoice_number",
			"field_type": "varchar",
			"field_length": 40,
			"field_number": 52
		},
		{
			"field_name": "term_of_delivery",
			"local_field": "term_of_delivery",
			"field_type": "varchar",
			"field_length": 30,
			"field_number": 39
		},
		{
			"field_name": "terms_of_payment_id",
			"local_field": "terms_of_payment_id",
			"field_type": "varchar",
			"field_length": 12,
			"field_number": 11,
			"constraint": ["index"],
			"foreign_key": [
				{
					"link_type": "prevent delete",
					"linked_field": "terms_of_payment_id",
					"linked_table": "terms_of_payment"
				}
			],
			"nullable": true
		},
		{
			"field_name": "total_amount",
			"local_field": "price_with_vat",
			"field_type": "double",
			"field_number": 13
		},
		{
			"field_name": "total_rounding",
			"local_field": "json_data.rounding_price",
			"field_type": "double",
			"field_number": 36
		},
		{
			"field_name": "transfer_id",
			"local_field": "json_data.transfer_id",
			"field_type": "varchar",
			"field_length": 60,
			"field_number": 59,
			"constraint": ["index"]
		},
		{
			"field_name": "transfer_state",
			"local_field": "json_data.transfer_state",
			"field_type": "integer",
			"field_number": 64
		},
		{
			"field_name": "type_",
			"local_field": "order_type",
			"field_type": "varchar",
			"field_length": 2,
			"field_number": 28,
			"constraint": ["index"]
		},
		{
			"field_name": "vat_total",
			"local_field": "vat_price",
			"field_type": "double",
			"field_number": 7
		},
		{
			"field_name": "volume",
			"local_field": "json_data.volume",
			"field_type": "double",
			"field_number": 42
		},
		{
			"field_name": "voucher_id",
			"local_field": "voucher_id",
			"field_type": "varchar",
			"field_length": 12,
			"field_number": 32,
			"constraint": ["index"]
		},
		{
			"field_name": "way_of_delivery",
			"local_field": "way_of_delivery",
			"field_type": "varchar",
			"field_length": 40,
			"field_number": 16
		},
		{
			"field_name": "your_reference",
			"local_field": "your_reference",
			"field_type": "varchar",
			"field_length": 35,
			"field_number": 19
		},
		{
			"field_name": "additional_data",
			"local_field": "json_data.additional_data",
			"field_type": "text",
			"field_number": 65
		}
	]
}
