mirror of
https://github.com/grocy/grocy.git
synced 2025-04-29 09:39:57 +00:00
Fixed shopping list print view table/list sorting (fixes #2602)
This commit is contained in:
parent
1b8f4e6a4f
commit
11ea8f3716
@ -22,7 +22,7 @@
|
|||||||
|
|
||||||
### Shopping list
|
### Shopping list
|
||||||
|
|
||||||
- xxx
|
- Fixed that when printing a shoppping list the table/list wasn't sorted (will now be sorted alphabetically by the product name of the corresponding list item)
|
||||||
|
|
||||||
### Recipes
|
### Recipes
|
||||||
|
|
||||||
|
@ -393,7 +393,7 @@ class StockController extends BaseController
|
|||||||
}
|
}
|
||||||
|
|
||||||
return $this->renderPage($response, 'shoppinglist', [
|
return $this->renderPage($response, 'shoppinglist', [
|
||||||
'listItems' => $this->getDatabase()->uihelper_shopping_list()->where('shopping_list_id = :1', $listId),
|
'listItems' => $this->getDatabase()->uihelper_shopping_list()->where('shopping_list_id = :1', $listId)->orderBy('product_name', 'COLLATE NOCASE'),
|
||||||
'products' => $this->getDatabase()->products()->where('active = 1')->orderBy('name', 'COLLATE NOCASE'),
|
'products' => $this->getDatabase()->products()->where('active = 1')->orderBy('name', 'COLLATE NOCASE'),
|
||||||
'quantityunits' => $this->getDatabase()->quantity_units()->orderBy('name', 'COLLATE NOCASE'),
|
'quantityunits' => $this->getDatabase()->quantity_units()->orderBy('name', 'COLLATE NOCASE'),
|
||||||
'missingProducts' => $this->getStockService()->GetMissingProducts(),
|
'missingProducts' => $this->getStockService()->GetMissingProducts(),
|
||||||
|
@ -22,8 +22,7 @@ $('#shoppinglist-table tbody').removeClass("d-none");
|
|||||||
shoppingListTable.columns.adjust().draw();
|
shoppingListTable.columns.adjust().draw();
|
||||||
|
|
||||||
var shoppingListPrintShadowTable = $('#shopping-list-print-shadow-table').DataTable({
|
var shoppingListPrintShadowTable = $('#shopping-list-print-shadow-table').DataTable({
|
||||||
'order': [[1, 'asc']],
|
"orderFixed": [[0, 'asc'], [2, 'asc']],
|
||||||
"orderFixed": [[2, 'asc']],
|
|
||||||
'columnDefs': [
|
'columnDefs': [
|
||||||
{ 'visible': false, 'targets': 2 },
|
{ 'visible': false, 'targets': 2 },
|
||||||
{ 'orderable': false, 'targets': '_all' }
|
{ 'orderable': false, 'targets': '_all' }
|
||||||
@ -500,7 +499,6 @@ $(document).on("click", "#print-shopping-list-button", function(e)
|
|||||||
if (!$("#print-group-by-product-group").prop("checked"))
|
if (!$("#print-group-by-product-group").prop("checked"))
|
||||||
{
|
{
|
||||||
shoppingListPrintShadowTable.rowGroup().enable(false);
|
shoppingListPrintShadowTable.rowGroup().enable(false);
|
||||||
shoppingListPrintShadowTable.order.fixed({});
|
|
||||||
shoppingListPrintShadowTable.draw();
|
shoppingListPrintShadowTable.draw();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4,6 +4,15 @@
|
|||||||
|
|
||||||
@section('title', $__t('Shopping list'))
|
@section('title', $__t('Shopping list'))
|
||||||
|
|
||||||
|
@push('pageStyles')
|
||||||
|
<style>
|
||||||
|
#shopping-list-print-shadow-table_wrapper .dataTable>thead>tr>th[class*="sort"]:before,
|
||||||
|
#shopping-list-print-shadow-table_wrapper .dataTable>thead>tr>th[class*="sort"]:after {
|
||||||
|
content: "" !important;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
@endpush
|
||||||
|
|
||||||
@push('pageScripts')
|
@push('pageScripts')
|
||||||
<script src="{{ $U('/viewjs/purchase.js?v=', true) }}{{ $version }}"></script>
|
<script src="{{ $U('/viewjs/purchase.js?v=', true) }}{{ $version }}"></script>
|
||||||
@endpush
|
@endpush
|
||||||
|
Loading…
x
Reference in New Issue
Block a user