2
0
mirror of https://github.com/inventree/inventree-app.git synced 2025-04-28 05:26:47 +00:00

Add sorting options for the StockItem list

This commit is contained in:
Oliver Walters 2022-07-06 21:07:19 +10:00
parent 6192932322
commit a450154bac
3 changed files with 26 additions and 0 deletions

View File

@ -425,6 +425,9 @@
"lastUpdated": "Last Updated",
"@lastUpdated": {},
"level": "Level",
"@level": {},
"lineItem": "Line Item",
"@lineItem": {},

View File

@ -50,6 +50,15 @@ class _PaginatedPartCategoryListState extends PaginatedSearchState<PaginatedPart
_PaginatedPartCategoryListState(Map<String, String> filters) : super(filters);
@override
String get prefix => "category_";
@override
Map<String, String> get orderingOptions => {
"name": L10().name,
"level": L10().level,
};
@override
Future<InvenTreePageResponse?> requestPage(int limit, int offset, Map<String, String> params) async {

View File

@ -52,6 +52,20 @@ class _PaginatedStockItemListState extends PaginatedSearchState<PaginatedStockIt
_PaginatedStockItemListState(Map<String, String> filters) : super(filters);
@override
String get prefix => "stock_";
@override
Map<String, String> get orderingOptions => {
"part__name": L10().name,
"part__IPN": L10().internalPartNumber,
"quantity": L10().quantity,
"status": L10().status,
"batch": L10().batchCode,
"updated": L10().lastUpdated,
"stocktake_date": L10().lastStocktake,
};
@override
Future<InvenTreePageResponse?> requestPage(int limit, int offset, Map<String, String> params) async {