mirror of
https://github.com/grocy/grocy.git
synced 2026-04-05 20:36:15 +02:00
fix stockdetail consume spoiled
This commit is contained in:
parent
40316314c7
commit
85ebc5bf86
|
|
@ -68,7 +68,7 @@ $(document).on('click', '.stock-consume-button', function(e)
|
|||
var stockRowId = $(e.currentTarget).attr('data-stockrow-id');
|
||||
var consumeAmount = $(e.currentTarget).attr('data-consume-amount');
|
||||
|
||||
var wasSpoiled = $(e.currentTarget).hasClass("product-consume-button-spoiled");
|
||||
var wasSpoiled = $(e.currentTarget).hasClass("stock-consume-button-spoiled");
|
||||
|
||||
Grocy.Api.Post('stock/products/' + productId + '/consume', { 'amount': consumeAmount, 'spoiled': wasSpoiled, 'location_id': locationId, 'stock_entry_id': specificStockEntryId},
|
||||
function(bookingResponse)
|
||||
|
|
|
|||
|
|
@ -127,10 +127,13 @@
|
|||
<i class="fas fa-edit"></i> {{ $__t('Edit product') }}
|
||||
</a>
|
||||
<div class="dropdown-divider"></div>
|
||||
<a class="dropdown-item product-consume-button product-consume-button-spoiled @if($currentStockEntry->amount < 1) disabled @endif" type="button" href="#"
|
||||
<a class="dropdown-item stock-consume-button stock-consume-button-spoiled @if($currentStockEntry->amount < 1) disabled @endif" type="button" href="#"
|
||||
data-product-id="{{ $currentStockEntry->product_id }}"
|
||||
data-product-name="{{ FindObjectInArrayByPropertyValue($products, 'id', $currentStockEntry->product_id)->name }}"
|
||||
data-product-qu-name="{{ FindObjectInArrayByPropertyValue($quantityunits, 'id', FindObjectInArrayByPropertyValue($products, 'id', $currentStockEntry->product_id)->qu_id_stock)->name }}"
|
||||
data-stock-id="{{ $currentStockEntry->stock_id }}"
|
||||
data-stockrow-id="{{ $currentStockEntry->id }}"
|
||||
data-location-id="{{ $currentStockEntry->location_id }}"
|
||||
data-consume-amount="1">
|
||||
<i class="fas fa-utensils"></i> {{ $__t('Consume %1$s of %2$s as spoiled', '1 ' . FindObjectInArrayByPropertyValue($quantityunits, 'id', FindObjectInArrayByPropertyValue($products, 'id', $currentStockEntry->product_id)->qu_id_stock)->name, FindObjectInArrayByPropertyValue($products, 'id', $currentStockEntry->product_id)->name) }}
|
||||
</a>
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user