| 35631 |
ranu |
1 |
<style>
|
|
|
2 |
#rbm-call-target-table td, #rbm-call-target-table th {
|
|
|
3 |
font-size: 14px;
|
|
|
4 |
text-align: center;
|
|
|
5 |
padding: 0.4rem;
|
|
|
6 |
vertical-align: middle;
|
|
|
7 |
}
|
|
|
8 |
|
|
|
9 |
#rbm-call-target-table thead th {
|
|
|
10 |
background-color: #343a40;
|
|
|
11 |
color: white;
|
|
|
12 |
font-weight: 600;
|
|
|
13 |
}
|
|
|
14 |
|
|
|
15 |
#rbm-call-target-table tbody tr:first-child td {
|
|
|
16 |
font-weight: bold;
|
|
|
17 |
background-color: #00d6b2;
|
|
|
18 |
}
|
|
|
19 |
|
|
|
20 |
.highlight-target {
|
|
|
21 |
background-color: #fff3cd !important;
|
|
|
22 |
font-weight: bold;
|
|
|
23 |
}
|
|
|
24 |
|
|
|
25 |
.highlight-achieved {
|
|
|
26 |
background-color: #d4edda !important;
|
|
|
27 |
}
|
|
|
28 |
|
|
|
29 |
.highlight-oos {
|
|
|
30 |
background-color: #f8d7da !important;
|
|
|
31 |
}
|
|
|
32 |
|
|
|
33 |
.highlight-plan-today {
|
|
|
34 |
background-color: #0f57a4 !important;
|
|
|
35 |
color: white !important;
|
|
|
36 |
}
|
|
|
37 |
|
|
|
38 |
.highlight-carry-forward {
|
|
|
39 |
background-color: #ffc107 !important;
|
|
|
40 |
color: #000 !important;
|
|
|
41 |
}
|
|
|
42 |
|
|
|
43 |
.highlight-untouched {
|
|
|
44 |
background-color: #dc3545 !important;
|
|
|
45 |
color: white !important;
|
|
|
46 |
}
|
|
|
47 |
|
|
|
48 |
.highlight-future-plan {
|
|
|
49 |
background-color: #6c757d !important;
|
|
|
50 |
color: #000 !important;
|
|
|
51 |
}
|
|
|
52 |
|
|
|
53 |
.clickable {
|
|
|
54 |
cursor: pointer;
|
|
|
55 |
text-decoration: underline;
|
|
|
56 |
color: #007bff;
|
|
|
57 |
}
|
|
|
58 |
|
|
|
59 |
.clickable:hover {
|
|
|
60 |
color: #0056b3;
|
|
|
61 |
}
|
|
|
62 |
|
|
|
63 |
.modal-body table {
|
|
|
64 |
width: 100%;
|
|
|
65 |
}
|
|
|
66 |
|
|
|
67 |
.modal-body table th, .modal-body table td {
|
|
|
68 |
padding: 8px;
|
|
|
69 |
border: 1px solid #ddd;
|
|
|
70 |
}
|
|
|
71 |
</style>
|
|
|
72 |
|
|
|
73 |
<div class="container-fluid">
|
|
|
74 |
<h3>RBM Call Target Summary</h3>
|
|
|
75 |
<table id="rbm-call-target-table" class="table table-bordered table-striped">
|
|
|
76 |
<thead>
|
|
|
77 |
<tr>
|
|
|
78 |
<th>RBM Name</th>
|
|
|
79 |
<th>Partner Count</th>
|
| 35645 |
ranu |
80 |
<th>(Ach/Tgt)</th>
|
| 35631 |
ranu |
81 |
<th>Calling Target</th>
|
|
|
82 |
<th>Called</th>
|
|
|
83 |
<th class="highlight-plan-today">Plan Today</th>
|
|
|
84 |
<th class="highlight-carry-forward">Carry Forward</th>
|
|
|
85 |
<th style="background-color: #1e6e0e; color: white;">Zero Billing</th>
|
|
|
86 |
<th class="highlight-untouched">Untouched</th>
|
|
|
87 |
<th class="highlight-future-plan">Future Plan</th>
|
|
|
88 |
<th>Normal</th>
|
|
|
89 |
<th style="background-color: #c0392b;">Out of Sequence</th>
|
| 35645 |
ranu |
90 |
<th>Download</th>
|
| 35631 |
ranu |
91 |
</tr>
|
|
|
92 |
</thead>
|
|
|
93 |
<tbody>
|
|
|
94 |
#set($totalPartnerCount = 0)
|
|
|
95 |
#set($totalTodayTarget = 0)
|
|
|
96 |
#set($totalValueAchieved = 0)
|
|
|
97 |
#set($totalMovedToFuture = 0)
|
|
|
98 |
#set($totalPlanToday = 0)
|
|
|
99 |
#set($totalCarryForward = 0)
|
|
|
100 |
#set($totalZeroBilling = 0)
|
|
|
101 |
#set($totalUntouched = 0)
|
|
|
102 |
#set($totalFuturePlan = 0)
|
|
|
103 |
#set($totalNormal = 0)
|
|
|
104 |
#set($totalOutOfSequence = 0)
|
|
|
105 |
#set($totalL2CallingList = 0)
|
|
|
106 |
#set($totalArrAchieved = 0)
|
|
|
107 |
#set($totalArrTarget = 0)
|
|
|
108 |
|
|
|
109 |
## Total row first
|
|
|
110 |
#foreach($model in $rbmCallTargetModels)
|
|
|
111 |
#set($totalPartnerCount = $totalPartnerCount + $model.getPartnerCount())
|
|
|
112 |
#set($totalTodayTarget = $totalTodayTarget + $model.getTodayTargetOfCall())
|
|
|
113 |
#set($totalValueAchieved = $totalValueAchieved + $model.getValueTargetAchieved())
|
|
|
114 |
#set($totalMovedToFuture = $totalMovedToFuture + $model.getMovedToFuture())
|
|
|
115 |
#set($totalPlanToday = $totalPlanToday + $model.getPlanToday())
|
|
|
116 |
#set($totalCarryForward = $totalCarryForward + $model.getCarryForward())
|
|
|
117 |
#set($totalZeroBilling = $totalZeroBilling + $model.getZeroBilling())
|
|
|
118 |
#set($totalUntouched = $totalUntouched + $model.getUntouched())
|
|
|
119 |
#set($totalFuturePlan = $totalFuturePlan + $model.getFuturePlan())
|
|
|
120 |
#set($totalNormal = $totalNormal + $model.getNormal())
|
|
|
121 |
#set($totalOutOfSequence = $totalOutOfSequence + $model.getOutOfSequenceCount())
|
|
|
122 |
#set($totalL2CallingList = $totalL2CallingList + $model.getL2CallingList())
|
|
|
123 |
#if($arrAchievedByAuthId && $arrAchievedByAuthId.get($model.getAuthId()))
|
|
|
124 |
#set($totalArrAchieved = $totalArrAchieved + $arrAchievedByAuthId.get($model.getAuthId()))
|
|
|
125 |
#end
|
|
|
126 |
#if($arrTargetByAuthId && $arrTargetByAuthId.get($model.getAuthId()))
|
|
|
127 |
#set($totalArrTarget = $totalArrTarget + $arrTargetByAuthId.get($model.getAuthId()))
|
|
|
128 |
#end
|
|
|
129 |
#end
|
|
|
130 |
|
|
|
131 |
#set($adjustedTotalTarget = $totalTodayTarget + $totalMovedToFuture)
|
|
|
132 |
#set($adjustedTotalAchieved = $totalValueAchieved + $totalMovedToFuture)
|
|
|
133 |
|
|
|
134 |
<tr>
|
|
|
135 |
<td><strong>TOTAL</strong></td>
|
|
|
136 |
<td><strong>$totalPartnerCount</strong></td>
|
| 35636 |
ranu |
137 |
<td><strong><span class="lakh">$totalArrAchieved</span> / <span class="lakh">$totalArrTarget</span></strong>
|
| 35631 |
ranu |
138 |
</td>
|
|
|
139 |
<td class="highlight-target"><strong>$adjustedTotalTarget</strong></td>
|
|
|
140 |
<td class="highlight-achieved currency"><strong>$adjustedTotalAchieved</strong></td>
|
|
|
141 |
<td class="highlight-plan-today"><strong>$totalPlanToday</strong></td>
|
|
|
142 |
<td class="highlight-carry-forward"><strong>$totalCarryForward</strong></td>
|
|
|
143 |
<td><strong>$totalZeroBilling</strong></td>
|
|
|
144 |
<td class="highlight-untouched"><strong>$totalUntouched</strong></td>
|
|
|
145 |
<td class="highlight-future-plan"><strong>$totalFuturePlan</strong></td>
|
|
|
146 |
<td><strong>$totalNormal</strong></td>
|
|
|
147 |
<td class="highlight-oos"><strong>$totalOutOfSequence</strong></td>
|
| 35645 |
ranu |
148 |
<td></td>
|
| 35631 |
ranu |
149 |
</tr>
|
|
|
150 |
|
|
|
151 |
#foreach($model in $rbmCallTargetModels)
|
|
|
152 |
#set($rowTarget = $model.getTodayTargetOfCall() + $model.getMovedToFuture())
|
|
|
153 |
#set($rowAchieved = $model.getValueTargetAchieved() + $model.getMovedToFuture())
|
|
|
154 |
<tr>
|
|
|
155 |
<td>$model.getRbmName()</td>
|
|
|
156 |
<td>$model.getPartnerCount()</td>
|
|
|
157 |
<td>
|
|
|
158 |
#if($arrAchievedByAuthId && $arrAchievedByAuthId.get($model.getAuthId()))
|
| 35636 |
ranu |
159 |
<span class="lakh">$arrAchievedByAuthId.get($model.getAuthId())</span>
|
| 35631 |
ranu |
160 |
#else
|
|
|
161 |
|
|
|
162 |
#end
|
|
|
163 |
/
|
|
|
164 |
#if($arrTargetByAuthId && $arrTargetByAuthId.get($model.getAuthId()))
|
| 35636 |
ranu |
165 |
<span class="lakh">$arrTargetByAuthId.get($model.getAuthId())</span>
|
| 35631 |
ranu |
166 |
#else
|
|
|
167 |
|
|
|
168 |
#end
|
|
|
169 |
</td>
|
|
|
170 |
<td class="highlight-target">$rowTarget</td>
|
|
|
171 |
<td class="highlight-achieved currency">$rowAchieved</td>
|
|
|
172 |
<td class="highlight-plan-today">$model.getPlanToday()</td>
|
|
|
173 |
<td class="highlight-carry-forward">$model.getCarryForward()</td>
|
|
|
174 |
<td>$model.getZeroBilling()</td>
|
|
|
175 |
<td class="highlight-untouched">$model.getUntouched()</td>
|
|
|
176 |
<td class="highlight-future-plan">$model.getFuturePlan()</td>
|
|
|
177 |
<td>$model.getNormal()</td>
|
|
|
178 |
<td class="highlight-oos" style="color: red;">
|
|
|
179 |
#if($model.getOutOfSequenceCount() > 0)
|
|
|
180 |
<span class="clickable" style="color: #e80404"
|
|
|
181 |
onclick="showOutOfSequenceDetails($model.getAuthId(), '$model.getRbmName()')">$model.getOutOfSequenceCount()</span>
|
|
|
182 |
#else
|
|
|
183 |
|
|
|
184 |
#end
|
|
|
185 |
</td>
|
| 35645 |
ranu |
186 |
<td>
|
|
|
187 |
<a href="/indent/rbm_call_target/download_raw_data?authId=$model.getAuthId()" target="_blank"
|
|
|
188 |
class="btn btn-sm btn-outline-success">CSV</a>
|
|
|
189 |
</td>
|
| 35631 |
ranu |
190 |
</tr>
|
|
|
191 |
#end
|
|
|
192 |
</tbody>
|
|
|
193 |
</table>
|
|
|
194 |
</div>
|
|
|
195 |
|
|
|
196 |
<script type="text/javascript">
|
| 35638 |
ranu |
197 |
document.addEventListener('DOMContentLoaded', function () {
|
|
|
198 |
var elems = document.querySelectorAll('.lakh');
|
|
|
199 |
for (var i = 0; i < elems.length; i++) {
|
|
|
200 |
var val = parseInt(elems[i].textContent.trim());
|
| 35636 |
ranu |
201 |
if (!isNaN(val)) {
|
| 35638 |
ranu |
202 |
elems[i].textContent = (val / 100000).toFixed(1) + 'L';
|
| 35636 |
ranu |
203 |
}
|
| 35638 |
ranu |
204 |
}
|
| 35636 |
ranu |
205 |
});
|
|
|
206 |
|
| 35631 |
ranu |
207 |
function showOutOfSequenceDetails(authId, rbmName) {
|
|
|
208 |
document.getElementById('oosModalLabel').textContent = 'Out of Sequence Calls - ' + rbmName;
|
|
|
209 |
document.getElementById('oosDetailsContent').innerHTML = '<p>Loading...</p>';
|
|
|
210 |
$('#oosModal').modal('show');
|
|
|
211 |
|
|
|
212 |
fetch('/indent/rbm_call_target/oos_details?authId=' + authId)
|
|
|
213 |
.then(function (response) {
|
|
|
214 |
return response.json();
|
|
|
215 |
})
|
|
|
216 |
.then(function (data) {
|
|
|
217 |
if (data && data.length > 0) {
|
|
|
218 |
var html = '<table class="table table-bordered table-sm"><thead><tr><th>S.No</th><th>Party Name</th><th>Code</th><th>Time</th></tr></thead><tbody>';
|
|
|
219 |
for (var i = 0; i < data.length; i++) {
|
|
|
220 |
html += '<tr><td>' + (i + 1) + '</td><td>' + data[i].partyName + '</td><td>' + data[i].code + '</td><td>' + data[i].time + '</td></tr>';
|
|
|
221 |
}
|
|
|
222 |
html += '</tbody></table>';
|
|
|
223 |
document.getElementById('oosDetailsContent').innerHTML = html;
|
|
|
224 |
} else {
|
|
|
225 |
document.getElementById('oosDetailsContent').innerHTML = '<p>No out of sequence calls found.</p>';
|
|
|
226 |
}
|
|
|
227 |
})
|
|
|
228 |
.catch(function () {
|
|
|
229 |
document.getElementById('oosDetailsContent').innerHTML = '<p>Error loading details. Please try again.</p>';
|
|
|
230 |
});
|
|
|
231 |
}
|
|
|
232 |
</script>
|