| 32748 |
amit.gupta |
1 |
<div class="col-lg-12">
|
|
|
2 |
<table id="warehouseBrandItemStock" class="table table-striped table-advance table-hover">
|
|
|
3 |
<thead>
|
|
|
4 |
<tr>
|
|
|
5 |
<th>W/H Name</th>
|
|
|
6 |
<th>Item</th>
|
|
|
7 |
<th>Unit Price</th>
|
|
|
8 |
<th>Stock Qty</th>
|
|
|
9 |
<th>Stock Value</th>
|
|
|
10 |
<th>Pending Indent</th>
|
|
|
11 |
<th>Tertiary</th>
|
|
|
12 |
<th><10</th>
|
| 35129 |
amit |
13 |
<th><15</th>
|
| 35130 |
amit |
14 |
<th><20</th>
|
| 35129 |
amit |
15 |
<th>>20</th>
|
| 32748 |
amit.gupta |
16 |
|
|
|
17 |
</tr>
|
|
|
18 |
</thead>
|
|
|
19 |
<tbody>
|
|
|
20 |
#foreach($key in $warehouseWiseItemStock)
|
|
|
21 |
<tr>
|
|
|
22 |
<td>$key.getWarehouseName()</td>
|
|
|
23 |
<td
|
| 35128 |
amit |
24 |
#if($key.getD15to20() > 0 || $key.getD20to30() > 0 || $key.getDgt30() > 0))
|
| 35127 |
amit |
25 |
style="color:red"
|
| 35122 |
amit |
26 |
#elseif($key.getD10to15() > 0)
|
| 35127 |
amit |
27 |
style="color:lightsalmon"
|
| 32748 |
amit.gupta |
28 |
#end
|
|
|
29 |
>$key.getBrand() $key.getModelName() $key.getModelNumber() $key.getColor()</td>
|
|
|
30 |
<td>$key.getUnitPrice()</td>
|
|
|
31 |
<td>$key.getStockQty()</td>
|
|
|
32 |
<td class="currency">$key.getStockValue()</td>
|
|
|
33 |
<td class="pendingIndent" data-itemid="$key.getItemId()" data-warehouseid="$key.getWarehouseId()"
|
|
|
34 |
data-toggle="modal" data-target="#pendingIndentItem">$key.getPendingIndent()</td>
|
|
|
35 |
<td>$key.getTertiary()</td>
|
|
|
36 |
<td>$key.getDlt10()</td>
|
| 35129 |
amit |
37 |
<td>$key.getD10to15()</td>
|
|
|
38 |
<td>$key.getD15to20()</td>
|
|
|
39 |
<td>$key.getDgt20()</td>
|
| 32748 |
amit.gupta |
40 |
</tr>
|
|
|
41 |
#end
|
|
|
42 |
|
|
|
43 |
</tbody>
|
|
|
44 |
</table>
|
|
|
45 |
</div>
|
|
|
46 |
|
|
|
47 |
<div id="pendingIndentItem" class="modal" role="dialog">
|
|
|
48 |
<div class="modal-dialog">
|
|
|
49 |
<div class="modal-content">
|
|
|
50 |
|
|
|
51 |
</div>
|
| 27599 |
tejbeer |
52 |
</div>
|
| 32748 |
amit.gupta |
53 |
</div>
|
|
|
54 |
|
| 27538 |
tejbeer |
55 |
<script type="text/javascript">
|
| 32748 |
amit.gupta |
56 |
$(document).ready(function () {
|
| 27550 |
tejbeer |
57 |
|
| 32748 |
amit.gupta |
58 |
$('#warehouseBrandItemStock thead tr').clone(true).appendTo('#warehouseBrandItemStock thead');
|
|
|
59 |
$('#warehouseBrandItemStock thead tr:eq(1) th').each(function (i) {
|
|
|
60 |
var title = $(this).text();
|
|
|
61 |
$(this).html('<input type="text" style = "width:60%;" placeholder="Search ' + title + '" />');
|
| 27538 |
tejbeer |
62 |
|
| 32748 |
amit.gupta |
63 |
$('input', this).on('keyup change', function () {
|
|
|
64 |
if (table.column(i).search() !== this.value) {
|
|
|
65 |
table
|
|
|
66 |
.column(i)
|
|
|
67 |
.search(this.value)
|
|
|
68 |
.draw();
|
|
|
69 |
}
|
|
|
70 |
});
|
|
|
71 |
})
|
| 37358 |
ranu |
72 |
|
|
|
73 |
// Totals row appended at the bottom of thead — sits directly above the tbody data
|
|
|
74 |
// and stays visible thanks to fixedHeader. Refilled on every draw via drawCallback,
|
|
|
75 |
// so it reflects the current search/filter state.
|
|
|
76 |
var whbTotalsRow = '<tr class="whbTotalsRow" style="background:#eef;font-weight:700;">';
|
|
|
77 |
for (var c = 0; c < 11; c++) {
|
|
|
78 |
whbTotalsRow += '<th class="whbTotalCell" data-col-idx="' + c + '"></th>';
|
|
|
79 |
}
|
|
|
80 |
whbTotalsRow += '</tr>';
|
|
|
81 |
$('#warehouseBrandItemStock thead').append(whbTotalsRow);
|
|
|
82 |
|
|
|
83 |
// Numeric columns to sum across all filtered rows.
|
|
|
84 |
var whbSumCols = [2, 3, 4, 5, 6, 7, 8, 9, 10];
|
|
|
85 |
|
| 32748 |
amit.gupta |
86 |
var table = $('#warehouseBrandItemStock').DataTable({
|
|
|
87 |
orderCellsTop: true,
|
| 37358 |
ranu |
88 |
fixedHeader: true,
|
|
|
89 |
drawCallback: function () {
|
|
|
90 |
var api = this.api();
|
|
|
91 |
var whbTotalCells = jQuery('#warehouseBrandItemStock .whbTotalCell');
|
|
|
92 |
whbTotalCells.text('');
|
|
|
93 |
whbTotalCells.filter('[data-col-idx="0"]').text('Totals');
|
|
|
94 |
whbSumCols.forEach(function (idx) {
|
|
|
95 |
var sum = api.column(idx, {search: 'applied'}).data()
|
|
|
96 |
.reduce(function (a, b) {
|
|
|
97 |
var s = (b == null ? '' : String(b)).replace(/[,\s]/g, '');
|
|
|
98 |
var n = parseFloat(s);
|
|
|
99 |
return a + (isNaN(n) ? 0 : n);
|
|
|
100 |
}, 0);
|
|
|
101 |
whbTotalCells.filter('[data-col-idx="' + idx + '"]').text(
|
|
|
102 |
sum.toLocaleString('en-IN', {maximumFractionDigits: 0})
|
|
|
103 |
);
|
|
|
104 |
});
|
|
|
105 |
}
|
| 32748 |
amit.gupta |
106 |
});
|
|
|
107 |
});
|
| 27538 |
tejbeer |
108 |
|
|
|
109 |
|
| 27599 |
tejbeer |
110 |
</script>
|
|
|
111 |
|
|
|
112 |
<script type="text/javascript">
|
|
|
113 |
|
| 32748 |
amit.gupta |
114 |
$('#warehouseBrandItemStock').on('click', '.pendingIndent', function () {
|
|
|
115 |
var itemId = $(this).data('itemid');
|
|
|
116 |
var warehouseId = $(this).data('warehouseid');
|
| 27599 |
tejbeer |
117 |
|
|
|
118 |
|
| 32748 |
amit.gupta |
119 |
doGetAjaxRequestHandler(context + "/getPartnerPendingIndentItem?itemId="
|
|
|
120 |
+ itemId + "&warehouseId=" + warehouseId, function (response) {
|
|
|
121 |
|
|
|
122 |
$('#pendingIndentItem .modal-content').html(response);
|
|
|
123 |
|
|
|
124 |
});
|
|
|
125 |
});
|
| 27538 |
tejbeer |
126 |
</script>
|