2018-04-11 19:49:35 +02:00
@ extends ( 'layout.default' )
2019-05-01 20:19:18 +02:00
@ section ( 'title' , $__t ( 'Purchase' ))
2018-04-12 21:13:38 +02:00
@ section ( 'activeNav' , 'purchase' )
@ section ( 'viewJsName' , 'purchase' )
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 = " purchase-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' => '#best_before_date .datetimepicker-input'
))
2018-07-10 20:37:13 +02:00
2018-07-12 19:12:31 +02:00
@ include ( 'components.datetimepicker' , array (
2018-07-10 20:37:13 +02:00
'id' => 'best_before_date' ,
2018-07-12 19:12:31 +02:00
'label' => 'Best before' ,
'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' => '#amount' ,
2018-08-06 22:41:35 +02:00
'additionalCssClasses' => 'date-only-datetimepicker' ,
'shortcutValue' => '2999-12-31' ,
2019-03-10 16:02:13 +01:00
'shortcutLabel' => 'Never expires' ,
'earlierThanInfoLimit' => date ( 'Y-m-d' ),
2019-05-01 20:19:18 +02:00
'earlierThanInfoText' => $__t ( 'The given date is earlier than today, are you sure?' )
2018-07-10 20:37:13 +02:00
))
2018-09-08 12:04:31 +02:00
@ include ( 'components.numberpicker' , array (
'id' => 'amount' ,
'label' => 'Amount' ,
'hintId' => 'amount_qu_unit' ,
'min' => 1 ,
2019-05-01 20:19:18 +02:00
'invalidFeedback' => $__t ( 'The amount cannot be lower than %s' , '1' ),
'additionalHtmlContextHelp' => '<div id="tare-weight-handling-info" class="text-info font-italic d-none">' . $__t ( 'Tare weight handling enabled - please weigh the whole container, the amount to be posted will be automatically calculcated' ) . '</div>'
2018-09-08 12:04:31 +02:00
))
@ include ( 'components.numberpicker' , array (
'id' => 'price' ,
'label' => 'Price' ,
'min' => 0 ,
'step' => 0.01 ,
'value' => '' ,
2019-05-01 20:19:18 +02:00
'hint' => $__t ( 'in %s per purchase quantity unit' , GROCY_CURRENCY ),
'invalidFeedback' => $__t ( 'The price cannot be lower than %s' , '0' ),
2018-09-08 14:31:42 +02:00
'isRequired' => false
2018-09-08 12:04:31 +02:00
))
2018-07-26 20:27:38 +02:00
2019-03-04 17:43:12 +01:00
@ include ( 'components.locationpicker' , array (
'locations' => $locations ,
2019-03-10 16:02:13 +01:00
'isRequired' => false
2019-03-04 17:43:12 +01:00
))
2019-03-01 20:25:01 +01:00
2019-05-01 20:19:18 +02:00
< button id = " save-purchase-button " class = " btn btn-success " > {{ $__t ( 'OK' ) }} </ button >
2018-07-10 20:37:13 +02:00
</ form >
</ div >
2018-11-17 12:57:35 +01: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-19 21:09:28 +02:00
</ div >
2018-04-11 19:49:35 +02:00
@ stop