Add purchased date to inventory (#1102)

* Add purchased date to inventory

* Clarify stock settings label

Co-authored-by: Bernd Bestel <bernd@berrnd.de>
This commit is contained in:
kriddles
2020-10-29 11:04:34 -05:00
committed by GitHub
parent fb17c57dd3
commit 9bbcdafab9
6 changed files with 35 additions and 7 deletions

View File

@@ -20,7 +20,7 @@
@include('components.numberpicker', array(
'id' => 'new_amount',
'label' => 'New amount',
'label' => 'New stock amount',
'hintId' => 'new_amount_qu_unit',
'min' => 0,
'decimals' => $userSettings['stock_decimal_places_amounts'],
@@ -33,6 +33,23 @@
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>'
))
@if(boolval($userSettings['show_purchased_date_on_purchase']))
@include('components.datetimepicker2', array(
'id' => 'purchased_date',
'label' => 'Purchased date',
'format' => 'YYYY-MM-DD',
'hint' => 'This will apply to added products',
'initWithNow' => true,
'limitEndToNow' => false,
'limitStartToNow' => false,
'invalidFeedback' => $__t('A purchased date is required'),
'nextInputSelector' => '#best_before_date',
'additionalCssClasses' => 'date-only-datetimepicker2',
'additionalGroupCssClasses' => $additionalGroupCssClasses,
'activateNumberPad' => GROCY_FEATURE_FLAG_STOCK_BEST_BEFORE_DATE_FIELD_NUMBER_PAD
))
@endif
@php
$additionalGroupCssClasses = '';
if (!GROCY_FEATURE_FLAG_STOCK_BEST_BEFORE_DATE_TRACKING)
@@ -63,7 +80,7 @@
@if(GROCY_FEATURE_FLAG_STOCK_PRICE_TRACKING)
@include('components.numberpicker', array(
'id' => 'price',
'label' => 'Price',
'label' => 'Price per stock unit',
'min' => 0,
'decimals' => $userSettings['stock_decimal_places_prices'],
'value' => '',

View File

@@ -123,7 +123,7 @@
<input type="checkbox"
class="user-setting-control"
id="show_purchased_date_on_purchase"
data-setting-key="show_purchased_date_on_purchase"> {{ $__t('Show purchased date on purchase form (otherwise the purchased date defaults to today)') }}
data-setting-key="show_purchased_date_on_purchase"> {{ $__t('Show purchased date on purchase and inventory page (otherwise the purchased date defaults to today)') }}
</label>
</div>
</div>