{
	"name": "table/local/product/stock.json",
	"table_name": "stock",
	"table_prefix": "st",
	"record_type": ["", "product"],
	"table_name_language": {
		"": "Stock",
		"product": "Product stock"
	},
	"default_field": "table/prf/default_field.json",
	"default_order": [
		{
			"field": "stock_id",
			"order": ">"
		}
	],
	"save_script": [],
	"calculated_field": [],
	"field": [
		{
			"field_name": "stock_id",
			"field_type": "varchar",
			"info": "running id number",
			"field_length": 40
		},
		{
			"field_name": "product_id",
			"field_type": "varchar",
			"field_length": 80,
			"foreign_key": [
				{
					"link_type": "prevent delete",
					"linked_field": "product_id",
					"linked_record_type": "",
					"linked_table": "product",
					"linking_record_type": ""
				}
			],
			"not_allowed_value": [""]
		},
		{
			"field_name": "location_id",
			"field_type": "varchar",
			"field_length": 40,
			"foreign_key": [
				{
					"link_type": "prevent delete",
					"linked_field": "location_id",
					"linked_record_type": "",
					"linked_table": "stock_location",
					"linking_record_type": ""
				}
			]
		},
		{
			"field_name": "event_type",
			"field_type": "varchar",
			"field_length": 20
		},
		{
			"field_name": "event_time",
			"field_type": "timestamp",
			"field_length": 20
		},
		{
			"field_name": "amount",
			"field_type": "double"
		},
		{
			"field_name": "unit_price",
			"field_type": "double"
		},
		{
			"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": ""
				}
			]
		},
		{
			"field_name": "material_batch",
			"field_type": "text"
		},
		{
			"field_name": "info",
			"field_type": "text"
		}
	],
	"extra_field": [
		{
			"field_name": "json_data.production_order_id",
			"field_length": 70
		},
		{
			"field_name": "json_data.purchase_average_price",
			"field_type": "double"
		},
		{
			"field_name": "json_data.stock_balance__unit_2",
			"field_type": "double"
		},
		{
			"field_name": "json_data.transfer_id",
			"field_type": "varchar",
			"field_length": 120
		},
		{
			"field_name": "json_data.original_amount",
			"field_type": "double"
		},
		{
			"field_name": "json_data.customer_project",
			"field_type": "varchar",
			"field_length": 80
		},
		{
			"field_name": "json_data.purch_avg_price_amount",
			"field_type": "double"
		},
		{
			"field_name": "json_data.purch_avg_price_change_date",
			"field_type": "date"
		},
		{
			"field_name": "json_data.firm_id",
			"field_type": "integer"
		},
		{
			"field_name": "json_data.purchase_price_total",
			"field_type": "double"
		},
		{
			"field_name": "json_data.is_ready",
			"field_type": "boolean"
		},
		{
			"field_name": "json_data.event_maker_id",
			"field_type": "varchar",
			"field_length": 24
		},
		{
			"field_name": "json_data.average_price_change_date",
			"field_type": "date"
		},
		{
			"field_name": "json_data.is_own_packet",
			"field_type": "boolean"
		},
		{
			"field_name": "json_data.average_price",
			"field_type": "double"
		},
		{
			"field_name": "json_data.purchase_price__unit",
			"field_type": "double"
		},
		{
			"field_name": "json_data.purchase_price_change_date",
			"field_type": "date"
		},
		{
			"field_name": "json_data.orderer_id",
			"field_type": "varchar",
			"field_length": 24
		},
		{
			"field_name": "json_data.unit_2",
			"field_type": "varchar",
			"field_length": 20
		},
		{
			"field_name": "json_data.state",
			"field_type": "integer"
		},
		{
			"field_name": "json_data.company_id",
			"field_type": "varchar",
			"field_length": 24
		},
		{
			"field_name": "json_data.origin",
			"field_type": "varchar",
			"field_length": 510
		},
		{
			"field_name": "json_data.original_packet_number",
			"field_type": "varchar",
			"field_length": 40
		},
		{
			"field_name": "json_data.sales_price__unit",
			"field_type": "double"
		},
		{
			"field_name": "json_data.average_balance",
			"field_type": "double"
		},
		{
			"field_name": "json_data.cost_price__unit",
			"field_type": "double"
		},
		{
			"field_name": "json_data.exchange_rate",
			"field_type": "double"
		},
		{
			"field_name": "json_data.foreign_price_change_date",
			"field_type": "date"
		},
		{
			"field_name": "json_data.transfer_state",
			"field_type": "integer"
		},
		{
			"field_name": "json_data.supplier_id",
			"field_type": "varchar",
			"field_length": 24
		},
		{
			"field_name": "json_data.location",
			"field_type": "text"
		},
		{
			"field_name": "json_data.foreign_purchase_price",
			"field_type": "double"
		},
		{
			"field_name": "json_data.stock_balance_wip",
			"field_type": "double"
		},
		{
			"field_name": "json_data.size",
			"field_type": "double"
		},
		{
			"field_name": "json_data.cost_center",
			"field_type": "varchar",
			"field_length": 160
		},
		{
			"field_name": "json_data.unit",
			"field_type": "varchar",
			"field_length": 20
		},
		{
			"field_name": "json_data.units",
			"field_type": "double"
		},
		{
			"field_name": "json_data.order_row",
			"field_type": "varchar",
			"field_length": 60
		},
		{
			"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.manufacturing_lot",
			"field_type": "varchar",
			"field_length": 70
		},
		{
			"field_name": "json_data.storage_place",
			"field_type": "varchar",
			"field_length": 60
		},
		{
			"field_name": "json_data.handler_id",
			"field_type": "varchar",
			"field_length": 40
		},
		{
			"field_name": "json_data.storage_type",
			"field_type": "varchar",
			"field_length": 40
		},
		{
			"field_name": "json_data.price_confirmation",
			"field_type": "integer"
		},
		{
			"field_name": "json_data.sales_price_total",
			"field_type": "double"
		},
		{
			"field_name": "json_data.time",
			"field_type": "time"
		}
	],
	"field_change": [
		{
			"name": "event_time",
			"old_name": ["event_date"]
		}
	]
}
