{
	"save_script": [],
	"field": [
		{
			"type": "varchar",
			"length": 80,
			"name": "product_id",
			"constraint": [
				"primary key",
				"unique"
			]
		},
		{
			"type": "varchar",
			"length": 40,
			"name": "default_supplier_id",
			"foreign_key": {
				"field": "company_id",
				"link_type": "prevent delete",
				"table": "company"
			}
		},
		{
			"type": "varchar",
			"length": 40,
			"name": "default_customer_id",
			"foreign_key": {
				"field": "company_id",
				"link_type": "prevent delete",
				"table": "company"
			}
		},
		{
			"type": "varchar",
			"length": 40,
			"name": "purchase_order_code_id",
			"foreign_key": {
				"field": "order_code_id",
				"link_type": "prevent delete",
				"table": "order_code"
			}
		},
		{
			"type": "varchar",
			"length": 40,
			"name": "sales_order_code_id",
			"foreign_key": {
				"field": "order_code_id",
				"link_type": "prevent delete",
				"table": "order_code"
			}
		},
		{
			"type": "varchar",
			"length": 40,
			"name": "foreign_sales_order_code_id",
			"foreign_key": {
				"field": "order_code_id",
				"link_type": "prevent delete",
				"table": "order_code"
			}
		},
		{
			"type": "varchar",
			"length": 200,
			"name": "name"
		},
		{
			"name": "production_control_type",
			"type": "integer"
		},
		{
			"name": "action_limit",
			"type": "double"
		},
		{
			"name": "minimum_stock",
			"type": "double"
		},
		{
			"name": "minimum_order_amount",
			"type": "double"
		},
		{
			"name": "purchase_price",
			"type": "double"
		},
		{
			"name": "cost_price",
			"type": "double"
		},
		{
			"name": "sales_price",
			"type": "double"
		},
		{
			"name": "purchase_multiplier",
			"type": "double"
		},
		{
			"name": "profit_multiplier",
			"type": "double"
		},
		{
			"name": "product_type",
			"type": "integer"
		},
		{
			"name": "product_state",
			"type": "integer"
		},
		{
			"type": "varchar",
			"length": 100,
			"name": "supplier_material_code"
		},
		{
			"type": "varchar",
			"length": 40,
			"name": "product_group"
		},
		{
			"type": "varchar",
			"length": 40,
			"name": "subgroup"
		},
		{
			"type": "varchar",
			"length": 40,
			"name": "quality"
		},
		{
			"name": "critical_date",
			"type": "date"
		},
		{
			"name": "critical_start_date",
			"type": "date"
		},
		{
			"type": "varchar",
			"length": 20,
			"name": "stock_unit"
		},
		{
			"type": "varchar",
			"length": 20,
			"name": "stock_unit_2"
		},
		{
			"type": "varchar",
			"length": 20,
			"name": "design_unit"
		},
		{
			"type": "varchar",
			"length": 20,
			"name": "design_unit_2"
		},
		{
			"name": "stock_conversion_multiplier",
			"type": "double"
		},
		{
			"name": "design_conversion_multiplier",
			"type": "double"
		},
		{
			"name": "stock_vs_design_conversion_multiplier",
			"type": "double"
		},
		{
			"type": "varchar",
			"length": 80,
			"name": "ean_code"
		},
		{
			"type": "double",
			"length": 80,
			"name": "stock_balance"
		},
		{
			"name": "storable",
			"type": "boolean"
		},
		{
			"type": "varchar",
			"length": 20,
			"name": "work_number"
		},
		{
			"type": "varchar",
			"length": 80,
			"name": "drawing_number"
		},
		{
			"name": "material_cost_price",
			"type": "double"
		},
		{
			"name": "material_sales_price",
			"type": "double"
		},
		{
			"name": "subcontract_cost_price",
			"type": "double"
		},
		{
			"name": "subcontract_sales_price",
			"type": "double"
		},
		{
			"name": "work_cost_price",
			"type": "double"
		},
		{
			"name": "work_sales_price",
			"type": "double"
		},
		{
			"name": "setup_time",
			"type": "double"
		},
		{
			"name": "work_time",
			"type": "double"
		},
		{
			"name": "info",
			"type": "text"
		},
		{
			"name": "json_data",
			"type": "jsonb"
		}
	],
	"constraint": {
		"save": {
			"allow": [
				{
					"field": "pr_product_id",
					"message": "Field '%s' may not be empty",
					"code": [
						[
							"pr_product_id",
							"<>",
							""
						]
					]
				},
				{
					"field": "pr_stock_unit",
					"message": "Field '%s' may not be empty",
					"code": [
						[
							"pr_stock_unit",
							"<>",
							""
						]
					]
				},
				{
					"field": "pr_stock_unit_2",
					"message": "Field '%s' may not be empty",
					"code": [
						[
							"pr_stock_unit_2",
							"<>",
							""
						]
					]
				},
				{
					"field": "pr_design_unit",
					"message": "Field '%s' may not be empty",
					"code": [
						[
							"pr_design_unit",
							"<>",
							""
						]
					]
				},
				{
					"field": "pr_design_unit_2",
					"message": "Field '%s' may not be empty",
					"code": [
						[
							"pr_design_unit_2",
							"<>",
							""
						]
					]
				},
				{
					"field": "pr_sales_order_code_id",
					"message": "Field '%s' may not be empty",
					"code": [
						[
							"pr_sales_order_code_id",
							"<>",
							""
						]
					]
				},
				{
					"field": "pr_purchase_order_code_id",
					"message": "Field '%s' may not be empty",
					"code": [
						[
							"pr_purchase_order_code_id",
							"<>",
							""
						]
					]
				}
			]
		}
	},
	"table_prefix": "pr",
	"table_name": "product",
	"extra_field": [
		{
			"type": "varchar",
			"length": 40,
			"name": "json_data.abc_class"
		},
		{
			"type": "double",
			"name": "json_data.actual_average_need"
		},
		{
			"type": "double",
			"name": "json_data.average_balance"
		},
		{
			"type": "date",
			"name": "json_data.average_balance_start_date"
		},
		{
			"type": "double",
			"name": "json_data.average_price"
		},
		{
			"type": "double",
			"name": "json_data.calculated_sales_pr__unit"
		},
		{
			"type": "integer",
			"name": "json_data.calculation_type"
		},
		{
			"type": "varchar",
			"length": 80,
			"name": "json_data.category"
		},
		{
			"type": "date",
			"name": "json_data.change_date"
		},
		{
			"type": "double",
			"name": "json_data.coming_amount"
		},
		{
			"type": "varchar",
			"length": 160,
			"name": "json_data.cost_center"
		},
		{
			"type": "date",
			"name": "json_data.critical_date_real"
		},
		{
			"type": "date",
			"name": "json_data.critical_start_date_real"
		},
		{
			"type": "varchar",
			"length": 12,
			"name": "json_data.currency_id"
		},
		{
			"type": "varchar",
			"length": 40,
			"name": "json_data.default_sales_person_id"
		},
		{
			"type": "integer",
			"name": "json_data.document_count"
		},
		{
			"type": "varchar",
			"length": 160,
			"name": "json_data.drawing_number__material"
		},
		{
			"type": "integer",
			"name": "json_data.dynamic_act_limit_in_use"
		},
		{
			"type": "double",
			"name": "json_data.dynamic_act_limit_max_val"
		},
		{
			"type": "double",
			"name": "json_data.dynamic_act_limit_min_val"
		},
		{
			"type": "varchar",
			"length": 80,
			"name": "json_data.ean_code2"
		},
		{
			"type": "integer",
			"name": "json_data.effect_of_amount"
		},
		{
			"type": "integer",
			"name": "json_data.effect_of_fixed_size"
		},
		{
			"type": "double",
			"name": "json_data.est_work_time"
		},
		{
			"type": "double",
			"name": "json_data.estimated_average_need"
		},
		{
			"type": "text",
			"name": "json_data.explanation"
		},
		{
			"type": "double",
			"name": "json_data.external_storage_balance"
		},
		{
			"type": "integer",
			"name": "json_data.firm_id"
		},
		{
			"type": "integer",
			"name": "json_data.forecast_days"
		},
		{
			"type": "double",
			"name": "json_data.foreign_purch_pr__unit"
		},
		{
			"type": "double",
			"name": "json_data.free_amount"
		},
		{
			"type": "double",
			"name": "json_data.going_amount"
		},
		{
			"type": "double",
			"name": "json_data.gross_weight"
		},
		{
			"type": "boolean",
			"name": "json_data.in_price_list"
		},
		{
			"type": "date",
			"name": "json_data.inventory_date"
		},
		{
			"type": "boolean",
			"name": "json_data.is_in_enclosure"
		},
		{
			"type": "date",
			"name": "json_data.last_stock_event_date"
		},
		{
			"type": "date",
			"name": "json_data.last_stock_removal_date"
		},
		{
			"type": "double",
			"name": "json_data.manufacturing_average_need"
		},
		{
			"type": "double",
			"name": "json_data.manufacturing_cycle_time"
		},
		{
			"type": "double",
			"name": "json_data.manufacturing_need"
		},
		{
			"type": "varchar",
			"length": 80,
			"name": "json_data.material_class"
		},
		{
			"type": "double",
			"name": "json_data.max_production_amount"
		},
		{
			"type": "double",
			"name": "json_data.max_wanted_stock_balance"
		},
		{
			"type": "double",
			"name": "json_data.maximum_stock"
		},
		{
			"type": "varchar",
			"length": 40,
			"name": "json_data.modifier_id"
		},
		{
			"type": "boolean",
			"name": "json_data.need_calculation_in_use"
		},
		{
			"type": "double",
			"name": "json_data.net_weight"
		},
		{
			"type": "boolean",
			"name": "json_data.no_automatic_stock_remove"
		},
		{
			"type": "boolean",
			"name": "json_data.no_billing"
		},
		{
			"type": "boolean",
			"name": "json_data.no_discount"
		},
		{
			"type": "boolean",
			"name": "json_data.no_printing"
		},
		{
			"type": "double",
			"name": "json_data.normal_delivery_lot_size"
		},
		{
			"type": "boolean",
			"name": "json_data.not_in_dispatch_note"
		},
		{
			"type": "boolean",
			"name": "json_data.not_in_use"
		},
		{
			"type": "integer",
			"name": "json_data.order_forecast_days"
		},
		{
			"type": "varchar",
			"length": 160,
			"name": "json_data.origin"
		},
		{
			"type": "varchar",
			"length": 40,
			"name": "json_data.parcel_code"
		},
		{
			"type": "text",
			"name": "json_data.picture_path"
		},
		{
			"type": "date",
			"name": "json_data.price_change_date"
		},
		{
			"type": "varchar",
			"length": 88,
			"name": "json_data.price_group"
		},
		{
			"type": "varchar",
			"length": 88,
			"name": "json_data.product_code"
		},
		{
			"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_start_date"
		},
		{
			"type": "double",
			"name": "json_data.purchase_average_price"
		},
		{
			"type": "date",
			"name": "json_data.purchase_price_change_date"
		},
		{
			"type": "double",
			"name": "json_data.raw_material_delivery_time"
		},
		{
			"type": "integer",
			"name": "json_data.reclamation_count"
		},
		{
			"type": "double",
			"name": "json_data.safety_stock_duration"
		},
		{
			"type": "double",
			"name": "json_data.shelf_stock_balance"
		},
		{
			"type": "varchar",
			"length": 160,
			"name": "json_data.size"
		},
		{
			"type": "double",
			"name": "json_data.spare_part_need"
		},
		{
			"type": "double",
			"name": "json_data.stock_balance_wip"
		},
		{
			"type": "integer",
			"name": "json_data.stock_limit_calc_type"
		},
		{
			"type": "boolean",
			"name": "json_data.stock_parcel_in_use"
		},
		{
			"type": "varchar",
			"length": 40,
			"name": "json_data.stock_position"
		},
		{
			"type": "varchar",
			"length": 100,
			"name": "json_data.company_product_code"
		},
		{
			"type": "boolean",
			"name": "json_data.supplier_price_in_use"
		},
		{
			"type": "varchar",
			"length": 30,
			"name": "json_data.tariff_heading"
		},
		{
			"type": "integer",
			"name": "json_data.track_time_status"
		},
		{
			"type": "varchar",
			"length": 120,
			"name": "json_data.transfer_id"
		},
		{
			"type": "integer",
			"name": "json_data.transfer_state"
		},
		{
			"type": "double",
			"name": "json_data.true_coming_amount"
		},
		{
			"type": "double",
			"name": "json_data.true_free_amount"
		},
		{
			"type": "double",
			"name": "json_data.true_going_amount"
		},
		{
			"type": "double",
			"name": "json_data.unfinished_orders_in_weeks"
		},
		{
			"type": "double",
			"name": "json_data.volume"
		},
		{
			"type": "varchar",
			"length": 24,
			"name": "json_data.work_resource"
		},
		{
			"type": "integer",
			"name": "json_data.work_order_type"
		},
		{
			"type": "double",
			"name": "json_data.calculation_lot"
		},
		{
			"type": "date",
			"name": "json_data.creation_date"
		},
		{
			"type": "varchar",
			"length": 80,
			"name": "json_data.customer_project"
		},
		{
			"type": "double",
			"name": "json_data.salary_price"
		},
		{
			"type": "boolean",
			"name": "json_data.sales_price_locked"
		},
		{
			"type": "varchar",
			"length": 4,
			"name": "json_data.state"
		}
	],
	"calculated_field": [],
	"field_change": [
		{
			"name": "product_type",
			"old_name": [
				"type"
			]
		},
		{
			"name": "product_state",
			"old_name": [
				"record_state"
			]
		}
	],
	"name": "table/manager/product/product.json",
	"row_table": [
		{
			"row_table_name": "additional_field",
			"save_field": "pr_json_data",
			"field": [
				{
					"type": "varchar",
					"length": 80,
					"name": "header"
				},
				{
					"name": "value",
					"type": "text"
				}
			]
		}
	]
}