Added Default store as a column to the shopping list (closes #957)

This commit is contained in:
Bernd Bestel 2020-12-20 10:26:02 +01:00
parent 268b8e87d7
commit 76e4a1578c
No known key found for this signature in database
GPG Key ID: 71BD34C0D4891300
4 changed files with 12 additions and 4 deletions

View File

@ -147,9 +147,9 @@
- All tables are now customizable (new little eye icon on the top left corner on each table)
- Table columns be shown/hidden
- There are also new columns on some pages, hidden by default
- Stock overview: Value, product group, calories, last purchased, last price, min. stock amount
- Stock overview: Value, Product group, Calories, Last purchased, Last price, Min. stock amount
- Products list: Default store
- Shopping list: Last price (Unit), Last price (Total)
- Shopping list: Last price (Unit), Last price (Total), Default store
- Row grouping can be customized to use any available column (thanks @edenhaus)
- Table states (visible columns, sorting, column order and so on) are now saved server side (in user settings) means that this stays the same when using different browsers
- Dialogs are now used everywhere where appropriate instead of jumping between pages (for example when adding/editing shopping list items)

View File

@ -7,7 +7,8 @@ SELECT
sl.*,
p.name AS product_name,
plp.price * IFNULL(qucr.factor, 1.0) AS last_price_unit,
plp.price * IFNULL(qucr.factor, 1.0) * sl.amount AS last_price_total
plp.price * IFNULL(qucr.factor, 1.0) * sl.amount AS last_price_total,
st.name AS default_shopping_location_name
FROM shopping_list sl
LEFT JOIN products p
ON sl.product_id = p.id
@ -16,4 +17,6 @@ LEFT JOIN quantity_unit_conversions_resolved qucr
AND p.qu_id_stock = qucr.from_qu_id
AND sl.qu_id = qucr.to_qu_id
LEFT JOIN products_last_purchased plp
ON sl.product_id = plp.product_id;
ON sl.product_id = plp.product_id
LEFT JOIN shopping_locations st
ON p.shopping_location_id = st.id;

View File

@ -7,6 +7,7 @@
{ 'visible': false, 'targets': 3 },
{ 'visible': false, 'targets': 5 },
{ 'visible': false, 'targets': 6 },
{ 'visible': false, 'targets': 7 },
{ "type": "num", "targets": 2 },
{ "type": "html-num-fmt", "targets": 5 },
{ "type": "html-num-fmt", "targets": 6 }

View File

@ -164,6 +164,7 @@
<th class="d-none">Hidden status</th>
<th class="@if(!GROCY_FEATURE_FLAG_STOCK_PRICE_TRACKING) d-none @endif">{{ $__t('Last price (Unit)') }}</th>
<th class="@if(!GROCY_FEATURE_FLAG_STOCK_PRICE_TRACKING) d-none @endif">{{ $__t('Last price (Total)') }}</th>
<th class="@if(!GROCY_FEATURE_FLAG_STOCK_PRICE_TRACKING) d-none @endif">{{ $__t('Default store') }}</th>
@include('components.userfields_thead', array(
'userfields' => $userfields
@ -243,6 +244,9 @@
<td class="@if(!GROCY_FEATURE_FLAG_STOCK_PRICE_TRACKING) d-none @endif">
<span class="locale-number locale-number-currency">{{ $listItem->last_price_total }}</span>
</td>
<td class="@if(!GROCY_FEATURE_FLAG_STOCK_PRICE_TRACKING) d-none @endif">
{{ $listItem->default_shopping_location_name }}
</td>
@include('components.userfields_tbody', array(
'userfields' => $userfields,