mirror of
https://github.com/grocy/grocy.git
synced 2026-04-07 21:26:16 +02:00
Grocycode: Print Label from product form
This commit is contained in:
parent
6951c1dfac
commit
a7c5d2931e
|
|
@ -301,6 +301,21 @@ $('#name').focus();
|
||||||
$('.input-group-qu').trigger('change');
|
$('.input-group-qu').trigger('change');
|
||||||
Grocy.FrontendHelpers.ValidateForm('product-form');
|
Grocy.FrontendHelpers.ValidateForm('product-form');
|
||||||
|
|
||||||
|
$(document).on('click', '.stockentry-grocycode-product-label-print', function(e)
|
||||||
|
{
|
||||||
|
e.preventDefault();
|
||||||
|
document.activeElement.blur();
|
||||||
|
|
||||||
|
var productId = $(e.currentTarget).attr('data-product-id');
|
||||||
|
Grocy.Api.Get('stock/products/' + productId + '/printlabel', function(labelData)
|
||||||
|
{
|
||||||
|
if (Grocy.Webhooks.labelprinter !== undefined)
|
||||||
|
{
|
||||||
|
Grocy.FrontendHelpers.RunWebhook(Grocy.Webhooks.labelprinter, labelData);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
$(document).on('click', '.qu-conversion-delete-button', function(e)
|
$(document).on('click', '.qu-conversion-delete-button', function(e)
|
||||||
{
|
{
|
||||||
var objectId = $(e.currentTarget).attr('data-qu-conversion-id');
|
var objectId = $(e.currentTarget).attr('data-qu-conversion-id');
|
||||||
|
|
|
||||||
|
|
@ -25,11 +25,7 @@
|
||||||
|
|
||||||
@if($mode == 'edit')
|
@if($mode == 'edit')
|
||||||
<script>
|
<script>
|
||||||
Grocy.EditObjectId = {
|
Grocy.EditObjectId = {{ $product->id }};
|
||||||
{
|
|
||||||
$product - > id
|
|
||||||
}
|
|
||||||
};
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
@if(!empty($product->picture_file_name))
|
@if(!empty($product->picture_file_name))
|
||||||
|
|
@ -445,8 +441,18 @@
|
||||||
<p>
|
<p>
|
||||||
<img src="{{ $U('/product/' . $product->id . '/grocycode') }}"
|
<img src="{{ $U('/product/' . $product->id . '/grocycode') }}"
|
||||||
class="float-lg-left mr-2">
|
class="float-lg-left mr-2">
|
||||||
{{ $__t('Grocycode is a unique referer to this product in your grocy instance. Print it onto a label and scan it like any other barcode!') }}<br>
|
{{ $__t('Grocycode is a unique referer to this product in your grocy instance. Print it onto a label and scan it like any other barcode!') }}
|
||||||
<a href="{{ $U('/product/' . $product->id . '/grocycode?download=true') }}">{{ $__t('Download') }}</a>
|
</p>
|
||||||
|
<p>
|
||||||
|
<a class="btn btn-outline-primary btn-sm"
|
||||||
|
href="{{ $U('/product/' . $product->id . '/grocycode?download=true') }}">{{ $__t('Download') }}</a>
|
||||||
|
@if(GROCY_FEATURE_FLAG_LABELPRINTER)
|
||||||
|
<a class="btn btn-outline-primary btn-sm stockentry-grocycode-product-label-print"
|
||||||
|
data-product-id="{{ $product->id }}"
|
||||||
|
href="#">
|
||||||
|
{{ $__t('Print Product Label') }}
|
||||||
|
</a>
|
||||||
|
@endif
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -693,4 +699,4 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@stop
|
@stop
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user