{
	"name": "table/external/ksef/order/order_row-invoice.json",
	"table_name": "order_row",
	"table_prefix": "ordr",
	"record_type": ["invoice"],
	"local_table": "order_row",
	"local_record_type": "invoice",
	"format": {
		"date": "%Y-%m-%d",
		"datetime": "%Y-%m-%dT%H:%M:%SZ"
	},
	"field": [
		{
			"field_name": "id",
			"local_field": "order_row_id",
			"field_type": "integer",
			"writeable": false
		},
		{
			"field_name": "invoiceId",
			"local_field": "order_id",
			"field_type": "integer"
		},
		{
			"field_name": "productCode",
			"local_field": "product_id",
			"field_type": "string",
			"info": "Product or service code from KSeF invoice line"
		},
		{
			"field_name": "productName",
			"local_field": "description",
			"field_type": "string",
			"info": "Product or service name"
		},
		{
			"field_name": "quantity",
			"local_field": "delivery_amount",
			"field_type": "decimal",
			"info": "Quantity of items"
		},
		{
			"field_name": "unit",
			"local_field": "unit_name",
			"field_type": "string",
			"info": "Unit of measure (szt, usl, kg, m, etc.)"
		},
		{
			"field_name": "unitPrice",
			"local_field": "unit_price",
			"field_type": "decimal",
			"info": "Net price per unit"
		},
		{
			"field_name": "netAmount",
			"local_field": "price_without_vat",
			"field_type": "decimal",
			"info": "Net amount (quantity * unitPrice)"
		},
		{
			"field_name": "vatRate",
			"local_field": "json_data.vat_rate",
			"field_type": "string",
			"info": "VAT rate code (8, 23, 7, 0, etc.)"
		},
		{
			"field_name": "vatAmount",
			"local_field": "vat_price",
			"field_type": "decimal",
			"info": "VAT amount for this line"
		},
		{
			"field_name": "grossAmount",
			"local_field": "price_with_vat",
			"field_type": "decimal",
			"info": "Gross amount (net + VAT)"
		},
		{
			"field_name": "pkwiu",
			"local_field": "json_data.pkwiu",
			"field_type": "string",
			"info": "PKWiU code (Polish classification of products)"
		},
		{
			"field_name": "gtu",
			"local_field": "json_data.gtu_code",
			"field_type": "string",
			"info": "GTU code (special goods marker)"
		},
		{
			"field_name": "discount",
			"local_field": "json_data.discount_percent",
			"field_type": "decimal",
			"info": "Discount percentage"
		}
	]
}
