Added a filter for only done items on the /shoppinglist page (closes #1406)

This commit is contained in:
Bernd Bestel 2021-07-06 19:40:26 +02:00
parent 70d51c757b
commit 135ac118b0
No known key found for this signature in database
GPG Key ID: 71BD34C0D4891300
4 changed files with 7 additions and 3 deletions

View File

@ -41,6 +41,7 @@
### Shopping list improvements/fixes
- The amount now defaults to `1` for adding items quicker
- Added a status filter for only _done_ items
- Fixed that shopping list prints had a grey background (thanks @Forceu)
- Fixed the form validation on the shopping list item page (thanks @Forceu)
- Fixed that when adding products to the shopping list from the stock overview page, the used quantity unit was always the products default purchase QU (and not the selected one)

View File

@ -2142,3 +2142,5 @@ msgstr ""
msgid "Unable to print"
msgstr ""
msgid "Only done items"
msgstr ""

View File

@ -361,11 +361,11 @@ $(document).on('click', '.order-listitem-button', function(e)
var statusInfoCell = $("#shoppinglistitem-" + listItemId + "-status-info");
if (done == 1)
{
statusInfoCell.text(statusInfoCell.text().replace("xxUNDONExx", ""));
statusInfoCell.text(statusInfoCell.text().replace("xxUNDONExx", "xxDONExx"));
}
else
{
statusInfoCell.text(statusInfoCell.text() + " xxUNDONExx");
statusInfoCell.text(statusInfoCell.text().replace("xxDONExx", "xxUNDONExx"));
}
shoppingListTable.rows().invalidate().draw(false);

View File

@ -131,6 +131,7 @@
<option value="all">{{ $__t('All') }}</option>
<option class="@if(!GROCY_FEATURE_FLAG_STOCK) d-none @endif"
value="belowminstockamount">{{ $__t('Below min. stock amount') }}</option>
<option value="xxDONExx">{{ $__t('Only done items') }}</option>
<option value="xxUNDONExx">{{ $__t('Only undone items') }}</option>
</select>
</div>
@ -239,7 +240,7 @@
<td id="shoppinglistitem-{{ $listItem->id }}-status-info"
class="d-none">
@if(FindObjectInArrayByPropertyValue($missingProducts, 'id', $listItem->product_id) !== null) belowminstockamount @endif
@if($listItem->done != 1) xxUNDONExx @endif
@if($listItem->done == 1) xxDONExx @else xxUNDONExx @endif
</td>
<td class="@if(!GROCY_FEATURE_FLAG_STOCK_PRICE_TRACKING) d-none @endif">
<span class="locale-number locale-number-currency">{{ $listItem->last_price_unit }}</span>