| 29966 |
amit.gupta |
1 |
<html lang="en">
|
|
|
2 |
<head>
|
| 29983 |
amit.gupta |
3 |
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
| 31538 |
amit.gupta |
4 |
<meta http-equiv="refresh" content="180">
|
| 29988 |
amit.gupta |
5 |
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css"
|
|
|
6 |
integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" crossorigin="anonymous">
|
| 29966 |
amit.gupta |
7 |
<style>
|
|
|
8 |
html, body {
|
| 29983 |
amit.gupta |
9 |
margin-top: 10px;
|
| 29966 |
amit.gupta |
10 |
padding: 0;
|
|
|
11 |
}
|
|
|
12 |
|
|
|
13 |
|
|
|
14 |
td, th {
|
| 29981 |
amit.gupta |
15 |
font-size: 20px;
|
| 29966 |
amit.gupta |
16 |
}
|
|
|
17 |
|
| 29988 |
amit.gupta |
18 |
|
|
|
19 |
.table td, .table th {
|
|
|
20 |
padding: 0.25rem;
|
|
|
21 |
}
|
|
|
22 |
|
| 30786 |
amit.gupta |
23 |
tr:first-child.green td {
|
| 29981 |
amit.gupta |
24 |
font-weight: bold;
|
| 29982 |
amit.gupta |
25 |
background-color: #00d6b2;
|
| 29981 |
amit.gupta |
26 |
}
|
| 29982 |
amit.gupta |
27 |
|
|
|
28 |
td {
|
| 29983 |
amit.gupta |
29 |
font-size: 24px;
|
| 29982 |
amit.gupta |
30 |
}
|
| 29966 |
amit.gupta |
31 |
</style>
|
|
|
32 |
<link href="../resources/css/brand-logo.css" rel="stylesheet"/>
|
|
|
33 |
</head>
|
|
|
34 |
<body>
|
| 33991 |
ranu |
35 |
|
|
|
36 |
#if($isGtEqL2)
|
| 34055 |
ranu |
37 |
|
|
|
38 |
#parse("rbm-today-arr.vm")
|
| 33953 |
ranu |
39 |
<br>
|
| 35147 |
ranu |
40 |
<div class="container-fluid mb-3">
|
|
|
41 |
<label for="userType">Select User Type</label>
|
|
|
42 |
<select id="userType" class="form-control" style="width:200px; display:inline-block;">
|
|
|
43 |
<option value="">--Select--</option>
|
|
|
44 |
<option value="RBM">RBM</option>
|
|
|
45 |
<option value="BM">BM</option>
|
|
|
46 |
<option value="ASM">ASM</option>
|
|
|
47 |
</select>
|
| 35174 |
ranu |
48 |
<button class="partnerwise-billed-po btn btn-info btn-sm">Today PO and Billed (Partner
|
| 35172 |
ranu |
49 |
wise)
|
|
|
50 |
</button>
|
| 35147 |
ranu |
51 |
</div>
|
|
|
52 |
|
|
|
53 |
<div class="container-fluid">
|
| 29983 |
amit.gupta |
54 |
#foreach($brands in $brandParts)
|
|
|
55 |
<table class="table table-bordered table-striped">
|
| 29966 |
amit.gupta |
56 |
<thead>
|
|
|
57 |
<tr>
|
| 33791 |
amit.gupta |
58 |
<th rowspan="2">AuthUser</th>
|
| 29966 |
amit.gupta |
59 |
#foreach($brand in $brands)
|
|
|
60 |
<th colspan="3" class="$brand.toLowerCase()"><p>$brand</p></th>
|
|
|
61 |
#end
|
|
|
62 |
</tr>
|
|
|
63 |
<tr>
|
|
|
64 |
#foreach($brand in $brands)
|
|
|
65 |
<th>TODAY PO</th>
|
| 33801 |
amit.gupta |
66 |
<th>Partner Count</th>
|
| 29966 |
amit.gupta |
67 |
<th>Total Billed</th>
|
|
|
68 |
#end
|
|
|
69 |
</tr>
|
|
|
70 |
</thead>
|
|
|
71 |
<tbody>
|
|
|
72 |
#foreach($brandRegionModelEntry in $brandRegionModelMap.entrySet())
|
| 30786 |
amit.gupta |
73 |
<tr class="green">
|
| 35155 |
ranu |
74 |
<td>
|
|
|
75 |
#if($brandRegionModelEntry.getKey() != -1)
|
|
|
76 |
<b>$authUserMap.get($brandRegionModelEntry.getKey())</b>
|
|
|
77 |
#else -
|
|
|
78 |
#end
|
|
|
79 |
</td>
|
| 29966 |
amit.gupta |
80 |
#foreach($brand in $brands)
|
|
|
81 |
#set($obj = $brandRegionModelEntry.getValue().get($brand))
|
| 29972 |
amit.gupta |
82 |
#if($obj.getTodayPOValue())
|
| 30036 |
amit.gupta |
83 |
<td class="currency">$obj.getTodayPOValue()</td>
|
| 29972 |
amit.gupta |
84 |
#else
|
|
|
85 |
<td>-</td>
|
|
|
86 |
#end
|
| 33801 |
amit.gupta |
87 |
#if($obj.getPartiesBilled())
|
|
|
88 |
<td>$obj.getPartiesBilled()</td>
|
| 29972 |
amit.gupta |
89 |
#else
|
|
|
90 |
<td>-</td>
|
|
|
91 |
#end
|
|
|
92 |
#if($obj.getTodayBilledValue())
|
| 30036 |
amit.gupta |
93 |
<td class="currency">$obj.getTodayBilledValue()</td>
|
| 29972 |
amit.gupta |
94 |
#else
|
|
|
95 |
<td>-</td>
|
|
|
96 |
#end
|
| 29966 |
amit.gupta |
97 |
#end
|
|
|
98 |
|
|
|
99 |
</tr>
|
|
|
100 |
#end
|
|
|
101 |
</tbody>
|
|
|
102 |
</table>
|
| 29983 |
amit.gupta |
103 |
#end
|
| 30787 |
amit.gupta |
104 |
</div>
|
| 32938 |
amit.gupta |
105 |
#if($partnerTypeRegionModelMap)
|
| 31538 |
amit.gupta |
106 |
<div class="container-fluid">
|
| 33953 |
ranu |
107 |
## <table class="table table-bordered table-striped">
|
|
|
108 |
## <thead>
|
|
|
109 |
## <tr>
|
|
|
110 |
## <th>Regionwise Billed Partners</th>
|
|
|
111 |
## #foreach($partnerType in $partnerTypes)
|
|
|
112 |
## <th>$partnerType.getValue()<br>Today/MTD/Total</th>
|
|
|
113 |
## #end
|
|
|
114 |
## </tr>
|
|
|
115 |
## </thead>
|
|
|
116 |
## <tbody>
|
|
|
117 |
## #foreach($authUserEntry in $authUserMap.entrySet())
|
|
|
118 |
## #if($authUserEntry.getKey()!=0)
|
|
|
119 |
## <tr>
|
|
|
120 |
## <td><b>$authUserEntry.getValue()</b></td>
|
|
|
121 |
## #foreach($partnerType in $partnerTypes)
|
|
|
122 |
## <td>
|
|
|
123 |
## #if($partnerTypeRegionModelMap.containsKey($warehouseEntry.getKey()))
|
|
|
124 |
## #if($partnerTypeRegionModelMap.get($warehouseEntry.getKey()).containsKey($partnerType.getValue()))
|
|
|
125 |
## #set ($partnerTypeRegionModel=$partnerTypeRegionModelMap.get($warehouseEntry.getKey()).get($partnerType.getValue()))
|
|
|
126 |
## $partnerTypeRegionModel.getTodayCount()/$partnerTypeRegionModel.getMtdCount()
|
|
|
127 |
## /$partnerTypeRegionModel.getTotalCount()
|
|
|
128 |
## #else
|
|
|
129 |
## -
|
|
|
130 |
## #end
|
|
|
131 |
## #else
|
|
|
132 |
## -
|
|
|
133 |
## #end
|
|
|
134 |
## </td>
|
|
|
135 |
## #end
|
|
|
136 |
## </tr>
|
|
|
137 |
## #end
|
|
|
138 |
## #end
|
|
|
139 |
## </tbody>
|
|
|
140 |
## </table>
|
| 31538 |
amit.gupta |
141 |
</div>
|
| 32938 |
amit.gupta |
142 |
#end
|
| 31254 |
amit.gupta |
143 |
<div class="container-fluid ">
|
| 33700 |
amit.gupta |
144 |
<h3>Total Collection(Overall Collection/Limit Utilization))</h3>
|
| 29994 |
amit.gupta |
145 |
<div class="row">
|
|
|
146 |
#foreach($warehouseEntry in $warehouseMap.entrySet())
|
| 31345 |
amit.gupta |
147 |
<div class="col-lg-2" style="font-size: 20px">
|
| 29994 |
amit.gupta |
148 |
$warehouseEntry.getValue() -
|
|
|
149 |
#if($warehouseCollectionMap.get($warehouseEntry.getKey()))
|
| 31250 |
amit.gupta |
150 |
<span class="currency">$warehouseCollectionMap.get($warehouseEntry.getKey())</span>
|
| 29994 |
amit.gupta |
151 |
#else
|
|
|
152 |
|
|
|
153 |
#end
|
| 31242 |
amit.gupta |
154 |
/
|
| 31250 |
amit.gupta |
155 |
#if($warehousePgCollectionMap.get($warehouseEntry.getKey()))
|
| 31251 |
amit.gupta |
156 |
<span class="currency">$warehousePgCollectionMap.get($warehouseEntry.getKey())</span>
|
| 31242 |
amit.gupta |
157 |
#else
|
|
|
158 |
|
|
|
159 |
#end
|
|
|
160 |
|
| 29994 |
amit.gupta |
161 |
</div>
|
|
|
162 |
#end
|
|
|
163 |
</div>
|
| 30784 |
amit.gupta |
164 |
</div>
|
| 30783 |
amit.gupta |
165 |
#parse("today_target.vm")
|
| 32938 |
amit.gupta |
166 |
#end
|
| 29983 |
amit.gupta |
167 |
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js"
|
|
|
168 |
integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo"
|
|
|
169 |
crossorigin="anonymous"></script>
|
|
|
170 |
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js"
|
|
|
171 |
integrity="sha384-ZMP7rVo3mIykV+2+9J3UJ46jBk0WLaUAdn689aCwoqbBJiSnjAK/l8WvCWPIPm49"
|
|
|
172 |
crossorigin="anonymous"></script>
|
|
|
173 |
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js"
|
|
|
174 |
integrity="sha384-ChfqqxuZUCnJSK3+MXmPNIyE6ZbWh2IMqE241rYiqJxyMiZ6OW/JmZQ5stwEULTy"
|
|
|
175 |
crossorigin="anonymous"></script>
|
| 30036 |
amit.gupta |
176 |
<script type="text/javascript">
|
|
|
177 |
function numberToComma(x) {
|
| 29966 |
amit.gupta |
178 |
|
| 30036 |
amit.gupta |
179 |
x = x.toString();
|
|
|
180 |
x = x.split('.');
|
|
|
181 |
var x1 = x[0];
|
|
|
182 |
var x2 = x.length > 1 && x[1] != '0' ? '.' + x[1] : '';
|
|
|
183 |
var lastThree = x1.substring(x1.length - 3);
|
|
|
184 |
var otherNumbers = x1.substring(0, x1.length - 3);
|
|
|
185 |
if (x1.charAt(x1.length - 4) == ',' || x1.charAt(x1.length - 4) == '-') {
|
|
|
186 |
console.log(lastThree)
|
|
|
187 |
} else {
|
|
|
188 |
if (otherNumbers != '')
|
|
|
189 |
lastThree = ',' + lastThree;
|
|
|
190 |
}
|
|
|
191 |
return otherNumbers.replace(/\B(?=(\d{2})+(?!\d))/g, ",") + (lastThree)
|
|
|
192 |
+ x2;
|
|
|
193 |
|
|
|
194 |
}
|
|
|
195 |
|
|
|
196 |
$(document).ready(function () {
|
|
|
197 |
$('.currency').each(function (index, ele) {
|
|
|
198 |
if (!isNaN(parseInt($(ele).html()))) {
|
|
|
199 |
$(ele).html(numberToComma($(ele).html()));
|
|
|
200 |
}
|
|
|
201 |
});
|
|
|
202 |
})
|
|
|
203 |
</script>
|
| 33991 |
ranu |
204 |
|
|
|
205 |
|
|
|
206 |
<script type="text/javascript" src="https://cdn.jsdelivr.net/jquery/latest/jquery.min.js"></script>
|
|
|
207 |
<script type="text/javascript" src="https://cdn.jsdelivr.net/momentjs/latest/moment.min.js"></script>
|
|
|
208 |
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/daterangepicker/daterangepicker.min.js"></script>
|
|
|
209 |
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/daterangepicker/daterangepicker.css"/>
|
|
|
210 |
|
|
|
211 |
<script>
|
|
|
212 |
// Initialize the date range picker
|
|
|
213 |
$('input[name="rbmArrPeriod"]').daterangepicker({
|
|
|
214 |
autoUpdateInput: false, // Prevent auto-filling the input with dates
|
|
|
215 |
locale: {
|
|
|
216 |
cancelLabel: 'Clear'
|
|
|
217 |
}
|
|
|
218 |
});
|
|
|
219 |
|
|
|
220 |
// Update the input field when dates are selected
|
|
|
221 |
$('input[name="rbmArrPeriod"]').on('apply.daterangepicker', function (ev, picker) {
|
|
|
222 |
$(this).val(picker.startDate.format('YYYY-MM-DD') + ' - ' + picker.endDate.format('YYYY-MM-DD'));
|
|
|
223 |
});
|
|
|
224 |
|
|
|
225 |
// Clear the input field when the user cancels
|
|
|
226 |
$('input[name="rbmArrPeriod"]').on('cancel.daterangepicker', function (ev, picker) {
|
|
|
227 |
$(this).val('');
|
|
|
228 |
});
|
|
|
229 |
|
|
|
230 |
// Function to get the dates from the picker
|
|
|
231 |
function getDatesFromPicker(selector) {
|
|
|
232 |
const pickerElement = $(selector).data('daterangepicker');
|
|
|
233 |
if (!pickerElement) {
|
|
|
234 |
console.error('Date Range Picker is not initialized.');
|
|
|
235 |
return {startDate: null, endDate: null};
|
|
|
236 |
}
|
|
|
237 |
return {
|
|
|
238 |
startDate: pickerElement.startDate.format('YYYY-MM-DD'),
|
|
|
239 |
endDate: pickerElement.endDate.format('YYYY-MM-DD')
|
|
|
240 |
};
|
|
|
241 |
}
|
|
|
242 |
|
|
|
243 |
// Button click event
|
|
|
244 |
$(document).on('click', '.sold-catalog-report', function () {
|
|
|
245 |
const dates = getDatesFromPicker('input[name="rbmArrPeriod"]');
|
|
|
246 |
const startDate = dates.startDate;
|
|
|
247 |
const endDate = dates.endDate;
|
|
|
248 |
|
|
|
249 |
if (!startDate || !endDate) {
|
|
|
250 |
alert("Start date and end date cannot be empty!!");
|
|
|
251 |
return;
|
|
|
252 |
}
|
|
|
253 |
|
|
|
254 |
let endPoint = `/downloadSoldCatalogReport?startDate=${startDate}&endDate=${endDate}`;
|
|
|
255 |
window.open(endPoint, '_blank');
|
|
|
256 |
;
|
|
|
257 |
});
|
| 33997 |
ranu |
258 |
|
| 35172 |
ranu |
259 |
|
| 33997 |
ranu |
260 |
// Button click event
|
| 35172 |
ranu |
261 |
$(document).on('click', '.partnerwise-billed-po', function () {
|
|
|
262 |
let endPoint = `/downloadModelBrandWisePo`;
|
|
|
263 |
window.open(endPoint, '_blank');
|
|
|
264 |
;
|
|
|
265 |
});
|
|
|
266 |
|
|
|
267 |
// Button click event
|
| 33997 |
ranu |
268 |
$(document).on('click', '.rbm-target-achievement', function () {
|
|
|
269 |
const dates = getDatesFromPicker('input[name="rbmArrPeriod"]');
|
|
|
270 |
const startDate = dates.startDate;
|
|
|
271 |
const endDate = dates.endDate;
|
|
|
272 |
|
|
|
273 |
if (!startDate || !endDate) {
|
|
|
274 |
alert("Start date and end date cannot be empty!!");
|
|
|
275 |
return;
|
|
|
276 |
}
|
|
|
277 |
|
|
|
278 |
let endPoint = `/getDateWiseRabmTargetAndAchievements?startDate=${startDate}&endDate=${endDate}`;
|
|
|
279 |
window.open(endPoint, '_blank');
|
|
|
280 |
;
|
|
|
281 |
});
|
| 33991 |
ranu |
282 |
</script>
|
| 35147 |
ranu |
283 |
|
|
|
284 |
<script>
|
|
|
285 |
$(document).on('change', '#userType', function () {
|
|
|
286 |
const selectedType = $(this).val();
|
|
|
287 |
if (selectedType) {
|
|
|
288 |
// Reload the same page with categoryType param
|
|
|
289 |
window.location.href = `/indent/today_po_rbm?categoryType=${selectedType}`;
|
|
|
290 |
}
|
|
|
291 |
});
|
|
|
292 |
|
|
|
293 |
// Keep dropdown selected on reload
|
|
|
294 |
$(document).ready(function () {
|
|
|
295 |
const urlParams = new URLSearchParams(window.location.search);
|
|
|
296 |
const selectedType = urlParams.get('categoryType');
|
|
|
297 |
if (selectedType) {
|
|
|
298 |
$('#userType').val(selectedType);
|
|
|
299 |
}
|
|
|
300 |
});
|
|
|
301 |
</script>
|
|
|
302 |
|
| 29966 |
amit.gupta |
303 |
</body>
|
|
|
304 |
</html>
|