| 23343 |
ashik.ali |
1 |
$(function() {
|
| 27754 |
amit.gupta |
2 |
$(document).on('click', ".create-scheme", function() {
|
| 23343 |
ashik.ali |
3 |
loadScheme("main-content");
|
|
|
4 |
});
|
| 23752 |
govind |
5 |
|
| 30054 |
manish |
6 |
|
| 27755 |
amit.gupta |
7 |
$(document).on('click', "#schemes-paginated .next",
|
| 28134 |
tejbeer |
8 |
function() {
|
|
|
9 |
var category = $('#partner-category').val();
|
|
|
10 |
var searchText = $("#scheme-item-search-text").val();
|
| 26802 |
tejbeer |
11 |
|
| 28134 |
tejbeer |
12 |
var category = $('#partner-category').val();
|
|
|
13 |
if (typeof (searchText) == "undefined" || !searchText) {
|
|
|
14 |
searchText = "";
|
|
|
15 |
}
|
|
|
16 |
if (typeof (category) == "undefined" || !category) {
|
|
|
17 |
category = "";
|
|
|
18 |
}
|
| 23752 |
govind |
19 |
|
| 28134 |
tejbeer |
20 |
if ((searchText) && (category)) {
|
| 26802 |
tejbeer |
21 |
|
| 28134 |
tejbeer |
22 |
var params = {};
|
|
|
23 |
params['searchItem'] = currentItem.itemId;
|
|
|
24 |
params['partnerType'] = category
|
|
|
25 |
loadPaginatedNextItems('/getPaginatedSchemes', params,
|
|
|
26 |
'schemes-paginated', 'schemes-table',
|
|
|
27 |
'scheme-details-container');
|
| 26763 |
tejbeer |
28 |
|
| 28134 |
tejbeer |
29 |
} else if ((searchText)) {
|
|
|
30 |
var params = {};
|
|
|
31 |
params['searchItem'] = currentItem.itemId;
|
|
|
32 |
loadPaginatedNextItems('/getPaginatedSchemes', params,
|
|
|
33 |
'schemes-paginated', 'schemes-table',
|
|
|
34 |
'scheme-details-container');
|
| 26802 |
tejbeer |
35 |
|
| 28134 |
tejbeer |
36 |
} else {
|
|
|
37 |
var params = {};
|
|
|
38 |
params['partnerType'] = category
|
|
|
39 |
loadPaginatedNextItems('/getPaginatedSchemes', params,
|
|
|
40 |
'schemes-paginated', 'schemes-table',
|
|
|
41 |
'scheme-details-container');
|
|
|
42 |
}
|
|
|
43 |
$(this).blur();
|
|
|
44 |
});
|
| 23752 |
govind |
45 |
|
| 27755 |
amit.gupta |
46 |
$(document).on('click', "#schemes-paginated .previous",
|
| 28134 |
tejbeer |
47 |
function() {
|
|
|
48 |
var searchText = $("#scheme-item-search-text").val();
|
|
|
49 |
var category = $('#partner-category').val();
|
|
|
50 |
// var searchTxt=$("#scheme-search-text").val();
|
|
|
51 |
console.log(searchText);
|
|
|
52 |
if (typeof (searchText) == "undefined" || !searchText) {
|
|
|
53 |
searchText = "";
|
|
|
54 |
}
|
|
|
55 |
if (typeof (category) == "undefined" || !category) {
|
|
|
56 |
category = "";
|
|
|
57 |
}
|
| 23752 |
govind |
58 |
|
| 28134 |
tejbeer |
59 |
console.log(searchText)
|
| 26802 |
tejbeer |
60 |
|
| 28134 |
tejbeer |
61 |
if ((searchText) && (category)) {
|
| 26802 |
tejbeer |
62 |
|
| 28134 |
tejbeer |
63 |
var params = {};
|
|
|
64 |
params['searchItem'] = currentItem.itemId;
|
|
|
65 |
params['partnerType'] = category
|
|
|
66 |
loadPaginatedPreviousItems('/getPaginatedSchemes', params,
|
|
|
67 |
'schemes-paginated', 'schemes-table',
|
|
|
68 |
'scheme-details-container');
|
| 26763 |
tejbeer |
69 |
|
| 28134 |
tejbeer |
70 |
} else if ((searchText)) {
|
|
|
71 |
var params = {};
|
|
|
72 |
params['searchItem'] = currentItem.itemId;
|
|
|
73 |
loadPaginatedPreviousItems('/getPaginatedSchemes', params,
|
|
|
74 |
'schemes-paginated', 'schemes-table',
|
|
|
75 |
'scheme-details-container');
|
| 26763 |
tejbeer |
76 |
|
| 28134 |
tejbeer |
77 |
} else {
|
|
|
78 |
var params = {};
|
|
|
79 |
params['partnerType'] = category
|
|
|
80 |
loadPaginatedPreviousItems('/getPaginatedSchemes', params,
|
|
|
81 |
'schemes-paginated', 'schemes-table',
|
|
|
82 |
'scheme-details-container');
|
|
|
83 |
}
|
|
|
84 |
$(this).blur();
|
|
|
85 |
});
|
| 23752 |
govind |
86 |
|
| 27754 |
amit.gupta |
87 |
$(document).on('click', ".scheme-details", function() {
|
| 23343 |
ashik.ali |
88 |
var schemeId = $(this).attr('data');
|
| 23752 |
govind |
89 |
console.log("schemeId = " + schemeId);
|
| 23343 |
ashik.ali |
90 |
loadSchemeDetails(schemeId, "scheme-details-container");
|
|
|
91 |
});
|
| 23752 |
govind |
92 |
|
| 27754 |
amit.gupta |
93 |
$(document).on('click', ".active-scheme", function() {
|
| 23343 |
ashik.ali |
94 |
var schemeId = $(this).attr('data');
|
| 23752 |
govind |
95 |
console.log("active-scheme id : " + schemeId);
|
|
|
96 |
var start = $("#schemes-paginated .start").text();
|
|
|
97 |
// var end = $( "#schemes-paginated .end" ).text();
|
| 23343 |
ashik.ali |
98 |
var offset = start - 1;
|
| 23752 |
govind |
99 |
if (confirm("Are you sure you want to Active Scheme!") == true) {
|
| 23343 |
ashik.ali |
100 |
activeScheme(schemeId, offset, "schemes-table");
|
|
|
101 |
}
|
|
|
102 |
});
|
| 23752 |
govind |
103 |
|
| 27754 |
amit.gupta |
104 |
$(document).on('click', ".expire-scheme", function() {
|
| 23343 |
ashik.ali |
105 |
var schemeId = $(this).attr('data');
|
| 25069 |
amit.gupta |
106 |
var expireDate = startDate;
|
| 23752 |
govind |
107 |
var start = $("#schemes-paginated .start").text();
|
|
|
108 |
// var end = $( "#schemes-paginated .end" ).text();
|
| 23343 |
ashik.ali |
109 |
var offset = start - 1;
|
| 23752 |
govind |
110 |
if (confirm("Are you sure you want to Expire Scheme!") == true) {
|
| 25069 |
amit.gupta |
111 |
expireScheme(schemeId, expireDate, offset, "schemes-table");
|
| 23343 |
ashik.ali |
112 |
}
|
|
|
113 |
});
|
| 27755 |
amit.gupta |
114 |
$(document).on('click', "#extendDatetime-button",
|
| 28134 |
tejbeer |
115 |
function() {
|
|
|
116 |
console.log("extendAll button click");
|
|
|
117 |
var extendDatetime = $('input[name="extendDatetime"]')
|
|
|
118 |
.val();
|
|
|
119 |
console.log("extendDatetime : " + extendDatetime);
|
|
|
120 |
if (extendDatetime) {
|
|
|
121 |
if (confirm("Are you sure you want to Extend expireDateTime for All Scheme!") == true) {
|
|
|
122 |
extendAllScheme(extendDatetime, "schemes-table")
|
|
|
123 |
}
|
|
|
124 |
} else {
|
|
|
125 |
alert("feild can't be blank");
|
|
|
126 |
}
|
|
|
127 |
});
|
| 27755 |
amit.gupta |
128 |
$(document).on('click', "#extendScheme-button",
|
| 28134 |
tejbeer |
129 |
function() {
|
|
|
130 |
console.log("extend button click");
|
|
|
131 |
var extendDatetime = $('input[name="extendScheme"]')
|
|
|
132 |
.val();
|
|
|
133 |
var schemeId = $('#schemeId').val()
|
|
|
134 |
console.log("extendDatetime : " + extendDatetime);
|
|
|
135 |
console.log(schemeId);
|
|
|
136 |
if (extendDatetime) {
|
|
|
137 |
if (confirm("Are you sure you want to Extend expireDateTime for Scheme!") == true) {
|
|
|
138 |
extendSchemeById(schemeId)
|
|
|
139 |
}
|
|
|
140 |
} else {
|
| 30054 |
manish |
141 |
alert("field can't be blank");
|
| 29759 |
amit.gupta |
142 |
}
|
| 28134 |
tejbeer |
143 |
});
|
| 29586 |
manish |
144 |
|
|
|
145 |
|
|
|
146 |
$(document).on('click', ".monthy-investment",
|
|
|
147 |
function() {
|
|
|
148 |
console.log("hello evaluateActualInvestmentPayout");
|
|
|
149 |
window.location.href = context + "/evaluateActualInvestmentPayout";
|
|
|
150 |
|
|
|
151 |
});
|
|
|
152 |
|
| 30054 |
manish |
153 |
$(document).on('click', ".process-investment", function() {
|
| 29759 |
amit.gupta |
154 |
if (confirm("Are you sure you want to Process Investment")) {
|
| 29761 |
amit.gupta |
155 |
processInvestment();
|
| 29759 |
amit.gupta |
156 |
}
|
|
|
157 |
});
|
|
|
158 |
|
| 30054 |
manish |
159 |
|
| 29586 |
manish |
160 |
$(document).on('click', ".processInvestmentDryRun",
|
|
|
161 |
function() {
|
|
|
162 |
console.log("processInvestmentDryRun");
|
|
|
163 |
window.location.href = context + "/processInvestmentDryRun";
|
|
|
164 |
|
|
|
165 |
});
|
|
|
166 |
|
| 30054 |
manish |
167 |
$(document).on('click', ".brand-wise-income",
|
|
|
168 |
function() {
|
|
|
169 |
var brand = $(this).data('brand');
|
| 29586 |
manish |
170 |
|
| 30054 |
manish |
171 |
var status = $(this).data('status');
|
|
|
172 |
var month = $(this).data('month');
|
| 29586 |
manish |
173 |
|
| 30054 |
manish |
174 |
brandWiseIncome(brand,month,status);
|
|
|
175 |
|
|
|
176 |
});
|
| 29586 |
manish |
177 |
|
| 30054 |
manish |
178 |
$(document).on('click', ".imei_wise_income",
|
|
|
179 |
function() {
|
|
|
180 |
|
|
|
181 |
|
|
|
182 |
var catalogItemId = $(this).data('catalogitemid');
|
|
|
183 |
var month = $(this).data('month');
|
|
|
184 |
|
|
|
185 |
console.log(catalogItemId);
|
|
|
186 |
imeiWiseIncome(catalogItemId,month);
|
|
|
187 |
|
|
|
188 |
});
|
|
|
189 |
|
|
|
190 |
$(document).on('change', "#month-wise-income", function() {
|
|
|
191 |
var month = $(this).val();
|
|
|
192 |
|
|
|
193 |
monthWiseIncome(month,"main-content");
|
|
|
194 |
});
|
|
|
195 |
|
|
|
196 |
|
|
|
197 |
|
| 23752 |
govind |
198 |
|
| 27754 |
amit.gupta |
199 |
$(document).on('click', ".schemes", function() {
|
| 23347 |
ashik.ali |
200 |
console.log("Active Schemes Button Clicked...")
|
| 28134 |
tejbeer |
201 |
|
|
|
202 |
bootbox.confirm({
|
|
|
203 |
message: "<div class = 'disclosurehindata'> <img src='resources/images/disclosure.png' style='width:100%'> </div>"
|
|
|
204 |
,
|
|
|
205 |
buttons: {
|
|
|
206 |
confirm: {
|
|
|
207 |
label: 'I agree',
|
|
|
208 |
className: 'btn-success'
|
|
|
209 |
},
|
|
|
210 |
cancel: {
|
|
|
211 |
label: 'I disagree',
|
|
|
212 |
className: 'btn-danger'
|
|
|
213 |
}
|
|
|
214 |
},
|
|
|
215 |
callback: function(result) {
|
|
|
216 |
if (result == true) {
|
|
|
217 |
schemes("main-content");
|
|
|
218 |
}
|
|
|
219 |
}
|
|
|
220 |
});
|
|
|
221 |
|
| 23347 |
ashik.ali |
222 |
});
|
| 23752 |
govind |
223 |
|
| 28134 |
tejbeer |
224 |
$(document).on('click', ".margin-calculator", function() {
|
| 27648 |
tejbeer |
225 |
console.log("Active Schemes Button Clicked...")
|
| 28134 |
tejbeer |
226 |
marginCalculator("main-content");
|
| 27648 |
tejbeer |
227 |
});
|
|
|
228 |
|
| 27754 |
amit.gupta |
229 |
$(document).on('click', ".schemes-download-page", function() {
|
| 23347 |
ashik.ali |
230 |
console.log("Schemes Download Clicked...")
|
|
|
231 |
loadSchemesDownloadPage("main-content");
|
| 22860 |
ashik.ali |
232 |
});
|
| 23752 |
govind |
233 |
|
| 27754 |
amit.gupta |
234 |
$(document).on('click', ".schemes-update", function() {
|
| 23556 |
amit.gupta |
235 |
loadSchemeUpdatePage("main-content");
|
|
|
236 |
});
|
| 23557 |
amit.gupta |
237 |
|
| 27754 |
amit.gupta |
238 |
$(document).on('click', ".add-item", function() {
|
| 23928 |
govind |
239 |
|
|
|
240 |
schemeIds = $("#schemeids").val();
|
|
|
241 |
itemIds = $("#itemids").val();
|
|
|
242 |
console.log(schemeIds);
|
|
|
243 |
console.log(itemIds);
|
|
|
244 |
if (confirm("Are you sure you want to Add Item to Scheme!") == true) {
|
| 26763 |
tejbeer |
245 |
if (itemIds.trim().length === 0 || schemeIds.trim().length === 0) {
|
|
|
246 |
alert("fields shouldn't be blank");
|
|
|
247 |
return;
|
|
|
248 |
}
|
|
|
249 |
updateSingleScheme(schemeIds, itemIds);
|
| 23928 |
govind |
250 |
}
|
|
|
251 |
});
|
| 27754 |
amit.gupta |
252 |
$(document).on('click', ".add-schemes", function() {
|
| 23752 |
govind |
253 |
|
| 23557 |
amit.gupta |
254 |
schemeIds = $("#schemeids").val();
|
|
|
255 |
itemIds = $("#itemids").val();
|
| 23914 |
govind |
256 |
console.log(schemeIds);
|
|
|
257 |
console.log(itemIds);
|
|
|
258 |
if (confirm("Are you sure you want to Add Item to Scheme!") == true) {
|
| 26763 |
tejbeer |
259 |
if (itemIds.trim().length === 0 || schemeIds.trim().length === 0) {
|
|
|
260 |
alert("fields shouldn't be blank");
|
|
|
261 |
return;
|
|
|
262 |
}
|
|
|
263 |
updateSchemes(schemeIds, itemIds);
|
| 23557 |
amit.gupta |
264 |
}
|
|
|
265 |
});
|
| 27754 |
amit.gupta |
266 |
$(document).on('click', ".delete-schemes", function() {
|
| 23819 |
govind |
267 |
if (confirm("Are you sure you want to delete Scheme!") == true) {
|
| 23914 |
govind |
268 |
schemeId = $(this).data('schemeid');
|
|
|
269 |
itemId = $(this).data('itemid');
|
|
|
270 |
console.log(schemeId);
|
|
|
271 |
console.log(itemId);
|
|
|
272 |
deleteScheme(schemeId, itemId);
|
| 23715 |
govind |
273 |
}
|
| 23752 |
govind |
274 |
});
|
|
|
275 |
|
| 27755 |
amit.gupta |
276 |
$(document).on('click', "#scheme-search-button",
|
| 28134 |
tejbeer |
277 |
function() {
|
|
|
278 |
var searchText = $("#scheme-search-text").val();
|
|
|
279 |
if (typeof (searchText) == "undefined" || !searchText) {
|
|
|
280 |
searchText = "";
|
|
|
281 |
}
|
|
|
282 |
doGetAjaxRequestHandler(context + "/getSchemes?searchTerm="
|
|
|
283 |
+ searchText, function(response) {
|
| 26802 |
tejbeer |
284 |
$('#' + "main-content").html(response);
|
|
|
285 |
});
|
| 28134 |
tejbeer |
286 |
});
|
| 26802 |
tejbeer |
287 |
|
| 27754 |
amit.gupta |
288 |
$(document).on("keyup", "#scheme-search-text", function(e) {
|
| 23752 |
govind |
289 |
var keyCode = e.keyCode || e.which;
|
|
|
290 |
if (keyCode == 13) {
|
|
|
291 |
$("#scheme-search-button").click();
|
|
|
292 |
}
|
|
|
293 |
});
|
| 27754 |
amit.gupta |
294 |
$(document).on('click', "#scheme-item-search-button", function() {
|
| 23752 |
govind |
295 |
var searchText = $("#scheme-item-search-text").val();
|
| 27875 |
amit.gupta |
296 |
var date = $(".schemes-date").val();
|
| 23752 |
govind |
297 |
if (typeof (searchText) == "undefined" || !searchText) {
|
|
|
298 |
searchText = "";
|
| 26497 |
amit.gupta |
299 |
alert("please select item");
|
|
|
300 |
return;
|
| 23752 |
govind |
301 |
}
|
| 27094 |
tejbeer |
302 |
if (typeof currentItem != "undefined") {
|
|
|
303 |
console.log(currentItem);
|
| 27875 |
amit.gupta |
304 |
loadSchemeItemSearchInfo(currentItem, date);
|
| 27094 |
tejbeer |
305 |
} else {
|
|
|
306 |
console.log("reeffff")
|
|
|
307 |
alert("Data No Found")
|
|
|
308 |
}
|
| 23752 |
govind |
309 |
});
|
|
|
310 |
|
| 28795 |
tejbeer |
311 |
|
|
|
312 |
$(document).on('click', "#scheme-imei-search-button", function() {
|
|
|
313 |
var searchText = $("#scheme-imei-search-text").val();
|
|
|
314 |
var date = $(".schemes-date").val();
|
|
|
315 |
if (typeof (searchText) == "undefined" || !searchText) {
|
|
|
316 |
searchText = "";
|
|
|
317 |
alert("please select imei");
|
|
|
318 |
return;
|
|
|
319 |
}
|
|
|
320 |
if (typeof imei != "undefined") {
|
|
|
321 |
console.log(imei);
|
|
|
322 |
loadSchemeImeiSearchInfo(imei, date);
|
|
|
323 |
} else {
|
|
|
324 |
console.log("reeffff")
|
|
|
325 |
alert("Data No Found")
|
|
|
326 |
}
|
|
|
327 |
});
|
| 27755 |
amit.gupta |
328 |
$(document).on('click', ".categoryWiseSchemeHistory",
|
| 28134 |
tejbeer |
329 |
function() {
|
|
|
330 |
var category = $('#partner-category').val();
|
|
|
331 |
console.log(category);
|
| 26763 |
tejbeer |
332 |
|
| 28134 |
tejbeer |
333 |
doGetAjaxRequestHandler(context + "/getSchemes?partnerType="
|
|
|
334 |
+ category, function(response) {
|
| 26802 |
tejbeer |
335 |
$('#' + "main-content").html(response);
|
|
|
336 |
$('#partner-category').val(category);
|
|
|
337 |
window.dispatchEvent(new Event('resize'));
|
|
|
338 |
});
|
| 26763 |
tejbeer |
339 |
|
| 28134 |
tejbeer |
340 |
});
|
| 26763 |
tejbeer |
341 |
|
| 27754 |
amit.gupta |
342 |
$(document).on("keyup", "#scheme-item-search-text", function(e) {
|
| 23752 |
govind |
343 |
var keyCode = e.keyCode || e.which;
|
|
|
344 |
if (keyCode == 13) {
|
|
|
345 |
$("#scheme-item-search-button").click();
|
|
|
346 |
}
|
|
|
347 |
});
|
| 22860 |
ashik.ali |
348 |
});
|
|
|
349 |
|
| 23752 |
govind |
350 |
function configureTagListingItemsDescriptionDropDown() {
|
| 28134 |
tejbeer |
351 |
$('.tagListingItemsDescription').multiselect({
|
|
|
352 |
includeSelectAllOption: true,
|
|
|
353 |
maxHeight: 200,
|
|
|
354 |
buttonWidth: '180px',
|
|
|
355 |
numberDisplayed: 1,
|
|
|
356 |
nonSelectedText: 'Items',
|
|
|
357 |
nSelectedText: ' - Items Selected',
|
|
|
358 |
allSelectedText: 'All Items Selected',
|
|
|
359 |
enableFiltering: true,
|
|
|
360 |
enableCaseInsensitiveFiltering: true
|
| 23752 |
govind |
361 |
});
|
| 23343 |
ashik.ali |
362 |
}
|
|
|
363 |
|
| 23752 |
govind |
364 |
function schemesDownload() {
|
| 23343 |
ashik.ali |
365 |
console.log("downloadItemLedgerReport Button clicked")
|
| 23914 |
govind |
366 |
var startDateTime = $('input[name="startDateTime"]').val();
|
|
|
367 |
console.log("startDateTime : " + startDateTime);
|
|
|
368 |
var endDateTime = $('input[name="endDateTime"]').val();
|
|
|
369 |
console.log("endDateTime : " + endDateTime);
|
| 23752 |
govind |
370 |
doAjaxGetDownload(context + "/schemes/download?startDateTime="
|
| 28134 |
tejbeer |
371 |
+ startDateTime + "&endDateTime=" + endDateTime,
|
|
|
372 |
"SchemesReport.xlsx");
|
| 23343 |
ashik.ali |
373 |
}
|
| 23914 |
govind |
374 |
function selectedbrand() {
|
|
|
375 |
var brands = $('#tag-listing-brands').val();
|
|
|
376 |
console.log(brands);
|
|
|
377 |
if (brands) {
|
|
|
378 |
loadTagListingItemsDescriptionByBrand(
|
| 28134 |
tejbeer |
379 |
"tag-listing-items-description-container", brands);
|
| 23914 |
govind |
380 |
}
|
|
|
381 |
}
|
| 23752 |
govind |
382 |
function loadSchemeDetails(schemeId, domId) {
|
|
|
383 |
doGetAjaxRequestHandler(context + "/getSchemeById?schemeId=" + schemeId,
|
| 28134 |
tejbeer |
384 |
function(response) {
|
|
|
385 |
$('#' + domId).html(response);
|
|
|
386 |
window.dispatchEvent(new Event('resize'));
|
|
|
387 |
});
|
| 23343 |
ashik.ali |
388 |
}
|
|
|
389 |
|
| 23752 |
govind |
390 |
function activeScheme(schemeId, offset, domId) {
|
|
|
391 |
doPutAjaxRequestHandler(context + "/activeSchemeById?schemeId=" + schemeId
|
| 28134 |
tejbeer |
392 |
+ "&offset=" + offset, function(response) {
|
|
|
393 |
$('#' + domId).html(response);
|
|
|
394 |
$('#scheme-details-container').html('');
|
|
|
395 |
});
|
| 23752 |
govind |
396 |
|
| 23343 |
ashik.ali |
397 |
}
|
|
|
398 |
|
| 25069 |
amit.gupta |
399 |
function expireScheme(schemeId, expireDate, offset, domId) {
|
| 23752 |
govind |
400 |
doPutAjaxRequestHandler(context + "/expireSchemeById?schemeId=" + schemeId
|
| 28134 |
tejbeer |
401 |
+ "&offset=" + offset + "&expireTimestamp=" + expireDate, function(
|
| 26763 |
tejbeer |
402 |
response) {
|
|
|
403 |
alert("Scheme - " + schemeId + " marked for expiry successfully!");
|
| 23343 |
ashik.ali |
404 |
$('#' + domId).html(response);
|
|
|
405 |
$('#scheme-details-container').html('');
|
|
|
406 |
});
|
|
|
407 |
}
|
| 23914 |
govind |
408 |
function extendAllScheme(domId) {
|
| 26763 |
tejbeer |
409 |
doPostAjaxRequestWithJsonHandler(context + "/extendAllSchemes", JSON
|
| 28134 |
tejbeer |
410 |
.stringify(startDate), function(response) {
|
|
|
411 |
if (response == 'true') {
|
|
|
412 |
alert("Scheme All Extended successfully");
|
|
|
413 |
schemes("main-content");
|
|
|
414 |
} else {
|
|
|
415 |
alert("No scheme Activated Currently");
|
|
|
416 |
schemes("main-content");
|
|
|
417 |
}
|
|
|
418 |
});
|
| 23343 |
ashik.ali |
419 |
|
| 23914 |
govind |
420 |
}
|
|
|
421 |
function extendSchemeById(schemeId) {
|
| 26763 |
tejbeer |
422 |
doPostAjaxRequestWithJsonHandler(context + "/extendSchemeById?schemeId="
|
| 28134 |
tejbeer |
423 |
+ schemeId, JSON.stringify(startDate), function(response) {
|
|
|
424 |
if (response == 'true') {
|
|
|
425 |
alert("Scheme extended successfully");
|
|
|
426 |
schemes("main-content");
|
|
|
427 |
} else {
|
|
|
428 |
alert("Scheme already Expired");
|
|
|
429 |
schemes("main-content");
|
|
|
430 |
}
|
|
|
431 |
});
|
| 23914 |
govind |
432 |
|
|
|
433 |
}
|
| 29761 |
amit.gupta |
434 |
function processInvestment() {
|
| 29762 |
amit.gupta |
435 |
doPostAjaxRequestWithJsonHandler(context + "/payMonthlyInvestment", function(response) {
|
| 29759 |
amit.gupta |
436 |
alert("InvestmentPayout processed successfully");
|
|
|
437 |
});
|
|
|
438 |
}
|
| 23914 |
govind |
439 |
|
| 23752 |
govind |
440 |
function loadScheme(domId) {
|
|
|
441 |
doGetAjaxRequestHandler(context + "/createScheme", function(response) {
|
| 23343 |
ashik.ali |
442 |
$('#' + domId).html(response);
|
|
|
443 |
});
|
| 23752 |
govind |
444 |
|
| 23343 |
ashik.ali |
445 |
}
|
|
|
446 |
|
| 23914 |
govind |
447 |
function loadTagListingItemsDescriptionByBrand(domId, brands) {
|
|
|
448 |
doPostAjaxRequestWithJsonHandler(context + '/getTagListingItemsByBrand',
|
| 28134 |
tejbeer |
449 |
JSON.stringify(brands), function(response) {
|
|
|
450 |
$('#' + domId).html(response);
|
|
|
451 |
debugger;
|
|
|
452 |
configureTagListingItemsDescriptionDropDown();
|
|
|
453 |
});
|
| 23752 |
govind |
454 |
|
| 23343 |
ashik.ali |
455 |
}
|
|
|
456 |
|
| 23752 |
govind |
457 |
function schemes(domId) {
|
|
|
458 |
doGetAjaxRequestHandler(context + "/getSchemes", function(response) {
|
| 23343 |
ashik.ali |
459 |
$('#' + domId).html(response);
|
|
|
460 |
});
|
|
|
461 |
}
|
| 27648 |
tejbeer |
462 |
function marginCalculator(domId) {
|
|
|
463 |
doGetAjaxRequestHandler(context + "/getMarginCalculator", function(response) {
|
|
|
464 |
$('#' + domId).html(response);
|
|
|
465 |
});
|
|
|
466 |
}
|
| 23343 |
ashik.ali |
467 |
|
| 23752 |
govind |
468 |
function loadSchemesDownloadPage(domId) {
|
|
|
469 |
doGetAjaxRequestHandler(context + "/schemes/downloadPage", function(
|
| 28134 |
tejbeer |
470 |
response) {
|
| 23343 |
ashik.ali |
471 |
$('#' + domId).html(response);
|
|
|
472 |
});
|
| 23556 |
amit.gupta |
473 |
}
|
|
|
474 |
|
| 23752 |
govind |
475 |
function loadSchemeUpdatePage(domId) {
|
|
|
476 |
doGetAjaxRequestHandler(context + "/schemes/update-schemes-page", function(
|
| 28134 |
tejbeer |
477 |
response) {
|
| 23556 |
amit.gupta |
478 |
$('#' + domId).html(response);
|
|
|
479 |
});
|
| 23557 |
amit.gupta |
480 |
}
|
|
|
481 |
|
| 30054 |
manish |
482 |
function brandWiseIncome(brand,month,status) {
|
|
|
483 |
console.log(brand);
|
|
|
484 |
console.log(month);
|
|
|
485 |
|
|
|
486 |
doGetAjaxRequestHandler(context + "/brandWiseIncome?brand=" + brand + "&month=" + month + "&status=" + status, function(
|
|
|
487 |
response) {
|
|
|
488 |
$('.imei-wise-income-container').html('');
|
|
|
489 |
$('.brand-wise-income-container').html(response);
|
|
|
490 |
});
|
|
|
491 |
}
|
|
|
492 |
|
|
|
493 |
function monthWiseIncome(month,domId) {
|
|
|
494 |
console.log(month);
|
|
|
495 |
doGetAjaxRequestHandler(context + "/monthWisePartnerIncome/" + month ,function (response) {
|
|
|
496 |
console.log(response);
|
|
|
497 |
$('#' + domId).html(response);
|
|
|
498 |
})
|
|
|
499 |
}
|
|
|
500 |
function imeiWiseIncome(catalogItemId,month) {
|
|
|
501 |
console.log(catalogItemId);
|
|
|
502 |
console.log(month);
|
|
|
503 |
|
|
|
504 |
doGetAjaxRequestHandler(context + "/getLastMonthImeiWiseIncome?catalogItemId=" + catalogItemId + "&month=" + month, function(
|
|
|
505 |
response) {
|
|
|
506 |
$('.imei-wise-income-container').html(response);
|
|
|
507 |
});
|
|
|
508 |
}
|
|
|
509 |
|
| 23928 |
govind |
510 |
function updateSingleScheme(shcemeIds, itemIds) {
|
|
|
511 |
doPostAjaxRequestWithJsonHandler(context + '/addItemToScheme', JSON
|
| 28134 |
tejbeer |
512 |
.stringify({
|
|
|
513 |
"itemIds": itemIds.split(",").map(Number),
|
|
|
514 |
"schemeIds": schemeIds.split(",").map(Number)
|
|
|
515 |
}), function(response) {
|
|
|
516 |
if (response == 'true') {
|
|
|
517 |
alert("Item Added to scheme successfully");
|
|
|
518 |
// $('#newItemToSchemeModal').modal('hide');
|
|
|
519 |
loadSchemeDetails(shcemeIds, "scheme-details-container");
|
|
|
520 |
} else {
|
|
|
521 |
alert("Item already present");
|
|
|
522 |
loadSchemeDetails(shcemeIds, "scheme-details-container");
|
|
|
523 |
}
|
|
|
524 |
});
|
| 23715 |
govind |
525 |
}
|
| 23928 |
govind |
526 |
function updateSchemes(shcemeIds, itemIds) {
|
|
|
527 |
doPostAjaxRequestWithJsonHandler(context + '/schemes/update', JSON
|
| 28134 |
tejbeer |
528 |
.stringify({
|
|
|
529 |
"itemIds": itemIds.split(",").map(Number),
|
|
|
530 |
"schemeIds": schemeIds.split(",").map(Number)
|
|
|
531 |
}), function(response) {
|
|
|
532 |
if (response == 'true') {
|
|
|
533 |
alert("Item Added to scheme successfully");
|
|
|
534 |
// $('#newItemToSchemeModal').modal('hide');
|
|
|
535 |
loadSchemeUpdatePage("main-content");
|
|
|
536 |
}
|
|
|
537 |
});
|
| 23928 |
govind |
538 |
}
|
| 23914 |
govind |
539 |
function deleteScheme(shcemeId, itemId) {
|
|
|
540 |
doDeleteAjaxRequestHandler(context + "/schemes/delete?schemeId=" + shcemeId
|
| 28134 |
tejbeer |
541 |
+ "&itemId=" + itemId, function(response) {
|
|
|
542 |
if (response == 'true') {
|
|
|
543 |
alert("ItemId Deleted successfully from Scheme");
|
|
|
544 |
loadSchemeDetails(shcemeId, "scheme-details-container");
|
|
|
545 |
}
|
|
|
546 |
});
|
| 23752 |
govind |
547 |
}
|
|
|
548 |
function loadSearchScheme(domId, search_text) {
|
| 27875 |
amit.gupta |
549 |
doGetAjaxRequestHandler(context + "/searchScheme?searchTerm="
|
| 28134 |
tejbeer |
550 |
+ search_text, function(response) {
|
|
|
551 |
$('#' + domId).html(response);
|
|
|
552 |
});
|
| 23752 |
govind |
553 |
}
|
| 27875 |
amit.gupta |
554 |
function loadSearchItemScheme(domId, selected_item, date) {
|
| 26802 |
tejbeer |
555 |
var category = $('#partner-category').val();
|
|
|
556 |
var searchText = $("#scheme-item-search-text").val();
|
| 26763 |
tejbeer |
557 |
|
| 26802 |
tejbeer |
558 |
var category = $('#partner-category').val();
|
| 26912 |
tejbeer |
559 |
|
|
|
560 |
console.log(category)
|
|
|
561 |
|
| 26802 |
tejbeer |
562 |
if (typeof (searchText) == "undefined" || !searchText) {
|
|
|
563 |
searchText = "";
|
|
|
564 |
}
|
|
|
565 |
if (typeof (category) == "undefined" || !category) {
|
|
|
566 |
category = "";
|
|
|
567 |
}
|
|
|
568 |
if ((searchText) && (category)) {
|
| 27875 |
amit.gupta |
569 |
doGetAjaxRequestHandler(context + "/getSchemes?searchItem="
|
| 28134 |
tejbeer |
570 |
+ selected_item.itemId + "&partnerType=" + category, function(
|
| 26802 |
tejbeer |
571 |
response) {
|
|
|
572 |
$('#' + domId).html(response);
|
|
|
573 |
$('#partner-category').val(category);
|
|
|
574 |
$('#scheme-item-search-text').val(selected_item.itemDescription);
|
|
|
575 |
|
|
|
576 |
});
|
| 26912 |
tejbeer |
577 |
} else if ((searchText)) {
|
| 27875 |
amit.gupta |
578 |
doGetAjaxRequestHandler(`${context}/getSchemes?searchItem=${selected_item.itemId}&date=${date}`, function(response) {
|
| 26802 |
tejbeer |
579 |
$('#' + domId).html(response);
|
|
|
580 |
$('#scheme-item-search-text').val(selected_item.itemDescription);
|
|
|
581 |
|
|
|
582 |
});
|
| 26912 |
tejbeer |
583 |
|
|
|
584 |
}
|
|
|
585 |
|
| 23752 |
govind |
586 |
}
|
| 28795 |
tejbeer |
587 |
|
|
|
588 |
function loadSearchImeiScheme(domId, selected_imei, date) {
|
|
|
589 |
var category = $('#partner-category').val();
|
|
|
590 |
var searchText = $("#scheme-imei-search-text").val();
|
|
|
591 |
|
|
|
592 |
var category = $('#partner-category').val();
|
|
|
593 |
|
|
|
594 |
console.log(category)
|
|
|
595 |
|
|
|
596 |
if (typeof (searchText) == "undefined" || !searchText) {
|
|
|
597 |
searchText = "";
|
|
|
598 |
}
|
|
|
599 |
if (typeof (category) == "undefined" || !category) {
|
|
|
600 |
category = "";
|
|
|
601 |
}
|
|
|
602 |
if ((searchText) && (category)) {
|
|
|
603 |
doGetAjaxRequestHandler(context + "/getSchemes?searchImei="
|
|
|
604 |
+ selected_imei + "&partnerType=" + category, function(
|
|
|
605 |
response) {
|
|
|
606 |
$('#' + domId).html(response);
|
|
|
607 |
|
|
|
608 |
$('#partner-category').val(category);
|
|
|
609 |
$('#scheme-imei-search-text').val(selected_imei);
|
|
|
610 |
});
|
|
|
611 |
} else if ((searchText)) {
|
|
|
612 |
doGetAjaxRequestHandler(`${context}/getSchemes?searchImei=${selected_imei}&date=${date}`, function(response) {
|
|
|
613 |
$('#' + domId).html(response);
|
|
|
614 |
$('#scheme-imei-search-text').val(selected_imei);
|
|
|
615 |
|
|
|
616 |
});
|
|
|
617 |
|
|
|
618 |
}
|
|
|
619 |
|
|
|
620 |
}
|
| 23752 |
govind |
621 |
function loadSchemeSearchInfo(search_text) {
|
|
|
622 |
loadSearchScheme("main-content", search_text);
|
|
|
623 |
}
|
| 27875 |
amit.gupta |
624 |
function loadSchemeItemSearchInfo(selectedItem, date) {
|
|
|
625 |
loadSearchItemScheme("main-content", selectedItem, date);
|
| 23914 |
govind |
626 |
}
|
| 28795 |
tejbeer |
627 |
|
|
|
628 |
function loadSchemeImeiSearchInfo(selectedImei, date) {
|
|
|
629 |
|
|
|
630 |
loadSearchImeiScheme("main-content", selectedImei, date);
|
|
|
631 |
}
|
|
|
632 |
|