{
	"namespace": "xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\"",
	"linebreak": "\r\n",
	"convert": [
		[
			"/ArrayOfInvoice",
			"=",
			""
		],
		[
			"/ArrayOfInvoice/Invoice",
			"=",
			[
				"inv",
				[
					[
						"Invoice_number",
						"=",
						"0"
					],
					[
						"Invoice_date",
						"=",
						"inv_date_"
					],
					[
						"Invoice_description",
						"=",
						"inv_invoice_text"
					],
					[
						"Invoice_customer_number",
						"=",
						["linkedFieldValue",["inv_company_id", "co_company_number"]]
					],
					[
						"Invoice_customer_name1",
						"=",
						"inv_additional_data.invoicing_address.name"
					],
					[
						"Invoice_customer_name2",
						"=",
						"inv_additional_data.invoicing_address.name_2"
					],
					[
						"Invoice_customer_address1",
						"=",
						"inv_additional_data.invoicing_address.address"
					],
					[
						"Invoice_customer_address3",
						"=",
						["concatWith",[[" ", "inv_additional_data.invoicing_address.post_code", "inv_additional_data.invoicing_address.post_office"]]]
					],
					[
						"Invoice_customer_country",
						"=",
						"inv_additional_data.invoicing_address.country"
					],
					[
						"Language_code",
						"=",
						["from_preference","custom/lemon/export_lemon_invoice.language_code[inv_additional_data.invoicing_address.country]", "FIN"]
					],
					[
						"Invoice_currency_rate",
						"=",
						1
					],
					[
						"Invoice_type",
						"=",
						"0"
					],
					[
						"Invoice_delivery_customer_number",
						"=",
						"inv_additional_data.delivery_address.company_number"
					],
					[
						"Invoice_delivery_customer_name1",
						"=",
						"inv_additional_data.delivery_address.name"
					],
					[
						"Invoice_delivery_customer_name2",
						"=",
						"inv_additional_data.delivery_address.name_2"
					],
					[
						"Invoice_delivery_customer_address1",
						"=",
						"inv_additional_data.delivery_address.address"
					],
					[
						"Invoice_delivery_customer_address3",
						"=",
						["concatWith",[[" ", "inv_additional_data.delivery_address.post_code", "inv_additional_data.delivery_address.post_office"]]]
					],
					[
						"Invoice_delivery_customer_country",
						"=",
						"inv_additional_data.delivery_address.country"
					],
					[
						"Invoice_orderer_customer_number",
						"=",
						"inv_additional_data.order_address.company_number"
					],
					[
						"Invoice_orderer_customer_name1",
						"=",
						"inv_additional_data.order_address.name"
					],
					[
						"Invoice_orderer_customer_name2",
						"=",
						"inv_additional_data.order_address.name_2"
					],
					[
						"Invoice_orderer_customer_address1",
						"=",
						"inv_additional_data.order_address.address"
					],
					[
						"Invoice_orderer_customer_address3",
						"=",
						["concatWith",[[" ", "inv_additional_data.order_address.post_code", "inv_additional_data.order_address.post_office"]]]
					],
					[
						"Invoice_orderer_customer_country",
						"=",
						"inv_additional_data.order_address.country"
					],
					[
						"Invoice_orderer_customer_contact",
						"=",
						"inv_your_reference"
					],
					[
						"Currency_code",
						"=",
						"inv_currency_id"
					],
					[
						"Invoice_ordermark",
						"=",
						"inv_customer_project"
					],
					[
						"Invoice_customer_order_number",
						"=",
						"inv_mark"
					],
					[
						"invoice_customer_reference",
						"=",
						"inv_your_reference"
					],
					[
						"Invoice_our_reference",
						"=",
						"inv_our_reference"
					],
					[
						"Payment_term",
						"=",
						["linkedFieldValue",["inv_terms_of_payment_id", "top_export_code"]]
					],
					[
						"Invoice_delivery_term",
						"=",
						["from_preference","custom/lemon/export_lemon_invoice.term_of_delivery[inv_term_of_delivery]", ""]
					],
					[
						"Invoice_taxtype",
						"=",
						"false"
					],
					[
						"Invoice_totalsum",
						"=",
						"inv_total_amount"
					],
					[
						"Company_location_id",
						"=",
						"1"
					],
					[
						["if",	[["linkedFieldValue",["inv_company_id", "co_send_type"]], "=", "EDI"],
							[
								["Invoice_Method_Id", "=", "13"]
							],
						"else",
							[
								["Invoice_Method_Id", "=", "17"]
							]

						]
					],
					[
						"Person_seller_number",
						"=",
						["linkedFieldValue",["invr.1.invr_employee_id", "em_employee_number"]]
					],
					[
						"/ArrayOfInvoice/Invoice/InvoiceRows/InvoiceRow",
						"=",
						[
							"invr",
							[
								[
									"Row_position",
									"=",
									"invr_customer_row_number"
								],
								[
									"Row_productcode",
									"=",
									"invr_product_id"
								],
								[
									"Row_productdescription",
									"=",
									"invr_explanation"
								],
								[
									"Row_amount",
									"=",
									"invr_delivered_quantity"
								],
								[
									"Row_Unitprice",
									"=",
									"invr_price__unit"
								],
								[
									"Row_Total",
									"=",
									"invr_price_total"
								],
								[
									"Row_unit",
									"=",
									"invr_unit"
								],
								[
									"Row_taxrate",
									"=",
									"invr_vat_percentage"
								],
								[
									"Accountlist_account",
									"=",
									["linkedFieldValue",["invr_sales_order_code_id", "soc_sales_account_id"]]
								],
								[
									"Row_note",
									"=",
									"invr_serial_number"
								],
								[
									"Row_innernote",
									"=",
									"invr_invoice_id"
								],
								[
									"Invoicerow_deliverydate",
									"=",
									"invr_delivery_date"
								],
								[
									"Invoicerow_reference",
									"=",
									"invr_dispatch_note"
								]
							]
						]
					]
				]
			]
		]
	]
}
