| 
									
										
										
										
											2018-04-11 19:49:35 +02:00
										 |  |  | @extends('layout.default') | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-05-01 20:19:18 +02:00
										 |  |  | @section('title', $__t('Inventory')) | 
					
						
							| 
									
										
										
										
											2018-04-12 21:13:38 +02:00
										 |  |  | @section('activeNav', 'inventory') | 
					
						
							|  |  |  | @section('viewJsName', 'inventory') | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-04-11 19:49:35 +02:00
										 |  |  | @section('content') | 
					
						
							| 
									
										
										
										
											2020-11-09 21:51:55 +01:00
										 |  |  | <script> | 
					
						
							|  |  |  | 	Grocy.QuantityUnits = {!! json_encode($quantityUnits) !!}; | 
					
						
							|  |  |  | 	Grocy.QuantityUnitConversionsResolved = {!! json_encode($quantityUnitConversionsResolved) !!}; | 
					
						
							|  |  |  | </script> | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-07-10 20:37:13 +02:00
										 |  |  | <div class="row"> | 
					
						
							| 
									
										
										
										
											2018-07-12 19:12:31 +02:00
										 |  |  | 	<div class="col-xs-12 col-md-6 col-xl-4 pb-3"> | 
					
						
							| 
									
										
										
										
											2020-04-19 08:51:02 -04:00
										 |  |  | 		<h2 class="title">@yield('title')</h2> | 
					
						
							| 
									
										
										
										
											2020-10-31 18:37:10 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-11-08 15:09:10 +01:00
										 |  |  | 		<hr class="my-2"> | 
					
						
							| 
									
										
										
										
											2020-10-31 18:37:10 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-08-31 20:32:50 +02:00
										 |  |  | 		<form id="inventory-form" | 
					
						
							|  |  |  | 			novalidate> | 
					
						
							| 
									
										
										
										
											2018-07-10 20:37:13 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-07-14 14:43:57 +02:00
										 |  |  | 			@include('components.productpicker', array( | 
					
						
							| 
									
										
										
										
											2020-08-31 20:32:50 +02:00
										 |  |  | 			'products' => $products, | 
					
						
							|  |  |  | 			'barcodes' => $barcodes, | 
					
						
							|  |  |  | 			'nextInputSelector' => '#new_amount' | 
					
						
							| 
									
										
										
										
											2018-07-14 14:43:57 +02:00
										 |  |  | 			)) | 
					
						
							| 
									
										
										
										
											2018-07-10 20:37:13 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-11-09 21:51:55 +01:00
										 |  |  | 			@include('components.productamountpicker', array( | 
					
						
							| 
									
										
										
										
											2020-08-31 20:32:50 +02:00
										 |  |  | 			'value' => 1, | 
					
						
							| 
									
										
										
										
											2020-11-09 21:51:55 +01:00
										 |  |  | 			'label' => 'New stock amount', | 
					
						
							| 
									
										
										
										
											2020-08-31 20:32:50 +02:00
										 |  |  | 			'additionalHtmlElements' => '<div id="inventory-change-info" | 
					
						
							| 
									
										
										
										
											2020-11-09 21:51:55 +01:00
										 |  |  | 				class="form-text text-muted d-none ml-3 my-0 w-100"></div>', | 
					
						
							| 
									
										
										
										
											2020-08-31 20:32:50 +02:00
										 |  |  | 			'additionalHtmlContextHelp' => '<div id="tare-weight-handling-info" | 
					
						
							| 
									
										
										
										
											2020-11-09 21:51:55 +01:00
										 |  |  | 				class="text-info font-italic d-none">' . $__t('Tare weight handling enabled - please weigh the whole container, the amount to be posted will be automatically calculcated') . '</div>' | 
					
						
							| 
									
										
										
										
											2018-09-08 12:04:31 +02:00
										 |  |  | 			)) | 
					
						
							| 
									
										
										
										
											2020-08-29 16:41:27 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-10-29 11:04:34 -05:00
										 |  |  | 			@if(boolval($userSettings['show_purchased_date_on_purchase'])) | 
					
						
							|  |  |  | 			@include('components.datetimepicker2', array( | 
					
						
							|  |  |  | 			'id' => 'purchased_date', | 
					
						
							|  |  |  | 			'label' => 'Purchased date', | 
					
						
							|  |  |  | 			'format' => 'YYYY-MM-DD', | 
					
						
							|  |  |  | 			'hint' => 'This will apply to added products', | 
					
						
							|  |  |  | 			'initWithNow' => true, | 
					
						
							|  |  |  | 			'limitEndToNow' => false, | 
					
						
							|  |  |  | 			'limitStartToNow' => false, | 
					
						
							|  |  |  | 			'invalidFeedback' => $__t('A purchased date is required'), | 
					
						
							|  |  |  | 			'nextInputSelector' => '#best_before_date', | 
					
						
							|  |  |  | 			'additionalCssClasses' => 'date-only-datetimepicker2', | 
					
						
							|  |  |  | 			'activateNumberPad' => GROCY_FEATURE_FLAG_STOCK_BEST_BEFORE_DATE_FIELD_NUMBER_PAD | 
					
						
							|  |  |  | 			)) | 
					
						
							|  |  |  | 			@endif | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-09-19 17:46:52 +02:00
										 |  |  | 			@php | 
					
						
							| 
									
										
										
										
											2020-08-31 20:32:50 +02:00
										 |  |  | 			$additionalGroupCssClasses = ''; | 
					
						
							|  |  |  | 			if (!GROCY_FEATURE_FLAG_STOCK_BEST_BEFORE_DATE_TRACKING) | 
					
						
							|  |  |  | 			{ | 
					
						
							|  |  |  | 			$additionalGroupCssClasses = 'd-none'; | 
					
						
							|  |  |  | 			} | 
					
						
							| 
									
										
										
										
											2019-09-19 17:46:52 +02:00
										 |  |  | 			@endphp | 
					
						
							| 
									
										
										
										
											2018-07-12 19:12:31 +02:00
										 |  |  | 			@include('components.datetimepicker', array( | 
					
						
							| 
									
										
										
										
											2020-08-31 20:32:50 +02:00
										 |  |  | 			'id' => 'best_before_date', | 
					
						
							| 
									
										
										
										
											2020-11-15 19:53:44 +01:00
										 |  |  | 			'label' => 'Due date', | 
					
						
							| 
									
										
										
										
											2020-08-31 20:32:50 +02:00
										 |  |  | 			'hint' => 'This will apply to added products', | 
					
						
							|  |  |  | 			'format' => 'YYYY-MM-DD', | 
					
						
							|  |  |  | 			'initWithNow' => false, | 
					
						
							|  |  |  | 			'limitEndToNow' => false, | 
					
						
							|  |  |  | 			'limitStartToNow' => false, | 
					
						
							| 
									
										
										
										
											2020-11-15 19:53:44 +01:00
										 |  |  | 			'invalidFeedback' => $__t('A due date is required'), | 
					
						
							| 
									
										
										
										
											2020-08-31 20:32:50 +02:00
										 |  |  | 			'nextInputSelector' => '#best_before_date', | 
					
						
							|  |  |  | 			'additionalGroupCssClasses' => 'date-only-datetimepicker', | 
					
						
							|  |  |  | 			'shortcutValue' => '2999-12-31', | 
					
						
							| 
									
										
										
										
											2020-11-15 19:53:44 +01:00
										 |  |  | 			'shortcutLabel' => 'Never overdue', | 
					
						
							| 
									
										
										
										
											2020-08-31 20:32:50 +02:00
										 |  |  | 			'earlierThanInfoLimit' => date('Y-m-d'), | 
					
						
							|  |  |  | 			'earlierThanInfoText' => $__t('The given date is earlier than today, are you sure?'), | 
					
						
							|  |  |  | 			'additionalGroupCssClasses' => $additionalGroupCssClasses, | 
					
						
							|  |  |  | 			'activateNumberPad' => GROCY_FEATURE_FLAG_STOCK_BEST_BEFORE_DATE_FIELD_NUMBER_PAD | 
					
						
							| 
									
										
										
										
											2018-07-10 20:37:13 +02:00
										 |  |  | 			)) | 
					
						
							| 
									
										
										
										
											2019-09-19 17:46:52 +02:00
										 |  |  | 			@php $additionalGroupCssClasses = ''; @endphp | 
					
						
							| 
									
										
										
										
											2018-07-10 20:37:13 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-09-19 17:46:52 +02:00
										 |  |  | 			@if(GROCY_FEATURE_FLAG_STOCK_PRICE_TRACKING) | 
					
						
							| 
									
										
										
										
											2019-05-03 22:11:20 +02:00
										 |  |  | 			@include('components.numberpicker', array( | 
					
						
							| 
									
										
										
										
											2020-08-31 20:32:50 +02:00
										 |  |  | 			'id' => 'price', | 
					
						
							| 
									
										
										
										
											2020-11-12 21:35:10 +01:00
										 |  |  | 			'label' => 'Price', | 
					
						
							| 
									
										
										
										
											2020-11-16 19:10:29 +01:00
										 |  |  | 			'min' => '0.' . str_repeat('0', $userSettings['stock_decimal_places_amounts'] - 1) . '1', | 
					
						
							| 
									
										
										
										
											2020-10-20 13:08:54 -05:00
										 |  |  | 			'decimals' => $userSettings['stock_decimal_places_prices'], | 
					
						
							| 
									
										
										
										
											2020-08-31 20:32:50 +02:00
										 |  |  | 			'value' => '', | 
					
						
							| 
									
										
										
										
											2020-11-12 21:35:10 +01:00
										 |  |  | 			'hint' => $__t('Per stock quantity unit', GROCY_CURRENCY), | 
					
						
							| 
									
										
										
										
											2020-11-15 15:23:47 +01:00
										 |  |  | 			'additionalHtmlContextHelp' => '<i class="fas fa-question-circle text-muted" | 
					
						
							| 
									
										
										
										
											2020-11-09 21:30:22 +01:00
										 |  |  | 				data-toggle="tooltip" | 
					
						
							|  |  |  | 				title="' . $__t('This will apply to added products') . '"></i>', | 
					
						
							| 
									
										
										
										
											2020-11-15 14:15:09 +01:00
										 |  |  | 			'isRequired' => false, | 
					
						
							|  |  |  | 			'additionalCssClasses' => 'locale-number-input locale-number-currency' | 
					
						
							| 
									
										
										
										
											2019-05-03 22:11:20 +02:00
										 |  |  | 			)) | 
					
						
							| 
									
										
										
										
											2020-03-25 19:34:56 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  | 			@include('components.shoppinglocationpicker', array( | 
					
						
							| 
									
										
										
										
											2020-08-31 20:32:50 +02:00
										 |  |  | 			'label' => 'Store', | 
					
						
							|  |  |  | 			'shoppinglocations' => $shoppinglocations | 
					
						
							| 
									
										
										
										
											2020-03-25 19:34:56 +01:00
										 |  |  | 			)) | 
					
						
							| 
									
										
										
										
											2019-09-19 17:46:52 +02:00
										 |  |  | 			@else | 
					
						
							| 
									
										
										
										
											2020-08-31 20:32:50 +02:00
										 |  |  | 			<input type="hidden" | 
					
						
							|  |  |  | 				name="price" | 
					
						
							|  |  |  | 				id="price" | 
					
						
							|  |  |  | 				value="0"> | 
					
						
							| 
									
										
										
										
											2019-09-19 17:46:52 +02:00
										 |  |  | 			@endif | 
					
						
							| 
									
										
										
										
											2019-05-03 22:11:20 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-09-19 17:46:52 +02:00
										 |  |  | 			@if(GROCY_FEATURE_FLAG_STOCK_LOCATION_TRACKING) | 
					
						
							| 
									
										
										
										
											2019-04-05 21:26:44 +02:00
										 |  |  | 			@include('components.locationpicker', array( | 
					
						
							| 
									
										
										
										
											2020-08-31 20:32:50 +02:00
										 |  |  | 			'locations' => $locations, | 
					
						
							|  |  |  | 			'hint' => $__t('This will apply to added products') | 
					
						
							| 
									
										
										
										
											2019-04-05 21:26:44 +02:00
										 |  |  | 			)) | 
					
						
							| 
									
										
										
										
											2019-09-19 17:46:52 +02:00
										 |  |  | 			@endif | 
					
						
							| 
									
										
										
										
											2019-04-05 21:26:44 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-08-31 20:32:50 +02:00
										 |  |  | 			<button id="save-inventory-button" | 
					
						
							|  |  |  | 				class="btn btn-success">{{ $__t('OK') }}</button> | 
					
						
							| 
									
										
										
										
											2018-07-10 20:37:13 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | 		</form> | 
					
						
							|  |  |  | 	</div> | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-09-20 13:37:53 +02:00
										 |  |  | 	<div class="col-xs-12 col-md-6 col-xl-4 hide-when-embedded"> | 
					
						
							| 
									
										
										
										
											2018-07-10 20:37:13 +02:00
										 |  |  | 		@include('components.productcard') | 
					
						
							|  |  |  | 	</div> | 
					
						
							| 
									
										
										
										
											2017-04-20 17:10:21 +02:00
										 |  |  | </div> | 
					
						
							| 
									
										
										
										
											2018-04-11 19:49:35 +02:00
										 |  |  | @stop |