{
	"name": "form/nc/erp-sync/ksef/column/order-invoice.json",
	"option": {
		"grid_option": {
			"cell_class_rules": {
				"nc-grid-cell-changed": "data.link_rec && colDef.change_compare !== false && data.change_field && recDataDifferent(data.link_rec, colDef, x)"
			},
			"row_class_rules": {
				"nc-grid-row-changed": "data.change_status === 'changed'",
				"nc-grid-row-deleted": "data.change_status === 'deleted'",
				"nc-grid-row-equal": "data.change_status === 'equal'",
				"nc-grid-row-new": "data.change_status === 'new'"
			}
		}
	},
	"column": [
		{
			"export": false,
			"link_field": "ord.order_id",
			"name": "Row",
			"record_type": "invoice",
			"variable": "idx"
		},
		{
			"export": false,
			"name": "Status",
			"variable": "change_status",
			"editable": false,
			"width": 70
		},
		{
			"export": false,
			"name": "Change field",
			"variable": "change_field",
			"editable": false,
			"width": 150
		},
		{
			"change_compare": false,
			"field": "ord.record_type",
			"name": "Type",
			"width": 60,
			"organization_id": { "4d": { "load": false } }
		},
		{
			"field": "ord.json_data.transfer_id",
			"name": "KSeF number",
			"width": 110,
			"organization_id": { "ksef": { "load": false } }
		},
		{
			"change_compare": false,
			"field": "ord.json_data.error",
			"name": "Err.",
			"width": 40,
			"organization_id": { "": { "load": false }, "4d": { "load": false } },
			"cell_class_rules": {
				"darkred": "x && x != ''"
			}
		},
		{
			"change_compare": false,
			"field": "ord.json_data.import_text",
			"name": "XML",
			"format": "xml",
			"width": 60,
			"organization_id": { "": { "load": false }, "4d": { "load": false } },
			"cell_class_rules": {
				"blue": "x && x != ''"
			}
		},
		{
			"field": "ord.json_data.html_text",
			"name": "HTML",
			"format": "xml",
			"width": 60,
			"organization_id": { "": { "load": false }, "4d": { "load": false }, "odoo": { "field": "" } },
			"cell_class_rules": {
				"lightgreen-bg": "x && x != ''"
			}
		},
		{
			"field": "ord.json_data.html_text_en",
			"name": "HTML-en",
			"format": "xml",
			"width": 80,
			"organization_id": { "": { "load": false }, "4d": { "load": false }, "odoo": { "field": "" } },
			"cell_class_rules": {
				"lightgreen-bg": "x && x != ''"
			}
		},
		{
			"field": "ord.order_id",
			"name": "Invoice",
			"width": 80
		},
		{
			"field": "ord.order_type",
			"name": "Type",
			"name_fi": "Ty.",
			"width": 60
		},
		{
			"field": "ord.json_data.credit_note",
			"name": "Cr. note",
			"name_fi": "Hyv. lasku",
			"width": 60
		},
		{
			"field": "ord.company_reference_number",
			"organization_id": { "odoo": { "field": "" } },
			"name_fi": "Tilausviite",
			"name": "Buyer order",
			"width": 100
		},
		{
			"field": "ord.our_reference",
			"name_fi": "Viitteemme",
			"width": 120
		},
		{
			"change_compare": false,
			"info": "no change_compare because PL is stripped from front of vat number in ksef data",
			"field": "co.json_data.vat_number",
			"organization_id": { "ksef": { "field": "ord.json_data.buyer.vat_number" } },
			"name": "Buyer VAT",
			"name_fi": "ALV numero",
			"width": 120
		},
		{
			"field": "co.name",
			"organization_id": { "ksef": { "field": "ord.json_data.buyer.name" } },
			"name_fi": "Asiakkaan nimi",
			"width": 180
		},
		{
			"field": "ord.invoicing_company_id",
			"name": "Inv. company",
			"organization_id": {},
			"name_fi": "Lask. as.",
			"width": 110
		},
		{
			"field": "ord.delivery_company_id",
			"name": "Deliv. comp.",
			"organization_id": {},
			"name_fi": "Toim. as.",
			"width": 100
		},
		{
			"field": "ord.order_date",
			"name": "Invoice date",
			"name_fi": "Laskun pv",
			"width": 120
		},
		{
			"field": "ord.price_with_vat",
			"name": "Total price",
			"name_fi": "Laskun summa",
			"format": "%'.2f",
			"width": 110
		},
		{
			"field": "ord.price_without_vat",
			"name": "Price vat 0%",
			"name_fi": "Hinta alv 0%",
			"format": "%'.2f",
			"width": 100
		},
		{
			"export": false,
			"field": "ord.currency_id",
			"name": "Curr.",
			"name_fi": "Val.",
			"width": 60
		},
		{
			"field": "ord.due_date",
			"format": "%d.%m.%Y",
			"name_fi": "Eräpäivä",
			"width": 100
		},
		{
			"field": "ord.json_data.destination_date",
			"name": "Dest. date",
			"name_fi": "Kohdepv",
			"width": 100
		},
		{
			"field": "ord.your_reference",
			"name_fi": "Asiaa hoitaa",
			"width": 160
		},
		{
			"field": "ord.json_data.firm_id",
			"organization_id": { "ksef": { "load": false } },
			"name": "Firm",
			"width": 50,
			"name_fi": "Yritys"
		},
		{
			"field": "co.address",
			"organization_id": { "ksef": { "field": "ord.json_data.buyer.address" } },
			"name_fi": "Osoite",
			"width": 120
		},
		{
			"field": "co.post_office",
			"organization_id": { "ksef": { "field": "ord.json_data.buyer.post_office" }, "odoo": { "field": "" } },
			"name_fi": "Postitoimip.",
			"width": 120
		},
		{
			"field": "co.post_code",
			"organization_id": { "ksef": { "field": "ord.json_data.buyer.post_code" } },
			"name_fi": "Postinumero",
			"width": 120
		},
		{
			"field": "ord.json_data.buyer.address2",
			"name": "Buyer address2",
			"width": 150,
			"organization_id": { "": { "load": false }, "4d": { "load": false }, "odoo": { "field": "" } }
		},
		{
			"field": "ord.invoicing_address",
			"organization_id": { "ksef": { "field": "ord.json_data.buyer.invoicing_address" } },
			"name_fi": "Text address",
			"width": 120
		},
		{
			"change_compare": false,
			"info": "no change_compare for co.country because of value-map change",
			"field": "co.country",
			"organization_id": { "ksef": { "field": "ord.json_data.buyer.country" } },
			"name": "Country",
			"name_fi": "Maa",
			"width": 90
		},
		{
			"variable": "co.country_code",
			"organization_id": { "": { "load": false }, "4d": { "load": false }, "ksef": { "field": "ord.json_data.buyer.country_code" }, "odoo": { "field": "" } },
			"name": "Count. code",
			"name_fi": "Maakoodi",
			"width": 90
		},
		{
			"field": "per.full_name-employee",
			"organization_id": { "ksef": { "load": false }, "odoo": { "field": "" } },
			"name": "Contact person",
			"name_fi": "Yhteyshenkilö",
			"width": 120
		},
		{
			"field": "co.www",
			"organization_id": { "ksef": { "field": "ord.json_data.buyer.www" } },
			"name_fi": "As. www",
			"width": 120
		},
		{
			"field": "co.email",
			"organization_id": { "ksef": { "field": "ord.json_data.buyer.email" } },
			"name_fi": "As. sähköposti",
			"width": 120
		},
		{
			"field": "ord.json_data.remark_time",
			"organization_id": { "odoo": { "field": "" } },
			"name_fi": "Huom. aika",
			"width": 90,
			"fault_value": "8 pv"
		},
		{
			"field": "ord.json_data.paid_price",
			"name_fi": "Maksettu",
			"format": "%'.2f",
			"width": 90
		},
		{
			"field": "ord.json_data.penalty_interest_percent",
			"organization_id": { "odoo": { "field": "" } },
			"name_fi": "Viiv. korko %",
			"format": "%'.2f",
			"width": 110,
			"fault_value": "9,00%"
		},
		{
			"field": "ord.json_data.bank_reference_number",
			"name": "Bank ref.",
			"name_fi": "Viitenumero",
			"width": 120
		},
		{
			"field": "ord.vat_price",
			"name_fi": "ALV",
			"format": "%'.2f",
			"width": 90
		},
		{
			"field": "ord.record_id",
			"name": "Record id",
			"width": 120
		},
		{
			"type": "Field",
			"organization_id": { "odoo": { "field": "" } },
			"field": "ord.note",
			"width": 90
		},
		{
			"type": "Field",
			"name": "Terms id",
			"field": "ord.terms_of_payment_id",
			"width": 90
		},
		{
			"change_compare": false,
			"type": "Field",
			"name": "Terms of payment",
			"field": "top.name",
			"organization_id": { "ksef": { "load": false }, "odoo": { "field": "" } },
			"width": 160
		},
		{
			"field": "ord.json_data.seller.name",
			"name": "Seller name",
			"width": 180,
			"organization_id": { "": { "load": false }, "4d": { "load": false }, "odoo": { "field": "" } }
		},
		{
			"field": "ord.json_data.seller.vat_number",
			"name": "Seller VAT",
			"width": 120,
			"organization_id": { "": { "load": false }, "4d": { "load": false }, "odoo": { "field": "" } }
		},
		{
			"field": "ord.json_data.seller.address",
			"name": "Seller address",
			"width": 150,
			"organization_id": { "": { "load": false }, "4d": { "load": false }, "odoo": { "field": "" } }
		},
		{
			"field": "ord.json_data.seller.address2",
			"name": "Seller address2",
			"width": 150,
			"organization_id": { "": { "load": false }, "4d": { "load": false }, "odoo": { "field": "" } }
		},
		{
			"field": "ord.json_data.seller.post_office",
			"name": "Seller city",
			"width": 120,
			"organization_id": { "": { "load": false }, "4d": { "load": false }, "odoo": { "field": "" } }
		},
		{
			"field": "ord.json_data.seller.post_code",
			"name": "Sel. post c.",
			"width": 100,
			"organization_id": { "": { "load": false }, "4d": { "load": false }, "odoo": { "field": "" } }
		},
		{
			"field": "ord.json_data.seller.country_code",
			"name": "Sel. code",
			"width": 80,
			"organization_id": { "": { "load": false }, "4d": { "load": false }, "odoo": { "field": "" } }
		},
		{
			"field": "ord.json_data.seller.country",
			"name": "Sel. cou.",
			"width": 90,
			"organization_id": { "": { "load": false }, "4d": { "load": false }, "odoo": { "field": "" } }
		},
		{
			"field": "ord.json_data.seller.bank_name",
			"organization_id": { "": { "load": false }, "4d": { "load": false }, "odoo": { "field": "" } },
			"name": "Seller bank",
			"width": 120
		},
		{
			"field": "ord.json_data.seller.swift_code",
			"organization_id": { "": { "load": false }, "4d": { "load": false }, "odoo": { "field": "" } },
			"name": "Seller swift",
			"width": 100
		},
		{
			"field": "ord.json_data.seller.bank_account",
			"name": "Seller account",
			"width": 280,
			"organization_id": { "": { "load": false }, "4d": { "load": false }, "odoo": { "field": "" } }
		},
		{
			"field": "ord.json_data.seller.www",
			"name": "Seller website",
			"width": 150,
			"organization_id": { "": { "load": false }, "4d": { "load": false }, "odoo": { "field": "" } }
		},
		{
			"field": "ord.json_data.seller.email",
			"name": "Seller email",
			"width": 150,
			"organization_id": { "": { "load": false }, "4d": { "load": false }, "odoo": { "field": "" } }
		},
		{
			"change_compare": false,
			"field": "ord.json_data.poland_vat_price",
			"name": "Poland vat",
			"width": 150,
			"organization_id": { "": { "load": false }, "4d": { "load": false }, "odoo": { "field": "" } }
		},
		{
			"change_compare": false,
			"field": "ord.json_data.poland_vat_rate",
			"name": "Poland VAT rate",
			"width": 150,
			"organization_id": { "": { "load": false }, "4d": { "load": false }, "odoo": { "field": "" } }
		},
		{
			"change_compare": false,
			"field": "ord.json_data.poland_vat_rate_date",
			"name": "Poland VAT rate date",
			"width": 150,
			"organization_id": { "": { "load": false }, "4d": { "load": false }, "odoo": { "field": "" } }
		},
		{
			"change_compare": false,
			"field": "ord.json_data.poland_payment_method",
			"name": "Poland payment method",
			"width": 150,
			"organization_id": { "": { "load": false }, "4d": { "load": false }, "odoo": { "field": "" } }
		},
		{
			"change_compare": false,
			"variable": "ord.json_data",
			"name": "Data",
			"width": 200
		}
	],
	"column-": [
		{
			"field": "ord.invoicing_address",
			"name_fi": "Laskutusosoite",
			"width": 800
		},
		{
			"field": "ord.info",
			"name_fi": "Muistiinpanoja",
			"width": 250
		},
		{
			"field": "ord.json_data.additional_data",
			"name_fi": "Liikekumppanin osoitetiedot",
			"width": 120
		},
		{
			"field": "ord.currency_id",
			"name_fi": "Valuuttakoodi",
			"width": 120
		},
		{
			"field": "ord.delivery_address",
			"name_fi": "Toimitusosoite",
			"width": 800
		},
		{
			"field": "ord.note",
			"name_fi": "Laskun lisätietoja",
			"width": 120
		},
		{
			"field": "ord.exchange_rate",
			"name_fi": "Valuuttakurssi",
			"width": 120
		},
		{
			"field": "co.company_number",
			"organization_id": { "ksef": { "load": false } },
			"name_fi": "Asiakasnumero",
			"width": 120
		},
		{
			"field": "ord.json_data.discount_percentage",
			"name_fi": "Laskun alennusprosentti",
			"width": 120
		},
		{
			"change_compare": false,
			"field": "top.discount_days",
			"organization_id": { "ksef": { "load": false } },
			"name_fi": "Käteisalennuksen päivien lukumäärä",
			"info": "Käteisalennuksen päivien lukumäärä",
			"width": 80
		},
		{
			"change_compare": false,
			"field": "top.discount_percent",
			"organization_id": { "ksef": { "load": false } },
			"name_fi": "Käteisalennuksen prosentti",
			"info": "Käteisalennuksen prosentti",
			"width": 120
		},
		{
			"field": "ord.way_of_delivery",
			"name_fi": "Toimitustapa",
			"width": 120
		},
		{
			"field": "ord.json_data.processing_status",
			"name": "Processing",
			"width": 100,
			"organization_id": { "ksef": { "load": false } }
		},
		{
			"field": "ord.json_data.receipt_timestamp",
			"type": "datetime",
			"name": "Received",
			"width": 140,
			"organization_id": { "ksef": { "load": false } }
		}
	]
}
