2018-04-11 19:49:35 +02:00
@ extends ( 'layout.default' )
2019-05-01 20:19:18 +02:00
@ section ( 'title' , $__t ( 'Inventory' ))
2018-04-12 21:13:38 +02:00
@ section ( 'activeNav' , 'inventory' )
@ section ( 'viewJsName' , 'inventory' )
2018-04-11 19:49:35 +02:00
@ section ( 'content' )
2018-07-10 20:37:13 +02:00
< div class = " row " >
2018-07-12 19:12:31 +02:00
< div class = " col-xs-12 col-md-6 col-xl-4 pb-3 " >
2018-07-10 20:37:13 +02:00
< h1 >@ yield ( 'title' ) </ h1 >
2018-07-11 19:43:05 +02:00
< form id = " inventory-form " novalidate >
2018-07-10 20:37:13 +02:00
2018-07-14 14:43:57 +02:00
@ include ( 'components.productpicker' , array (
'products' => $products ,
'nextInputSelector' => '#new_amount'
))
2018-07-10 20:37:13 +02:00
2018-09-08 12:04:31 +02:00
@ include ( 'components.numberpicker' , array (
'id' => 'new_amount' ,
'label' => 'New amount' ,
'hintId' => 'new_amount_qu_unit' ,
'min' => 0 ,
'value' => 1 ,
2019-05-01 20:19:18 +02:00
'invalidFeedback' => $__t ( 'The amount cannot be lower than %s' , '0' ),
2019-05-03 19:08:54 +02:00
'additionalAttributes' => 'data-not-equal="-1"' ,
2019-03-05 17:51:50 +01:00
'additionalHtmlElements' => '<div id="inventory-change-info" class="form-text text-muted small d-none"></div>' ,
2019-05-01 20:19:18 +02:00
'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>'
2018-09-08 12:04:31 +02:00
))
2018-07-12 19:12:31 +02:00
2019-09-19 17:46:52 +02:00
@ php
$additionalGroupCssClasses = '' ;
if ( ! GROCY_FEATURE_FLAG_STOCK_BEST_BEFORE_DATE_TRACKING )
{
$additionalGroupCssClasses = 'd-none' ;
}
@ endphp
2018-07-12 19:12:31 +02:00
@ include ( 'components.datetimepicker' , array (
2018-07-10 20:37:13 +02:00
'id' => 'best_before_date' ,
'label' => 'Best before' ,
2018-07-12 19:12:31 +02:00
'hint' => 'This will apply to added products' ,
'format' => 'YYYY-MM-DD' ,
'initWithNow' => false ,
'limitEndToNow' => false ,
2019-03-10 16:02:13 +01:00
'limitStartToNow' => false ,
2019-05-01 20:19:18 +02:00
'invalidFeedback' => $__t ( 'A best before date is required' ),
2018-07-14 08:38:03 +02:00
'nextInputSelector' => '#best_before_date' ,
2019-04-23 09:06:18 +02:00
'additionalGroupCssClasses' => 'date-only-datetimepicker' ,
2018-08-06 22:41:35 +02:00
'shortcutValue' => '2999-12-31' ,
2019-03-10 16:02:13 +01:00
'shortcutLabel' => 'Never expires' ,
'earlierThanInfoLimit' => date ( 'Y-m-d' ),
2019-09-19 17:46:52 +02:00
'earlierThanInfoText' => $__t ( 'The given date is earlier than today, are you sure?' ),
'additionalGroupCssClasses' => $additionalGroupCssClasses
2018-07-10 20:37:13 +02:00
))
2019-09-19 17:46:52 +02:00
@ php $additionalGroupCssClasses = '' ; @ endphp
2018-07-10 20:37:13 +02:00
2019-09-19 17:46:52 +02:00
@ if ( GROCY_FEATURE_FLAG_STOCK_PRICE_TRACKING )
2019-05-03 22:11:20 +02:00
@ include ( 'components.numberpicker' , array (
'id' => 'price' ,
'label' => 'Price' ,
'min' => 0 ,
2019-05-03 22:15:30 +02:00
'step' => 0.0001 ,
2019-05-03 22:11:20 +02:00
'value' => '' ,
'hint' => $__t ( 'in %s per purchase quantity unit' , GROCY_CURRENCY ),
'additionalHtmlContextHelp' => '<br><span class="small text-muted">' . $__t ( 'This will apply to added products' ) . '</span>' ,
'invalidFeedback' => $__t ( 'The price cannot be lower than %s' , '0' ),
'isRequired' => false
))
2019-09-19 17:46:52 +02:00
@ else
< input type = " hidden " name = " price " id = " price " value = " 0 " >
@ endif
2019-05-03 22:11:20 +02:00
2019-09-19 17:46:52 +02:00
@ if ( GROCY_FEATURE_FLAG_STOCK_LOCATION_TRACKING )
2019-04-05 21:26:44 +02:00
@ include ( 'components.locationpicker' , array (
'locations' => $locations ,
2019-07-07 09:29:04 +02:00
'hint' => $__t ( 'This will apply to added products' )
2019-04-05 21:26:44 +02:00
))
2019-09-19 17:46:52 +02:00
@ else
< input type = " hidden " name = " location_id " id = " location_id " value = " 1 " >
@ endif
2019-04-05 21:26:44 +02:00
2019-05-01 20:19:18 +02:00
< button id = " save-inventory-button " class = " btn btn-success " > {{ $__t ( 'OK' ) }} </ button >
2018-07-10 20:37:13 +02:00
</ form >
</ div >
2019-09-20 13:37:53 +02:00
< div class = " col-xs-12 col-md-6 col-xl-4 hide-when-embedded " >
2018-07-10 20:37:13 +02:00
@ include ( 'components.productcard' )
</ div >
2017-04-20 17:10:21 +02:00
</ div >
2018-04-11 19:49:35 +02:00
@ stop