{
	"name": "form/nc/nc-stock/stock-value/stock-value.json",
	"layout": {
		"component": "nc-form",
		"attribute": {
			"id": "stock-value"
		},
		"element": [
			{
				"component": "nc-row",
				"element": [
					{
						"component": "nc-header",
						"attribute": {
							"size": "medium",
							"hdr": "hdr.stock_value.header"
						}
					}
				]
			},
			{
				"component": "nc-row",
				"element": [
					{
						"component": "nc-col",
						"attribute": {
							"width": "10em"
						},
						"element": [
							{
								"component": "nc-label",
								"text": "Value date",
								"attribute": {
									"model": "hdr.stock_value.value_date"
								}
							}
						]
					},
					{
						"component": "nc-col",
						"attribute": {
							"width": "8em",
							"class": ["nc-margin-right"]
						},
						"element": [
							{
								"component": "nc-input",
								"attribute": {
									"id": "value_date",
									"model": "rec.value_date"
								}
							}
						]
					},
					{
						"component": "nc-col",
						"attribute": {
							"width": "22em",
							"class": ["nc-margin-right"]
						},
						"element": [
							{
								"component": "nc-label-dropdown",
								"text": "Conversion table",
								"attribute": {
									":horizontal": "true",
									":disabled": "arr.main_currency.length <= 1",
									"model": "rec.main_currency",
									"v-on:change": "update()"
								}
							}
						]
					},
					{
						"component": "nc-col",
						"attribute": {
							"width": "20em",
							"class": ["nc-margin-right"]
						},
						"element": [
							{
								"component": "nc-label-dropdown",
								"text": "Target currency",
								"attribute": {
									":horizontal": "true",
									":readonly": "true",
									"model": "rec.target_currency",
									"v-on:change": "update()"
								}
							}
						]
					},
					{
						"component": "nc-col",
						"attribute": {
							"class": ["nc-margin-right"],
							"width": "auto"
						},
						"element": [
							{
								"component": "nc-label-input",
								"text": "Product",
								"attribute": {
									":horizontal": "true",
									"model": "rec.search_product"
								}
							}
						]
					},
					{
						"component": "nc-col",
						"attribute": {
							"class": ["nc-end-h"],
							"width": "8em"
						},
						"element": [
							{
								"component": "nc-button",
								"attribute": {
									"type": "submit",
									"model": "hdr.stock_value.update",
									"primary": "primary",
									"v-on:click": "update()"
								},
								"element": [
									{
										"component": "i",
										"attribute": {
											"class": ["far", "fa-sync"]
										}
									},
									{
										"component": "nc-translate",
										"text": "Update",
										"attribute": {
											"model": "hdr.stock_value.update"
										}
									}
								]
							}
						]
					}
				]
			},
			{
				"component": "nc-row",
				"element": [
					{
						"component": "nc-col",
						"attribute": {
							"width": "10em"
						},
						"element": [
							{
								"component": "nc-label",
								"text": "Options",
								"attribute": {
									"model": "hdr.stock_value.option"
								}
							}
						]
					},
					{
						"component": "nc-col",
						"attribute": {
							"width": "auto",
							"class": ["nc-space-between", "nc-margin-right"]
						},
						"element": [
							{
								"component": "nc-checkbox",
								"text": "Show all stock events",
								"attribute": {
									"hdr": "hdr.stock_value.show_show_all_events",
									"model": "rec.show_all_events",
									"v-on:click": "update()"
								}
							},
							{
								"component": "nc-checkbox",
								"text": "Remove zero value rows",
								"attribute": {
									"hdr": "hdr.stock_value.remove_zero_balance_row",
									"model": "rec.remove_zero_balance_row",
									"v-on:click": "update()"
								}
							},
							{
								"component": "nc-checkbox",
								"text": "Use cost price",
								"attribute": {
									"hdr": "hdr.stock_value.use_cost_price",
									"model": "rec.use_cost_price",
									"v-on:click": "update()"
								}
							},
							{
								"component": "nc-checkbox",
								"text": "Use product price",
								"attribute": {
									"hdr": "hdr.stock_value.use_product_price",
									"model": "rec.use_product_price",
									"v-on:click": "update()"
								}
							},
							{
								"component": "nc-checkbox",
								"text": "Use stock event price for own work",
								"attribute": {
									"hdr": "hdr.stock_value.use_stock_event_price_for_own_work",
									"model": "rec.use_stock_event_price_for_own_work",
									"v-on:click": "update()"
								}
							},
							{
								"component": "nc-checkbox",
								"text": "Use sales price for own work",
								"attribute": {
									"hdr": "hdr.stock_value.use_sales_price_for_own_work",
									"model": "rec.use_sales_price_for_own_work",
									"v-on:click": "update()"
								}
							}
						]
					},
					{
						"component": "nc-col",
						"attribute": {
							"width": "8em"
						}
					}
				]
			},
			{
				"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",
											"style": "height: calc(100vh - 18em)"
										}
									}
								]
							},
							{
								"component": "nc-row",
								"attribute": {
									"v-show": "rec.tab !== 'pdf'"
								},
								"element": [
									{
										"component": "nc-grid",
										"attribute": {
											"id": "stock_value",
											"height": "calc(70vh - 18em)",
											"model": "grid.stock_value",
											"v-on:grid-row-clicked": "gridRowClicked"
										}
									}
								]
							},
							{
								"component": "nc-row",
								"attribute": {
									"v-show": "rec.tab !== 'pdf'"
								},
								"element": [
									{
										"component": "nc-col",
										"attribute": {
											"style": "margin-top: 1px",
											"width": "auto"
										},
										"element": [
											{
												"component": "nc-grid",
												"attribute": {
													"id": "stock_event",
													":doesExternalFilterPass": "doesExternalFilterPass",
													":isExternalFilterPresent": "() => true",
													"height": "calc(30vh - 1em)",
													"model": "grid.stock_event"
												}
											}
										]
									},
									{
										"component": "nc-col",
										"attribute": {
											"height": "30vh",
											"width": "25em"
										},
										"element": [
											{
												"component": "nc-label-textarea",
												"text": "Info",
												"attribute": {
													"hdr": "hdr.stock_value.product_info",
													"model": "rec.product_info",
													"rows": "10000",
													"input-style": "height: calc(30vh - 2em)",
													"label-style": "margin-left: 0.5em; font-size: 1em"
												}
											}
										]
									}
								]
							}
						]
					}
				]
			}
		]
	}
}
