Rev 35130 | Blame | Compare with Previous | Last modification | View Log | RSS feed
<div class="col-lg-12"><table id="warehouseBrandItemStock" class="table table-striped table-advance table-hover"><thead><tr><th>W/H Name</th><th>Item</th><th>Unit Price</th><th>Stock Qty</th><th>Stock Value</th><th>Pending Indent</th><th>Tertiary</th><th><10</th><th><15</th><th><20</th><th>>20</th></tr></thead><tbody>#foreach($key in $warehouseWiseItemStock)<tr><td>$key.getWarehouseName()</td><td#if($key.getD15to20() > 0 || $key.getD20to30() > 0 || $key.getDgt30() > 0))style="color:red"#elseif($key.getD10to15() > 0)style="color:lightsalmon"#end>$key.getBrand() $key.getModelName() $key.getModelNumber() $key.getColor()</td><td>$key.getUnitPrice()</td><td>$key.getStockQty()</td><td class="currency">$key.getStockValue()</td><td class="pendingIndent" data-itemid="$key.getItemId()" data-warehouseid="$key.getWarehouseId()"data-toggle="modal" data-target="#pendingIndentItem">$key.getPendingIndent()</td><td>$key.getTertiary()</td><td>$key.getDlt10()</td><td>$key.getD10to15()</td><td>$key.getD15to20()</td><td>$key.getDgt20()</td></tr>#end</tbody></table></div><div id="pendingIndentItem" class="modal" role="dialog"><div class="modal-dialog"><div class="modal-content"></div></div></div><script type="text/javascript">$(document).ready(function () {$('#warehouseBrandItemStock thead tr').clone(true).appendTo('#warehouseBrandItemStock thead');$('#warehouseBrandItemStock thead tr:eq(1) th').each(function (i) {var title = $(this).text();$(this).html('<input type="text" style = "width:60%;" placeholder="Search ' + title + '" />');$('input', this).on('keyup change', function () {if (table.column(i).search() !== this.value) {table.column(i).search(this.value).draw();}});})// Totals row appended at the bottom of thead — sits directly above the tbody data// and stays visible thanks to fixedHeader. Refilled on every draw via drawCallback,// so it reflects the current search/filter state.var whbTotalsRow = '<tr class="whbTotalsRow" style="background:#eef;font-weight:700;">';for (var c = 0; c < 11; c++) {whbTotalsRow += '<th class="whbTotalCell" data-col-idx="' + c + '"></th>';}whbTotalsRow += '</tr>';$('#warehouseBrandItemStock thead').append(whbTotalsRow);// Numeric columns to sum across all filtered rows.var whbSumCols = [2, 3, 4, 5, 6, 7, 8, 9, 10];var table = $('#warehouseBrandItemStock').DataTable({orderCellsTop: true,fixedHeader: true,drawCallback: function () {var api = this.api();var whbTotalCells = jQuery('#warehouseBrandItemStock .whbTotalCell');whbTotalCells.text('');whbTotalCells.filter('[data-col-idx="0"]').text('Totals');whbSumCols.forEach(function (idx) {var sum = api.column(idx, {search: 'applied'}).data().reduce(function (a, b) {var s = (b == null ? '' : String(b)).replace(/[,\s]/g, '');var n = parseFloat(s);return a + (isNaN(n) ? 0 : n);}, 0);whbTotalCells.filter('[data-col-idx="' + idx + '"]').text(sum.toLocaleString('en-IN', {maximumFractionDigits: 0}));});}});});</script><script type="text/javascript">$('#warehouseBrandItemStock').on('click', '.pendingIndent', function () {var itemId = $(this).data('itemid');var warehouseId = $(this).data('warehouseid');doGetAjaxRequestHandler(context + "/getPartnerPendingIndentItem?itemId="+ itemId + "&warehouseId=" + warehouseId, function (response) {$('#pendingIndentItem .modal-content').html(response);});});</script>