{
	"name": "form/nc/report/form/form.json",
	"layout": {
		"component": "nc-form",
		"attribute": {
			"id": "nc-report-form",
			"info": "change also convertName = {form = 'nc-report-form'}"
		},
		"element": [
			{
				"component": "nc-row",
				"attribute": {
					"v-if": "!rec.printing"
				},
				"element": [
					{
						"component": "nc-tab",
						"attribute": {
							"model": "rec.tab",
							"v-on:change": "changeTab"
						}
					}
				]
			},
			{
				"component": "nc-row",
				"attribute": {
					"class": ["nc-margin-top"],
					"v-if": "!rec.printing"
				},
				"element": [
					{
						"component": "nc-col",
						"attribute": {
							"width": "9em"
						},
						"element": [
							{
								"component": "nc-label",
								"text": "Dispatch note",
								"attribute": {
									"v-if": "rec.tab === 'pallet-label'",
									"model": "hdr.form.dispatch_note"
								}
							},
							{
								"component": "nc-label",
								"text": "Invoice",
								"attribute": {
									"v-else-if": "rec.tab === 'invoice'",
									"model": "hdr.form.invoice"
								}
							},
							{
								"component": "nc-label",
								"text": "Program number",
								"attribute": {
									"v-else-if": "rec.tab === 'production-label'",
									"model": "hdr.form.program_number"
								}
							},
							{
								"component": "nc-label",
								"text": "Production order",
								"attribute": {
									"v-else-if": "rec.tab === 'production-label'",
									"model": "hdr.form.production_order"
								}
							},
							{
								"component": "nc-label",
								"text": "Product",
								"attribute": {
									"v-else": "",
									"model": "hdr.form.product"
								}
							}
						]
					},
					{
						"component": "nc-col",
						"attribute": {
							"class": ["nc-margin-right"],
							"width": "7em"
						},
						"element": [
							{
								"component": "nc-input",
								"attribute": {
									"v-if": "rec.tab === 'pallet-label'",
									"model": "rec.dispatch_note",
									"v-on:blur": "update"
								}
							},
							{
								"component": "nc-input",
								"attribute": {
									"v-else-if": "rec.tab === 'invoice'",
									"model": "rec.invoice",
									"v-on:blur": "update"
								}
							},
							{
								"component": "nc-input",
								"attribute": {
									"v-else-if": "rec.tab === 'production-label'",
									"model": "rec.program_number",
									"v-on:blur": "update"
								}
							},
							{
								"component": "nc-input",
								"attribute": {
									"v-else-if": "rec.tab === 'production-label'",
									"model": "rec.production_order",
									"v-on:blur": "update"
								}
							},
							{
								"component": "nc-input",
								"attribute": {
									"v-else": "",
									"model": "rec.product_id",
									"v-on:blur": "update"
								}
							}
						]
					},
					{
						"component": "nc-col",
						"attribute": {
							"width": "1/4",
							"style": "max-width: 32em;",
							"class": ["nc-space-evenly"]
						},
						"element": [
							{
								"component": "nc-checkbox",
								"attribute": {
									"model": "rec.show_pdf"
								},
								"element": [
									{
										"component": "nc-translate",
										"text": "Show pdf",
										"attribute": {
											"model": "hdr.form.show_pdf"
										}
									}
								]
							},
							{
								"component": "nc-checkbox",
								"attribute": {
									"model": "rec.show_barcode",
									":disabled": "rec.tab !== 'pallet-label'",
									"v-on:click": "showPdf('no-delay')"
								},
								"element": [
									{
										"component": "nc-translate",
										"text": "Show barcode",
										"attribute": {
											"model": "hdr.form.show_barcode"
										}
									}
								]
							},
							{
								"component": "nc-checkbox",
								"attribute": {
									"model": "rec.landscape",
									"v-on:click": "showPdf('no-delay')"
								},
								"element": [
									{
										"component": "nc-translate",
										"text": "Landscape",
										"attribute": {
											"model": "hdr.form.landscape"
										}
									}
								]
							}
						]
					},
					{
						"component": "nc-col",
						"attribute": {
							"class": ["nc-end-h", "nc-margin-right"],
							"width": "5em"
						},
						"element": [
							{
								"component": "nc-label",
								"text": "",
								"attribute": {
									"model": "hdr.form.paper_type"
								}
							}
						]
					},
					{
						"component": "nc-col",
						"attribute": {
							"width": "10em"
						},
						"element": [
							{
								"component": "nc-dropdown",
								"text": "",
								"attribute": {
									"model": "rec.paper_type",
									"v-on:change": "showPdf('no-delay')"
								}
							}
						]
					},
					{
						"component": "nc-col",
						"attribute": {
							"class": ["nc-end-h"],
							"width": "auto"
						},
						"element": [
							{
								"component": "nc-button",
								"attribute": {
									"class": ["nc-button-wide"],
									":disabled": "rec.selected < 1",
									"v-on:click": "print('selected')"
								},
								"element": [
									{
										"component": "nc-icon",
										"attribute": {
											"icon": "print"
										}
									},
									{
										"component": "nc-translate",
										"text": "Print all",
										"attribute": {
											"model": "hdr.form.print"
										}
									}
								]
							},
							{
								"component": "nc-button",
								"attribute": {
									"class": ["nc-button-wide", "nc-margin-left"],
									":disabled": "grid.form_row.data.length < 1",
									"v-on:click": "print('all')"
								},
								"element": [
									{
										"component": "nc-icon",
										"attribute": {
											"icon": "print"
										}
									},
									{
										"component": "nc-translate",
										"text": "Print all",
										"attribute": {
											"model": "hdr.form.print_all"
										}
									}
								]
							},
							{
								"component": "nc-button",
								"attribute": {
									"primary": "primary",
									"class": ["nc-button-wide", "nc-margin-left"],
									"type": "submit",
									"v-on:click": "update"
								},
								"element": [
									{
										"component": "nc-icon",
										"attribute": {
											"icon": "sync"
										}
									},
									{
										"component": "nc-translate",
										"text": "Update",
										"attribute": {
											"model": "hdr.form.update"
										}
									}
								]
							}
						]
					}
				]
			},
			{
				"component": "nc-row",
				"attribute": {
					"v-if": "!rec.printing"
				},
				"element": [
					{
						"component": "nc-grid",
						"attribute": {
							"id": "form_row",
							"height": "20vh",
							"model": "grid.form_row",
							"v-on:grid-row-clicked": "gridRowClicked"
						}
					}
				]
			},
			{
				"component": "nc-row",
				"attribute": {
					"class": ["nc-margin-top"],
					"v-if": "!rec.printing"
				},
				"element": [
					{
						"component": "nc-col",
						"attribute": {
							"v-if": "!rec.printing && rec.show_pdf",
							"width": "auto",
							"class": ["nc-align-top"]
						},
						"element": [
							{
								"component": "nc-document-preview",
								"attribute": {
									"id": "form-pdf",
									":src": "rec.document_data"
								}
							}
						]
					},
					{
						"component": "nc-col",
						"attribute": {
							"width": "auto",
							"class": ["nc-margin-right", "nc-align-top"]
						},
						"element": [
							{
								"component": "nc-include",
								"attribute": {
									"width": "calc(100% - 1em)",
									":include": "rec.layout_component"
								}
							}
						]
					}
				]
			}
		]
	}
}
