{
	"name": "form/nc/erp-sync/cxml/save/order-invoice-xml-convert.json",
	"line_break": "\n",
	"indent": "\t",
	"main_data_tag": "ord",
	"charset": "UTF-8",
	"decimal_separator": ".",
	"create_empty_tag": true,
	"xml_header": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>",
	"namespace": "",
	"convert": [
		{
			"field": "ord",
			"tag": "cXML",
			"attribute": {
				"payloadID": "",
				"timestamp": "",
				"version": "1.2.063",
				"xml:lang": "en-GB"
			},
			"content": [
				{
					"tag": "Header",
					"content": [
						{
							"tag": "From",
							"content": [
								{
									"tag": "Credential",
									"attribute": {
										"domain": "NetworkID"
									},
									"content": [
										{
											"tag": "Identity",
											"from_static": "AN01000000001-T"
										}
									]
								}
							]
						},
						{
							"tag": "To",
							"content": [
								{
									"tag": "Credential",
									"attribute": {
										"domain": "NetworkID"
									},
									"content": [
										{
											"tag": "Identity",
											"from_static": "AN11167947425-T"
										}
									]
								}
							]
						},
						{
							"tag": "Sender",
							"content": [
								{
									"tag": "Credential",
									"attribute": {
										"domain": "NetworkID"
									},
									"content": [
										{
											"tag": "Identity",
											"from_static": "AN01000000001-T"
										}
									]
								},
								{
									"tag": "UserAgent",
									"from_static": "SCMSupplier"
								}
							]
						}
					]
				},
				{
					"tag": "Request",
					"attribute": {
						"deploymentMode": "test"
					},
					"content": [
						{
							"tag": "InvoiceDetailRequest",
							"content": [
								{
									"tag": "InvoiceDetailRequestHeader",
									"attribute": {
										"purpose": "standard",
										"operation": "new",
										"invoiceDate": {
											"field": "ord.order_date",
											"data_type": "date",
											"format": "%Y-%m-%dT%H:%M:%S%z2"
										},
										"invoiceID": { "field": "ord.order_id" }
									}
								},
								{
									"tag": "InvoiceDetailOrder",
									"content": [
										{
											"tag": "InvoiceDetailOrderInfo",
											"content": [
												{
													"tag": "OrderReference",
													"attribute": {
														"orderID": { "field": "ord.company_reference_number" }
													},
													"content": [
														{
															"tag": "DocumentReference",
															"attribute": {
																"payloadID": ""
															}
														}
													]
												}
											]
										},
										{
											"tag": "InvoiceDetailItem",
											"field": "ordr",
											"attribute": {
												"quantity": { "field": "ordr.delivery_amount" },
												"invoiceLineNumber": { "field": "ordr.json_data.customer_row_number" }
											},
											"content": [
												{
													"tag": "UnitOfMeasure",
													"field": "ordr.unit"
												},
												{
													"tag": "UnitPrice",
													"content": [
														{
															"field": "ordr.unit_price",
															"tag": "Money",
															"attribute": {
																"currency": { "field": "ord.currency_id" }
															}
														}
													]
												},
												{
													"tag": "PriceBasisQuantity",
													"attribute": {
														"conversionFactor": "1",
														"quantity": "1"
													},
													"content": [
														{
															"tag": "UnitOfMeasure",
															"field": "ordr.unit"
														}
													]
												},
												{
													"tag": "ItemID",
													"content": [
														{
															"tag": "SupplierPartID",
															"field": "ordr.product_id"
														},
														{
															"tag": "BuyerPartID",
															"field": "ordr.json_data.supplier_product_code"
														}
													]
												},
												{
													"tag": "Description",
													"field": "ordr.description",
													"attribute": {
														"xml:lang": "EN"
													}
												},
												{
													"tag": "SubtotalAmount",
													"content": [
														{
															"field": "ordr.price_without_vat",
															"tag": "Money",
															"attribute": {
																"currency": { "field": "ord.currency_id" }
															}
														}
													]
												}
											]
										}
									]
								},
								{
									"tag": "InvoiceDetailSummary",
									"content": [
										{
											"tag": "SubtotalAmount",
											"content": [
												{
													"field": "ord.price_without_vat",
													"tag": "Money",
													"attribute": {
														"currency": { "field": "ord.currency_id" }
													}
												}
											]
										},
										{
											"tag": "Tax",
											"content": [
												{
													"field": "ord.vat_price",
													"tag": "Money",
													"attribute": {
														"currency": { "field": "ord.currency_id" }
													}
												},
												{
													"tag": "Description",
													"attribute": {
														"xml:lang": "EN"
													}
												},
												{
													"tag": "TaxDetail",
													"attribute": {
														"category": "NN",
														"percentageRate": "",
														"purpose": "tax"
													},
													"content": [
														{
															"tag": "TaxableAmount",
															"content": [
																{
																	"field": "ord.price_without_vat",
																	"tag": "Money",
																	"attribute": {
																		"currency": { "field": "ord.currency_id" }
																	}
																}
															]
														},
														{
															"tag": "TaxAmount",
															"content": [
																{
																	"field": "ord.vat_price",
																	"tag": "Money",
																	"attribute": {
																		"currency": { "field": "ord.currency_id" }
																	}
																}
															]
														}
													]
												}
											]
										},
										{
											"tag": "GrossAmount",
											"content": [
												{
													"field": "ord.price_with_vat",
													"tag": "Money",
													"attribute": {
														"currency": { "field": "ord.currency_id" }
													}
												}
											]
										},
										{
											"tag": "NetAmount",
											"content": [
												{
													"field": "ord.price_without_vat",
													"tag": "Money",
													"attribute": {
														"currency": { "field": "ord.currency_id" }
													}
												}
											]
										},
										{
											"tag": "DueAmount",
											"content": [
												{
													"field": "ord.price_with_vat",
													"tag": "Money",
													"attribute": {
														"currency": { "field": "ord.currency_id" }
													}
												}
											]
										}
									]
								}
							]
						}
					]
				}
			]
		}
	]
}
