2019-12-19 12:48:36 -06:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								@ extends ( 'layout.default' )  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2019-12-19 20:03:27 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								@ section ( 'title' ,  $__t ( 'Edit stock entry' ))  
						 
					
						
							
								
									
										
										
										
											2020-01-27 19:19:09 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								@ section ( 'viewJsName' ,  'stockentryform' )  
						 
					
						
							
								
									
										
										
										
											2019-12-19 12:48:36 -06:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								@ section ( 'content' )  
						 
					
						
							
								
									
										
										
										
											2020-01-27 19:00:49 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								< script >  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									Grocy . EditObjectId  =  {{  $stockEntry -> id  }}; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									Grocy . EditObjectProductId  =  {{  $stockEntry -> product_id  }}; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								</ script >  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-04-19 08:51:02 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								< div  class = " row " >  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									< div  class = " col " > 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										< h2  class = " title " >@ yield ( 'title' ) </ h2 > 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										< hr > 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									</ div > 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								</ div >  
						 
					
						
							
								
									
										
										
										
											2019-12-19 12:48:36 -06:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								< div  class = " row " >  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									< div  class = " col-xs-12 col-md-6 col-xl-4 pb-3 " > 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-01-27 19:19:09 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										< form  id = " stockentry-form "  novalidate > 
							 
						 
					
						
							
								
									
										
										
										
											2020-01-27 19:00:49 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
											@ php 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											$product  =  FindObjectInArrayByPropertyValue ( $products ,  'id' ,  $stockEntry -> product_id ); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											@ endphp 
							 
						 
					
						
							
								
									
										
										
										
											2019-12-19 12:48:36 -06:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											@ php 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												$additionalGroupCssClasses  =  '' ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												if  ( ! GROCY_FEATURE_FLAG_STOCK_BEST_BEFORE_DATE_TRACKING ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													$additionalGroupCssClasses  =  'd-none' ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											@ endphp 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											@ include ( 'components.datetimepicker' ,  array ( 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												'id'  =>  'best_before_date' , 
							 
						 
					
						
							
								
									
										
										
										
											2020-01-27 19:00:49 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
												'initialValue'  =>  $stockEntry -> best_before_date , 
							 
						 
					
						
							
								
									
										
										
										
											2019-12-19 12:48:36 -06:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
												'label'  =>  'Best before' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												'format'  =>  'YYYY-MM-DD' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												'initWithNow'  =>  false , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												'limitEndToNow'  =>  false , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												'limitStartToNow'  =>  false , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												'invalidFeedback'  =>  $__t ( 'A best before date is required' ), 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												'nextInputSelector'  =>  '#best_before_date' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												'additionalGroupCssClasses'  =>  'date-only-datetimepicker' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												'shortcutValue'  =>  '2999-12-31' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												'shortcutLabel'  =>  'Never expires' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												'earlierThanInfoLimit'  =>  date ( 'Y-m-d' ), 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												'earlierThanInfoText'  =>  $__t ( 'The given date is earlier than today, are you sure?' ), 
							 
						 
					
						
							
								
									
										
										
										
											2020-03-25 20:26:54 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
												'additionalGroupCssClasses'  =>  $additionalGroupCssClasses , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												'activateNumberPad'  =>  GROCY_FEATURE_FLAG_STOCK_BEST_BEFORE_DATE_FIELD_NUMBER_PAD 
							 
						 
					
						
							
								
									
										
										
										
											2019-12-19 12:48:36 -06:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
											)) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											@ php  $additionalGroupCssClasses  =  '' ;  @ endphp 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-01-27 19:00:49 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
											@ include ( 'components.numberpicker' ,  array ( 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												'id'  =>  'amount' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												'value'  =>  $stockEntry -> amount , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												'label'  =>  'Amount' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												'hintId'  =>  'amount_qu_unit' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												'invalidFeedback'  =>  $__t ( 'The amount cannot be lower than %s' ,  '0' ), 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												'additionalAttributes'  =>  'data-not-equal="-1"' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												'additionalHtmlContextHelp'  =>  '<div id="tare-weight-handling-info" class="text-small 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>' 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											)) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-08-17 14:47:33 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
											@ include ( 'components.numberpicker' ,  array ( 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												'id'  =>  'qu_factor_purchase_to_stock' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												'label'  =>  'Factor purchase to stock quantity unit' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												'value'  =>  $stockEntry -> qu_factor_purchase_to_stock , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												'min'  =>  1 , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												'invalidFeedback'  =>  $__t ( 'The amount cannot be lower than %s' ,  '1' ), 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												'additionalCssClasses'  =>  'input-group-qu' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												'additionalHtmlElements'  =>  '<p id="qu-conversion-info" class="form-text text-muted small d-none"></p>' 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											)) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2019-12-19 12:48:36 -06:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
											@ if ( GROCY_FEATURE_FLAG_STOCK_PRICE_TRACKING ) 
							 
						 
					
						
							
								
									
										
										
										
											2020-08-24 17:42:41 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
											@ php 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											if  ( empty ( $stockEntry -> price )) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												$price  =  '' ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											else 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												$price  =  $stockEntry -> price ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											@ endphp 
							 
						 
					
						
							
								
									
										
										
										
											2019-12-19 12:48:36 -06:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
											@ include ( 'components.numberpicker' ,  array ( 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												'id'  =>  'price' , 
							 
						 
					
						
							
								
									
										
										
										
											2020-08-24 17:42:41 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
												'value'  =>  $price , 
							 
						 
					
						
							
								
									
										
										
										
											2019-12-19 12:48:36 -06:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
												'label'  =>  'Price' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												'min'  =>  0 , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												'step'  =>  0.01 , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												'hint'  =>  $__t ( 'in %s per purchase quantity unit' ,  GROCY_CURRENCY ), 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												'invalidFeedback'  =>  $__t ( 'The price cannot be lower than %s' ,  '0' ), 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												'isRequired'  =>  false 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											)) 
							 
						 
					
						
							
								
									
										
										
										
											2020-03-25 19:34:56 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
											@ include ( 'components.shoppinglocationpicker' ,  array ( 
							 
						 
					
						
							
								
									
										
										
										
											2020-03-27 13:27:40 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
												'label'  =>  'Store' , 
							 
						 
					
						
							
								
									
										
										
										
											2020-03-25 19:34:56 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
												'shoppinglocations'  =>  $shoppinglocations , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												'prefillById'  =>  $stockEntry -> shopping_location_id 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											)) 
							 
						 
					
						
							
								
									
										
										
										
											2019-12-19 12:48:36 -06:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
											@ else 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											< input  type = " hidden "  name = " price "  id = " price "  value = " 0 " > 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											@ endif 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-01-27 19:00:49 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
											@ if ( GROCY_FEATURE_FLAG_STOCK_LOCATION_TRACKING ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											@ include ( 'components.locationpicker' ,  array ( 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												'locations'  =>  $locations , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												'prefillById'  =>  $stockEntry -> location_id 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											)) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											@ else 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											< input  type = " hidden "  name = " location_id "  id = " location_id "  value = " 1 " > 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											@ endif 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											
							 
						 
					
						
							
								
									
										
										
										
											2020-01-23 18:58:05 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
											@ include ( 'components.datetimepicker2' ,  array ( 
							 
						 
					
						
							
								
									
										
										
										
											2020-01-21 17:30:09 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
												'id'  =>  'purchase_date' , 
							 
						 
					
						
							
								
									
										
										
										
											2020-01-27 19:00:49 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
												'initialValue'  =>  $stockEntry -> purchased_date , 
							 
						 
					
						
							
								
									
										
										
										
											2020-01-21 17:30:09 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
												'label'  =>  'Purchased date' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												'format'  =>  'YYYY-MM-DD' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												'initWithNow'  =>  false , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												'limitEndToNow'  =>  false , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												'limitStartToNow'  =>  false , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												'invalidFeedback'  =>  $__t ( 'A purchased date is required' ), 
							 
						 
					
						
							
								
									
										
										
										
											2020-01-27 19:19:09 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
												'nextInputSelector'  =>  '#save-stockentry-button' , 
							 
						 
					
						
							
								
									
										
										
										
											2020-01-21 17:30:09 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
												'additionalGroupCssClasses'  =>  'date-only-datetimepicker' 
							 
						 
					
						
							
								
									
										
										
										
											2020-01-23 18:58:05 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
											)) 
							 
						 
					
						
							
								
									
										
										
										
											2020-01-21 17:30:09 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											< div  class = " checkbox " > 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												< label  for = " open " > 
							 
						 
					
						
							
								
									
										
										
										
											2020-01-27 19:00:49 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
													< input  @ if ( $stockEntry -> open  ==  1 )  checked  @ endif  type = " checkbox "  id = " open "  name = " open " >  {{  $__t ( 'Opened' )  }} 
							 
						 
					
						
							
								
									
										
										
										
											2020-01-21 17:30:09 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
												</ label > 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											</ div > 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-01-27 19:19:09 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
											< button  id = " save-stockentry-button "  class = " btn btn-success " > {{  $__t ( 'OK' )  }} </ button > 
							 
						 
					
						
							
								
									
										
										
										
											2019-12-19 12:48:36 -06:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										</ form > 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									</ div > 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								</ div >  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								@ stop