Subversion Repositories SmartDukaan

Rev

Rev 37331 | Rev 37394 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 37331 Rev 37374
Line 288... Line 288...
288
 
288
 
289
                                </button>
289
                                </button>
290
                            </div>
290
                            </div>
291
                        </div>
291
                        </div>
292
 
292
 
-
 
293
                        ## Brand filter — AJAX-swaps the tbody below. "All Brands" restores the original numbers.
-
 
294
                        <div class="row" style="margin: 0 0 8px 0;">
-
 
295
                            <div class="col-lg-6" style="padding-left:0;">
-
 
296
                                <select id="whrBrandFilter" class="form-control input-sm">
-
 
297
                                    <option value="">All Brands</option>
-
 
298
                                    #if($whrBrandList)
-
 
299
                                        #foreach($b in $whrBrandList)
-
 
300
                                            <option value="$b">$b</option>
-
 
301
                                        #end
-
 
302
                                    #end
-
 
303
                                </select>
-
 
304
                            </div>
-
 
305
                        </div>
293
 
306
 
294
                        <table class="table table-striped table-advance table-hover">
307
                        <table class="table table-striped table-advance table-hover">
295
                            <tbody>
308
                            <tbody id="whrTableBody">
296
                            <tr>
309
                            <tr>
297
                                <th>W/H Location</th>
310
                                <th>W/H Location</th>
298
                                <th>Total Stock</th>
311
                                <th>Total Stock</th>
299
                                <th>Total Value</th>
312
                                <th>Total Value</th>
300
                                <th>Pending Indent</th>
313
                                <th>Pending Indent</th>
Line 316... Line 329...
316
                                    <td>$warehouseStockMap.get($key).getTertiary()</td>
329
                                    <td>$warehouseStockMap.get($key).getTertiary()</td>
317
                                </tr>
330
                                </tr>
318
                                #end
331
                                #end
319
                            </tbody>
332
                            </tbody>
320
                        </table>
333
                        </table>
-
 
334
 
-
 
335
                        <script>
-
 
336
                            (function () {
-
 
337
                                var whrSelect = document.getElementById('whrBrandFilter');
-
 
338
                                if (!whrSelect) return;
-
 
339
                                var whrCtx = "${rc.contextPath}";
-
 
340
                                whrSelect.addEventListener('change', function () {
-
 
341
                                    var brand = this.value;
-
 
342
                                    var url = whrCtx + '/getWarehouseStockByBrand';
-
 
343
                                    if (brand) url += '?brand=' + encodeURIComponent(brand);
-
 
344
                                    doGetAjaxRequestHandler(url, function (response) {
-
 
345
                                        var tbody = document.getElementById('whrTableBody');
-
 
346
                                        if (tbody && response) {
-
 
347
                                            tbody.innerHTML = response;
-
 
348
                                            if (typeof formatCurrency === 'function') formatCurrency();
-
 
349
                                        }
-
 
350
                                    });
-
 
351
                                });
-
 
352
                            })();
-
 
353
                        </script>
321
                    </div>
354
                    </div>
322
                </div>
355
                </div>
323
            #end
356
            #end
324
 
357
 
325
 
358