| 35538 |
amit |
1 |
<div class="row warehouseMilestone" style="margin: 5px">
|
|
|
2 |
<div class="col-lg-4 form-group">
|
|
|
3 |
<span><b> Warehouse </b> </span>
|
|
|
4 |
<select class="form-control input-sm" id="warehousepurchasemil" name="warehouseMap" placeholder="Warehouse" onchange="changeWarehousePurchaseMilestone()">
|
|
|
5 |
<option value="" disabled selected>Warehouse</option>
|
|
|
6 |
#if($warehouseId == 0)
|
|
|
7 |
<option value="0" selected>All</option>
|
|
|
8 |
#else
|
|
|
9 |
<option value="0">All</option>
|
|
|
10 |
#end
|
|
|
11 |
#foreach($wm in $warehouseMap.entrySet()))
|
|
|
12 |
#if($warehouseId == $wm.getKey())
|
|
|
13 |
<option value="$wm.getKey()" selected>$wm.getValue()</option>
|
|
|
14 |
#else
|
|
|
15 |
<option value="$wm.getKey()">$wm.getValue()</option>
|
|
|
16 |
#end
|
|
|
17 |
#end
|
|
|
18 |
</select>
|
|
|
19 |
</div>
|
|
|
20 |
</div>
|
| 31273 |
tejbeer |
21 |
|
| 35538 |
amit |
22 |
<table class="table table-striped table-advance table-hover">
|
|
|
23 |
<tbody>
|
|
|
24 |
<tr>
|
|
|
25 |
<th>Partner Category</th>
|
|
|
26 |
<th>MTD</th>
|
|
|
27 |
<th>LMTD</th>
|
|
|
28 |
<th>LMS</th>
|
|
|
29 |
<th>Avg 3 Month</th>
|
|
|
30 |
</tr>
|
|
|
31 |
#foreach( $milestone in $milestones )
|
|
|
32 |
<tr>
|
|
|
33 |
<td>$milestone</td>
|
|
|
34 |
#if($smtdMap.get($milestone))
|
|
|
35 |
<td onclick="getPartnersPurchaseDetail($smtdMap.get($milestone))">$smtdMap.get($milestone).size()</td>
|
|
|
36 |
#else
|
|
|
37 |
<td>0</td>
|
|
|
38 |
#end
|
|
|
39 |
#if($slmtdMap.get($milestone))
|
|
|
40 |
<td onclick="getPartnersPurchaseDetail($slmtdMap.get($milestone))">$slmtdMap.get($milestone).size()</td>
|
|
|
41 |
#else
|
|
|
42 |
<td>0</td>
|
|
|
43 |
#end
|
|
|
44 |
#if($lmsMap.get($milestone))
|
|
|
45 |
<td onclick="getPartnersPurchaseDetail($lmsMap.get($milestone))">$lmsMap.get($milestone).size()</td>
|
|
|
46 |
#else
|
|
|
47 |
<td>0</td>
|
|
|
48 |
#end
|
|
|
49 |
#if($avg3MonthS.get($milestone))
|
|
|
50 |
<td onclick="getPartnersPurchaseDetail($avg3MonthS.get($milestone))">$avg3MonthS.get($milestone).size()</td>
|
|
|
51 |
#else
|
|
|
52 |
<td>0</td>
|
|
|
53 |
#end
|
|
|
54 |
</tr>
|
|
|
55 |
#end
|
|
|
56 |
#set($mtdTotal = 0)
|
|
|
57 |
#set($lmtdTotal = 0)
|
|
|
58 |
#set($lmsTotal = 0)
|
|
|
59 |
#set($avg3Total = 0)
|
| 35539 |
amit |
60 |
#set($mtdIds = [])
|
|
|
61 |
#set($lmtdIds = [])
|
|
|
62 |
#set($lmsIds = [])
|
|
|
63 |
#set($avg3Ids = [])
|
| 35538 |
amit |
64 |
#foreach( $milestone in $milestones )
|
| 35539 |
amit |
65 |
#if($smtdMap.get($milestone))#set($mtdTotal = $mtdTotal + $smtdMap.get($milestone).size())#set($dummy = $mtdIds.addAll($smtdMap.get($milestone)))#end
|
|
|
66 |
#if($slmtdMap.get($milestone))#set($lmtdTotal = $lmtdTotal + $slmtdMap.get($milestone).size())#set($dummy = $lmtdIds.addAll($slmtdMap.get($milestone)))#end
|
|
|
67 |
#if($lmsMap.get($milestone))#set($lmsTotal = $lmsTotal + $lmsMap.get($milestone).size())#set($dummy = $lmsIds.addAll($lmsMap.get($milestone)))#end
|
|
|
68 |
#if($avg3MonthS.get($milestone))#set($avg3Total = $avg3Total + $avg3MonthS.get($milestone).size())#set($dummy = $avg3Ids.addAll($avg3MonthS.get($milestone)))#end
|
| 35538 |
amit |
69 |
#end
|
|
|
70 |
<tr class="info" style="font-weight: bold;">
|
|
|
71 |
<td><b>Total</b></td>
|
| 35539 |
amit |
72 |
<td onclick="getPartnersPurchaseDetail($mtdIds)"><b>$mtdTotal</b></td>
|
|
|
73 |
<td onclick="getPartnersPurchaseDetail($lmtdIds)"><b>$lmtdTotal</b></td>
|
|
|
74 |
<td onclick="getPartnersPurchaseDetail($lmsIds)"><b>$lmsTotal</b></td>
|
|
|
75 |
<td onclick="getPartnersPurchaseDetail($avg3Ids)"><b>$avg3Total</b></td>
|
| 35538 |
amit |
76 |
</tr>
|
|
|
77 |
</tbody>
|
|
|
78 |
</table>
|
| 31273 |
tejbeer |
79 |
|
|
|
80 |
<script>
|
| 35538 |
amit |
81 |
function changeWarehousePurchaseMilestone() {
|
|
|
82 |
var warehouseId = $('#warehousepurchasemil').val();
|
|
|
83 |
doGetAjaxRequestHandler(context + "/getPurchaseCountByMileStone?warehouseId=" + warehouseId, function (response) {
|
|
|
84 |
$('.purchaseMilestoneContainer').html(response);
|
|
|
85 |
});
|
|
|
86 |
}
|
| 31273 |
tejbeer |
87 |
|
| 35538 |
amit |
88 |
function getPartnersPurchaseDetail(partnerIds) {
|
|
|
89 |
console.log(partnerIds)
|
|
|
90 |
doGetAjaxRequestHandler(context + "/getMonthWisePurchase?fofoIds=" + partnerIds, function(response) {
|
|
|
91 |
$('#' + "main-content").html(response);
|
|
|
92 |
console.log(response)
|
|
|
93 |
});
|
|
|
94 |
}
|
|
|
95 |
</script>
|