mirror of
https://github.com/grocy/grocy.git
synced 2025-08-20 04:12:59 +00:00
Allow different locations per product in stock (closes #124)
Kind of basic for now, a different location can be set on purchase, the filters on the stock overview page handles different locations
This commit is contained in:
@@ -49,6 +49,17 @@
|
||||
'isRequired' => false
|
||||
))
|
||||
|
||||
<div class="form-group">
|
||||
<label for="location_id">{{ $L('Location') }}</label>
|
||||
<select required class="form-control" id="location_id" name="location_id">
|
||||
<option></option>
|
||||
@foreach($locations as $location)
|
||||
<option value="{{ $location->id }}">{{ $location->name }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
<div class="invalid-feedback">{{ $L('A location is required') }}</div>
|
||||
</div>
|
||||
|
||||
<button id="save-purchase-button" class="btn btn-success">{{ $L('OK') }}</button>
|
||||
|
||||
</form>
|
||||
|
@@ -119,7 +119,9 @@
|
||||
<time id="product-{{ $currentStockEntry->product_id }}-next-best-before-date-timeago" class="timeago timeago-contextual" datetime="{{ $currentStockEntry->best_before_date }} 23:59:59"></time>
|
||||
</td>
|
||||
<td class="d-none">
|
||||
{{ FindObjectInArrayByPropertyValue($locations, 'id', FindObjectInArrayByPropertyValue($products, 'id', $currentStockEntry->product_id)->location_id)->name }}
|
||||
@foreach(FindAllObjectsInArrayByPropertyValue($currentStockLocations, 'product_id', $currentStockEntry->product_id) as $locationsForProduct)
|
||||
{{ FindObjectInArrayByPropertyValue($locations, 'id', $locationsForProduct->location_id)->name }}
|
||||
@endforeach
|
||||
</td>
|
||||
<td class="d-none">
|
||||
@if($currentStockEntry->best_before_date < date('Y-m-d 23:59:59', strtotime('-1 days')) && $currentStockEntry->amount > 0) expired @elseif($currentStockEntry->best_before_date < date('Y-m-d 23:59:59', strtotime("+$nextXDays days")) && $currentStockEntry->amount > 0) expiring @elseif (FindObjectInArrayByPropertyValue($missingProducts, 'id', $currentStockEntry->product_id) !== null) belowminstockamount @endif
|
||||
|
Reference in New Issue
Block a user