Added a note field to product barcodes (closes #962)

This commit is contained in:
Bernd Bestel 2020-12-19 17:20:54 +01:00
parent 5421dfb6b2
commit 3ad5f2cac5
No known key found for this signature in database
GPG Key ID: 71BD34C0D4891300
5 changed files with 21 additions and 2 deletions

View File

@ -4372,7 +4372,10 @@
"last_price": { "last_price": {
"type": "number", "type": "number",
"format": "float" "format": "float"
} },
"note": {
"type": "string"
},
} }
}, },
"ExternalBarcodeLookupResponse": { "ExternalBarcodeLookupResponse": {

2
migrations/0123.sql Normal file
View File

@ -0,0 +1,2 @@
ALTER TABLE product_barcodes
ADD note TEXT;

View File

@ -288,7 +288,8 @@ var barcodeTable = $('#barcode-table').DataTable({
'columnDefs': [ 'columnDefs': [
{ 'orderable': false, 'targets': 0 }, { 'orderable': false, 'targets': 0 },
{ 'searchable': false, "targets": 0 }, { 'searchable': false, "targets": 0 },
{ 'visible': false, 'targets': 5 } { 'visible': false, 'targets': 5 },
{ 'visible': false, 'targets': 6 }
].concat($.fn.dataTable.defaults.columnDefs) ].concat($.fn.dataTable.defaults.columnDefs)
}); });
$('#barcode-table tbody').removeClass("d-none"); $('#barcode-table tbody').removeClass("d-none");

View File

@ -90,6 +90,15 @@
value="1"> value="1">
@endif @endif
<div class="form-group">
<label for="note">{{ $__t('Note') }}</label>
<input type="text"
class="form-control"
id="note"
name="note"
value="@if($mode == 'edit'){{ $barcode->note }}@endif">
</div>
@include('components.userfieldsform', array( @include('components.userfieldsform', array(
'userfields' => $userfields, 'userfields' => $userfields,
'entity' => 'product_barcodes' 'entity' => 'product_barcodes'

View File

@ -470,6 +470,7 @@
<th>{{ $__t('Quantity unit') }}</th> <th>{{ $__t('Quantity unit') }}</th>
<th>{{ $__t('Amount') }}</th> <th>{{ $__t('Amount') }}</th>
<th class="@if(!GROCY_FEATURE_FLAG_STOCK_PRICE_TRACKING) d-none @endif">{{ $__t('Last price') }}</th> <th class="@if(!GROCY_FEATURE_FLAG_STOCK_PRICE_TRACKING) d-none @endif">{{ $__t('Last price') }}</th>
<th>{{ $__t('Note') }}</th>
@include('components.userfields_thead', array( @include('components.userfields_thead', array(
'userfields' => $productBarcodeUserfields 'userfields' => $productBarcodeUserfields
@ -518,6 +519,9 @@
<td class="@if(!GROCY_FEATURE_FLAG_STOCK_PRICE_TRACKING) d-none @endif"> <td class="@if(!GROCY_FEATURE_FLAG_STOCK_PRICE_TRACKING) d-none @endif">
<span class="locale-number locale-number-currency">{{ $barcode->last_price }}</span> <span class="locale-number locale-number-currency">{{ $barcode->last_price }}</span>
</td> </td>
<td>
{{ $barcode->note }}
</td>
@include('components.userfields_tbody', array( @include('components.userfields_tbody', array(
'userfields' => $productBarcodeUserfields, 'userfields' => $productBarcodeUserfields,