mirror of
https://github.com/grocy/grocy.git
synced 2025-08-20 12:20:22 +00:00
Improve sorting for stock entries view (#1695)
In the stockentries view the ordering by expiration date, amount, price
and purchase date did not work as expected. b5fc64cf
already addressed a
similar issue for other views. This commit now does the same: set
DataTables types on the specific columns.
Since the units being part of the "amount" column break numeric sorting,
this commit adds a "data-order" field for that column, so numeric
sorting can still work. This is done in aligment with the stockoverview
page, that already contains such an entry to facilitate proper sorting.
This commit is contained in:
@@ -231,7 +231,7 @@
|
||||
data-product-id="{{ $stockEntry->product_id }}">
|
||||
{{ FindObjectInArrayByPropertyValue($products, 'id', $stockEntry->product_id)->name }}
|
||||
</td>
|
||||
<td>
|
||||
<td data-order="{{ $stockEntry->amount }}">
|
||||
<span id="stock-{{ $stockEntry->id }}-amount"
|
||||
class="locale-number locale-number-quantity-amount">{{ $stockEntry->amount }}</span> <span id="product-{{ $stockEntry->product_id }}-qu-name">{{ $__n($stockEntry->amount, FindObjectInArrayByPropertyValue($quantityunits, 'id', FindObjectInArrayByPropertyValue($products, 'id', $stockEntry->product_id)->qu_id_stock)->name, FindObjectInArrayByPropertyValue($quantityunits, 'id', FindObjectInArrayByPropertyValue($products, 'id', $stockEntry->product_id)->qu_id_stock)->name_plural) }}</span>
|
||||
<span id="stock-{{ $stockEntry->id }}-opened-amount"
|
||||
|
Reference in New Issue
Block a user