{
	"name": "form/nc/erp-sync/lantek/save/production_order_to_xml_convert.json",
	"line_break": "\n",
	"namespace": "xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\"",
	"save_path": "C:/nc/lantek_export/production_order.xml",
	"save_path_mac": "~/Documents/work/ferrum/Lantek/export/production_order.xml",
	"allow_missing_drawing": true,
	"convert": [
		{
			"field": "pro",
			"tag": "/DATAEX",
			"content": [
				{
					"tag": "COMMAND[Name=\"IMPORT\" TblRef=\"PRODUCTS\"]",
					"content": [
						{
							"field": "pr.product_id",
							"tag": "FIELD[FldRef=\"PrdRef\" FldType=\"20\" FldValue=\"{{pr.product_id}}\"]"
						},
						{
							"field": "pr.name",
							"tag": "FIELD[FldRef=\"PrdName\" FldType=\"20\" FldValue=\"{{pr.name}}\"]"
						},
						{
							"field": "thickness",
							"tag": "FIELD[FldRef=\"Thickness\" FldType=\"100\" FldValue=\"{{thickness}}\"]"
						},
						{
							"field": "",
							"tag": "FIELD[FldRef=\"MatRef\" FldType=\"100\" FldValue=\"Steel\"]"
						},
						{
							"field": "work_phase_list",
							"tag": "FIELD[FldRef=\"UData1\" FldType=\"20\" FldValue=\"{{work_phase_list}}\"]"
						},
						{
							"field": "material",
							"tag": "FIELD[FldRef=\"UData2\" FldType=\"20\" FldValue=\"{{material}}\"]"
						}
					]
				},
				{
					"tag": "COMMAND[Name=\"IMPORT\" TblRef=\"MANUFACTURING\"]",
					"content": [
						{
							"field": "pr.product_id",
							"tag": "FIELD[FldRef=\"Product\" FldType=\"20\" FldValue=\"{{pr.product_id}}\"]"
						},
						{
							"field": "production_order_id",
							"tag": "FIELD[FldRef=\"Reference\" FldType=\"20\" FldValue=\"{{production_order_id}}\"]"
						},
						{
							"field": "company_id",
							"tag": "FIELD[FldRef=\"Customer\" FldType=\"20\" FldValue=\"{{company_id}}\"]",
							"from-": "co.company_name"
						},
						{
							"field": "sales_order",
							"tag": "FIELD[FldRef=\"SaleOrder\" FldType=\"20\" FldValue=\"{{sales_order}}\"]"
						},
						{
							"field": "amount_to_produce",
							"tag": "FIELD[FldRef=\"Quantity\" FldType=\"100\" FldValue=\"{{amount_to_produce}}\"]"
						},
						{
							"result": "result",
							"tag": "FIELD[FldRef=\"DeliveryDate\" FldType=\"120\" FldValue=\"{{result}}\"]",
							"code": [
								{
									"result": "result",
									"function": "dt.format",
									"parameter": ["start_date", "%Y%m%d"]
								}
							]
						}
					]
				},
				{
					"tag": "COMMAND[Name=\"IMPORT\" TblRef=\"PRODUCT OPERATIONS\"]",
					"content": [
						{
							"field": "pr.product_id",
							"tag": "FIELD[FldRef=\"PrdRef\" FldType=\"20\" FldValue=\"{{pr.product_id}}\"]"
						},
						{
							"field": "work_phase",
							"tag": "FIELD[FldRef=\"WorkCenter\" FldType=\"20\" FldValue=\"{{work_phase}}\"]"
						},
						{
							"field": "2D Cut",
							"tag": "FIELD[FldRef=\"Operation\" FldType=\"20\" FldValue=\"2D Cut\"]"
						}
					],
					"array-": [
						{
							"field": "1",
							"tag": "FIELD[FldRef=\"OOrder\" FldType=\"20\" FldValue=\"1\"]"
						},
						{
							"field": "0",
							"tag": "FIELD[FldRef=\"PrevOpr\" FldType=\"20\" FldValue=\"0\"]"
						}
					]
				},
				{
					"field": "att",
					"tag": "COMMAND[Name=\"IMPORT\" TblRef=\"IMPORTGEO\"]",
					"content": [
						{
							"field": "product_id",
							"tag": "FIELD[FldRef=\"Product\" FldType=\"20\" FldValue=\"{{product_id}}\"]"
						},
						{
							"field": "geometry_type",
							"tag": "FIELD[FldRef=\"GeometryType\" FldType=\"20\" FldValue=\"{{geometry_type}}\"]"
						},
						{
							"field": "drawing_path",
							"tag": "FIELD[FldRef=\"GeometryPath\" FldType=\"20\" FldValue=\"{{drawing_path}}\"]"
						}
					]
				}
			]
		}
	]
}
