{
	"name": "table/manager/product/product_material.json",
	"table_name": "product_material",
	"table_prefix": "prma",
	"main_table": "product",
	"record_type": ["actual", "estimated", "schedule"],
	"default_order": [{
			"field": "material_id",
			"order": ">"
		},
		{
			"field": "row_number",
			"order": ">"
		}
	],
	"save_script": [],
	"calculated_field": {
		"json_data.amount_in_unit_2": {
			"type": "double"
		}
	},
	"field": [{
			"field_name": "amount",
			"field_type": "double"
		},
		{
			"field_name": "cost_price",
			"field_type": "double"
		},
		{
			"field_name": "description",
			"field_type": "text"
		},
		{
			"field_name": "info",
			"field_type": "text"
		},
		{
			"field_name": "material_id",
			"field_type": "varchar",
			"foreign_key": [{
				"info": "aga, check",
				"link_type": "prevent delete",
				"linked_field": "product_id",
				"linked_record_type": "material",
				"linked_table": "product",
				"linking_record_type": ""
			}],
			"length": 80,
			"not_allowed_value": [""]
		},
		{
			"field_name": "product_id",
			"field_type": "varchar",
			"foreign_key": [{
				"link_type": "prevent delete",
				"linked_field": "product_id",
				"linked_record_type": "",
				"linked_table": "product",
				"linking_record_type": ""
			}],
			"length": 80
		},
		{
			"field_name": "product_material_state",
			"field_type": "integer"
		},
		{
			"field_name": "production_lot",
			"field_type": "varchar",
			"length": 40
		},
		{
			"field_name": "profit_multiplier",
			"field_type": "double"
		},
		{
			"field_name": "record_type",
			"field_type": "varchar",
			"length": 20
		},
		{
			"field_name": "row_number",
			"field_type": "integer"
		},
		{
			"field_name": "sales_price",
			"field_type": "double"
		},
		{
			"field_name": "stock_event_id",
			"field_type": "varchar",
			"length": 40
		},
		{
			"field_name": "unit",
			"field_type": "varchar",
			"length": 20
		},
		{
			"field_name": "work_phase_number",
			"field_type": "integer"
		}
	],
	"extra_field": [{
			"field_length": 20,
			"field_name": "json_data.unit_2",
			"field_type": "varchar"
		},
		{
			"field_name": "json_data.extra_percentage",
			"field_type": "double"
		},
		{
			"field_name": "json_data.cost_price_in_stock_unit",
			"field_type": "double"
		},
		{
			"field_name": "json_data.quantity__unit_2",
			"field_type": "double"
		},
		{
			"field_name": "json_data.height",
			"field_type": "double"
		},
		{
			"field_length": 80,
			"field_name": "json_data.customer_project",
			"field_type": "varchar"
		},
		{
			"field_name": "json_data.working_allowance",
			"field_type": "double"
		},
		{
			"field_name": "json_data.calc_sales_price__unit",
			"field_type": "double"
		},
		{
			"field_name": "json_data.transfer_state",
			"field_type": "varchar"
		},
		{
			"field_name": "json_data.kind",
			"field_type": "varchar"
		},
		{
			"field_name": "json_data.work_need_amount",
			"field_type": "double"
		},
		{
			"field_name": "json_data.quantity__unit_without_ex",
			"field_type": "double"
		},
		{
			"field_length": 60,
			"field_name": "json_data.work_number",
			"field_type": "varchar"
		},
		{
			"field_length": 40,
			"field_name": "json_data.modifier_id",
			"field_type": "varchar"
		},
		{
			"field_name": "json_data.firm_id",
			"field_type": "varchar"
		},
		{
			"field_name": "json_data.total_quantity_2",
			"field_type": "double"
		},
		{
			"field_name": "json_data.total_quantity",
			"field_type": "double"
		},
		{
			"field_length": 120,
			"field_name": "json_data.transfer_id",
			"field_type": "varchar"
		},
		{
			"field_name": "json_data.amount_in_unit_2",
			"field_type": "double"
		},
		{
			"field_name": "json_data.width",
			"field_type": "double"
		},
		{
			"field_name": "json_data.pages__paper",
			"field_type": "double"
		},
		{
			"field_name": "json_data.net_amount__design_unit_2",
			"field_type": "double"
		},
		{
			"field_length": 80,
			"field_name": "json_data.project_id",
			"field_type": "varchar"
		},
		{
			"field_name": "json_data.net_amount",
			"field_type": "double"
		},
		{
			"field_length": 20,
			"field_name": "json_data.cover__inside",
			"field_type": "varchar"
		},
		{
			"field_name": "json_data.cost_price_total",
			"field_type": "double"
		},
		{
			"field_length": 60,
			"field_name": "json_data.work__position_num_id",
			"field_type": "varchar"
		},
		{
			"field_length": 40,
			"field_name": "json_data.parcel_code",
			"field_type": "varchar"
		},
		{
			"field_name": "json_data.material_owner",
			"field_type": "varchar"
		},
		{
			"field_name": "json_data.pieces",
			"field_type": "double"
		},
		{
			"field_name": "json_data.sales_price_total",
			"field_type": "double"
		}
	],
	"default_field": "table/default_field.json",
	"field_change": [{
		"name": "product_material_state",
		"old_name": ["record_state"]
	}]
}