{
	"save_script": [],
	"field": [
		{
			"type": "varchar",
			"length": 80,
			"name": "product_id",
			"foreign_key": {
				"field": "product_id",
				"link_type": "prevent delete",
				"table": "product"
			}
		},
		{
			"type": "varchar",
			"length": 20,
			"name": "currency_id",
			"foreign_key": {
				"field": "currency_id",
				"link_type": "prevent delete",
				"table": "currency"
			}
		},
		{
			"type": "varchar",
			"length": 40,
			"name": "location_id"
		},
		{
			"type": "varchar",
			"length": 40,
			"name": "stock_id"
		},
		{
			"type": "varchar",
			"length": 80,
			"name": "project_id"
		},
		{
			"type": "varchar",
			"length": 20,
			"name": "stock_type"
		},
		{
			"name": "stock_state",
			"type": "integer"
		},
		{
			"name": "stock_balance",
			"type": "double"
		},
		{
			"name": "unit_price",
			"type": "double"
		},
		{
			"name": "info",
			"type": "text"
		},
		{
			"name": "json_data",
			"type": "jsonb"
		}
	],
	"constraint": {
		"save": {
			"allow": [
				{
					"field": "st_product_id",
					"message": "Field '%s' may not be empty",
					"code": [
						[
							"st_product_id",
							"<>",
							""
						]
					]
				}
			]
		}
	},
	"table_prefix": "st",
	"extra_field": [
		{
			"type": "double",
			"name": "json_data.amount__unit"
		},
		{
			"type": "double",
			"name": "json_data.average_balance"
		},
		{
			"type": "double",
			"name": "json_data.average_price"
		},
		{
			"type": "date",
			"name": "json_data.average_price_change_date"
		},
		{
			"type": "varchar",
			"length": 24,
			"name": "json_data.company_id"
		},
		{
			"type": "varchar",
			"length": 160,
			"name": "json_data.cost_center"
		},
		{
			"type": "double",
			"name": "json_data.cost_price__unit"
		},
		{
			"type": "varchar",
			"length": 80,
			"name": "json_data.customer_project"
		},
		{
			"type": "varchar",
			"length": 24,
			"name": "json_data.event_maker_id"
		},
		{
			"type": "double",
			"name": "json_data.exchange_rate"
		},
		{
			"type": "integer",
			"name": "json_data.firm_id"
		},
		{
			"type": "date",
			"name": "json_data.foreign_price_change_date"
		},
		{
			"type": "double",
			"name": "json_data.foreign_purchase_price"
		},
		{
			"type": "varchar",
			"length": 70,
			"name": "json_data.manufacturing_lot"
		},
		{
			"type": "varchar",
			"length": 40,
			"name": "json_data.modifier_id"
		},
		{
			"type": "varchar",
			"length": 60,
			"name": "json_data.order_row"
		},
		{
			"type": "varchar",
			"length": 24,
			"name": "json_data.orderer_id"
		},
		{
			"type": "integer",
			"name": "json_data.price_confirmation"
		},
		{
			"type": "varchar",
			"length": 80,
			"name": "json_data.project_id"
		},
		{
			"type": "double",
			"name": "json_data.purch_avg_price_amount"
		},
		{
			"type": "date",
			"name": "json_data.purch_avg_price_change_date"
		},
		{
			"type": "double",
			"name": "json_data.purchase_average_price"
		},
		{
			"type": "double",
			"name": "json_data.purchase_costs"
		},
		{
			"type": "double",
			"name": "json_data.purchase_price__unit"
		},
		{
			"type": "date",
			"name": "json_data.purchase_price_change_date"
		},
		{
			"type": "double",
			"name": "json_data.purchase_price_total"
		},
		{
			"type": "double",
			"name": "json_data.sales_price__unit"
		},
		{
			"type": "double",
			"name": "json_data.sales_price_total"
		},
		{
			"type": "integer",
			"name": "json_data.state"
		},
		{
			"type": "double",
			"name": "json_data.stock_balance_wip"
		},
		{
			"type": "varchar",
			"length": 60,
			"name": "json_data.storage_place"
		},
		{
			"type": "varchar",
			"length": 24,
			"name": "json_data.supplier_id"
		},
		{
			"type": "varchar",
			"length": 120,
			"name": "json_data.transfer_id"
		},
		{
			"type": "integer",
			"name": "json_data.transfer_state"
		},
		{
			"type": "varchar",
			"length": 20,
			"name": "json_data.st_unit"
		},
		{
			"type": "varchar",
			"length": 20,
			"name": "json_data.unit_2"
		},
		{
			"type": "varchar",
			"length": 40,
			"name": "json_data.handler_id"
		},
		{
			"type": "boolean",
			"name": "json_data.is_own_packet"
		},
		{
			"type": "boolean",
			"name": "json_data.is_ready"
		},
		{
			"type": "text",
			"name": "json_data.location"
		},
		{
			"type": "varchar",
			"length": 510,
			"name": "json_data.origin"
		},
		{
			"type": "varchar",
			"length": 40,
			"name": "json_data.original_packet_number"
		},
		{
			"type": "double",
			"name": "json_data.original_amount"
		},
		{
			"type": "varchar",
			"length": 70,
			"name": "json_data.production_lot"
		},
		{
			"type": "double",
			"name": "json_data.size"
		},
		{
			"type": "double",
			"name": "json_data.stock_balance__unit_2"
		},
		{
			"type": "varchar",
			"length": 20,
			"name": "json_data.unit"
		},
		{
			"type": "double",
			"name": "json_data.units"
		}
	],
	"calculated_field": [],
	"field_change": [
		{
			"name": "stock_state",
			"old_name": [
				"record_state"
			]
		}
	],
	"name": "table/manager/product/stock.json",
	"table_name": "stock"
}