Subversion Repositories SmartDukaan

Rev

Rev 33102 | Rev 33809 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

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