2018-09-22 13:26:58 +02:00 
										
									 
								 
							 
							
								
							 
							
								 
							
								
									
										 
							
							
								 $ ( '#save-chore-button' ) . on ( 'click' ,  function ( e )  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								{  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
									e . preventDefault ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2022-03-26 10:34:00 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
									if  ( ! Grocy . FrontendHelpers . ValidateForm ( "chore-form" ,  true ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
									{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
										return ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-12-31 13:45:14 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
									if  ( $ ( ".combobox-menu-visible" ) . length ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
									{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
										return ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-11-11 17:34:37 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
									var  jsonData  =  $ ( '#chore-form' ) . serializeJSON ( ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2022-02-08 20:35:47 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
									jsonData . start _date  =  Grocy . Components . DateTimePicker . GetValue ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2019-09-26 17:20:25 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
									if  ( Grocy . FeatureFlags . GROCY _FEATURE _FLAG _CHORES _ASSIGNMENTS ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
									{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
										jsonData . assignment _config  =  $ ( "#assignment_config" ) . val ( ) . join ( "," ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
									} 
							 
						 
					
						
							
								
									
										
										
										
											2020-08-29 16:41:27 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2018-11-24 19:40:50 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
									Grocy . FrontendHelpers . BeginUiBusy ( "chore-form" ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2018-09-22 13:26:58 +02:00 
										
									 
								 
							 
							
								
							 
							
								 
							
								
									
								 
							
							
									if  ( Grocy . EditMode  ===  'create' ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
									{ 
							 
						 
					
						
							
								
									
										
										
										
											2019-01-19 14:51:51 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
										Grocy . Api . Post ( 'objects/chores' ,  jsonData , 
							 
						 
					
						
							
								
									
										
										
										
											2018-09-22 13:26:58 +02:00 
										
									 
								 
							 
							
								
							 
							
								 
							
								
									
								 
							
							
											function ( result ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
											{ 
							 
						 
					
						
							
								
									
										
										
										
											2019-04-22 22:16:35 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
												Grocy . EditObjectId  =  result . created _object _id ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
												Grocy . Components . UserfieldsForm . Save ( function ( ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
												{ 
							 
						 
					
						
							
								
									
										
										
										
											2019-09-17 13:13:26 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
													Grocy . Api . Post ( 'chores/executions/calculate-next-assignments' ,  {  "chore_id" :  Grocy . EditObjectId  } , 
							 
						 
					
						
							
								
									
										
										
										
											2020-08-30 12:18:16 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
														function ( result ) 
							 
						 
					
						
							
								
									
										
										
										
											2019-09-17 13:13:26 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
														{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
															window . location . href  =  U ( '/chores' ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
														} , 
							 
						 
					
						
							
								
									
										
										
										
											2020-08-30 12:18:16 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
														function ( xhr ) 
							 
						 
					
						
							
								
									
										
										
										
											2019-09-17 13:13:26 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
														{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
															Grocy . FrontendHelpers . EndUiBusy ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
															console . error ( xhr ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
														} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
													) ; 
							 
						 
					
						
							
								
									
										
										
										
											2019-04-22 22:16:35 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
												} ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2018-09-22 13:26:58 +02:00 
										
									 
								 
							 
							
								
							 
							
								 
							
								
									
								 
							
							
											} , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
											function ( xhr ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
											{ 
							 
						 
					
						
							
								
									
										
										
										
											2018-11-24 19:40:50 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
												Grocy . FrontendHelpers . EndUiBusy ( "chore-form" ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2018-09-22 13:26:58 +02:00 
										
									 
								 
							 
							
								
							 
							
								 
							
								
									
								 
							
							
												Grocy . FrontendHelpers . ShowGenericError ( 'Error while saving, probably this item already exists' ,  xhr . response ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
											} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
										) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
									else 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
									{ 
							 
						 
					
						
							
								
									
										
										
										
											2019-01-19 14:51:51 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
										Grocy . Api . Put ( 'objects/chores/'  +  Grocy . EditObjectId ,  jsonData , 
							 
						 
					
						
							
								
									
										
										
										
											2018-09-22 13:26:58 +02:00 
										
									 
								 
							 
							
								
							 
							
								 
							
								
									
								 
							
							
											function ( result ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
											{ 
							 
						 
					
						
							
								
									
										
										
										
											2019-04-22 22:16:35 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
												Grocy . Components . UserfieldsForm . Save ( function ( ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
												{ 
							 
						 
					
						
							
								
									
										
										
										
											2019-09-17 13:13:26 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
													Grocy . Api . Post ( 'chores/executions/calculate-next-assignments' ,  {  "chore_id" :  Grocy . EditObjectId  } , 
							 
						 
					
						
							
								
									
										
										
										
											2020-08-30 12:18:16 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
														function ( result ) 
							 
						 
					
						
							
								
									
										
										
										
											2019-09-17 13:13:26 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
														{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
															window . location . href  =  U ( '/chores' ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
														} , 
							 
						 
					
						
							
								
									
										
										
										
											2020-08-30 12:18:16 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
														function ( xhr ) 
							 
						 
					
						
							
								
									
										
										
										
											2019-09-17 13:13:26 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
														{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
															Grocy . FrontendHelpers . EndUiBusy ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
															console . error ( xhr ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
														} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
													) ; 
							 
						 
					
						
							
								
									
										
										
										
											2019-04-22 22:16:35 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
												} ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2018-09-22 13:26:58 +02:00 
										
									 
								 
							 
							
								
							 
							
								 
							
								
									
								 
							
							
											} , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
											function ( xhr ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
											{ 
							 
						 
					
						
							
								
									
										
										
										
											2018-11-24 19:40:50 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
												Grocy . FrontendHelpers . EndUiBusy ( "chore-form" ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2018-09-22 13:26:58 +02:00 
										
									 
								 
							 
							
								
							 
							
								 
							
								
									
								 
							
							
												Grocy . FrontendHelpers . ShowGenericError ( 'Error while saving, probably this item already exists' ,  xhr . response ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
											} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
										) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								} ) ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								$ ( '#chore-form input' ) . keyup ( function ( event )  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								{  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
									Grocy . FrontendHelpers . ValidateForm ( 'chore-form' ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								} ) ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								$ ( '#chore-form input' ) . keydown ( function ( event )  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								{  
						 
					
						
							
								
									
										
										
										
											2022-03-30 18:00:28 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
									if  ( event . keyCode  ===  13 )  // Enter
 
							 
						 
					
						
							
								
									
										
										
										
											2018-09-22 13:26:58 +02:00 
										
									 
								 
							 
							
								
							 
							
								 
							
								
									
								 
							
							
									{ 
							 
						 
					
						
							
								
									
										
										
										
											2018-09-29 13:41:56 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
										event . preventDefault ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2022-03-30 18:00:28 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
										if  ( ! Grocy . FrontendHelpers . ValidateForm ( 'chore-form' ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2018-09-22 13:26:58 +02:00 
										
									 
								 
							 
							
								
							 
							
								 
							
								
									
								 
							
							
										{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
											return  false ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
										} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
										else 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
										{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
											$ ( '#save-chore-button' ) . click ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
										} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								} ) ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2019-04-22 14:01:31 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								var  checkboxValues  =  $ ( "#period_config" ) . val ( ) . split ( "," ) ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								for  ( var  i  =  0 ;  i  <  checkboxValues . length ;  i ++ )  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								{  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
									if  ( ! checkboxValues [ i ] . isEmpty ( ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
									{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
										$ ( "#"  +  checkboxValues [ i ] ) . prop ( 'checked' ,  true ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2019-04-22 22:16:35 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								Grocy . Components . UserfieldsForm . Load ( ) ;  
						 
					
						
							
								
									
										
										
										
											2018-09-22 13:26:58 +02:00 
										
									 
								 
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								$ ( '#name' ) . focus ( ) ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								Grocy . FrontendHelpers . ValidateForm ( 'chore-form' ) ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2022-02-08 20:35:47 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								if  ( Grocy . EditMode  ==  "edit" )  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								{  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
									Grocy . Api . Get ( 'objects/chores_log?limit=1&query[]=chore_id='  +  Grocy . EditObjectId , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
										function ( journalEntries ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
										{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
											if  ( journalEntries . length  >  0 ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
											{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
												$ ( ".datetimepicker-input" ) . attr ( "disabled" ,  "" ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
											} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
										} , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
										function ( xhr ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
										{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
											console . error ( xhr ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
										} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
									) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2019-03-04 17:43:12 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								setTimeout ( function ( )  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								{  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
									$ ( ".input-group-chore-period-type" ) . trigger ( "change" ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2019-09-17 13:13:26 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
									$ ( ".input-group-chore-assignment-type" ) . trigger ( "change" ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2019-09-18 10:02:52 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
									// Click twice to trigger on-click but not change the actual checked state
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
									$ ( "#consume_product_on_execution" ) . click ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
									$ ( "#consume_product_on_execution" ) . click ( ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2019-09-18 10:08:59 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
									Grocy . Components . ProductPicker . GetPicker ( ) . trigger ( 'change' ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2019-03-04 17:43:12 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								} ,  100 ) ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2022-02-09 19:52:19 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								$ ( '.input-group-chore-period-type' ) . on ( 'change keyup' ,  function ( e )  
						 
					
						
							
								
									
										
										
										
											2018-09-22 13:26:58 +02:00 
										
									 
								 
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								{  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
									var  periodType  =  $ ( '#period_type' ) . val ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
									var  periodDays  =  $ ( '#period_days' ) . val ( ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2019-10-04 11:14:11 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
									var  periodInterval  =  $ ( '#period_interval' ) . val ( ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2018-09-22 13:26:58 +02:00 
										
									 
								 
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2019-04-22 14:01:31 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
									$ ( ".period-type-input" ) . addClass ( "d-none" ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
									$ ( ".period-type-"  +  periodType ) . removeClass ( "d-none" ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
									$ ( "#period_config" ) . val ( "" ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
									if  ( periodType  ===  'manually' ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
									{ 
							 
						 
					
						
							
								
									
										
										
										
											2022-02-09 19:52:19 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
										$ ( '#chore-schedule-info' ) . text ( _ _t ( 'This means the next execution of this chore is not scheduled' ) ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2022-06-01 20:59:57 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
										$ ( "#period_days" ) . val ( 1 ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
										$ ( "#period_interval" ) . val ( 1 ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2019-04-22 14:01:31 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
									} 
							 
						 
					
						
							
								
									
										
										
										
											2022-02-09 20:02:11 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
									else  if  ( periodType  ===  'hourly' ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
									{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
										$ ( '#chore-schedule-info' ) . text ( _ _n ( periodInterval ,  "This means the next execution of this chore is scheduled %s hour after the last execution" ,  "This means the next execution of this chore is scheduled %s hours after the last execution" ) ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
									} 
							 
						 
					
						
							
								
									
										
										
										
											2019-04-22 14:01:31 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
									else  if  ( periodType  ===  'daily' ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
									{ 
							 
						 
					
						
							
								
									
										
										
										
											2022-02-20 16:03:50 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
										$ ( '#chore-schedule-info' ) . text ( _ _n ( periodInterval ,  "This means the next execution of this chore is scheduled at the same time (based on the start date) every day" ,  "This means the next execution of this chore is scheduled at the same time (based on the start date) every %s days" ) ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2022-09-20 15:02:24 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
										$ ( "#period_days" ) . val ( 1 ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2019-04-22 14:01:31 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
									else  if  ( periodType  ===  'weekly' ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
									{ 
							 
						 
					
						
							
								
									
										
										
										
											2022-02-09 19:52:19 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
										$ ( '#chore-schedule-info' ) . text ( _ _n ( periodInterval ,  "This means the next execution of this chore is scheduled every week on the selected weekdays" ,  "This means the next execution of this chore is scheduled every %s weeks on the selected weekdays" ) ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2020-08-30 12:18:16 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
										$ ( "#period_config" ) . val ( $ ( ".period-type-weekly input:checkbox:checked" ) . map ( function ( )  {  return  this . value ;  } ) . get ( ) . join ( "," ) ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2022-09-20 15:02:24 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
										$ ( "#period_days" ) . val ( 1 ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2019-04-22 14:01:31 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
									else  if  ( periodType  ===  'monthly' ) 
							 
						 
					
						
							
								
									
										
										
										
											2018-09-22 13:26:58 +02:00 
										
									 
								 
							 
							
								
							 
							
								 
							
								
									
								 
							
							
									{ 
							 
						 
					
						
							
								
									
										
										
										
											2022-02-09 19:52:19 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
										$ ( '#chore-schedule-info' ) . text ( _ _n ( periodInterval ,  "This means the next execution of this chore is scheduled on the selected day every month" ,  "This means the next execution of this chore is scheduled on the selected day every %s months" ) ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2019-05-01 20:19:18 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
										$ ( "label[for='period_days']" ) . text ( _ _t ( "Day of month" ) ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2019-04-22 14:01:31 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
										$ ( "#period_days" ) . attr ( "min" ,  "1" ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
										$ ( "#period_days" ) . attr ( "max" ,  "31" ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2018-09-22 13:26:58 +02:00 
										
									 
								 
							 
							
								
							 
							
								 
							
								
									
								 
							
							
									} 
							 
						 
					
						
							
								
									
										
										
										
											2019-10-04 11:24:51 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
									else  if  ( periodType  ===  'yearly' ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
									{ 
							 
						 
					
						
							
								
									
										
										
										
											2022-02-09 19:52:19 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
										$ ( '#chore-schedule-info' ) . text ( _ _n ( periodInterval ,  'This means the next execution of this chore is scheduled every year on the same day (based on the start date)' ,  'This means the next execution of this chore is scheduled every %s years on the same day (based on the start date)' ) ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2022-09-20 15:02:24 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
										$ ( "#period_days" ) . val ( 1 ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2019-10-04 11:24:51 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
									} 
							 
						 
					
						
							
								
									
										
										
										
											2022-02-10 18:06:33 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
									else  if  ( periodType  ===  'adaptive' ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
									{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
										$ ( '#chore-schedule-info' ) . text ( _ _t ( 'This means the next execution of this chore is scheduled dynamically based on the past average execution frequency' ) ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2022-06-01 20:59:57 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
										$ ( "#period_days" ) . val ( 1 ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
										$ ( "#period_interval" ) . val ( 1 ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2022-02-10 18:06:33 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
									} 
							 
						 
					
						
							
								
									
										
										
										
											2019-09-17 13:13:26 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
									Grocy . FrontendHelpers . ValidateForm ( 'chore-form' ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								} ) ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								$ ( '.input-group-chore-assignment-type' ) . on ( 'change' ,  function ( e )  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								{  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
									var  assignmentType  =  $ ( '#assignment_type' ) . val ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
									$ ( '#chore-period-assignment-info' ) . text ( "" ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
									$ ( "#assignment_config" ) . removeAttr ( "required" ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
									$ ( "#assignment_config" ) . attr ( "disabled" ,  "" ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
									if  ( assignmentType  ===  'no-assignment' ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
									{ 
							 
						 
					
						
							
								
									
										
										
										
											2022-02-10 18:06:33 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
										$ ( '#chore-assignment-type-info' ) . text ( _ _t ( 'This means the next execution of this chore will not be assigned to anyone' ) ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2019-09-17 13:13:26 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
									else  if  ( assignmentType  ===  'who-least-did-first' ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
									{ 
							 
						 
					
						
							
								
									
										
										
										
											2022-02-10 18:06:33 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
										$ ( '#chore-assignment-type-info' ) . text ( _ _t ( 'This means the next execution of this chore will be assigned to the one who executed it least' ) ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2019-09-17 13:13:26 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
										$ ( "#assignment_config" ) . attr ( "required" ,  "" ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
										$ ( "#assignment_config" ) . removeAttr ( "disabled" ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
									else  if  ( assignmentType  ===  'random' ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
									{ 
							 
						 
					
						
							
								
									
										
										
										
											2022-02-10 18:06:33 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
										$ ( '#chore-assignment-type-info' ) . text ( _ _t ( 'This means the next execution of this chore will be assigned randomly' ) ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2019-09-17 13:13:26 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
										$ ( "#assignment_config" ) . attr ( "required" ,  "" ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
										$ ( "#assignment_config" ) . removeAttr ( "disabled" ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
									else  if  ( assignmentType  ===  'in-alphabetical-order' ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
									{ 
							 
						 
					
						
							
								
									
										
										
										
											2022-02-10 18:06:33 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
										$ ( '#chore-assignment-type-info' ) . text ( _ _t ( 'This means the next execution of this chore will be assigned to the next one in alphabetical order' ) ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2019-09-17 13:13:26 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
										$ ( "#assignment_config" ) . attr ( "required" ,  "" ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
										$ ( "#assignment_config" ) . removeAttr ( "disabled" ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
									Grocy . FrontendHelpers . ValidateForm ( 'chore-form' ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2018-09-22 13:26:58 +02:00 
										
									 
								 
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								} ) ;  
						 
					
						
							
								
									
										
										
										
											2019-09-18 10:02:52 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								$ ( "#consume_product_on_execution" ) . on ( "click" ,  function ( )  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								{  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
									if  ( this . checked ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
									{ 
							 
						 
					
						
							
								
									
										
										
										
											2019-09-19 12:48:02 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
										Grocy . Components . ProductPicker . Enable ( ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2019-09-18 10:02:52 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
										$ ( "#product_amount" ) . removeAttr ( "disabled" ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
									else 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
									{ 
							 
						 
					
						
							
								
									
										
										
										
											2019-09-19 12:48:02 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
										Grocy . Components . ProductPicker . Disable ( ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2019-09-18 10:02:52 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
										$ ( "#product_amount" ) . attr ( "disabled" ,  "" ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
									Grocy . FrontendHelpers . ValidateForm ( "chore-form" ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								} ) ;  
						 
					
						
							
								
									
										
										
										
											2019-09-18 10:08:59 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								Grocy . Components . ProductPicker . GetPicker ( ) . on ( 'change' ,  function ( e )  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								{  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
									var  productId  =  $ ( e . target ) . val ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
									if  ( productId ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
									{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
										Grocy . Api . Get ( 'stock/products/'  +  productId , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
											function ( productDetails ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
											{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
												$ ( '#amount_qu_unit' ) . text ( productDetails . quantity _unit _stock . name ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
											} , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
											function ( xhr ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
											{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
												console . error ( xhr ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
											} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
										) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								} ) ;  
						 
					
						
							
								
									
										
										
										
											2021-07-13 19:29:23 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								$ ( document ) . on ( 'click' ,  '.chore-grocycode-label-print' ,  function ( e )  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								{  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
									e . preventDefault ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
									document . activeElement . blur ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
									var  choreId  =  $ ( e . currentTarget ) . attr ( 'data-chore-id' ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
									Grocy . Api . Get ( 'chores/'  +  choreId  +  '/printlabel' ,  function ( labelData ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
									{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
										if  ( Grocy . Webhooks . labelprinter  !==  undefined ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
										{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
											Grocy . FrontendHelpers . RunWebhook ( Grocy . Webhooks . labelprinter ,  labelData ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
										} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
									} ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								} ) ;