| 26053 |
amit.gupta |
1 |
$(document).on('click', 'a.list-group-item', function() {
|
| 26063 |
amit.gupta |
2 |
reportTitle = $(this).find('h4').html();
|
|
|
3 |
reportUrl = this.href;
|
| 26054 |
amit.gupta |
4 |
$reportModal = $('#report-modal');
|
| 26063 |
amit.gupta |
5 |
$reportModal.find('h4.modal-title').html(reportTitle);
|
| 31416 |
tejbeer |
6 |
if ($(this).data("paramslist") == undefined) {
|
| 26054 |
amit.gupta |
7 |
return true;
|
| 26053 |
amit.gupta |
8 |
} else {
|
|
|
9 |
var paramsList = $(this).data("paramslist");
|
|
|
10 |
paramsMap = {};
|
|
|
11 |
renderInputDialog(paramsList);
|
|
|
12 |
$reportModal.modal('show');
|
|
|
13 |
return false;
|
|
|
14 |
}
|
|
|
15 |
});
|
| 30163 |
manish |
16 |
|
|
|
17 |
|
|
|
18 |
|
|
|
19 |
$(document).on('click', ".invoice-scheme-out-report", function() {
|
| 31416 |
tejbeer |
20 |
|
| 30163 |
manish |
21 |
doGetAjaxRequestHandler(context + "/invoiceSchemeOutSummaryReport",
|
|
|
22 |
function(response) {
|
|
|
23 |
$('#' + 'main-content').html(response);
|
|
|
24 |
});
|
|
|
25 |
});
|
|
|
26 |
|
|
|
27 |
|
|
|
28 |
$(document).on('click', ".price-drop-report", function() {
|
| 31416 |
tejbeer |
29 |
|
| 30163 |
manish |
30 |
doGetAjaxRequestHandler(context + "/priceDropReport",
|
|
|
31 |
function(response) {
|
|
|
32 |
$('#' + 'main-content').html(response);
|
|
|
33 |
});
|
|
|
34 |
});
|
|
|
35 |
|
| 33094 |
shampa |
36 |
$(document).on('click', ".scheme-payout-report", function() {
|
| 31416 |
tejbeer |
37 |
|
| 30163 |
manish |
38 |
doGetAjaxRequestHandler(context + "/schemePayoutReport",
|
|
|
39 |
function(response) {
|
|
|
40 |
$('#' + 'main-content').html(response);
|
|
|
41 |
});
|
|
|
42 |
});
|
| 33094 |
shampa |
43 |
$(document).on('click', ".offer-payout-dump-report", function() {
|
| 33010 |
shampa |
44 |
console.log('HELLO');
|
|
|
45 |
doGetAjaxRequestHandler(context + "/offerPayoutReport",
|
|
|
46 |
function(response) {
|
|
|
47 |
$('#' + 'main-content').html(response);
|
|
|
48 |
});
|
|
|
49 |
});
|
| 30163 |
manish |
50 |
|
|
|
51 |
$(document).on('click', ".pending-indent", function() {
|
| 31416 |
tejbeer |
52 |
|
| 30163 |
manish |
53 |
doGetAjaxRequestHandler(context + "/pendingIndentReport",
|
|
|
54 |
function(response) {
|
|
|
55 |
$('#' + 'main-content').html(response);
|
|
|
56 |
});
|
|
|
57 |
});
|
| 33067 |
shampa |
58 |
$(document).on('click', '.pending-indent-fetch-report', function() {
|
|
|
59 |
var startDate = $("#startDate-pending-indent-report").val();
|
| 30163 |
manish |
60 |
|
| 33067 |
shampa |
61 |
var endDate = $("#endDate-pending-indent-report").val();
|
|
|
62 |
|
|
|
63 |
if (startDate == "" || startDate == undefined) {
|
|
|
64 |
|
|
|
65 |
alert("start date is not be empty!!");
|
|
|
66 |
return;
|
|
|
67 |
}
|
|
|
68 |
if (endDate == "" || endDate == undefined) {
|
|
|
69 |
|
|
|
70 |
alert("end date is not be empty!!");
|
|
|
71 |
return;
|
|
|
72 |
}
|
| 33092 |
tejus.loha |
73 |
let endPoint = `${context}/pendingIndentFetchReportByDate?startDate=${startDate}&endDate=${endDate}`;
|
|
|
74 |
if (typeof partnerId != "undefined") {
|
|
|
75 |
endPoint = `${endPoint}&fofoId=${partnerId}`;
|
|
|
76 |
}
|
|
|
77 |
|
|
|
78 |
doGetAjaxRequestHandler(endPoint,
|
|
|
79 |
function (response) {
|
| 33067 |
shampa |
80 |
$('#' + 'main-content').html(response);
|
|
|
81 |
});
|
|
|
82 |
});
|
|
|
83 |
|
|
|
84 |
|
|
|
85 |
|
| 30163 |
manish |
86 |
$(document).on('click', ".wallet_statement", function() {
|
|
|
87 |
doGetAjaxRequestHandler(context + "/walletSummaryReport",
|
|
|
88 |
function(response) {
|
|
|
89 |
$('#' + 'main-content').html(response);
|
|
|
90 |
});
|
|
|
91 |
});
|
|
|
92 |
|
|
|
93 |
|
| 33067 |
shampa |
94 |
$(document).on('click', ".partner-collection-summary", function() {
|
| 30163 |
manish |
95 |
doGetAjaxRequestHandler(context + "/collectionSummary",
|
|
|
96 |
function(response) {
|
|
|
97 |
$('#' + 'main-content').html(response);
|
|
|
98 |
});
|
|
|
99 |
});
|
|
|
100 |
|
|
|
101 |
|
|
|
102 |
$(document).on('click', '.download-collection-summary', function() {
|
| 31416 |
tejbeer |
103 |
var startDate = $("#startDate-collection-summary").val();
|
|
|
104 |
|
|
|
105 |
var endDate = $("#endDate-collection-summary").val();
|
|
|
106 |
|
|
|
107 |
if (startDate == "" || startDate == undefined) {
|
|
|
108 |
|
| 30163 |
manish |
109 |
alert("start date is not be empty!!");
|
|
|
110 |
return;
|
|
|
111 |
}
|
| 31416 |
tejbeer |
112 |
if (endDate == "" || endDate == undefined) {
|
|
|
113 |
|
|
|
114 |
alert("end date is not be empty!!");
|
| 30163 |
manish |
115 |
return;
|
|
|
116 |
}
|
| 33102 |
tejus.loha |
117 |
let endPoint = `${context}/downloadCollectionSummary?startDate=${startDate}&endDate=${endDate}`;
|
|
|
118 |
if (typeof partnerId != "undefined") {
|
|
|
119 |
endPoint = `${endPoint}&fofoId=${partnerId}`;
|
|
|
120 |
}
|
| 31416 |
tejbeer |
121 |
|
| 33102 |
tejus.loha |
122 |
window.location.href = endPoint;
|
|
|
123 |
|
| 30163 |
manish |
124 |
});
|
| 33010 |
shampa |
125 |
$(document).on('click', ".collection-summary-fetch-report", function() {
|
| 30163 |
manish |
126 |
|
| 33010 |
shampa |
127 |
var startDate = $("#startDate-collection-summary").val();
|
| 30163 |
manish |
128 |
|
| 33010 |
shampa |
129 |
var endDate = $("#endDate-collection-summary").val();
|
|
|
130 |
|
|
|
131 |
if (startDate == "" || startDate == undefined) {
|
|
|
132 |
alert("start date is not be empty!!");
|
|
|
133 |
return;
|
|
|
134 |
}
|
|
|
135 |
if (endDate == "" || endDate == undefined) {
|
|
|
136 |
|
|
|
137 |
alert("end date is not be empty!!");
|
|
|
138 |
return;
|
|
|
139 |
}
|
| 33092 |
tejus.loha |
140 |
let endPoint = `${context}/collectionSummaryFetchReportByDate?startDate=${startDate}&endDate=${endDate}`;
|
|
|
141 |
if (typeof partnerId != "undefined") {
|
|
|
142 |
endPoint = `${endPoint}&fofoId=${partnerId}`;
|
|
|
143 |
}
|
| 33010 |
shampa |
144 |
|
| 33092 |
tejus.loha |
145 |
doGetAjaxRequestHandler(endPoint,
|
|
|
146 |
function (response) {
|
|
|
147 |
$('#' + 'main-content').html(response);
|
|
|
148 |
});
|
|
|
149 |
|
|
|
150 |
|
| 33010 |
shampa |
151 |
});
|
|
|
152 |
|
|
|
153 |
|
| 30163 |
manish |
154 |
$(document).on('click', '.download-price-drop-report', function() {
|
| 31416 |
tejbeer |
155 |
var startDate = $("#startDate-price-drop-report").val();
|
|
|
156 |
|
|
|
157 |
var endDate = $("#endDate-price-drop-report").val();
|
|
|
158 |
|
|
|
159 |
if (startDate == "" || startDate == undefined) {
|
|
|
160 |
|
| 30163 |
manish |
161 |
alert("start date is not be empty!!");
|
|
|
162 |
return;
|
|
|
163 |
}
|
| 31416 |
tejbeer |
164 |
if (endDate == "" || endDate == undefined) {
|
|
|
165 |
|
|
|
166 |
alert("end date is not be empty!!");
|
| 30163 |
manish |
167 |
return;
|
|
|
168 |
}
|
| 33102 |
tejus.loha |
169 |
let endPoint = `${context}/downloadPriceDropReport?startDate=${startDate}&endDate=${endDate}`;
|
|
|
170 |
if (typeof partnerId != "undefined") {
|
|
|
171 |
endPoint = `${endPoint}&fofoId=${partnerId}`;
|
|
|
172 |
}
|
| 31416 |
tejbeer |
173 |
|
| 33102 |
tejus.loha |
174 |
window.location.href = endPoint;
|
|
|
175 |
|
|
|
176 |
|
| 30163 |
manish |
177 |
});
|
| 33010 |
shampa |
178 |
$(document).on('click', '.price-drop-fetch-report', function() {
|
|
|
179 |
var startDate = $("#startDate-price-drop-report").val();
|
| 30163 |
manish |
180 |
|
| 33010 |
shampa |
181 |
var endDate = $("#endDate-price-drop-report").val();
|
| 30163 |
manish |
182 |
|
| 33010 |
shampa |
183 |
if (startDate == "" || startDate == undefined) {
|
| 30163 |
manish |
184 |
|
| 33010 |
shampa |
185 |
alert("start date is not be empty!!");
|
|
|
186 |
return;
|
|
|
187 |
}
|
|
|
188 |
if (endDate == "" || endDate == undefined) {
|
| 30163 |
manish |
189 |
|
| 33010 |
shampa |
190 |
alert("end date is not be empty!!");
|
|
|
191 |
return;
|
|
|
192 |
}
|
| 33092 |
tejus.loha |
193 |
let endPoint = `${context}/priceDropFetchReportByDate?startDate=${startDate}&endDate=${endDate}`;
|
|
|
194 |
if (typeof partnerId != "undefined") {
|
|
|
195 |
endPoint = `${endPoint}&fofoId=${partnerId}`;
|
|
|
196 |
}
|
| 33010 |
shampa |
197 |
|
| 33092 |
tejus.loha |
198 |
doGetAjaxRequestHandler(endPoint,
|
|
|
199 |
function (response) {
|
|
|
200 |
$('#' + 'main-content').html(response);
|
|
|
201 |
});
|
|
|
202 |
|
| 33010 |
shampa |
203 |
});
|
|
|
204 |
|
|
|
205 |
|
|
|
206 |
|
|
|
207 |
|
| 30163 |
manish |
208 |
$(document).on('click', ".smartdukaan-billing-statement", function() {
|
|
|
209 |
console.log('HELO');
|
|
|
210 |
doGetAjaxRequestHandler(context + "/selectPartnerBillingSummaryReport",
|
|
|
211 |
function(response) {
|
|
|
212 |
$('#' + 'main-content').html(response);
|
|
|
213 |
});
|
|
|
214 |
});
|
|
|
215 |
|
|
|
216 |
|
|
|
217 |
$(document).on('click', '.download-invoicewise-scheme-out-report', function() {
|
| 31416 |
tejbeer |
218 |
|
| 30163 |
manish |
219 |
window.location.href = context + "/downloadInvoiceSchemeOutSummaryReport";
|
| 31416 |
tejbeer |
220 |
|
| 30163 |
manish |
221 |
});
|
|
|
222 |
|
|
|
223 |
$(document).on('click', ".download-pending-indent-report", function() {
|
| 33067 |
shampa |
224 |
var startDate = $("#startDate-pending-indent-report").val();
|
| 31416 |
tejbeer |
225 |
|
| 33067 |
shampa |
226 |
var endDate = $("#endDate-pending-indent-report").val();
|
| 30163 |
manish |
227 |
|
| 33067 |
shampa |
228 |
if (startDate == "" || startDate == undefined) {
|
|
|
229 |
alert("start date is not be empty!!");
|
|
|
230 |
return;
|
|
|
231 |
}
|
|
|
232 |
if (endDate == "" || endDate == undefined) {
|
| 33010 |
shampa |
233 |
|
| 33067 |
shampa |
234 |
alert("end date is not be empty!!");
|
|
|
235 |
return;
|
|
|
236 |
}
|
| 33010 |
shampa |
237 |
|
| 33102 |
tejus.loha |
238 |
let endPoint = `${context}/pendingIndentReportDownload?startDate=${startDate}&endDate=${endDate}`;
|
|
|
239 |
if (typeof partnerId != "undefined") {
|
|
|
240 |
endPoint = `${endPoint}&fofoId=${partnerId}`;
|
|
|
241 |
}
|
|
|
242 |
|
|
|
243 |
window.location.href = endPoint;
|
| 33010 |
shampa |
244 |
});
|
|
|
245 |
|
|
|
246 |
|
| 33067 |
shampa |
247 |
|
| 30163 |
manish |
248 |
$(document).on('click', ".download-scheme-payout-report", function() {
|
| 31416 |
tejbeer |
249 |
|
|
|
250 |
var startDate = $("#startDate-scheme-payout").val();
|
|
|
251 |
|
|
|
252 |
var endDate = $("#endDate-scheme-payout").val();
|
|
|
253 |
|
|
|
254 |
if (startDate == "" || startDate == undefined) {
|
|
|
255 |
alert("start date is not be empty!!");
|
|
|
256 |
return;
|
|
|
257 |
}
|
|
|
258 |
if (endDate == "" || endDate == undefined) {
|
|
|
259 |
|
|
|
260 |
alert("end date is not be empty!!");
|
|
|
261 |
return;
|
|
|
262 |
}
|
| 33102 |
tejus.loha |
263 |
let endPoint = `${context}/schemePayoutReportDownload?startDate=${startDate}&endDate=${endDate}`;
|
|
|
264 |
if (typeof partnerId != "undefined") {
|
|
|
265 |
endPoint = `${endPoint}&fofoId=${partnerId}`;
|
|
|
266 |
}
|
| 31416 |
tejbeer |
267 |
|
| 33102 |
tejus.loha |
268 |
window.location.href = endPoint;
|
| 30163 |
manish |
269 |
});
|
|
|
270 |
|
| 33010 |
shampa |
271 |
$(document).on('click', ".scheme-payout-fetch-report", function() {
|
|
|
272 |
|
|
|
273 |
var startDate = $("#startDate-scheme-payout").val();
|
|
|
274 |
|
|
|
275 |
var endDate = $("#endDate-scheme-payout").val();
|
|
|
276 |
|
|
|
277 |
if (startDate == "" || startDate == undefined) {
|
|
|
278 |
alert("start date is not be empty!!");
|
|
|
279 |
return;
|
|
|
280 |
}
|
|
|
281 |
if (endDate == "" || endDate == undefined) {
|
|
|
282 |
|
|
|
283 |
alert("end date is not be empty!!");
|
|
|
284 |
return;
|
|
|
285 |
}
|
|
|
286 |
|
| 33091 |
shampa |
287 |
let endPoint = `${context}/schemePayoutFetchReportByDate?startDate=${startDate}&endDate=${endDate}`;
|
|
|
288 |
if (typeof partnerId != "undefined") {
|
|
|
289 |
endPoint = `${endPoint}&fofoId=${partnerId}`;
|
|
|
290 |
}
|
|
|
291 |
|
|
|
292 |
doGetAjaxRequestHandler(endPoint,
|
|
|
293 |
function (response) {
|
|
|
294 |
$('#' + 'main-content').html(response);
|
|
|
295 |
});
|
| 33010 |
shampa |
296 |
});
|
|
|
297 |
|
|
|
298 |
$(document).on('click', ".download-offer-payout-dump-report", function() {
|
|
|
299 |
|
|
|
300 |
var startDate = $("#startDate-offer-payout-dump").val();
|
|
|
301 |
|
|
|
302 |
var endDate = $("#endDate-offer-payout-dump").val();
|
|
|
303 |
|
|
|
304 |
if (startDate == "" || startDate == undefined) {
|
|
|
305 |
alert("start date is not be empty!!");
|
|
|
306 |
return;
|
|
|
307 |
}
|
|
|
308 |
if (endDate == "" || endDate == undefined) {
|
|
|
309 |
|
|
|
310 |
alert("end date is not be empty!!");
|
|
|
311 |
return;
|
|
|
312 |
}
|
| 33102 |
tejus.loha |
313 |
let endPoint = `${context}/offerPayoutDumpReportDownload?startDate=${startDate}&endDate=${endDate}`;
|
|
|
314 |
if (typeof partnerId != "undefined") {
|
|
|
315 |
endPoint = `${endPoint}&fofoId=${partnerId}`;
|
|
|
316 |
}
|
| 33010 |
shampa |
317 |
|
| 33102 |
tejus.loha |
318 |
window.location.href = endPoint;
|
| 33010 |
shampa |
319 |
|
| 33102 |
tejus.loha |
320 |
|
|
|
321 |
|
|
|
322 |
|
| 33010 |
shampa |
323 |
});
|
|
|
324 |
$(document).on('click', ".offer-payout-fetch-report", function() {
|
|
|
325 |
|
|
|
326 |
var startDate = $("#startDate-offer-payout-dump").val();
|
|
|
327 |
|
|
|
328 |
var endDate = $("#endDate-offer-payout-dump").val();
|
|
|
329 |
|
|
|
330 |
if (startDate == "" || startDate == undefined) {
|
|
|
331 |
alert("start date is not be empty!!");
|
|
|
332 |
return;
|
|
|
333 |
}
|
|
|
334 |
if (endDate == "" || endDate == undefined) {
|
|
|
335 |
|
|
|
336 |
alert("end date is not be empty!!");
|
|
|
337 |
return;
|
|
|
338 |
}
|
| 33096 |
shampa |
339 |
let endPoint = `${context}/offerPayoutFetchReportByDate?startDate=${startDate}&endDate=${endDate}`;
|
|
|
340 |
if (typeof partnerId != "undefined") {
|
|
|
341 |
endPoint = `${endPoint}&fofoId=${partnerId}`;
|
|
|
342 |
}
|
| 33010 |
shampa |
343 |
|
| 33091 |
shampa |
344 |
doGetAjaxRequestHandler(endPoint,
|
|
|
345 |
function (response) {
|
|
|
346 |
$('#' + 'main-content').html(response);
|
|
|
347 |
});
|
| 33010 |
shampa |
348 |
});
|
|
|
349 |
|
|
|
350 |
|
| 30163 |
manish |
351 |
$(document).on('click', ".franchisee_sales", function() {
|
| 33010 |
shampa |
352 |
console.log('HELLO');
|
| 30163 |
manish |
353 |
doGetAjaxRequestHandler(context + "/franchiseeSalesReport",
|
|
|
354 |
function(response) {
|
|
|
355 |
$('#' + 'main-content').html(response);
|
|
|
356 |
});
|
|
|
357 |
});
|
| 33092 |
tejus.loha |
358 |
$(document).on('click', '.franchisee-sales-fetch-report', function () {
|
|
|
359 |
var startDate = $("#startDate-franchisee-sales").val();
|
| 30163 |
manish |
360 |
|
| 33092 |
tejus.loha |
361 |
var endDate = $("#endDate-franchisee-sales").val();
|
|
|
362 |
|
|
|
363 |
if (startDate == "" || startDate == undefined) {
|
|
|
364 |
|
|
|
365 |
alert("start date is not be empty!!");
|
|
|
366 |
return;
|
|
|
367 |
}
|
|
|
368 |
if (endDate == "" || endDate == undefined) {
|
|
|
369 |
|
|
|
370 |
alert("end date is not be empty!!");
|
|
|
371 |
return;
|
|
|
372 |
}
|
|
|
373 |
let endPoint = `${context}/franchiseeSalesFetchReportByDate?startDate=${startDate}&endDate=${endDate}`;
|
|
|
374 |
if (typeof partnerId != "undefined") {
|
|
|
375 |
endPoint = `${endPoint}&fofoId=${partnerId}`;
|
|
|
376 |
}
|
|
|
377 |
|
|
|
378 |
doGetAjaxRequestHandler(endPoint,
|
|
|
379 |
function (response) {
|
|
|
380 |
$('#' + 'main-content').html(response);
|
|
|
381 |
});
|
|
|
382 |
});
|
|
|
383 |
|
|
|
384 |
|
|
|
385 |
|
| 30163 |
manish |
386 |
$(document).on('click', '.download-wallet-summary-report', function() {
|
| 31416 |
tejbeer |
387 |
var startDate = $("#startDate-wallet-summary-report").val();
|
|
|
388 |
|
|
|
389 |
var endDate = $("#endDate-wallet-summary-report").val();
|
|
|
390 |
|
|
|
391 |
if (startDate == "" || startDate == undefined) {
|
|
|
392 |
alert("start date is not be empty!!");
|
| 30163 |
manish |
393 |
return;
|
|
|
394 |
}
|
| 31416 |
tejbeer |
395 |
if (endDate == "" || endDate == undefined) {
|
|
|
396 |
|
| 30163 |
manish |
397 |
alert("end date is not be empty!!");
|
|
|
398 |
return;
|
|
|
399 |
}
|
| 33102 |
tejus.loha |
400 |
let endPoint = `${context}/downloadWalletSummaryReport?startDate=${startDate}&endDate=${endDate}`;
|
|
|
401 |
if (typeof partnerId != "undefined") {
|
|
|
402 |
endPoint = `${endPoint}&fofoId=${partnerId}`;
|
|
|
403 |
}
|
|
|
404 |
window.location.href = endPoint;
|
| 30163 |
manish |
405 |
});
|
| 33010 |
shampa |
406 |
$(document).on('click', '.wallet-summary-fetch-report', function() {
|
|
|
407 |
var startDate = $("#startDate-wallet-summary-report").val();
|
| 30163 |
manish |
408 |
|
| 33010 |
shampa |
409 |
var endDate = $("#endDate-wallet-summary-report").val();
|
| 30163 |
manish |
410 |
|
| 33010 |
shampa |
411 |
if (startDate == "" || startDate == undefined) {
|
|
|
412 |
alert("start date is not be empty!!");
|
|
|
413 |
return;
|
|
|
414 |
}
|
|
|
415 |
if (endDate == "" || endDate == undefined) {
|
|
|
416 |
|
|
|
417 |
alert("end date is not be empty!!");
|
|
|
418 |
return;
|
|
|
419 |
}
|
| 33092 |
tejus.loha |
420 |
|
|
|
421 |
let endPoint = `${context}/walletSummaryFetchReportByDate?startDate=${startDate}&endDate=${endDate}`;
|
|
|
422 |
if (typeof partnerId != "undefined") {
|
|
|
423 |
endPoint = `${endPoint}&fofoId=${partnerId}`;
|
|
|
424 |
}
|
|
|
425 |
|
|
|
426 |
doGetAjaxRequestHandler(endPoint,
|
|
|
427 |
function (response) {
|
|
|
428 |
$('#' + 'main-content').html(response);
|
|
|
429 |
});
|
|
|
430 |
|
|
|
431 |
|
| 33010 |
shampa |
432 |
});
|
|
|
433 |
|
|
|
434 |
|
| 30163 |
manish |
435 |
$(document).on('click', '.download-partner-billing-report', function() {
|
| 31416 |
tejbeer |
436 |
var startDate = $("#startDate-partner-billing-report").val();
|
|
|
437 |
|
|
|
438 |
var endDate = $("#endDate-partner-billing-report").val();
|
|
|
439 |
|
|
|
440 |
if (startDate == "" || startDate == undefined) {
|
|
|
441 |
|
| 30163 |
manish |
442 |
alert("start date is not be empty!!");
|
|
|
443 |
return;
|
|
|
444 |
}
|
| 31416 |
tejbeer |
445 |
if (endDate == "" || endDate == undefined) {
|
|
|
446 |
|
| 30163 |
manish |
447 |
alert("end date is not be empty!!");
|
|
|
448 |
return;
|
|
|
449 |
}
|
| 33102 |
tejus.loha |
450 |
let endPoint = `${context}/downloadPartnerBillingSummaryReport?startDate=${startDate}&endDate=${endDate}`;
|
|
|
451 |
if (typeof partnerId != "undefined") {
|
|
|
452 |
endPoint = `${endPoint}&fofoId=${partnerId}`;
|
|
|
453 |
}
|
|
|
454 |
|
|
|
455 |
window.location.href = endPoint;
|
| 30163 |
manish |
456 |
});
|
| 33010 |
shampa |
457 |
$(document).on('click', '.billing-summary-fetch-report', function() {
|
|
|
458 |
var startDate = $("#startDate-partner-billing-report").val();
|
| 30163 |
manish |
459 |
|
| 33010 |
shampa |
460 |
var endDate = $("#endDate-partner-billing-report").val();
|
|
|
461 |
|
|
|
462 |
if (startDate == "" || startDate == undefined) {
|
|
|
463 |
|
|
|
464 |
alert("start date is not be empty!!");
|
|
|
465 |
return;
|
|
|
466 |
}
|
|
|
467 |
if (endDate == "" || endDate == undefined) {
|
|
|
468 |
|
|
|
469 |
alert("end date is not be empty!!");
|
|
|
470 |
return;
|
|
|
471 |
}
|
|
|
472 |
doGetAjaxRequestHandler(context + "/selectPartnerBillingSummaryReport",
|
|
|
473 |
function(response) {
|
|
|
474 |
$('#' + 'main-content').html(response);
|
|
|
475 |
});
|
|
|
476 |
});
|
|
|
477 |
|
| 30163 |
manish |
478 |
$(document).on('click', '.download-franchisee-sales', function() {
|
| 31416 |
tejbeer |
479 |
var startDate = $("#startDate-franchisee-sales").val();
|
|
|
480 |
|
|
|
481 |
var endDate = $("#endDate-franchisee-sales").val();
|
|
|
482 |
|
|
|
483 |
if (startDate == "" || startDate == undefined) {
|
|
|
484 |
|
| 30163 |
manish |
485 |
alert("start date is not be empty!!");
|
|
|
486 |
return;
|
|
|
487 |
}
|
| 31416 |
tejbeer |
488 |
if (endDate == "" || endDate == undefined) {
|
|
|
489 |
|
| 30163 |
manish |
490 |
alert("end date is not be empty!!");
|
|
|
491 |
return;
|
|
|
492 |
}
|
| 33102 |
tejus.loha |
493 |
let endPoint = `${context}/downloadFranchiseeSales?startDate=${startDate}&endDate=${endDate}`;
|
|
|
494 |
if (typeof partnerId != "undefined") {
|
|
|
495 |
endPoint = `${endPoint}&fofoId=${partnerId}`;
|
|
|
496 |
}
|
|
|
497 |
window.location.href = endPoint;
|
| 30163 |
manish |
498 |
});
|
| 31416 |
tejbeer |
499 |
$(document).on('click', 'button.download-report', function() {
|
| 26054 |
amit.gupta |
500 |
var reportParams = {};
|
| 26153 |
amit.gupta |
501 |
var validated = true;
|
| 26134 |
amit.gupta |
502 |
$inputContainer.find("input.param,select.param").each(function(idx, inputElement) {
|
| 26054 |
amit.gupta |
503 |
var inputName = $(inputElement).attr("name");
|
| 31416 |
tejbeer |
504 |
if (typeof inputName === "undefined" || !(inputName in paramsMap)) {
|
| 26089 |
amit.gupta |
505 |
console.log(inputName);
|
|
|
506 |
return;
|
|
|
507 |
}
|
|
|
508 |
param = paramsMap[inputName];
|
| 31416 |
tejbeer |
509 |
if ($(inputElement).val() == "") {
|
| 26089 |
amit.gupta |
510 |
bootbox.alert(`${param.displayName} is required`);
|
| 26153 |
amit.gupta |
511 |
validated = false;
|
| 26148 |
amit.gupta |
512 |
return false;
|
| 26054 |
amit.gupta |
513 |
}
|
| 31416 |
tejbeer |
514 |
if (param.type == 'DATE') {
|
| 30599 |
amit.gupta |
515 |
reportParams[`MANUAL_${inputName}`] = getReporticoDatesFromPicker(inputElement).startDate;
|
| 31416 |
tejbeer |
516 |
} else if (param.type == 'DATE_RANGE') {
|
| 30599 |
amit.gupta |
517 |
reportParams[`MANUAL_${inputName}_FROMDATE`] = getReporticoDatesFromPicker(inputElement).startDate;
|
|
|
518 |
reportParams[`MANUAL_${inputName}_TODATE`] = getReporticoDatesFromPicker(inputElement).endDate;
|
| 26054 |
amit.gupta |
519 |
} else {
|
| 31416 |
tejbeer |
520 |
if (['code', 'warehouseId'].indexOf(param.name) >= 0) {
|
|
|
521 |
if (typeof $(inputElement).val() == "string") {
|
| 26204 |
amit.gupta |
522 |
reportParams[`${inputName}`] = $(inputElement).val();
|
| 26167 |
amit.gupta |
523 |
} else {
|
| 26204 |
amit.gupta |
524 |
reportParams[`${inputName}`] = $(inputElement).val().join(",");
|
| 26157 |
amit.gupta |
525 |
}
|
| 26116 |
amit.gupta |
526 |
|
| 26089 |
amit.gupta |
527 |
} else {
|
|
|
528 |
reportParams[`MANUAL_${inputName}`] = $(inputElement).val();
|
|
|
529 |
}
|
| 26054 |
amit.gupta |
530 |
}
|
|
|
531 |
});
|
| 31416 |
tejbeer |
532 |
if (validated) {
|
| 26153 |
amit.gupta |
533 |
var jsonParams = JSON.stringify(reportParams);
|
|
|
534 |
doAjaxPostDownload(reportUrl, jsonParams, `${reportTitle}.csv`);
|
|
|
535 |
}
|
| 31416 |
tejbeer |
536 |
|
| 26054 |
amit.gupta |
537 |
});
|
| 26053 |
amit.gupta |
538 |
function renderInputDialog(paramsList) {
|
| 26054 |
amit.gupta |
539 |
$reportModal = $('div#report-modal');
|
|
|
540 |
$inputContainer = $reportModal.find('div.modal-body');
|
|
|
541 |
//Clear container first
|
|
|
542 |
$inputContainer.html('');
|
| 26053 |
amit.gupta |
543 |
paramsList.forEach(function(value) {
|
|
|
544 |
paramsMap[value.name] = value;
|
|
|
545 |
renderInput($inputContainer, value);
|
|
|
546 |
});
|
|
|
547 |
}
|
|
|
548 |
|
| 26054 |
amit.gupta |
549 |
function renderInput($inputContainer, param) {
|
|
|
550 |
console.log(param.type);
|
| 26053 |
amit.gupta |
551 |
switch (param.type) {
|
|
|
552 |
case "DATE": {
|
| 26054 |
amit.gupta |
553 |
$inputContainer.append(`<div class="form-group">
|
| 26053 |
amit.gupta |
554 |
<label>${param.displayText}</label>
|
| 26146 |
amit.gupta |
555 |
<input name="${param.name}" type="text" value="" class="param form-control input-sm">
|
| 26053 |
amit.gupta |
556 |
</div>`);
|
| 30599 |
amit.gupta |
557 |
$inputContainer.find(`input[name="${param.name}"]`).daterangepicker(getSingleDatePicker());
|
| 26054 |
amit.gupta |
558 |
return;
|
| 26053 |
amit.gupta |
559 |
}
|
| 31416 |
tejbeer |
560 |
case "DATE_RANGE": {
|
| 26054 |
amit.gupta |
561 |
$inputContainer.append(`<div class="form-group">
|
| 26053 |
amit.gupta |
562 |
<label>${param.displayText}</label>
|
| 26134 |
amit.gupta |
563 |
<input name="${param.name}" type="text" value="" class="param form-control input-sm">
|
| 26053 |
amit.gupta |
564 |
</div>`);
|
| 30599 |
amit.gupta |
565 |
$inputContainer.find(`input[name="${param.name}"]`).daterangepicker(getRangedDatePicker(true));
|
| 26054 |
amit.gupta |
566 |
return;
|
| 26053 |
amit.gupta |
567 |
}
|
|
|
568 |
case "STRING": {
|
| 31416 |
tejbeer |
569 |
if (param.name == "authId") {
|
| 26154 |
amit.gupta |
570 |
$inputContainer.append(`
|
|
|
571 |
<input type="hidden" name="${param.name}" type="text" value="${authId}" class="param form-control input-sm">`);
|
| 26155 |
amit.gupta |
572 |
} else {
|
|
|
573 |
$inputContainer.append(`<div class="form-group">
|
|
|
574 |
<label>${param.displayText}</label>
|
|
|
575 |
<input name="${param.name}" type="text" value="" class="param form-control input-sm">
|
|
|
576 |
</div>`);
|
| 26142 |
amit.gupta |
577 |
}
|
| 26054 |
amit.gupta |
578 |
return;
|
| 26053 |
amit.gupta |
579 |
}
|
| 31416 |
tejbeer |
580 |
case "LIST": {
|
|
|
581 |
if (param.name == "code") {
|
| 26089 |
amit.gupta |
582 |
var arr = [];
|
| 31416 |
tejbeer |
583 |
if (retailers.length == 1) {
|
| 26157 |
amit.gupta |
584 |
$inputContainer.append(`<input type="hidden" name="${param.name}" type="text" value="${authId}" class="param form-control input-sm">`)
|
|
|
585 |
} else {
|
| 31416 |
tejbeer |
586 |
for (var i in retailers) {
|
| 26157 |
amit.gupta |
587 |
arr.push(`<option value="${retailers[i].code}">${retailers[i].displayName}-${retailers[i].code}</option>`);
|
|
|
588 |
}
|
|
|
589 |
var options = arr.join("");
|
|
|
590 |
$inputContainer.append(`<div class="col-lg-2 form-group">
|
|
|
591 |
<label>${param.displayText}</label>
|
|
|
592 |
<select class="param form-control input-sm" id="code" multiple="multiple" name="${param.name}">
|
| 26089 |
amit.gupta |
593 |
<option value="" disabled selected>Select Franchisee</option>
|
|
|
594 |
${options}
|
| 26157 |
amit.gupta |
595 |
</select>
|
|
|
596 |
</div>`);
|
| 31416 |
tejbeer |
597 |
|
| 26157 |
amit.gupta |
598 |
$('#code').multiselect({
|
|
|
599 |
includeSelectAllOption: true,
|
| 31416 |
tejbeer |
600 |
multiple: true,
|
| 26157 |
amit.gupta |
601 |
maxHeight: 200,
|
|
|
602 |
buttonWidth: '180px',
|
|
|
603 |
numberDisplayed: 1,
|
|
|
604 |
nonSelectedText: 'Franchisee',
|
|
|
605 |
nSelectedText: ' - Franchisees Selected',
|
|
|
606 |
allSelectedText: 'All Franchisees',
|
|
|
607 |
enableFiltering: true,
|
| 31416 |
tejbeer |
608 |
enableCaseInsensitiveFiltering: true
|
| 26157 |
amit.gupta |
609 |
});
|
|
|
610 |
}
|
| 31416 |
tejbeer |
611 |
} else if (param.name == "warehouseId") {
|
| 26134 |
amit.gupta |
612 |
var arr = [];
|
| 31416 |
tejbeer |
613 |
for (var i in warehouses) {
|
| 26134 |
amit.gupta |
614 |
arr.push(`<option value="${i}">${warehouses[i]}</option>`);
|
|
|
615 |
}
|
|
|
616 |
var options = arr.join("");
|
|
|
617 |
$inputContainer.append(`<div class="col-lg-2 form-group">
|
|
|
618 |
<label>${param.displayText}</label>
|
|
|
619 |
<select class="param form-control input-sm" id="code" multiple="multiple" name="${param.name}">
|
|
|
620 |
<option value="" disabled selected>Select Warehouses</option>
|
|
|
621 |
${options}
|
|
|
622 |
</select>
|
|
|
623 |
</div>`);
|
| 31416 |
tejbeer |
624 |
|
| 26134 |
amit.gupta |
625 |
$('#code').multiselect({
|
|
|
626 |
includeSelectAllOption: true,
|
| 31416 |
tejbeer |
627 |
multiple: true,
|
| 26134 |
amit.gupta |
628 |
maxHeight: 200,
|
|
|
629 |
buttonWidth: '180px',
|
|
|
630 |
numberDisplayed: 1,
|
|
|
631 |
nonSelectedText: 'Warehouses',
|
|
|
632 |
nSelectedText: ' - Warehouse Selected',
|
|
|
633 |
allSelectedText: 'All Warehouses',
|
|
|
634 |
enableFiltering: true,
|
| 31416 |
tejbeer |
635 |
enableCaseInsensitiveFiltering: true
|
| 26134 |
amit.gupta |
636 |
});
|
|
|
637 |
} else {
|
| 26089 |
amit.gupta |
638 |
$inputContainer.append(`<div class="form-group">
|
|
|
639 |
<label>${param.displayText}(Comma Separated)</label>
|
| 26134 |
amit.gupta |
640 |
<input name="${param.name}" type="text" value="" class="param form-control input-sm">
|
| 26089 |
amit.gupta |
641 |
</div>`);
|
|
|
642 |
}
|
| 26054 |
amit.gupta |
643 |
return;
|
| 26053 |
amit.gupta |
644 |
}
|
|
|
645 |
}
|
|
|
646 |
}
|