{
	"name": "form/nc/nc-warehouse/nc-warehouse.json",
	"layout": {
		"component": "nc-form",
		"attribute": {
			"id": "nc-warehouse"
		},
		"element": [
			{
				"component": "nc-row",
				"element": [
					{
						"component": "nc-header",
						"attribute": {
							"size": "medium",
							"hdr": "hdr.warehouse.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.warehouse.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.warehouse.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.warehouse.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.warehouse.update",
									"primary": "primary",
									"v-on:click": "update()"
								},
								"element": [
									{
										"component": "i",
										"attribute": {
											"class": ["far", "fa-sync"]
										}
									},
									{
										"component": "nc-translate",
										"text": "Update",
										"attribute": {
											"model": "hdr.warehouse.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": "warehouse",
											"height": "calc(40vh - 10em)",
											"model": "grid.warehouse",
											"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": "warehouse_row",
											"height": "calc(40vh - 10em)",
											"model": "grid.warehouse_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.warehouse.location"
										}
									}
								]
							},
							{
								"component": "nc-row",
								"element": [
									{
										"component": "nc-col",
										"attribute": {
											"width": "28em",
											"class": ["nc-margin-right"]
										},
										"element": [
											{
												"component": "nc-label-dropdown",
												"text": "Location",
												"attribute": {
													"hdr": "hdr.location",

													"label-style": "width: 4em;",
													"model": "rec.location_id",
													"v-on:change": "gridRowClicked('work', null, null, true)",
													":doesExternalFilterPass": "doesExternalFilterPass",
													":isExternalFilterPresent": "isExternalFilterPresent"
												}
											}
										]
									},
									{
										"component": "nc-col",
										"attribute": {
											"width": "14em",
											"class": ["nc-margin-left"]
										},
										"element": [
											{
												"component": "nc-label-input",
												"text": "Product",
												"attribute": {
													"model": "rec.packet.product_id",

													"label-style": "width: 4em;",
													":disabled": "true"
												}
											}
										]
									},
									{
										"component": "nc-col",
										"attribute": {
											"width": "20em",
											":horizontal": "true"
										},
										"element": [
											{
												"component": "nc-input",
												"text": "Product name",
												"attribute": {
													"model": "rec.packet.name",
													":disabled": "true"
												}
											}
										]
									},
									{
										"component": "nc-col",
										"attribute": {
											"width": "auto",
											"class": ["nc-margin-right"]
										}
									},
									{
										"component": "nc-col",
										"attribute": {
											"width": "auto",
											"class": ["nc-margin-right", "nc-end-h"]
										},
										"element": [
											{
												"component": "nc-checkbox",
												"text": "Enable Target date",
												"attribute": {
													"model": "rec.enable_target_date",
													"v-on:click": "update()",
													"hdr": "hdr.warehouse.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.warehouse.save",
													"v-on:click": "save()"
												},
												"element": [
													{
														"component": "i",
														"attribute": {
															"class": ["far", "fa-sync"]
														}
													},
													{
														"component": "nc-translate",
														"text": "Save",
														"attribute": {
															"model": "hdr.warehouse.save"
														}
													}
												]
											}
										]
									}
								]
							},
							{
								"component": "nc-row",
								"element": [
									{
										"component": "nc-col",
										"attribute": {
											"width": "28em",
											"class": ["nc-align-top", "nc-margin-right"],
											"style": ["margin-top: 3px;"]
										},
										"element": [
											{
												"component": "nc-rect",
												"attribute": {
													"style": ["margin: 1px; overflow: hidden;"]
												},
												"element": [
													{
														"component": "nc-svg-map",
														"attribute": {
															":highlight": "mapSelected",
															"style": "height: 21vh; margin-top: -3em;",
															"svg": "img/storage-map.svg",
															"v-model:hover": "mapHover",
															"v-on:click": "storageMapToggleSelected($event)",
															"v-on:dblclick": "storageMapDoubleClick($event)"
														}
													}
												]
											}
										]
									},
									{
										"component": "nc-col",
										"attribute": {
											"width": "25em",
											"class": ["nc-align-top", "nc-margin-left"]
										},
										"element": [
											{
												"component": "nc-col",
												"attribute": {
													"width": "24em",

													"class": ["nc-margin-right"]
												},
												"element": [
													{
														"component": "nc-label-input",
														"text": "Material batch",
														"attribute": {
															"model": "rec.packet.material_batch",

															"label-style": "width: 9em;"
														}
													}
												]
											},
											{
												"component": "nc-row",
												"element": [
													{
														"component": "nc-col",
														"attribute": {
															"width": "14em",
															":horizontal": "true"
														},
														"element": [
															{
																"component": "nc-label-input",
																"text": "Total amount",
																"attribute": {
																	"model": "rec.packet.total_amount",

																	"label-style": "width: 9em;",
																	"v-on:blur": "updatePacket('total_amount')"
																}
															}
														]
													},
													{
														"component": "nc-col",
														"attribute": {
															"width": "3em",
															"class": ["nc-margin-right"]
														},
														"element": [
															{
																"component": "nc-input",
																"text": "Unit",
																"attribute": {
																	"model": "rec.packet.unit",
																	":disabled": "true",
																	":horizontal": "true"
																}
															}
														]
													},
													{
														"component": "nc-col",
														"attribute": {
															"width": "4em"
														},
														"element": [
															{
																"component": "nc-input",
																"text": "Total amount 2",
																"attribute": {
																	"model": "rec.packet.total_amount_2",
																	":disabled": "false",
																	":horizontal": "true"
																}
															}
														]
													},
													{
														"component": "nc-col",
														"attribute": {
															"width": "3em"
														},
														"element": [
															{
																"component": "nc-input",
																"attribute": {
																	"model": "rec.packet.unit2",
																	":disabled": "true"
																}
															}
														]
													}
												]
											},
											{
												"component": "nc-row",
												"element": [
													{
														"component": "nc-col",
														"attribute": {
															"width": "14em",
															"class": [""]
														},
														"element": [
															{
																"component": "nc-label-input",
																"text": "Packet count",
																"attribute": {
																	"model": "rec.packet.packet_count",

																	"label-style": "width: 9em;",
																	"v-on:blur": "updatePacket('packet_count')"
																}
															}
														]
													},
													{
														"component": "nc-col",
														"attribute": {
															"width": "3em"
														},
														"element": [
															{
																"component": "nc-input",
																"attribute": {
																	"model": "rec.packet.packet_count_unit",
																	":disabled": "true",
																	"v-on:blur": "updatePacket('packet_count_unit')"
																}
															}
														]
													}
												]
											},
											{
												"component": "nc-col",
												"attribute": {
													"width": "14em"
												},
												"element": [
													{
														"component": "nc-label-input",
														"text": "Full packet size",
														"attribute": {
															"model": "rec.packet.full_packet_size",

															"label-style": "width: 9em;",
															"v-on:blur": "updatePacket('full_packet_size')"
														}
													}
												]
											},
											{
												"component": "nc-col",
												"attribute": {
													"width": "3em",
													"class": ["nc-margin-right"]
												},
												"element": [
													{
														"component": "nc-input",
														"text": "Unit",
														"attribute": {
															"model": "rec.packet.unit",
															":disabled": "true",
															"hdr-": "hdr.warehouse.unit",
															":horizontal": "true"
														}
													}
												]
											},
											{
												"component": "nc-col",
												"attribute": {
													"width": "4em",
													":horizontal": "true"
												},
												"element": [
													{
														"component": "nc-input",
														"text": "Full packet size 2",
														"attribute": {
															"model": "rec.packet.last_packet_size2",
															":disabled": "false",
															"v-on:blur": "updatePacket('last_packet_size2')"
														}
													}
												]
											},
											{
												"component": "nc-col",
												"attribute": {
													"width": "3em"
												},
												"element": [
													{
														"component": "nc-input",
														"attribute": {
															"model": "rec.packet.unit2",
															":disabled": "true",
															"v-on:blur": "updatePacket('unit2')"
														}
													}
												]
											},
											{
												"component": "nc-col",
												"attribute": {
													"width": "14em",
													":horizontal": "true"
												},
												"element": [
													{
														"component": "nc-label-input",
														"text": "Last packet size",
														"attribute": {
															"model": "rec.packet.last_packet_size",

															"label-style": "width: 9em;",
															"v-on:blur": "updatePacket('last_packet_size')",
															":input-style": "rec.packet.last_packet_size > rec.packet.full_packet_size ? 'color: red; font-weight: bold' : ''"
														}
													}
												]
											},
											{
												"component": "nc-col",
												"attribute": {
													"width": "3em",
													"class": ["nc-margin-right"]
												},
												"element": [
													{
														"component": "nc-input",
														"text": "Unit",
														"attribute": {
															"model": "rec.packet.unit",
															":disabled": "true",
															"hdr-": "hdr.warehouse.unit",
															":horizontal": "true"
														}
													}
												]
											},
											{
												"component": "nc-col",
												"attribute": {
													"width": "4em",
													":horizontal": "true"
												},
												"element": [
													{
														"component": "nc-input",
														"text": "Last packet size 2",
														"attribute": {
															"model": "rec.packet.last_packet_size2",
															":disabled": "false",
															"v-on:blur": "updatePacket('last_packet_size2')"
														}
													}
												]
											},
											{
												"component": "nc-col",
												"attribute": {
													"width": "3em"
												},
												"element": [
													{
														"component": "nc-input",
														"attribute": {
															"model": "rec.packet.unit2",
															":disabled": "true"
														}
													}
												]
											},
											{
												"component": "nc-col",
												"attribute": {
													"width": "10em"
												},
												"element": [
													{
														"component": "nc-button",
														"attribute": {
															"model": "hdr.warehouse.create_row",
															"v-on:click": "createRow()"
														},
														"element": [
															{
																"component": "i",
																"attribute": {
																	"class": ["far", "fa-sync"]
																}
															},
															{
																"component": "nc-translate",
																"text": "Create row",
																"attribute": {
																	"model": "hdr.warehouse.create_row"
																}
															}
														]
													}
												]
											}
										]
									},
									{
										"component": "nc-col",
										"attribute": {
											"style": "margin-top: 1px",
											"width": "auto"
										},
										"element": [
											{
												"component": "nc-grid",
												"attribute": {
													"id": "warehouse_location",
													"height": "calc(20vh - 1em)",
													"model": "grid.warehouse_location",
													"v-on:grid-row-clicked": "gridRowClicked",
													":doesExternalFilterPass": "doesExternalFilterPass",
													":isExternalFilterPresent": "isExternalFilterPresent"
												}
											}
										]
									}
								]
							}
						]
					}
				]
			}
		]
	}
}
