Implemented notes and Userfields for stock entries (closes #443)

This commit is contained in:
Bernd Bestel
2022-03-30 17:32:53 +02:00
parent 2983687f34
commit d3a39270de
18 changed files with 438 additions and 107 deletions

View File

@@ -132,6 +132,27 @@
</div>
@endif
<div class="form-group">
<label for="note">
{{ $__t('Note') }}
<i class="fas fa-question-circle text-muted"
data-toggle="tooltip"
data-trigger="hover click"
title="{{ $__t('This will apply to added products') }}"></i>
</label>
<div class="input-group">
<input type="text"
class="form-control"
id="note"
name="note">
</div>
</div>
@include('components.userfieldsform', array(
'userfields' => $userfields,
'entity' => 'stock'
))
<button id="save-inventory-button"
class="btn btn-success">{{ $__t('OK') }}</button>

View File

@@ -162,6 +162,21 @@
</div>
@endif
<div class="form-group">
<label for="note">{{ $__t('Note') }}</label>
<div class="input-group">
<input type="text"
class="form-control"
id="note"
name="note">
</div>
</div>
@include('components.userfieldsform', array(
'userfields' => $userfields,
'entity' => 'stock'
))
<button id="save-purchase-button"
class="btn btn-success d-block">{{ $__t('OK') }}</button>

View File

@@ -73,9 +73,14 @@
data-shadow-rowgroup-column="9">{{ $__t('Purchased date') }}</th>
<th class="d-none">Hidden purchased_date</th>
<th>{{ $__t('Timestamp') }}</th>
<th>{{ $__t('Note') }}</th>
@include('components.userfields_thead', array(
'userfields' => $userfields
'userfields' => $userfieldsProducts
))
@include('components.userfields_thead', array(
'userfields' => $userfieldsStock
))
</tr>
</thead>
@@ -274,10 +279,18 @@
<time class="timeago timeago-contextual"
datetime="{{ $stockEntry->row_created_timestamp }}"></time>
</td>
<td>
<span id="stock-{{ $stockEntry->id }}-note">{{ $stockEntry->note }}</span>
</td>
@include('components.userfields_tbody', array(
'userfields' => $userfields,
'userfieldValues' => FindAllObjectsInArrayByPropertyValue($userfieldValues, 'object_id', $stockEntry->product_id)
'userfields' => $userfieldsProducts,
'userfieldValues' => FindAllObjectsInArrayByPropertyValue($userfieldValuesProducts, 'object_id', $stockEntry->product_id)
))
@include('components.userfields_tbody', array(
'userfields' => $userfieldsStock,
'userfieldValues' => FindAllObjectsInArrayByPropertyValue($userfieldValuesStock, 'object_id', $stockEntry->stock_id)
))
</tr>

View File

@@ -129,6 +129,17 @@
</div>
</div>
<div class="form-group">
<label for="note">{{ $__t('Note') }}</label>
<div class="input-group">
<input type="text"
class="form-control"
id="note"
name="note"
value="{{ $stockEntry->note }}">
</div>
</div>
<button id="save-stockentry-button"
class="btn btn-success">{{ $__t('OK') }}</button>

View File

@@ -147,6 +147,11 @@
<th class="allow-grouping">{{ $__t('Transaction type') }}</th>
<th class="@if(!GROCY_FEATURE_FLAG_STOCK_LOCATION_TRACKING) d-none @endif allow-grouping">{{ $__t('Location') }}</th>
<th class="allow-grouping">{{ $__t('Done by') }}</th>
<th>{{ $__t('Note') }}</th>
@include('components.userfields_thead', array(
'userfields' => $userfieldsStock
))
</tr>
</thead>
<tbody class="d-none">
@@ -193,6 +198,14 @@
<td>
{{ $stockLogEntry->user_display_name }}
</td>
<td>
{{ $stockLogEntry->note }}
</td>
@include('components.userfields_tbody', array(
'userfields' => $userfieldsStock,
'userfieldValues' => FindAllObjectsInArrayByPropertyValue($userfieldValuesStock, 'object_id', $stockLogEntry->stock_id)
))
</tr>
@endforeach
</tbody>