Files
grocy/views/components/productcard.blade.php

74 lines
3.9 KiB
PHP
Raw Normal View History

@once
2018-04-15 09:41:53 +02:00
@push('componentScripts')
2020-08-31 20:32:50 +02:00
<script src="{{ $U('/node_modules/chart.js/dist/Chart.min.js?v=', true) }}{{ $version }}"></script>
<script src="{{ $U('/viewjs/components/productcard.js', true) }}?v={{ $version }}"></script>
2018-04-15 09:41:53 +02:00
@endpush
@endonce
2018-04-14 11:10:38 +02:00
<div class="card productcard">
<div class="card-header">
2020-11-08 15:09:10 +01:00
<span class="float-left">{{ $__t('Product overview') }}</span>
2020-08-31 20:32:50 +02:00
<a id="productcard-product-edit-button"
2020-11-14 11:59:49 +01:00
class="btn btn-sm btn-outline-secondary py-0 float-right disabled"
2020-08-31 20:32:50 +02:00
href="#"
data-toggle="tooltip"
title="{{ $__t('Edit product') }}">
<i class="fas fa-edit"></i>
</a>
2020-08-31 20:32:50 +02:00
<a id="productcard-product-journal-button"
2020-11-08 15:09:10 +01:00
class="btn btn-sm btn-outline-secondary py-0 mr-1 float-right disabled show-as-dialog-link"
2020-11-14 11:59:49 +01:00
href="#">
{{ $__t('Stock journal') }}
</a>
<a id="productcard-product-stock-button"
2020-11-14 11:59:49 +01:00
class="btn btn-sm btn-outline-secondary py-0 mr-1 float-right disabled show-as-dialog-link"
href="#">
{{ $__t('Stock entries') }}
</a>
</div>
<div class="card-body">
<h3><span id="productcard-product-name"></span></h3>
2020-08-31 20:32:50 +02:00
<div id="productcard-product-description-wrapper"
class="expandable-text mb-2 d-none">
<p id="productcard-product-description"
class="text-muted collapse mb-0"></p>
<a class="collapsed"
data-toggle="collapse"
href="#productcard-product-description">{{ $__t('Show more') }}</a>
</div>
2020-08-31 20:32:50 +02:00
<strong>{{ $__t('Stock amount') }}:</strong> <span id="productcard-product-stock-amount"
class="locale-number locale-number-quantity-amount"></span> <span id="productcard-product-stock-qu-name"></span>
<span id="productcard-product-stock-opened-amount"
class="small font-italic locale-number locale-number-quantity-amount"></span>
2020-08-31 20:32:50 +02:00
<span id="productcard-aggregated-amounts"
class="pl-2 text-secondary d-none"><i class="fas fa-custom-sigma-sign"></i> <span id="productcard-product-stock-amount-aggregated"
class="locale-number locale-number-quantity-amount"></span> <span id="productcard-product-stock-qu-name-aggregated"></span> <span id="productcard-product-stock-opened-amount-aggregated locale-number locale-number-quantity-amount"
class="small font-italic"></span></span><br>
@if(GROCY_FEATURE_FLAG_STOCK_PRICE_TRACKING)<strong>{{ $__t('Stock value') }}:</strong> <span id="productcard-product-stock-value"
class="locale-number locale-number-currency"></span><br>@endif
@if(GROCY_FEATURE_FLAG_STOCK_LOCATION_TRACKING)<strong>{{ $__t('Default location') }}:</strong> <span id="productcard-product-location"></span><br>@endif
2020-08-31 20:32:50 +02:00
<strong>{{ $__t('Last purchased') }}:</strong> <span id="productcard-product-last-purchased"></span> <time id="productcard-product-last-purchased-timeago"
class="timeago timeago-contextual"></time><br>
<strong>{{ $__t('Last used') }}:</strong> <span id="productcard-product-last-used"></span> <time id="productcard-product-last-used-timeago"
class="timeago timeago-contextual"></time><br>
@if(GROCY_FEATURE_FLAG_STOCK_PRICE_TRACKING)<strong>{{ $__t('Last price') }}:</strong> <span id="productcard-product-last-price"></span><br>@endif
Qu factor purchase to stock & Product Barcode Details (#801) * Puchase add qu_factor_to_stock * qu_factor_purchase_to_stock for stock edit * product barcodes with QU and Stores * remove product barcode tags * migrations/0103 add value and factor_puchase_amount to stock_current and stock_current_location_content * Remove unused method * StockService#GetProductDetails: include stock_value * productcard: include stock_value * Add Purchase Factor to Stock Overview * update demo data with stock qu_factor_purchase_to_stock * recipes_pos_resolved update * avg_price and oldest_price in product details * add average price to product card * hint for recipe costs not included if not in stock * Round value and factor_purchas_amount. Include currency for stock value * Add factor_purchase_amount to product card stock amount * Allow editing qu_factor_purchase_to_stock for stock entries * fix update qu_factor_purchase_to_stock for Transfers * Add barcode to existing product update to add to product_barcodes table * Add barcode to new product workflow update to add to product_barcodes table * *** Price now saved as 1 QU to stock in stock tables *** * remove column product barcode and use product_barcodes * Allow products to be deactivated instead of deleted * Embedded barcode and qu-conversion with page reload on change * Save current product barcode into new product_barcodes table * Embedded popup for product group add/edit * barcode scanner added to product barcodes input * Edit product qu_stock is unavailable after first purchase * StockOverview: Filters break when columns are reordered so for now just disable colReorder * view stockoverview.blade: display product_group column * Review Co-authored-by: Bernd Bestel <bernd@berrnd.de>
2020-08-17 14:47:33 -05:00
@if (GROCY_FEATURE_FLAG_STOCK_PRICE_TRACKING)<strong>{{ $__t('Average price') }}:</strong> <span id="productcard-product-average-price"></span><br>@endif
@if (GROCY_FEATURE_FLAG_STOCK_BEST_BEFORE_DATE_TRACKING)<strong>{{ $__t('Average shelf life') }}:</strong> <span id="productcard-product-average-shelf-life"></span><br>@endif
<strong>{{ $__t('Spoil rate') }}:</strong> <span id="productcard-product-spoil-rate"></span>
2020-08-31 20:32:50 +02:00
<p class="w-75 mt-3 mx-auto"><img id="productcard-product-picture"
data-src=""
class="img-fluid img-thumbnail d-none lazy"></p>
@if(GROCY_FEATURE_FLAG_STOCK_PRICE_TRACKING)
<h5 class="mt-3">{{ $__t('Price history') }}</h5>
2020-08-31 20:32:50 +02:00
<canvas id="productcard-product-price-history-chart"
class="w-100 d-none"></canvas>
<span id="productcard-no-price-data-hint"
class="font-italic d-none">{{ $__t('No price history available') }}</span>
@endif
</div>
</div>