Show the product card also on /products (closes #2185)

This commit is contained in:
Bernd Bestel
2023-04-13 20:36:21 +02:00
parent 16011b91c6
commit 84bd74a1bc
6 changed files with 30 additions and 5 deletions

View File

@@ -31,6 +31,7 @@
- The product option "Quick consume amount" (the amount used for the "quick consume/open buttons" on the stock overview page) has been split into another option "Quick open amount", to be able to set different amounts for consume and open (defaults to the "Quick consume amount" per product, so no changed behavior when not configured) - The product option "Quick consume amount" (the amount used for the "quick consume/open buttons" on the stock overview page) has been split into another option "Quick open amount", to be able to set different amounts for consume and open (defaults to the "Quick consume amount" per product, so no changed behavior when not configured)
- Changed that for the product's average and last price (and for the price history chart) stock transactions with an empty or `0` price are ignored - Changed that for the product's average and last price (and for the price history chart) stock transactions with an empty or `0` price are ignored
- Added a filter option to only show currently out-of-stock products on the products list (master data) page - Added a filter option to only show currently out-of-stock products on the products list (master data) page
- When clicking the product name on the products list (master data) page, the product card will now be displayed (like on the stock overview page)
- Fixed that hiding the "Purchased date" column (table options) on the stock entries page didn't work - Fixed that hiding the "Purchased date" column (table options) on the stock entries page didn't work
- Fixed that sorting by the "Value" and "Min. stock amount" columns on the stock overview page didn't work - Fixed that sorting by the "Value" and "Min. stock amount" columns on the stock overview page didn't work
- Fixed that the consumed amount was wrong, when consuming multiple substituted subproducts at once and when multiple/different conversion factors were involved - Fixed that the consumed amount was wrong, when consuming multiple substituted subproducts at once and when multiple/different conversion factors were involved

View File

@@ -176,3 +176,9 @@ $("#merge-products-save-button").on("click", function(e)
} }
); );
}); });
$(document).on("click", ".product-name-cell", function(e)
{
Grocy.Components.ProductCard.Refresh($(e.currentTarget).attr("data-product-id"));
$("#productcard-modal").modal("show");
});

View File

@@ -174,7 +174,8 @@
</div> </div>
</div> </div>
</td> </td>
<td> <td class="product-name-cell cursor-link"
data-product-id="{{ $product->id }}">
{{ $product->name }} {{ $product->name }}
@if(!empty($product->picture_file_name)) @if(!empty($product->picture_file_name))
<i class="fa-solid fa-image text-muted" <i class="fa-solid fa-image text-muted"
@@ -283,4 +284,21 @@
</div> </div>
</div> </div>
</div> </div>
<div class="modal fade"
id="productcard-modal"
tabindex="-1">
<div class="modal-dialog">
<div class="modal-content text-center">
<div class="modal-body">
@include('components.productcard')
</div>
<div class="modal-footer">
<button type="button"
class="btn btn-secondary"
data-dismiss="modal">{{ $__t('Close') }}</button>
</div>
</div>
</div>
</div>
@stop @stop