{
	"name": "form/nc/nc-stock/nc-stock.json",
	"layout": {
		"component": "nc-form",
		"attribute": {
			"id": "nc-stock"
		},
		"element": [
			{
				"component": "nc-row",
				"element": [
					{
						"component": "nc-header",
						"attribute": {
							"size": "medium",
							"hdr": "hdr.stock.header"
						}
					}
				]
			},
			{
				"component": "nc-row",
				"attribute": {
					"class": ["nc-center-v"]
				},
				"element": [
					{
						"component": "nc-col",
						"attribute": {
							"width": "16em",
							"class": ["nc-margin-right"]
						},
						"element": [
							{
								"component": "nc-label-input",
								"text": "Purchase order",
								"attribute": {
									"hdr": "hdr.stock.purchase_order",
									"model": "rec.purchase_order",
									"label-style-": "width: 9em;",
									"v-on:change": "update()"
								}
							}
						]
					},
					{
						"component": "nc-col",
						"attribute": {
							"width": "16em",
							"class": ["nc-margin-right"]
						},
						"element": [
							{
								"component": "nc-label-input",
								"text": "Supplier",
								"attribute": {
									"hdr": "hdr.stock.search_company",
									"model": "rec.search_company",
									"v-on:change": "update()"
								}
							}
						]
					},
					{
						"component": "nc-col",
						"attribute": {
							"class": ["nc-margin-right"],
							"width": "auto"
						},
						"element": [
							{
								"component": "nc-label-input",
								"text": "Product",
								"attribute": {
									"model": "rec.search_product"
								}
							}
						]
					},
					{
						"component": "nc-col",
						"attribute": {
							"width": "9em",
							"class": ["nc-margin-right"]
						},
						"element": [
							{
								"component": "nc-checkbox",
								"text": "Hide before",
								"attribute": {
									"hdr": "hdr.stock.hide_before",
									"model": "rec.search.hide_before",
									"v-on:click": "update()"
								}
							}
						]
					},
					{
						"component": "nc-col",
						"attribute": {
							"width": "8em",
							"class": ["nc-margin-right"]
						},
						"element": [
							{
								"component": "nc-input",
								"attribute": {
									"model": "rec.search.hide_before_date"
								}
							}
						]
					},
					{
						"component": "nc-col",
						"attribute": {
							"class": ["nc-end-h"],
							"width": "8em"
						},
						"element": [
							{
								"component": "nc-button",
								"attribute": {
									"type": "submit",
									"model": "hdr.stock.update",
									"primary": "primary",
									"v-on:click": "update()"
								},
								"element": [
									{
										"component": "i",
										"attribute": {
											"class": ["far", "fa-sync"]
										}
									},
									{
										"component": "nc-translate",
										"text": "Update",
										"attribute": {
											"model": "hdr.stock.update"
										}
									}
								]
							}
						]
					}
				]
			},
			{
				"component": "nc-divider",
				"attribute": {
					"height": "0em"
				}
			},
			{
				"component": "nc-row",
				"element": [
					{
						"component": "nc-tab",
						"attribute": {
							"model": "rec.tab",
							"v-on:change": "tabChanged"
						},
						"element": [
							{
								"component": "nc-col",
								"attribute": {
									"v-if": "rec.tab === 'pdf'",
									"width": "100%"
								},
								"element": [
									{
										"component": "nc-pdf-viewer",
										"attribute": {
											":src": "rec.document_data",
											":name": "rec.document_name"
										}
									}
								]
							},
							{
								"component": "nc-row",
								"element": [
									{
										"component": "nc-grid",
										"attribute": {
											"id": "stock",
											"height": "calc(40vh - 12em)",
											"model": "grid.stock",
											"v-on:grid-row-clicked": "gridRowClicked",
											"v-on:grid-selection-changed": "gridSelectionChanged",
											":doesExternalFilterPass": "doesExternalFilterPass",
											":isExternalFilterPresent": "isExternalFilterPresent"
										}
									}
								]
							},
							{
								"component": "nc-row",
								"element": [
									{
										"component": "nc-grid",
										"attribute": {
											"id": "stock_row",
											"height": "calc(40vh - 12em)",
											"model": "grid.stock_row",
											"v-on:grid-row-clicked": "gridRowClicked",
											":doesExternalFilterPass": "doesExternalFilterPass",
											":isExternalFilterPresent": "isExternalFilterPresent"
										}
									}
								]
							},
							{
								"component": "nc-row",
								"attribute": {
									"v-if": "false"
								},
								"element": [
									{
										"component": "nc-header",
										"attribute": {
											"size": "small",
											"hdr": "hdr.stock.location"
										}
									}
								]
							},
							{
								"component": "nc-row",
								"element": [
									{
										"component": "nc-col",
										"attribute": {
											"width": "34em"
										},
										"element": [
											{
												"component": "nc-label-input",
												"text": "Material batch",
												"attribute": {
													"model": "rec.packet.material_batch",
													":disabled": "!packetEnabled()",
													"label-style": "width: 9em;"
												}
											}
										]
									},
									{
										"component": "nc-col",
										"attribute": {
											"width": "34em"
										},
										"element": [
											{
												"component": "nc-label-input",
												"text": "Product",
												"attribute": {
													"model": "rec.packet.product_id",
													":readonly": "true",
													"label-style": "width: 9em;"
												}
											}
										]
									},
									{
										"component": "nc-col",
										"attribute": {
											"width": "auto"
										},
										"element": [
											{
												"component": "nc-input",
												"text": "Product name",
												"attribute": {
													"model": "rec.packet.name",
													":readonly": "true"
												}
											}
										]
									},
									{
										"component": "nc-col",
										"attribute": {
											"width": "9em",
											"class": ["nc-margin-right"]
										},
										"element": [
											{
												"component": "nc-checkbox",
												"text": "Enable Target date",
												"attribute": {
													"model": "rec.enable_target_date",
													"v-on:click": "update()",
													"hdr": "hdr.stock.target_date"
												}
											}
										]
									},
									{
										"component": "nc-col",
										"attribute": {
											"width": "8em"
										},
										"element": [
											{
												"component": "nc-input",
												"attribute": {
													"model": "rec.target_date"
												}
											}
										]
									},
									{
										"component": "nc-col",
										"attribute": {
											"class": ["nc-end-h"],
											"width": "8em"
										},
										"element": [
											{
												"component": "nc-button",
												"attribute": {
													"model": "hdr.stock.save",
													"v-on:click": "save()",
													"icon": "sync"
												}
											}
										]
									}
								]
							},
							{
								"component": "nc-include",
								"attribute": { "src": "form/nc/nc-stock/packet-location.json", ":inline": true }
							}
						]
					}
				]
			}
		]
	}
}
