{
	"name": "table/external/4d/product/work_material_estimated.json",
	"table_name": "work_material_estimated",
	"table_prefix": "wme",
	"main_table": "work",
	"record_type": ["estimated"],
	"local_table": "product_material",
	"local_record_type": "estimated",
	"table_number": 45,
	"field": [
		{
			"field_name": "calc_cost__unit",
			"local_field": "json_data.cost_price_in_stock_unit",
			"field_type": "double",
			"field_number": 7
		},
		{
			"field_name": "calculation_type",
			"local_field": "product_material_state",
			"field_type": "integer",
			"field_number": 24
		},
		{
			"field_name": "change_id",
			"local_field": "modify_id",
			"field_type": "varchar",
			"field_length": 45,
			"field_number": 35,
			"length": 90,
			"constraint": ["index"]
		},
		{
			"field_name": "cost_price__unit",
			"local_field": "cost_price",
			"field_type": "double",
			"field_number": 9
		},
		{
			"field_name": "cost_price_total",
			"local_field": "json_data.cost_price_total",
			"field_type": "double",
			"field_number": 12
		},
		{
			"field_name": "cover__inside",
			"local_field": "json_data.cover__inside",
			"field_type": "varchar",
			"field_length": 10,
			"field_number": 19,
			"length": 20
		},
		{
			"field_name": "creator_id",
			"local_field": "json_data.create_user",
			"field_type": "varchar",
			"field_length": 20,
			"field_number": 36,
			"length": 40
		},
		{
			"field_name": "customer_project",
			"local_field": "json_data.customer_project",
			"field_type": "varchar",
			"field_length": 40,
			"field_number": 33,
			"length": 80
		},
		{
			"field_name": "explanation",
			"local_field": "description",
			"field_type": "text",
			"field_number": 30,
			"length": 0
		},
		{
			"field_name": "extra_percentage",
			"local_field": "json_data.extra_percentage",
			"field_type": "double",
			"field_number": 18
		},
		{
			"field_name": "firm_id",
			"local_field": "json_data.firm_id",
			"field_type": "integer",
			"field_number": 26,
			"constraint": ["index"]
		},
		{
			"field_name": "height",
			"local_field": "json_data.length",
			"field_type": "double",
			"field_number": 28
		},
		{
			"field_name": "info",
			"local_field": "info",
			"field_type": "text",
			"field_number": 11,
			"length": 0
		},
		{
			"field_name": "kind",
			"local_field": "json_data.kind",
			"field_type": "integer",
			"field_number": 14,
			"constraint": ["index"]
		},
		{
			"field_name": "material_owner",
			"local_field": "json_data.material_owner",
			"field_type": "integer",
			"field_number": 31
		},
		{
			"field_name": "modifier_id",
			"local_field": "modify_user",
			"field_type": "varchar",
			"field_length": 20,
			"field_number": 37,
			"length": 40
		},
		{
			"field_name": "pages__paper",
			"local_field": "json_data.pages__paper",
			"field_type": "double",
			"field_number": 17
		},
		{
			"field_name": "pieces",
			"local_field": "json_data.pieces",
			"field_type": "double",
			"field_number": 29
		},
		{
			"field_name": "profit_multiplier",
			"local_field": "profit_multiplier",
			"field_type": "double",
			"field_number": 8
		},
		{
			"field_name": "project_id",
			"local_field": "json_data.project_id",
			"field_type": "varchar",
			"field_length": 40,
			"field_number": 34,
			"length": 80
		},
		{
			"field_name": "quantity__unit",
			"local_field": "amount",
			"field_type": "double",
			"field_number": 3
		},
		{
			"field_name": "quantity__unit_2",
			"local_field": "json_data.quantity__unit_2",
			"field_type": "double",
			"field_number": 4
		},
		{
			"field_name": "quantity__unit_without_ex",
			"local_field": "json_data.quantity__unit_without_ex",
			"field_type": "double",
			"field_number": 16
		},
		{
			"field_name": "work__position_num_id",
			"local_field": "product_id",
			"field_type": "varchar",
			"field_length": 30,
			"field_number": 1,
			"length": 60,
			"constraint": ["index"],
			"foreign_key": [
				{
					"link_type": "prevent delete",
					"linked_field": "work__position_num_id",
					"linked_table": "work"
				},
				{
					"info": "4D work_material_estimated to work_order",
					"link_type": "do nothing",
					"linked_field": "work__position_num_id",
					"linked_table": "work_order"
				},
				{
					"info": "4D work_material_estimated to product, this is product_id -link to product",
					"link_field": "product_id",
					"link_type": "do nothing",
					"extra_link_field-": [
						{
							"linked": "pr.work__position_num_id",
							"linking": "w.work__position_num_id"
						}
					],
					"linked_field": "work__position_num_id",
					"linked_table": "product"
				}
			],
			"nullable": true
		},
		{
			"field_name": "raw_material_id",
			"info": "this is the default link to product",
			"local_field": "material_id",
			"field_type": "varchar",
			"field_length": 44,
			"field_number": 2,
			"length": 88,
			"constraint": ["index"],
			"foreign_key": [
				{
					"link_type": "prevent delete",
					"linked_field": "product_id",
					"linked_table": "product"
				}
			],
			"nullable": true
		},
		{
			"field_name": "record_id",
			"local_field": "record_id",
			"field_type": "varchar",
			"field_length": 45,
			"field_number": 25,
			"length": 90,
			"constraint": ["unique"]
		},
		{
			"field_name": "row_number",
			"local_field": "row_number",
			"field_type": "integer",
			"field_number": 21
		},
		{
			"field_name": "sales_price__unit",
			"local_field": "sales_price",
			"field_type": "double",
			"field_number": 10
		},
		{
			"field_name": "sales_price_total",
			"local_field": "json_data.sales_price_total",
			"field_type": "double",
			"field_number": 13
		},
		{
			"field_name": "total_quantity",
			"local_field": "json_data.total_quantity",
			"field_type": "double",
			"field_number": 5
		},
		{
			"field_name": "total_quantity_2",
			"local_field": "json_data.total_quantity_2",
			"field_type": "double",
			"field_number": 6
		},
		{
			"field_name": "transfer_id",
			"local_field": "json_data.transfer_id",
			"field_type": "varchar",
			"field_length": 60,
			"field_number": 32,
			"length": 120,
			"constraint": ["index"]
		},
		{
			"field_name": "transfer_state",
			"local_field": "json_data.transfer_state",
			"field_type": "integer",
			"field_number": 38
		},
		{
			"field_name": "unit",
			"local_field": "unit",
			"field_type": "varchar",
			"field_length": 10,
			"field_number": 22,
			"length": 20
		},
		{
			"field_name": "unit_2",
			"local_field": "json_data.unit_2",
			"field_type": "varchar",
			"field_length": 10,
			"field_number": 23,
			"length": 20
		},
		{
			"field_name": "width",
			"local_field": "json_data.width",
			"field_type": "double",
			"field_number": 27
		},
		{
			"field_name": "work_phase_est_id",
			"local_field": "work_phase_number",
			"field_type": "integer",
			"field_number": 15
		},
		{
			"field_name": "working_allowance",
			"local_field": "json_data.working_allowance",
			"field_type": "double",
			"field_number": 20
		}
	]
}
