Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitf5206b8

Browse files
OBPIH-6993 fix3. filter multiple products when downloading transactio… (#5580)
Co-authored-by: Kacper Chełstowski <kchelstowski@soldevelo.com>
1 parent59e3efb commitf5206b8

File tree

2 files changed

+8
-9
lines changed

2 files changed

+8
-9
lines changed

‎grails-app/controllers/org/pih/warehouse/JsonController.groovy‎

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1814,13 +1814,5 @@ class TransactionReportCommand implements Validateable {
18141814
Location location
18151815
List<TransactionType> transactionTypes
18161816
Category category
1817-
1818-
// TODO: The datatables plugin sends the ids as a single string (ex: products="1,2") so we need to split it up
1819-
// ourselves. Better would be to modify the usage of datatables to send up each id as a separate field
1820-
// (ex: products="1"&products="2") so that Grails can bind it normally. (see showTransactionReport.gsp)
1821-
@BindUsing({ obj, source ->
1822-
List<String>productIds= (source['products'] asString)?.split(',')
1823-
return productIds?Product.findAllByIdInList(productIds):null
1824-
})
18251817
List<Product> products
18261818
}

‎grails-app/views/report/showTransactionReport.gsp‎

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,14 @@
259259
data.push({ name:"startDate", value:$("#startDate").val() });
260260
data.push({ name:"endDate", value:$("#endDate").val() });
261261
data.push({ name:"category", value:$("#category").val() });
262-
data.push({ name:"products", value:$("#products-select").val() });
262+
263+
constselectedProducts=$("#products-select").val();
264+
if (selectedProducts) {
265+
selectedProducts.forEach(productId=> {
266+
data.push({ name:"products", value: productId });
267+
});
268+
}
269+
263270
data.push({ name:"tags", value:$("#tags").val() });
264271
data.push({ name:"catalogs", value:$("#catalogs").val() });
265272
if($('#includeCategoryChildren').is(':checked')) {

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp