| 21627 |
kshitij.so |
1 |
var googleProfile;
|
|
|
2 |
|
| 22139 |
amit.gupta |
3 |
|
|
|
4 |
$(document).ajaxComplete(
|
|
|
5 |
function(){
|
| 23026 |
ashik.ali |
6 |
}
|
| 22139 |
amit.gupta |
7 |
);
|
| 21627 |
kshitij.so |
8 |
var startApp = function() {
|
|
|
9 |
gapi.load('auth2', function(){
|
|
|
10 |
// Retrieve the singleton for the GoogleAuth library and set up the client.
|
|
|
11 |
auth2 = gapi.auth2.init({
|
| 22071 |
ashik.ali |
12 |
client_id: googleApiKey,
|
| 21627 |
kshitij.so |
13 |
cookiepolicy: 'single_host_origin',
|
|
|
14 |
// Request scopes in addition to 'profile' and 'email'
|
|
|
15 |
//scope: 'additional_scope'
|
|
|
16 |
});
|
|
|
17 |
attachSignin(document.getElementById('customBtn'));
|
|
|
18 |
});
|
|
|
19 |
};
|
|
|
20 |
|
| 22956 |
ashik.ali |
21 |
function badRequestAlert(response){
|
|
|
22 |
console.log(response.responseText);
|
|
|
23 |
var errorObject = JSON.parse(response.responseText);
|
|
|
24 |
errorObject = errorObject.response;
|
|
|
25 |
alert('Bad Request\n'+
|
|
|
26 |
'rejectedType : '+errorObject.rejectedType+'\n'+
|
|
|
27 |
'rejectedValue : '+errorObject.rejectedValue+'\n'+
|
|
|
28 |
'message : '+errorObject.message);
|
|
|
29 |
}
|
|
|
30 |
|
|
|
31 |
function internalServerErrorAlert(response){
|
|
|
32 |
console.log(response.responseText);
|
|
|
33 |
var errorObject = JSON.parse(response.responseText);
|
|
|
34 |
errorObject = errorObject.response;
|
|
|
35 |
alert('Internal Server Error\n'+
|
|
|
36 |
'rejectedType : '+errorObject.rejectedType+'\n'+
|
|
|
37 |
'rejectedValue : '+errorObject.rejectedValue+'\n'+
|
|
|
38 |
'message : '+errorObject.message);
|
|
|
39 |
}
|
|
|
40 |
|
|
|
41 |
$( document ).ajaxError(function(event, jqxhr, settings, thrownError) {
|
|
|
42 |
//$( ".log" ).text( "Triggered ajaxError handler." );
|
|
|
43 |
if(jqxhr.status == 400){
|
| 22982 |
ashik.ali |
44 |
//$('#error-prompt-model').modal();
|
| 22956 |
ashik.ali |
45 |
badRequestAlert(jqxhr);
|
|
|
46 |
}else{
|
|
|
47 |
internalServerErrorAlert(jqxhr);
|
|
|
48 |
}
|
|
|
49 |
});
|
|
|
50 |
|
| 23026 |
ashik.ali |
51 |
function doGetAjaxRequest(urlString){
|
|
|
52 |
var response;
|
|
|
53 |
doAjaxRequestHandler(urlString, "GET", function(ajaxResponse){
|
|
|
54 |
response = ajaxResponse;
|
|
|
55 |
});
|
|
|
56 |
return response;
|
|
|
57 |
}
|
|
|
58 |
|
|
|
59 |
function doPutAjaxRequest(urlString){
|
|
|
60 |
var response;
|
|
|
61 |
doAjaxRequestHandler(urlString, "PUT", function(ajaxResponse){
|
|
|
62 |
response = ajaxResponse;
|
|
|
63 |
});
|
|
|
64 |
return response;
|
|
|
65 |
}
|
|
|
66 |
|
| 23032 |
ashik.ali |
67 |
function doPutAjaxRequestWithJson(urlString, json){
|
|
|
68 |
var response;
|
|
|
69 |
doAjaxRequestWithJsonHandler(urlString, "PUT", json, function(ajaxResponse){
|
|
|
70 |
response = ajaxResponse;
|
|
|
71 |
});
|
|
|
72 |
return response;
|
|
|
73 |
}
|
| 23026 |
ashik.ali |
74 |
|
| 23193 |
ashik.ali |
75 |
function doPostAjaxRequestWithJson(urlString, json){
|
|
|
76 |
var response;
|
|
|
77 |
doAjaxRequestWithJsonHandler(urlString, "POST", json, function(ajaxResponse){
|
|
|
78 |
response = ajaxResponse;
|
|
|
79 |
});
|
|
|
80 |
return response;
|
|
|
81 |
}
|
|
|
82 |
|
|
|
83 |
function doPostAjaxRequestWithParams(urlString, params){
|
|
|
84 |
var response;
|
|
|
85 |
doAjaxRequestWithParamsHandler(urlString, "POST", params, function(ajaxResponse){
|
|
|
86 |
response = ajaxResponse;
|
|
|
87 |
});
|
|
|
88 |
return response;
|
|
|
89 |
}
|
|
|
90 |
|
|
|
91 |
function doAjaxRequestWithParamsHandler(urlString, httpType, params, callback_function){
|
|
|
92 |
$.ajax({
|
|
|
93 |
url: urlString,
|
|
|
94 |
async: false,
|
|
|
95 |
cache: false,
|
|
|
96 |
data: params,
|
|
|
97 |
//dataType:'json',
|
|
|
98 |
type: httpType,
|
|
|
99 |
success: function(response) {
|
|
|
100 |
//console.log("response"+JSON.stringify(data));
|
|
|
101 |
callback_function(response);
|
|
|
102 |
}
|
|
|
103 |
});
|
|
|
104 |
}
|
|
|
105 |
|
| 23032 |
ashik.ali |
106 |
function doAjaxRequestWithJsonHandler(urlString, httpType, json, callback_function){
|
|
|
107 |
$.ajax({
|
|
|
108 |
url: urlString,
|
|
|
109 |
async: false,
|
|
|
110 |
cache: false,
|
|
|
111 |
processData: false,
|
|
|
112 |
data: json,
|
|
|
113 |
contentType:'application/json',
|
|
|
114 |
type: httpType,
|
|
|
115 |
success: function(response) {
|
|
|
116 |
//console.log("response"+JSON.stringify(data));
|
|
|
117 |
callback_function(response);
|
|
|
118 |
}
|
|
|
119 |
});
|
|
|
120 |
}
|
|
|
121 |
|
|
|
122 |
|
| 23026 |
ashik.ali |
123 |
function doAjaxRequestHandler(urlString, httpType, callback_function){
|
| 22982 |
ashik.ali |
124 |
$.ajax({
|
|
|
125 |
url: urlString,
|
|
|
126 |
async: false,
|
| 23026 |
ashik.ali |
127 |
cache: false,
|
| 22982 |
ashik.ali |
128 |
type: httpType,
|
|
|
129 |
success: function(response) {
|
|
|
130 |
//console.log("response"+JSON.stringify(data));
|
|
|
131 |
callback_function(response);
|
|
|
132 |
}
|
|
|
133 |
});
|
|
|
134 |
}
|
|
|
135 |
|
| 23026 |
ashik.ali |
136 |
function doAjaxUploadRequest(urlString, httpType, file){
|
|
|
137 |
var response;
|
|
|
138 |
doAjaxUploadRequestHandler(urlString, httpType, file, function(ajaxResponse){
|
|
|
139 |
response = ajaxResponse;
|
|
|
140 |
});
|
|
|
141 |
return response;
|
|
|
142 |
}
|
|
|
143 |
|
|
|
144 |
function doAjaxUploadRequestHandler(urlString, httpType, file, callback_function){
|
| 22982 |
ashik.ali |
145 |
var formData = new FormData();
|
|
|
146 |
formData.append("file", file);
|
|
|
147 |
$.ajax({
|
|
|
148 |
url: urlString,
|
|
|
149 |
type: httpType,
|
|
|
150 |
data: formData,
|
|
|
151 |
dataType: 'json',
|
| 23026 |
ashik.ali |
152 |
async: false,
|
| 22982 |
ashik.ali |
153 |
cache: false,
|
|
|
154 |
contentType: false,
|
|
|
155 |
enctype: 'multipart/form-data',
|
|
|
156 |
processData: false,
|
|
|
157 |
success: function(response) {
|
|
|
158 |
//console.log("response"+JSON.stringify(data));
|
|
|
159 |
callback_function(response);
|
|
|
160 |
}
|
|
|
161 |
});
|
|
|
162 |
}
|
|
|
163 |
|
|
|
164 |
function uploadDocument(file){
|
|
|
165 |
var url = '/profitmandi-web/document-upload';
|
| 23026 |
ashik.ali |
166 |
var response = doAjaxUploadRequest(url, 'POST', file);
|
| 22982 |
ashik.ali |
167 |
var documentId = response.response.document_id;
|
|
|
168 |
console.log("documentId : "+documentId);
|
|
|
169 |
return documentId;
|
|
|
170 |
}
|
|
|
171 |
|
|
|
172 |
|
| 21627 |
kshitij.so |
173 |
function attachSignin(element) {
|
|
|
174 |
console.log(element.id);
|
|
|
175 |
auth2.attachClickHandler(element, {},
|
|
|
176 |
function(googleUser) {
|
|
|
177 |
googleProfile = googleUser.getBasicProfile();
|
|
|
178 |
console.log(googleProfile.getImageUrl());
|
|
|
179 |
submitUser(googleUser);
|
|
|
180 |
}, function(error) {
|
|
|
181 |
console.log(JSON.stringify(error, undefined, 2));
|
|
|
182 |
});
|
|
|
183 |
}
|
|
|
184 |
|
|
|
185 |
function submitUser(googleUser){
|
| 23193 |
ashik.ali |
186 |
var params = {
|
|
|
187 |
"token" : googleUser.getAuthResponse().id_token
|
|
|
188 |
};
|
|
|
189 |
var response = doPostAjaxRequestWithParams(context+"/login", params);
|
|
|
190 |
response = JSON.parse(response);
|
|
|
191 |
if(response.status){
|
|
|
192 |
addProfileInLocalDb();
|
|
|
193 |
window.location.href= response.redirectUrl;
|
|
|
194 |
}else{
|
|
|
195 |
alert("Retailer not found, Please login");
|
|
|
196 |
}
|
| 21627 |
kshitij.so |
197 |
}
|
|
|
198 |
|
|
|
199 |
function addProfileInLocalDb(){
|
|
|
200 |
var profile = {'image_url':googleProfile.getImageUrl(),'name':googleProfile.getName()};
|
|
|
201 |
localStorage.setItem("profile",JSON.stringify(profile));
|
|
|
202 |
}
|
|
|
203 |
|
|
|
204 |
|
|
|
205 |
function loadNewGrn(domId){
|
| 23026 |
ashik.ali |
206 |
var response = doGetAjaxRequest(context+"/purchase");
|
|
|
207 |
$('#' + domId).html(response);
|
| 21627 |
kshitij.so |
208 |
}
|
|
|
209 |
|
| 23076 |
ashik.ali |
210 |
function getPurchaseByInvoiceNumber(){
|
|
|
211 |
var airwayBillOrInvoiceNumber = $('#airwayBillOrInvoiceNumberText').val();
|
|
|
212 |
var response = doGetAjaxRequest(context+"/purchaseByInvoiceNumber?airwayBillOrInvoiceNumber="+airwayBillOrInvoiceNumber);
|
|
|
213 |
$('#main-content').html(response);
|
|
|
214 |
}
|
|
|
215 |
|
|
|
216 |
function loadPendingGrn(domId){
|
|
|
217 |
var response = doGetAjaxRequest(context+"/pendingGrn");
|
|
|
218 |
$('#' + domId).html(response);
|
|
|
219 |
}
|
|
|
220 |
|
| 21987 |
kshitij.so |
221 |
function loadGoodInventory(domId, search_text){
|
| 23026 |
ashik.ali |
222 |
var response = doGetAjaxRequest(context+"/getCurrentInventorySnapshot/?searchTerm="+search_text);
|
|
|
223 |
$('#' + domId).html(response);
|
| 21987 |
kshitij.so |
224 |
}
|
|
|
225 |
|
|
|
226 |
function loadCatalog(domId, search_text){
|
| 23026 |
ashik.ali |
227 |
var response = doGetAjaxRequest(context+"/getCatalog/?searchTerm="+search_text);
|
|
|
228 |
$('#' + domId).html(response);
|
| 21987 |
kshitij.so |
229 |
}
|
|
|
230 |
|
| 22523 |
ashik.ali |
231 |
function getInventoryItemAgingByInterval(domId, searchContent){
|
| 23193 |
ashik.ali |
232 |
var response = doPostAjaxRequestWithJson(context+"/getInventoryItemAgingByInterval?searchContent="+searchContent, JSON.stringify([5,15,30,45]));
|
|
|
233 |
$('#' + domId).html(response);
|
| 22523 |
ashik.ali |
234 |
}
|
|
|
235 |
|
| 22982 |
ashik.ali |
236 |
function getRetailerDetailsByEmailIdOrMobileNumber(domId, emailIdOrMobileNumber){
|
| 23026 |
ashik.ali |
237 |
var response = doGetAjaxRequest(context+"/retailerDetail/?emailIdOrMobileNumber="+emailIdOrMobileNumber);
|
|
|
238 |
$('#' + domId).html(response);
|
| 22982 |
ashik.ali |
239 |
}
|
|
|
240 |
|
| 22488 |
ashik.ali |
241 |
function downloadAgingReport(){
|
| 22523 |
ashik.ali |
242 |
data = JSON.stringify([5,15,30,45]),
|
| 22488 |
ashik.ali |
243 |
xhttp = new XMLHttpRequest();
|
|
|
244 |
xhttp.onreadystatechange = function() {
|
|
|
245 |
var a;
|
|
|
246 |
if (xhttp.readyState === 4 && xhttp.status === 200) {
|
|
|
247 |
// Trick for making downloadable link
|
|
|
248 |
a = document.createElement('a');
|
|
|
249 |
a.href = window.URL.createObjectURL(xhttp.response);
|
|
|
250 |
// Give filename you wish to download
|
|
|
251 |
a.download = "InventoryItemAging.xlsx";
|
|
|
252 |
a.style.display = 'none';
|
|
|
253 |
document.body.appendChild(a);
|
|
|
254 |
a.click();
|
|
|
255 |
}
|
| 22956 |
ashik.ali |
256 |
if(xhttp.readyState == 4 && xhttp.status === 400){
|
|
|
257 |
badRequestAlert(xhttp.responseText);
|
|
|
258 |
}
|
|
|
259 |
if(xhttp.readyState == 4 && xhttp.status === 500){
|
|
|
260 |
internalServerErrorAlert(xhttp.responseText);
|
|
|
261 |
}
|
| 22488 |
ashik.ali |
262 |
};
|
|
|
263 |
// Post data to URL which handles post request
|
| 23181 |
ashik.ali |
264 |
xhttp.open("POST", context+"/downloadInventoryItemAgingByInterval");
|
| 22488 |
ashik.ali |
265 |
xhttp.setRequestHeader("Content-Type", "application/json");
|
|
|
266 |
// You should set responseType as blob for binary responses
|
|
|
267 |
xhttp.responseType = 'blob';
|
|
|
268 |
xhttp.send(data);
|
|
|
269 |
}
|
|
|
270 |
|
| 22523 |
ashik.ali |
271 |
function downloadItemLedgerReport(){
|
| 23026 |
ashik.ali |
272 |
console.log("downloadItemLedgerReport Button clicked")
|
| 23193 |
ashik.ali |
273 |
var startDateTime = $('input[name="startDateTime"]').val();
|
| 23026 |
ashik.ali |
274 |
console.log("startDateTime : "+startDateTime);
|
| 23193 |
ashik.ali |
275 |
var endDateTime = $('input[name="endDateTime"]').val();
|
| 23026 |
ashik.ali |
276 |
console.log("endDateTime : "+endDateTime);
|
| 22523 |
ashik.ali |
277 |
//data = JSON.stringify([5,10,15,20,25,30,35,40]),
|
|
|
278 |
xhttp = new XMLHttpRequest();
|
|
|
279 |
xhttp.onreadystatechange = function() {
|
|
|
280 |
var a;
|
|
|
281 |
if (xhttp.readyState === 4 && xhttp.status === 200) {
|
|
|
282 |
// Trick for making downloadable link
|
|
|
283 |
a = document.createElement('a');
|
|
|
284 |
a.href = window.URL.createObjectURL(xhttp.response);
|
|
|
285 |
// Give filename you wish to download
|
|
|
286 |
a.download = "ItemCompleteLedegerReport.xlsx";
|
|
|
287 |
a.style.display = 'none';
|
|
|
288 |
document.body.appendChild(a);
|
|
|
289 |
a.click();
|
|
|
290 |
}
|
| 22956 |
ashik.ali |
291 |
if(xhttp.readyState == 4 && xhttp.status === 400){
|
|
|
292 |
badRequestAlert(xhttp.responseText);
|
|
|
293 |
}
|
|
|
294 |
if(xhttp.readyState == 4 && xhttp.status === 500){
|
|
|
295 |
internalServerErrorAlert(xhttp.responseText);
|
|
|
296 |
}
|
| 22523 |
ashik.ali |
297 |
};
|
|
|
298 |
// Post data to URL which handles post request
|
| 23026 |
ashik.ali |
299 |
xhttp.open("GET", context+"/itemLedger/complete/download?startDateTime="+startDateTime+"&endDateTime="+endDateTime);
|
| 22523 |
ashik.ali |
300 |
//xhttp.setRequestHeader("Content-Type", "application/json");
|
|
|
301 |
// You should set responseType as blob for binary responses
|
|
|
302 |
xhttp.responseType = 'blob';
|
|
|
303 |
xhttp.send(null);
|
|
|
304 |
}
|
|
|
305 |
|
| 23026 |
ashik.ali |
306 |
|
|
|
307 |
function schemesDownload(){
|
|
|
308 |
console.log("downloadItemLedgerReport Button clicked")
|
|
|
309 |
var startEndDateTime = $('input[name="startEndDateTime"]').val().split("-");
|
|
|
310 |
var startDateTime = $.trim(startEndDateTime[0]);
|
|
|
311 |
console.log("startDateTime : "+startDateTime);
|
|
|
312 |
var endDateTime = $.trim(startEndDateTime[1]);
|
|
|
313 |
console.log("endDateTime : "+endDateTime);
|
|
|
314 |
//data = JSON.stringify([5,10,15,20,25,30,35,40]),
|
|
|
315 |
xhttp = new XMLHttpRequest();
|
|
|
316 |
xhttp.onreadystatechange = function() {
|
|
|
317 |
var a;
|
|
|
318 |
if (xhttp.readyState === 4 && xhttp.status === 200) {
|
|
|
319 |
// Trick for making downloadable link
|
|
|
320 |
a = document.createElement('a');
|
|
|
321 |
a.href = window.URL.createObjectURL(xhttp.response);
|
|
|
322 |
// Give filename you wish to download
|
|
|
323 |
a.download = "SchemesReport.xlsx";
|
|
|
324 |
a.style.display = 'none';
|
|
|
325 |
document.body.appendChild(a);
|
|
|
326 |
a.click();
|
|
|
327 |
}
|
|
|
328 |
if(xhttp.readyState == 4 && xhttp.status === 400){
|
|
|
329 |
badRequestAlert(xhttp.responseText);
|
|
|
330 |
}
|
|
|
331 |
if(xhttp.readyState == 4 && xhttp.status === 500){
|
|
|
332 |
internalServerErrorAlert(xhttp.responseText);
|
|
|
333 |
}
|
|
|
334 |
};
|
|
|
335 |
// Post data to URL which handles post request
|
|
|
336 |
xhttp.open("GET", context+"/schemes/download?startDateTime="+startDateTime+"&endDateTime="+endDateTime);
|
|
|
337 |
//xhttp.setRequestHeader("Content-Type", "application/json");
|
|
|
338 |
// You should set responseType as blob for binary responses
|
|
|
339 |
xhttp.responseType = 'blob';
|
|
|
340 |
xhttp.send(null);
|
|
|
341 |
}
|
|
|
342 |
|
| 22523 |
ashik.ali |
343 |
function getItemAgingNextPreviousItems(offset, searchContent){
|
| 23193 |
ashik.ali |
344 |
console.log("getItemAgingNextPreviousItems() called");
|
|
|
345 |
var response = doPostAjaxRequestWithJson(context+"/getInventoryItemAgingByInterval?offset="+offset+"&searchContent="+searchContent, JSON.stringify([5,15,30,45]));
|
|
|
346 |
$('#main-content').html(response);
|
| 22523 |
ashik.ali |
347 |
}
|
|
|
348 |
|
|
|
349 |
function getGrnHistoryPreviousItems(start,end,pre,purchase_reference, searchType,startTime,endTime){
|
| 23026 |
ashik.ali |
350 |
var response = doGetAjaxRequest(context+"/getPaginatedGrnHistory/?purchaseReference="+purchase_reference+"&searchType="+searchType
|
| 22523 |
ashik.ali |
351 |
+"&startTime="+startTime
|
| 23026 |
ashik.ali |
352 |
+"&endTime="+endTime+"&offset="+pre);
|
|
|
353 |
|
|
|
354 |
$( "#grn-history-paginated .end" ).text(+end - +10);
|
|
|
355 |
$( "#grn-history-paginated .start" ).text(+start - +10);
|
|
|
356 |
$('#grn-history-table').html(response);
|
|
|
357 |
$("#grn-history-paginated .next").prop('disabled', false);
|
|
|
358 |
if (parseInt(pre)==0)
|
|
|
359 |
{
|
|
|
360 |
$("#grn-history-paginated .previous").prop('disabled', true);
|
|
|
361 |
}
|
| 22523 |
ashik.ali |
362 |
}
|
|
|
363 |
|
| 21987 |
kshitij.so |
364 |
function loadBadInventory(domId, search_text){
|
| 23026 |
ashik.ali |
365 |
var response = doGetAjaxRequest(context+"/getBadInventorySnapshot/?searchTerm="+search_text);
|
|
|
366 |
$('#' + domId).html(response);
|
| 21987 |
kshitij.so |
367 |
}
|
|
|
368 |
|
|
|
369 |
function loadGrnHistory(domId,purchase_reference,searchType, startTime, endTime){
|
| 23026 |
ashik.ali |
370 |
var response = doGetAjaxRequest(context+"/grnHistory/?purchaseReference="+purchase_reference+"&searchType="+searchType
|
|
|
371 |
+"&startTime="+startTime
|
|
|
372 |
+"&endTime="+endTime);
|
|
|
373 |
$('#' + domId).html(response);
|
| 21987 |
kshitij.so |
374 |
}
|
|
|
375 |
|
| 22245 |
ashik.ali |
376 |
|
| 21987 |
kshitij.so |
377 |
function getNextItems(start, end, searchText){
|
|
|
378 |
console.log(start);
|
|
|
379 |
console.log(end);
|
|
|
380 |
console.log(+end + +10);
|
|
|
381 |
console.log(+start + +10);
|
| 23026 |
ashik.ali |
382 |
var response = doGetAjaxRequest(context+"/getPaginatedCurrentInventorySnapshot/?offset="+end+"&searchTerm="+searchText);
|
|
|
383 |
|
|
|
384 |
$( "#good-inventory-paginated .end" ).text(+end + +10);
|
|
|
385 |
$( "#good-inventory-paginated .start" ).text(+start + +10);
|
|
|
386 |
var last = $( "#good-inventory-paginated .end" ).text();
|
|
|
387 |
var temp = $( "#good-inventory-paginated .size" ).text();
|
|
|
388 |
if (parseInt(last) >= parseInt(temp)){
|
|
|
389 |
$("#good-inventory-paginated .next").prop('disabled', true);
|
|
|
390 |
//$( "#good-inventory-paginated .end" ).text(temp);
|
| 21987 |
kshitij.so |
391 |
}
|
| 23026 |
ashik.ali |
392 |
$('#good-inventory-table').html(response);
|
|
|
393 |
$("#good-inventory-paginated .previous").prop('disabled', false);
|
|
|
394 |
|
|
|
395 |
}
|
|
|
396 |
|
| 21987 |
kshitij.so |
397 |
function getPreviousItems(start,end,pre,searchText){
|
| 23026 |
ashik.ali |
398 |
var response = doGetAjaxRequest(context+"/getPaginatedCurrentInventorySnapshot/?offset="+pre+"&searchTerm="+searchText);
|
|
|
399 |
|
|
|
400 |
$( "#good-inventory-paginated .end" ).text(+end - +10);
|
|
|
401 |
$( "#good-inventory-paginated .start" ).text(+start - +10);
|
|
|
402 |
$('#good-inventory-table').html(response);
|
|
|
403 |
$("#good-inventory-paginated .next").prop('disabled', false);
|
|
|
404 |
if (parseInt(pre)==0)
|
|
|
405 |
{
|
|
|
406 |
$("#good-inventory-paginated .previous").prop('disabled', true);
|
|
|
407 |
}
|
|
|
408 |
|
| 21987 |
kshitij.so |
409 |
}
|
|
|
410 |
|
|
|
411 |
function getGrnHistoryNextItems(start, end, purchase_reference, searchType,startTime,endTime){
|
|
|
412 |
console.log(start);
|
|
|
413 |
console.log(end);
|
|
|
414 |
console.log(+end + +10);
|
|
|
415 |
console.log(+start + +10);
|
| 23026 |
ashik.ali |
416 |
var response = doGetAjaxRequest(context+"/getPaginatedGrnHistory/?purchaseReference="+purchase_reference+"&searchType="+searchType
|
| 21987 |
kshitij.so |
417 |
+"&startTime="+startTime
|
| 23026 |
ashik.ali |
418 |
+"&endTime="+endTime+"&offset="+end);
|
|
|
419 |
|
|
|
420 |
$( "#grn-history-paginated .end" ).text(+end + +10);
|
|
|
421 |
$( "#grn-history-paginated .start" ).text(+start + +10);
|
|
|
422 |
var last = $( "#grn-history-paginated .end" ).text();
|
|
|
423 |
var temp = $( "#grn-history-paginated .size" ).text();
|
|
|
424 |
if (parseInt(last) >= parseInt(temp)){
|
|
|
425 |
$("#grn-history-paginated .next").prop('disabled', true);
|
|
|
426 |
//$( "#good-inventory-paginated .end" ).text(temp);
|
| 21987 |
kshitij.so |
427 |
}
|
| 23026 |
ashik.ali |
428 |
$('#grn-history-table').html(response);
|
|
|
429 |
$("#grn-history-paginated .previous").prop('disabled', false);
|
|
|
430 |
|
|
|
431 |
}
|
|
|
432 |
|
| 21987 |
kshitij.so |
433 |
function getGrnHistoryPreviousItems(start,end,pre,purchase_reference, searchType,startTime,endTime){
|
| 23026 |
ashik.ali |
434 |
var response = doGetAjaxRequest(context+"/getPaginatedGrnHistory/?purchaseReference="+purchase_reference+"&searchType="+searchType
|
| 21987 |
kshitij.so |
435 |
+"&startTime="+startTime
|
| 23026 |
ashik.ali |
436 |
+"&endTime="+endTime+"&offset="+pre);
|
|
|
437 |
|
|
|
438 |
$( "#grn-history-paginated .end" ).text(+end - +10);
|
|
|
439 |
$( "#grn-history-paginated .start" ).text(+start - +10);
|
|
|
440 |
$('#grn-history-table').html(response);
|
|
|
441 |
$("#grn-history-paginated .next").prop('disabled', false);
|
|
|
442 |
if (parseInt(pre)==0)
|
|
|
443 |
{
|
|
|
444 |
$("#grn-history-paginated .previous").prop('disabled', true);
|
|
|
445 |
}
|
| 21987 |
kshitij.so |
446 |
}
|
|
|
447 |
|
| 23203 |
ashik.ali |
448 |
function getSaleHistoryNextItems(start, end, searchType, searchValue, startTime, endTime){
|
| 22292 |
ashik.ali |
449 |
console.log(start);
|
|
|
450 |
console.log(end);
|
|
|
451 |
console.log(+end + +10);
|
|
|
452 |
console.log(+start + +10);
|
| 23203 |
ashik.ali |
453 |
var response = doGetAjaxRequest(context+"/getPaginatedSaleHistory/?searchType="+searchType+"&searchValue="+searchValue
|
|
|
454 |
+"&startTime="+startTime+"&endTime="+endTime+"&offset="+end);
|
| 23026 |
ashik.ali |
455 |
|
|
|
456 |
$( "#sale-history-paginated .end" ).text(+end + +10);
|
|
|
457 |
$( "#sale-history-paginated .start" ).text(+start + +10);
|
|
|
458 |
var last = $( "#sale-history-paginated .end" ).text();
|
|
|
459 |
var temp = $( "#sale-history-paginated .size" ).text();
|
|
|
460 |
if (parseInt(last) >= parseInt(temp)){
|
|
|
461 |
$("#sale-history-paginated .next").prop('disabled', true);
|
|
|
462 |
//$( "#good-inventory-paginated .end" ).text(temp);
|
| 22292 |
ashik.ali |
463 |
}
|
| 23026 |
ashik.ali |
464 |
$('#sale-history-table').html(response);
|
|
|
465 |
$("#sale-history-paginated .previous").prop('disabled', false);
|
|
|
466 |
|
|
|
467 |
}
|
|
|
468 |
|
| 23203 |
ashik.ali |
469 |
function getSaleHistoryPreviousItems(start, end, pre, searchType, searchValue, startTime, endTime){
|
| 23026 |
ashik.ali |
470 |
|
| 23203 |
ashik.ali |
471 |
var response = doGetAjaxRequest(context+"/getPaginatedSaleHistory/?searchType="+searchType+"&searchValue="+searchValue
|
| 22292 |
ashik.ali |
472 |
+"&startTime="+startTime
|
| 23026 |
ashik.ali |
473 |
+"&endTime="+endTime+"&offset="+pre);
|
|
|
474 |
|
|
|
475 |
$( "#sale-history-paginated .end" ).text(+end - +10);
|
|
|
476 |
$( "#sale-history-paginated .start" ).text(+start - +10);
|
|
|
477 |
$('#sale-history-table').html(response);
|
|
|
478 |
$("#sale-history-paginated .next").prop('disabled', false);
|
|
|
479 |
if (parseInt(pre)==0)
|
|
|
480 |
{
|
|
|
481 |
$("#sale-history-paginated .previous").prop('disabled', true);
|
|
|
482 |
}
|
|
|
483 |
|
| 22292 |
ashik.ali |
484 |
}
|
|
|
485 |
|
| 22551 |
ashik.ali |
486 |
|
| 22860 |
ashik.ali |
487 |
function getSchemesNextItems(start, end){
|
|
|
488 |
console.log(start);
|
|
|
489 |
console.log(end);
|
|
|
490 |
console.log(+end + +10);
|
|
|
491 |
console.log(+start + +10);
|
| 23026 |
ashik.ali |
492 |
var response = doGetAjaxRequest(context+"/getPaginatedSchemes?offset="+end);
|
|
|
493 |
|
|
|
494 |
$( "#schemes-paginated .end" ).text(+end + +10);
|
|
|
495 |
$( "#schemes-paginated .start" ).text(+start + +10);
|
|
|
496 |
var last = $( "#schemes-paginated .end" ).text();
|
|
|
497 |
var temp = $( "#schemes-paginated .size" ).text();
|
|
|
498 |
if (parseInt(last) >= parseInt(temp)){
|
|
|
499 |
$("#schemes-paginated .next").prop('disabled', true);
|
|
|
500 |
//$( "#good-inventory-paginated .end" ).text(temp);
|
| 22860 |
ashik.ali |
501 |
}
|
| 23026 |
ashik.ali |
502 |
$('#schemes-table').html(response);
|
|
|
503 |
$('#scheme-details-container').html('');
|
|
|
504 |
$("#schemes-paginated .previous").prop('disabled', false);
|
|
|
505 |
|
|
|
506 |
}
|
| 22551 |
ashik.ali |
507 |
|
| 22860 |
ashik.ali |
508 |
|
|
|
509 |
function getSchemesPreviousItems(start, end, pre){
|
| 23026 |
ashik.ali |
510 |
|
|
|
511 |
var response = doGetAjaxRequest(context+"/getPaginatedSchemes/?offset="+pre);
|
|
|
512 |
$( "#schemes-paginated .end" ).text(+end - +10);
|
|
|
513 |
$( "#schemes-paginated .start" ).text(+start - +10);
|
|
|
514 |
$('#schemes-table').html(response);
|
|
|
515 |
$('#scheme-details-container').html('');
|
|
|
516 |
$("#schemes-paginated .next").prop('disabled', false);
|
|
|
517 |
if (parseInt(pre)==0)
|
|
|
518 |
{
|
|
|
519 |
$("#schemes-paginated .previous").prop('disabled', true);
|
|
|
520 |
}
|
|
|
521 |
|
| 22860 |
ashik.ali |
522 |
}
|
|
|
523 |
|
|
|
524 |
|
|
|
525 |
|
| 22551 |
ashik.ali |
526 |
function getWalletHistoryNextItems(start, end, startTime, endTime){
|
|
|
527 |
console.log(start);
|
|
|
528 |
console.log(end);
|
|
|
529 |
console.log(+end + +10);
|
|
|
530 |
console.log(+start + +10);
|
| 23026 |
ashik.ali |
531 |
var response = doGetAjaxRequest(context+"/getPaginatedWalletHistory?startTime="+startTime
|
|
|
532 |
+"&endTime="+endTime+"&offset="+end);
|
|
|
533 |
|
|
|
534 |
$( "#wallet-history-paginated .end" ).text(+end + +10);
|
|
|
535 |
$( "#wallet-history-paginated .start" ).text(+start + +10);
|
|
|
536 |
var last = $( "#wallet-history-paginated .end" ).text();
|
|
|
537 |
var temp = $( "#wallet-history-paginated .size" ).text();
|
|
|
538 |
if (parseInt(last) >= parseInt(temp)){
|
|
|
539 |
$("#wallet-history-paginated .next").prop('disabled', true);
|
|
|
540 |
//$( "#good-inventory-paginated .end" ).text(temp);
|
| 22551 |
ashik.ali |
541 |
}
|
| 23026 |
ashik.ali |
542 |
$('#wallet-history-table').html(response);
|
|
|
543 |
$("#wallet-history-paginated .previous").prop('disabled', false);
|
|
|
544 |
|
|
|
545 |
|
|
|
546 |
}
|
|
|
547 |
|
| 22860 |
ashik.ali |
548 |
function getWalletHistoryPreviousItems(start, end, pre, startTime, endTime){
|
| 23026 |
ashik.ali |
549 |
var response = doGetAjaxRequest(context+"/getPaginatedWalletHistory?startTime="+startTime
|
|
|
550 |
+"&endTime="+endTime+"&offset="+pre);
|
|
|
551 |
|
|
|
552 |
$( "#wallet-history-paginated .end" ).text(+end - +10);
|
|
|
553 |
$( "#wallet-history-paginated .start" ).text(+start - +10);
|
|
|
554 |
$('#wallet-history-table').html(response);
|
|
|
555 |
$("#wallet-history-paginated .next").prop('disabled', false);
|
|
|
556 |
if (parseInt(pre)==0)
|
|
|
557 |
{
|
|
|
558 |
$("#wallet-history-paginated .previous").prop('disabled', true);
|
|
|
559 |
}
|
|
|
560 |
|
| 22551 |
ashik.ali |
561 |
}
|
|
|
562 |
|
| 21987 |
kshitij.so |
563 |
function loadGoodInventorySearchInfo(search_text){
|
|
|
564 |
loadGoodInventory("main-content",search_text);
|
|
|
565 |
}
|
|
|
566 |
|
|
|
567 |
function loadGrnHistorySearchInfo(search_text,searchType,startTime,endTime){
|
|
|
568 |
loadGrnHistory("main-content",search_text,searchType,startTime,endTime);
|
|
|
569 |
}
|
|
|
570 |
|
| 21627 |
kshitij.so |
571 |
function findDuplicateSerialNumbers(value){
|
|
|
572 |
var result = $("#grnImeiInformation :input[value='" + value + "']").length - 1;
|
|
|
573 |
return result;
|
|
|
574 |
}
|
| 21987 |
kshitij.so |
575 |
|
| 23026 |
ashik.ali |
576 |
function loadGrnDetails(purchaseId, domId){
|
|
|
577 |
var response = doGetAjaxRequest(context+"/grnHistoryDetailByPurchaseId/?purchaseId="+purchaseId);
|
|
|
578 |
$('#' + domId).html(response);
|
|
|
579 |
window.dispatchEvent(new Event('resize'));
|
| 21987 |
kshitij.so |
580 |
}
|
|
|
581 |
|
| 23076 |
ashik.ali |
582 |
function loadPendingGrnDetails(orderId, domId){
|
|
|
583 |
var response = doGetAjaxRequest(context+"/pendingGrnDetails/?orderId="+orderId);
|
|
|
584 |
$('#' + domId).html(response);
|
|
|
585 |
|
|
|
586 |
window.dispatchEvent(new Event('resize'));
|
|
|
587 |
}
|
|
|
588 |
|
| 22245 |
ashik.ali |
589 |
function loadSaleDetails(orderId, domId){
|
| 23026 |
ashik.ali |
590 |
|
|
|
591 |
var response = doGetAjaxRequest(context+"/saleDetails?orderId="+orderId);
|
|
|
592 |
$('#' + domId).html(response);
|
| 22860 |
ashik.ali |
593 |
}
|
|
|
594 |
|
|
|
595 |
function loadSchemeDetails(schemeId, domId){
|
| 23026 |
ashik.ali |
596 |
var response = doGetAjaxRequest(context+"/getSchemeById?schemeId="+schemeId);
|
|
|
597 |
$('#' + domId).html(response);
|
|
|
598 |
window.dispatchEvent(new Event('resize'));
|
| 22245 |
ashik.ali |
599 |
}
|
|
|
600 |
|
| 22860 |
ashik.ali |
601 |
function activeScheme(schemeId, offset, domId){
|
| 23026 |
ashik.ali |
602 |
var response = doPutAjaxRequest(context+"/activeSchemeById?schemeId="+schemeId
|
|
|
603 |
+"&offset="+offset);
|
|
|
604 |
$('#' + domId).html(response);
|
|
|
605 |
$('#scheme-details-container').html('');
|
| 22860 |
ashik.ali |
606 |
}
|
|
|
607 |
|
|
|
608 |
function expireScheme(schemeId, offset, domId){
|
| 23026 |
ashik.ali |
609 |
var response = doPutAjaxRequest(context+"/expireSchemeById?schemeId="+schemeId
|
|
|
610 |
+"&offset="+offset);
|
|
|
611 |
$('#' + domId).html(response);
|
|
|
612 |
$('#scheme-details-container').html('');
|
| 22860 |
ashik.ali |
613 |
}
|
|
|
614 |
|
| 21987 |
kshitij.so |
615 |
function getNextCatalogItems(start, end, searchText){
|
|
|
616 |
console.log(start);
|
|
|
617 |
console.log(end);
|
|
|
618 |
console.log(+end + +10);
|
|
|
619 |
console.log(+start + +10);
|
| 23026 |
ashik.ali |
620 |
var response = doGetAjaxRequest(context+"/getPaginatedCatalog/?offset="+end+"&searchTerm="+searchText);
|
|
|
621 |
|
|
|
622 |
$( "#catalog-paginated .end" ).text(+end + +10);
|
|
|
623 |
$( "#catalog-paginated .start" ).text(+start + +10);
|
|
|
624 |
var last = $( "#catalog-paginated .end" ).text();
|
|
|
625 |
var temp = $( "#catalog-paginated .size" ).text();
|
|
|
626 |
if (parseInt(last) >= parseInt(temp)){
|
|
|
627 |
$("#catalog-paginated .next").prop('disabled', true);
|
| 21987 |
kshitij.so |
628 |
}
|
| 23026 |
ashik.ali |
629 |
$('#catalog-table').html(response);
|
|
|
630 |
$("#catalog-paginated .previous").prop('disabled', false);
|
|
|
631 |
|
|
|
632 |
}
|
|
|
633 |
|
| 21987 |
kshitij.so |
634 |
function getPreviousCatalogItems(start,end,pre,searchText){
|
| 23026 |
ashik.ali |
635 |
var response = doGetAjaxRequest(context+"/getPaginatedCatalog/?offset="+pre+"&searchTerm="+searchText);
|
|
|
636 |
|
|
|
637 |
$( "#catalog-paginated .end" ).text(+end - +10);
|
|
|
638 |
$( "#catalog-paginated .start" ).text(+start - +10);
|
|
|
639 |
$('#catalog-table').html(response);
|
|
|
640 |
$("#catalog-paginated .next").prop('disabled', false);
|
|
|
641 |
if (parseInt(pre)==0)
|
|
|
642 |
{
|
|
|
643 |
$("#catalog-paginated .previous").prop('disabled', true);
|
|
|
644 |
}
|
| 21987 |
kshitij.so |
645 |
}
|
|
|
646 |
|
|
|
647 |
function loadCatalogSearchInfo(search_text){
|
|
|
648 |
loadCatalog("main-content",search_text);
|
|
|
649 |
}
|
|
|
650 |
|
|
|
651 |
function addItemInLocalStorage(bagObj){
|
|
|
652 |
if (localStorage.getItem("bag")!=null){
|
|
|
653 |
var bag = JSON.parse(localStorage.getItem("bag"));
|
|
|
654 |
bag[bagObj.itemId] = bagObj
|
|
|
655 |
localStorage.setItem("bag",JSON.stringify(bag));
|
|
|
656 |
bag = localStorage.getItem("bag")
|
|
|
657 |
$("#cart_bar").find('span').text(Object.keys(JSON.parse(bag)).length);
|
|
|
658 |
}
|
|
|
659 |
else{
|
|
|
660 |
var tempObj = {};
|
|
|
661 |
tempObj[bagObj.itemId] = bagObj
|
|
|
662 |
localStorage.setItem("bag",JSON.stringify(tempObj));
|
|
|
663 |
var bag = localStorage.getItem("bag")
|
|
|
664 |
$("#cart_bar").find('span').text(Object.keys(JSON.parse(bag)).length);
|
|
|
665 |
}
|
|
|
666 |
}
|
|
|
667 |
|
|
|
668 |
|
|
|
669 |
function changeQuantityInLocalStorage(itemId, newQuantity){
|
|
|
670 |
var bag = JSON.parse(localStorage.getItem("bag"));
|
|
|
671 |
bag[itemId].quantity = newQuantity;
|
|
|
672 |
localStorage.setItem("bag",JSON.stringify(bag));
|
|
|
673 |
}
|
|
|
674 |
|
|
|
675 |
function removeItemFromLocalStorage(itemId){
|
|
|
676 |
if (localStorage.getItem("bag")!=null){
|
|
|
677 |
var bag = JSON.parse(localStorage.getItem("bag"));
|
|
|
678 |
delete bag[itemId];
|
|
|
679 |
localStorage.setItem("bag",JSON.stringify(bag));
|
|
|
680 |
$("#cart_bar").find('span').text(Object.keys(bag).length);
|
|
|
681 |
}
|
|
|
682 |
}
|
|
|
683 |
|
|
|
684 |
function emptyBag(){
|
| 22095 |
kshitij.so |
685 |
localStorage.setItem("bag",JSON.stringify({}));
|
| 21987 |
kshitij.so |
686 |
$("#cart_bar").find('span').text(0);
|
|
|
687 |
}
|
|
|
688 |
|
|
|
689 |
function loadCart(domId){
|
| 23193 |
ashik.ali |
690 |
var params = {
|
|
|
691 |
"cartData":localStorage.getItem("bag")
|
|
|
692 |
}
|
|
|
693 |
var response = doPostAjaxRequestWithParams(context+"/cart", params);
|
|
|
694 |
$('#' + domId).html(response);
|
| 21987 |
kshitij.so |
695 |
}
|
|
|
696 |
|
| 22551 |
ashik.ali |
697 |
function loadWallet(domId, startTime, endTime){
|
| 23026 |
ashik.ali |
698 |
var response = doGetAjaxRequest(context+"/walletDetails?startTime="+startTime
|
|
|
699 |
+"&endTime="+endTime);
|
|
|
700 |
$('#' + domId).html(response);
|
| 22551 |
ashik.ali |
701 |
}
|
|
|
702 |
|
| 21987 |
kshitij.so |
703 |
function checkout(domId){
|
| 23193 |
ashik.ali |
704 |
var params = {
|
|
|
705 |
"cartData":localStorage.getItem("bag")
|
|
|
706 |
}
|
|
|
707 |
var response = doPostAjaxRequestWithParams(context+"/validate-cart", params);
|
|
|
708 |
$('#' + domId).html(response);
|
|
|
709 |
var obj = JSON.parse(response);
|
|
|
710 |
redirectCart(obj.redirectUrl, obj.params, obj.method, "main-content");
|
|
|
711 |
$('#main-content').html(response);
|
| 21987 |
kshitij.so |
712 |
}
|
|
|
713 |
|
| 22860 |
ashik.ali |
714 |
function loadScheme(domId){
|
| 23026 |
ashik.ali |
715 |
var response = doGetAjaxRequest(context+"/createScheme");
|
|
|
716 |
$('#' + domId).html(response);
|
|
|
717 |
}
|
|
|
718 |
|
| 23331 |
ashik.ali |
719 |
function loadDistrictNames(stateName){
|
|
|
720 |
if(undefined != $("#districtName")){
|
|
|
721 |
var response = doGetAjaxRequest(context+"/district/all/stateName?stateName="+stateName);
|
|
|
722 |
console.log(response);
|
|
|
723 |
var districtMasters = response.response;
|
|
|
724 |
//districtMasters = districtMasters.response;
|
|
|
725 |
var districtNameElements = '<option value="" disabled selected>District Name</option>';
|
|
|
726 |
for(index = 0; index < districtMasters.length; index++){
|
|
|
727 |
districtNameElements = districtNameElements + '<option value="'+districtMasters[index].name+'">'+districtMasters[index].name+'</option>';
|
|
|
728 |
}
|
|
|
729 |
$('#districtName').html(districtNameElements);
|
|
|
730 |
}
|
|
|
731 |
}
|
|
|
732 |
|
| 23026 |
ashik.ali |
733 |
function loadItemLedgerReportDownloadPage(domId){
|
|
|
734 |
var response = doGetAjaxRequest(context+"/itemLedger/downloadPage");
|
|
|
735 |
$('#' + domId).html(response);
|
|
|
736 |
}
|
|
|
737 |
|
|
|
738 |
function loadItemsDescriptionByBrand(domId, brand){
|
|
|
739 |
var response = doGetAjaxRequest(context+"/getItemsByBrand?brand="+brand);
|
|
|
740 |
$('#' + domId).html(response);
|
|
|
741 |
configureItemsDescriptionDropDown();
|
|
|
742 |
}
|
|
|
743 |
|
|
|
744 |
function configureItemsDescriptionDropDown(){
|
|
|
745 |
$(document).ready(function() {
|
|
|
746 |
$('#itemsDescription').multiselect({
|
|
|
747 |
includeSelectAllOption: true,
|
|
|
748 |
maxHeight: 200,
|
|
|
749 |
buttonWidth: '180px',
|
|
|
750 |
numberDisplayed: 1,
|
|
|
751 |
nonSelectedText: 'Items',
|
|
|
752 |
nSelectedText: ' - Items Selected',
|
|
|
753 |
allSelectedText: 'All Items Selected',
|
|
|
754 |
enableFiltering: true
|
|
|
755 |
});
|
| 22860 |
ashik.ali |
756 |
});
|
|
|
757 |
}
|
|
|
758 |
|
| 22982 |
ashik.ali |
759 |
function retailerInfo(domId){
|
| 23026 |
ashik.ali |
760 |
var response = doGetAjaxRequest(context+"/retailerInfo");
|
|
|
761 |
$('#' + domId).html(response);
|
| 22982 |
ashik.ali |
762 |
}
|
|
|
763 |
|
| 21987 |
kshitij.so |
764 |
function redirectCart(url, cartData, method, domId){
|
|
|
765 |
jQuery.ajax({
|
|
|
766 |
type : method,
|
|
|
767 |
data: {"cartData":cartData},
|
|
|
768 |
url : context+url,
|
|
|
769 |
success : function(response) {
|
|
|
770 |
$('#' + domId).html(response);
|
|
|
771 |
window.dispatchEvent(new Event('resize'));
|
|
|
772 |
}
|
|
|
773 |
});
|
|
|
774 |
}
|
|
|
775 |
|
| 23203 |
ashik.ali |
776 |
function saleHistory(domId, searchType, searchValue, startTime, endTime){
|
|
|
777 |
var response = doGetAjaxRequest(context+"/saleHistory?searchType="+searchType+"&searchValue="+searchValue
|
| 23026 |
ashik.ali |
778 |
+"&startTime="+startTime
|
|
|
779 |
+"&endTime="+endTime);
|
|
|
780 |
$('#' + domId).html(response);
|
| 22245 |
ashik.ali |
781 |
}
|
|
|
782 |
|
| 22860 |
ashik.ali |
783 |
function schemes(domId){
|
| 23026 |
ashik.ali |
784 |
var response = doGetAjaxRequest(context+"/getSchemes");
|
|
|
785 |
$('#' + domId).html(response);
|
| 22860 |
ashik.ali |
786 |
}
|
| 22354 |
ashik.ali |
787 |
|
| 23026 |
ashik.ali |
788 |
function loadSchemesDownloadPage(domId){
|
|
|
789 |
var response = doGetAjaxRequest(context+"/schemes/downloadPage");
|
|
|
790 |
$('#' + domId).html(response);
|
|
|
791 |
}
|
| 22860 |
ashik.ali |
792 |
|
| 23026 |
ashik.ali |
793 |
|
| 22354 |
ashik.ali |
794 |
function contactUs(domId){
|
| 23026 |
ashik.ali |
795 |
var response = doGetAjaxRequest(context+"/contactUs");
|
|
|
796 |
$('#' + domId).html(response);
|
| 22354 |
ashik.ali |
797 |
}
|
|
|
798 |
|
|
|
799 |
function writeOldCustomerDetailsByMobileNumber(mobileNumber){
|
| 23026 |
ashik.ali |
800 |
var response = doGetAjaxRequest(context+"/customer/mobileNumber?mobileNumber="+mobileNumber);
|
|
|
801 |
|
|
|
802 |
var customer = response.response;
|
|
|
803 |
$('#firstName').attr('value', customer.firstName);
|
|
|
804 |
$('#lastName').attr('value', customer.lastName);
|
|
|
805 |
$('#email').attr('value', customer.emailId);
|
|
|
806 |
//$('#phone').attr('value', customer.mobileNumber);
|
|
|
807 |
$('#alternatePhone').attr('value', customer.address.phoneNumber);
|
|
|
808 |
$('#line1').attr('value', customer.address.line1);
|
|
|
809 |
$('#line2').attr('value', customer.address.line2);
|
|
|
810 |
$('#landmark').attr('value', customer.address.landmark);
|
|
|
811 |
$('#pinCode').attr('value', customer.address.pinCode);
|
|
|
812 |
$('#city').attr('value', customer.address.city);
|
|
|
813 |
$('#state').attr('value', customer.address.state).prop('selected',true);
|
|
|
814 |
//$('#state').val(customer.address.state).prop('selected', true);
|
|
|
815 |
$('#phone').attr('addressId', customer.address.id);
|
| 22354 |
ashik.ali |
816 |
}
|
|
|
817 |
|
| 23203 |
ashik.ali |
818 |
function saleHistorySearchInfo(searchType, searchText, startTime, endTime){
|
|
|
819 |
saleHistory("main-content", searchType, searchText, startTime, endTime);
|
| 22283 |
ashik.ali |
820 |
}
|
| 22245 |
ashik.ali |
821 |
|
| 22283 |
ashik.ali |
822 |
|
| 22551 |
ashik.ali |
823 |
|
| 21987 |
kshitij.so |
824 |
function validateOrderDetails(){
|
|
|
825 |
var sNumbers = [];
|
|
|
826 |
var error = false;
|
|
|
827 |
$("form#cd input.serialNumber").each(function(){
|
|
|
828 |
var input = $(this).val().trim();
|
| 22245 |
ashik.ali |
829 |
var itemType = $(this).attr("itemType");
|
| 21987 |
kshitij.so |
830 |
$(this).removeClass("border-highlight");
|
| 22245 |
ashik.ali |
831 |
if (sNumbers.indexOf(input) !=-1 || (itemType ==='SERIALIZED' && !input)){
|
| 21987 |
kshitij.so |
832 |
error = true;
|
|
|
833 |
$(this).addClass("border-highlight");
|
|
|
834 |
}
|
|
|
835 |
sNumbers.push(input);
|
|
|
836 |
});
|
|
|
837 |
|
|
|
838 |
$("form#cd input.unitPrice").each(function(){
|
|
|
839 |
var input = $(this).val().trim();
|
|
|
840 |
$(this).removeClass("border-highlight");
|
|
|
841 |
if (!input || parseInt(input)<=0 || isNaN(input)){
|
|
|
842 |
error=true;
|
|
|
843 |
$(this).addClass("border-highlight");
|
|
|
844 |
}
|
| 23340 |
ashik.ali |
845 |
var unitPrice = parseFloat(input);
|
|
|
846 |
var mopPrice = parseFloat($(this).attr('mopPrice'));
|
|
|
847 |
if(unitPrice < mopPrice){
|
|
|
848 |
error = true;
|
|
|
849 |
alert("sellingPrice must be greater than equal to mop")
|
|
|
850 |
$(this).addClass("border-highlight");
|
|
|
851 |
}
|
| 21987 |
kshitij.so |
852 |
});
|
|
|
853 |
|
| 22581 |
ashik.ali |
854 |
// checking input discountAmount is not greater than maxDiscountAmount
|
|
|
855 |
$("form#cd input.discountAmount").each(function(){
|
|
|
856 |
var input = $(this).val().trim();
|
|
|
857 |
var mop = $(this).attr("mop");
|
| 22860 |
ashik.ali |
858 |
|
| 22581 |
ashik.ali |
859 |
if(mop){
|
| 22860 |
ashik.ali |
860 |
var maxDiscountPriceRangeString = $(this).attr("placeholder");
|
|
|
861 |
var maxDiscountPrice = 0;
|
|
|
862 |
if(maxDiscountPriceRangeString != undefined && maxDiscountPriceRangeString != ''){
|
|
|
863 |
maxDiscountPrice = maxDiscountPriceRangeString.substring(6);
|
|
|
864 |
}
|
| 22581 |
ashik.ali |
865 |
$(this).removeClass("border-highlight");
|
|
|
866 |
if (!input || parseFloat(input)<0 || isNaN(input)){
|
|
|
867 |
alert("DiscountAmount value can not be lesser than 0 or invalid value");
|
|
|
868 |
error=true;
|
|
|
869 |
$(this).addClass("border-highlight");
|
|
|
870 |
}
|
|
|
871 |
if(parseFloat(input) > maxDiscountPrice){
|
| 22655 |
ashik.ali |
872 |
alert("DiscountAmount [" + parseFloat(input) + "] value can not be greater than the suggested maxDiscountPrice [" + maxDiscountPrice + "]");
|
| 22581 |
ashik.ali |
873 |
error=true;
|
|
|
874 |
$(this).addClass("border-highlight");
|
|
|
875 |
}
|
|
|
876 |
}
|
|
|
877 |
});
|
|
|
878 |
|
| 21987 |
kshitij.so |
879 |
var amount = 0;
|
|
|
880 |
var netPayableAmount = parseFloat($("form#cd input.netPayableAmount").val());
|
|
|
881 |
|
|
|
882 |
|
|
|
883 |
$("form#cd input.amount").each(function(){
|
| 22354 |
ashik.ali |
884 |
if ($(this).val() == ""){
|
| 21987 |
kshitij.so |
885 |
$(this).val(0);
|
|
|
886 |
}
|
|
|
887 |
var tmpAmount = parseFloat($(this).val());
|
|
|
888 |
amount = amount + tmpAmount;
|
|
|
889 |
});
|
|
|
890 |
|
|
|
891 |
console.log(amount);
|
|
|
892 |
console.log(netPayableAmount);
|
|
|
893 |
|
| 22354 |
ashik.ali |
894 |
if (amount != netPayableAmount){
|
|
|
895 |
if(amount < netPayableAmount){
|
|
|
896 |
alert("[" + (netPayableAmount - amount) + "] is more required to complete the payment");
|
|
|
897 |
}else{
|
|
|
898 |
alert("[" + (amount - netPayableAmount) + "] is extra amount, please reduce the amount");
|
|
|
899 |
}
|
|
|
900 |
$("form#cd input.netPayableAmount").each(function(){
|
|
|
901 |
$(this).addClass("border-highlight");
|
|
|
902 |
});
|
| 21987 |
kshitij.so |
903 |
error = true;
|
|
|
904 |
}
|
|
|
905 |
|
|
|
906 |
if (error){
|
|
|
907 |
return false;
|
|
|
908 |
}
|
|
|
909 |
return true;
|
|
|
910 |
|
|
|
911 |
}
|
|
|
912 |
|
| 22860 |
ashik.ali |
913 |
function validateSchemeDetails(){
|
|
|
914 |
console.log("validating Scheme Details...");
|
|
|
915 |
var error = false;
|
|
|
916 |
var name = $("form#create-scheme-form input[name=schemeName]").val();
|
|
|
917 |
console.log("schemeName = " + name);
|
|
|
918 |
$("#schemeName").removeClass("border-highlight");
|
| 23203 |
ashik.ali |
919 |
if(name ==""){
|
| 22860 |
ashik.ali |
920 |
alert("Name is required");
|
|
|
921 |
$("#schemeName").addClass("border-highlight");
|
|
|
922 |
error = true;
|
|
|
923 |
return error;
|
|
|
924 |
}
|
|
|
925 |
var schemeType = $("#schemeType option:selected").val();
|
|
|
926 |
console.log("schemeType = " + schemeType);
|
|
|
927 |
$("#schemeType").removeClass("border-highlight");
|
| 23203 |
ashik.ali |
928 |
if(schemeType == ""){
|
| 22860 |
ashik.ali |
929 |
alert("Please choose Scheme Type");
|
|
|
930 |
$("#schemeType").addClass("border-highlight");
|
|
|
931 |
error = true;
|
|
|
932 |
return error;
|
|
|
933 |
}
|
|
|
934 |
var amountType = $("#amountType option:selected").val();
|
|
|
935 |
console.log("amountType = " + amountType);
|
|
|
936 |
$("#amountType").removeClass("border-highlight");
|
| 23203 |
ashik.ali |
937 |
if(amountType == ""){
|
| 22860 |
ashik.ali |
938 |
alert("Please choose Amount Type");
|
|
|
939 |
$("#amountType").addClass("border-highlight");
|
|
|
940 |
error = true;
|
|
|
941 |
return error;
|
|
|
942 |
}
|
|
|
943 |
var amount = $("form#create-scheme-form input[name=schemeAmount]").val();
|
|
|
944 |
console.log("amount = " + amount);
|
|
|
945 |
$("#schemeAmount").removeClass("border-highlight");
|
|
|
946 |
if (amount == ""){
|
|
|
947 |
$("form#create-scheme-form input[name=schemeAmount]").val(0);
|
|
|
948 |
}else if(amount <= 0){
|
|
|
949 |
alert("Amount should be greater than 0");
|
|
|
950 |
$("#schemeAmount").addClass("border-highlight");
|
|
|
951 |
error = true;
|
|
|
952 |
return error;
|
|
|
953 |
}
|
|
|
954 |
|
|
|
955 |
|
| 23299 |
ashik.ali |
956 |
var startDateTimeString = $("form#create-scheme-form input[name=startDateTime]").val();
|
|
|
957 |
var endDateTimeString = $("form#create-scheme-form input[name=endDateTime]").val();
|
|
|
958 |
$("#startDateTime").removeClass("border-highlight");
|
|
|
959 |
$("#endDateTime").removeClass("border-highlight");
|
| 23026 |
ashik.ali |
960 |
|
|
|
961 |
|
|
|
962 |
if(Date.parse(endDateTimeString) < Date.parse(startDateTimeString)){
|
|
|
963 |
alert("End date Time [" + endDateTimeString + "] can not be greater than equal to Start date Time [" + startDateTimeString + "]");
|
| 23299 |
ashik.ali |
964 |
$("#startDateTime").addClass("border-highlight");
|
|
|
965 |
$("#endDateTime").addClass("border-highlight");
|
| 22860 |
ashik.ali |
966 |
error = true;
|
|
|
967 |
return error;
|
|
|
968 |
}
|
|
|
969 |
|
| 23026 |
ashik.ali |
970 |
//$('#brand-value').text($(this).text());
|
|
|
971 |
$("#brand-value").removeClass("border-highlight");
|
|
|
972 |
if($("#brand-value").text() == "Brands"){
|
|
|
973 |
alert("Please choose Brand");
|
|
|
974 |
$("#brand-value").addClass("border-highlight");
|
| 22860 |
ashik.ali |
975 |
error = true;
|
|
|
976 |
return error;
|
|
|
977 |
}
|
|
|
978 |
|
| 23026 |
ashik.ali |
979 |
$("#itemsDescription").removeClass("border-hightlight");
|
|
|
980 |
var itemIdsString = $("#itemsDescription").val();
|
|
|
981 |
if(itemIdsString == null){
|
|
|
982 |
alert("Please choose items");
|
|
|
983 |
$("#itemsDescription").addClass("border-highlight");
|
|
|
984 |
error = true;
|
|
|
985 |
return error;
|
|
|
986 |
}
|
|
|
987 |
|
| 22860 |
ashik.ali |
988 |
var retailerIdsString = $("#retailerIds").val();
|
|
|
989 |
if(retailerIdsString != undefined){
|
|
|
990 |
var retailerIdsPattern = "^[0-9]{1,10}(?:,[0-9]{1,10})*$";
|
|
|
991 |
if(retailerIdsString.match(retailerIdsPattern) == null){
|
|
|
992 |
alert("Invalid retailerIds["+retailerIdsString+"] pattern");
|
|
|
993 |
$("#retailerIds").addClass("border-highlight");
|
|
|
994 |
error = true;
|
|
|
995 |
return error;
|
|
|
996 |
}
|
|
|
997 |
}
|
|
|
998 |
|
|
|
999 |
console.log("validation scheme error = " + error);
|
|
|
1000 |
return error;
|
|
|
1001 |
}
|
|
|
1002 |
|
| 23026 |
ashik.ali |
1003 |
function validateRetailerDetails(){
|
|
|
1004 |
console.log("validating Retailer Details...");
|
|
|
1005 |
var error = false;
|
| 23331 |
ashik.ali |
1006 |
|
|
|
1007 |
var firstName = $("form#update-retailer-details-form input[name=firstName]").val();
|
|
|
1008 |
console.log("firstName = " + firstName);
|
|
|
1009 |
$("#firstName").removeClass("border-highlight");
|
|
|
1010 |
if(firstName == ""){
|
|
|
1011 |
alert("First Name is required");
|
|
|
1012 |
$("#firstName").addClass("border-highlight");
|
|
|
1013 |
error = true;
|
|
|
1014 |
return error;
|
|
|
1015 |
}
|
|
|
1016 |
|
|
|
1017 |
var lastName = $("form#update-retailer-details-form input[name=lastName]").val();
|
|
|
1018 |
console.log("lastName = " + lastName);
|
|
|
1019 |
$("#lastName").removeClass("border-highlight");
|
|
|
1020 |
if(firstName == ""){
|
|
|
1021 |
alert("Last Name is required");
|
|
|
1022 |
$("#lastName").addClass("border-highlight");
|
|
|
1023 |
error = true;
|
|
|
1024 |
return error;
|
|
|
1025 |
}
|
|
|
1026 |
|
|
|
1027 |
var emailId = $("form#update-retailer-details-form input[name=emailId]").val();
|
|
|
1028 |
console.log("emailId = " + emailId);
|
|
|
1029 |
$("#emailId").removeClass("border-highlight");
|
|
|
1030 |
if(emailId == ""){
|
|
|
1031 |
alert("Email Id is required");
|
|
|
1032 |
$("#emailId").addClass("border-highlight");
|
|
|
1033 |
error = true;
|
|
|
1034 |
return error;
|
|
|
1035 |
}
|
|
|
1036 |
|
|
|
1037 |
var mobileNumber = $("form#update-retailer-details-form input[name=mobileNumber]").val();
|
|
|
1038 |
console.log("mobileNumber = " + mobileNumber);
|
|
|
1039 |
$("#mobileNumber").removeClass("border-highlight");
|
|
|
1040 |
if(mobileNumber == ""){
|
|
|
1041 |
alert("Mobile Number is required");
|
|
|
1042 |
$("#mobileNumber").addClass("border-highlight");
|
|
|
1043 |
error = true;
|
|
|
1044 |
return error;
|
|
|
1045 |
}
|
|
|
1046 |
|
| 23026 |
ashik.ali |
1047 |
var retailerName = $("form#update-retailer-details-form input[name=retailerName]").val();
|
|
|
1048 |
console.log("retailerName = " + retailerName);
|
|
|
1049 |
$("#retailerName").removeClass("border-highlight");
|
|
|
1050 |
if(retailerName == ""){
|
|
|
1051 |
alert("Retailer Name is required");
|
|
|
1052 |
$("#retailerName").addClass("border-highlight");
|
|
|
1053 |
error = true;
|
|
|
1054 |
return error;
|
|
|
1055 |
}
|
|
|
1056 |
|
| 23108 |
ashik.ali |
1057 |
/*var retailerNumber = $("form#update-retailer-details-form input[name=retailerNumber]").val();
|
| 23026 |
ashik.ali |
1058 |
console.log("retailerNumber = " + retailerNumber);
|
|
|
1059 |
$("#retailerNumber").removeClass("border-highlight");
|
|
|
1060 |
if(retailerNumber == ""){
|
|
|
1061 |
alert("Retailer Number is required");
|
|
|
1062 |
$("#retailerNumber").addClass("border-highlight");
|
|
|
1063 |
error = true;
|
|
|
1064 |
return error;
|
| 23108 |
ashik.ali |
1065 |
}*/
|
| 23026 |
ashik.ali |
1066 |
|
| 23331 |
ashik.ali |
1067 |
|
|
|
1068 |
var gstNumber = $("form#update-retailer-details-form input[name=gstNumber]").val();
|
|
|
1069 |
console.log("gstNumber = " + gstNumber);
|
|
|
1070 |
var fofo = $("form#update-retailer-details-form input[name=fofoPartner]").val();
|
|
|
1071 |
$("#gstNumber").removeClass("border-highlight");
|
|
|
1072 |
|
|
|
1073 |
var districtName = $("#districtName option:selected").val();
|
|
|
1074 |
if(fofo == "true" && (districtName == undefined || districtName == "")){
|
|
|
1075 |
alert("Please choose district name");
|
|
|
1076 |
$("#districtName").addClass("border-highlight");
|
|
|
1077 |
error = true;
|
|
|
1078 |
return error;
|
|
|
1079 |
}
|
|
|
1080 |
|
|
|
1081 |
if(fofo == "true" && gstNumber == ""){
|
|
|
1082 |
alert("For Fofo Partner GST number is required");
|
|
|
1083 |
$("#gstNumber").addClass("border-highlight");
|
|
|
1084 |
error = true;
|
|
|
1085 |
return error;
|
|
|
1086 |
}
|
|
|
1087 |
|
|
|
1088 |
|
|
|
1089 |
|
| 23026 |
ashik.ali |
1090 |
var fileSelector = $('#retailerDocument')[0];
|
|
|
1091 |
if(fileSelector != undefined && fileSelector.files[0] == undefined){
|
|
|
1092 |
alert("Retailer Document is required");
|
|
|
1093 |
error = true;
|
|
|
1094 |
return error;
|
|
|
1095 |
}
|
|
|
1096 |
|
|
|
1097 |
var retailerAddressName = $("form#update-retailer-details-form input[name=retailerAddressName]").val();
|
|
|
1098 |
console.log("retailerAddressName = " + retailerAddressName);
|
|
|
1099 |
$("#retailerAddressName").removeClass("border-highlight");
|
|
|
1100 |
if(retailerAddressName == ""){
|
|
|
1101 |
alert("Retailer Address Name is required");
|
|
|
1102 |
$("#retailerAddressName").addClass("border-highlight");
|
|
|
1103 |
error = true;
|
|
|
1104 |
return error;
|
|
|
1105 |
}
|
|
|
1106 |
|
|
|
1107 |
var retailerAddressLine1 = $("form#update-retailer-details-form input[name=retailerAddressLine1]").val();
|
|
|
1108 |
console.log("retailerAddressLine1 = " + retailerAddressLine1);
|
|
|
1109 |
$("#retailerAddressLine1").removeClass("border-highlight");
|
|
|
1110 |
if(retailerAddressLine1 == ""){
|
|
|
1111 |
alert("Retailer Address Line1 is required");
|
|
|
1112 |
$("#retailerAddressLine1").addClass("border-highlight");
|
|
|
1113 |
error = true;
|
|
|
1114 |
return error;
|
|
|
1115 |
}
|
|
|
1116 |
|
|
|
1117 |
var retailerAddressLine2 = $("form#update-retailer-details-form input[name=retailerAddressLine2]").val();
|
|
|
1118 |
console.log("retailerAddressLine2 = " + retailerAddressLine2);
|
|
|
1119 |
$("#retailerAddressLine2").removeClass("border-highlight");
|
|
|
1120 |
if(retailerAddressLine2 == ""){
|
|
|
1121 |
alert("Retailer Address Line2 is required");
|
|
|
1122 |
$("#retailerAddressLine2").addClass("border-highlight");
|
|
|
1123 |
error = true;
|
|
|
1124 |
return error;
|
|
|
1125 |
}
|
|
|
1126 |
|
|
|
1127 |
var retailerAddressCity = $("form#update-retailer-details-form input[name=retailerAddressCity]").val();
|
|
|
1128 |
console.log("retailerAddressCity = " + retailerAddressCity);
|
|
|
1129 |
$("#retailerAddressCity").removeClass("border-highlight");
|
|
|
1130 |
if(retailerAddressCity == ""){
|
|
|
1131 |
alert("Retailer Address City is required");
|
|
|
1132 |
$("#retailerAddressCity").addClass("border-highlight");
|
|
|
1133 |
error = true;
|
|
|
1134 |
return error;
|
|
|
1135 |
}
|
|
|
1136 |
|
|
|
1137 |
var retailerAddressPinCode = $("form#update-retailer-details-form input[name=retailerAddressPinCode]").val();
|
|
|
1138 |
console.log("retailerAddressPinCode = " + retailerAddressPinCode);
|
|
|
1139 |
$("#retailerAddressPinCode").removeClass("border-highlight");
|
|
|
1140 |
if(retailerAddressPinCode == ""){
|
|
|
1141 |
alert("Retailer Address Pin Code is required");
|
|
|
1142 |
$("#retailerAddressPinCode").addClass("border-highlight");
|
|
|
1143 |
error = true;
|
|
|
1144 |
return error;
|
|
|
1145 |
}
|
|
|
1146 |
|
| 23331 |
ashik.ali |
1147 |
var retailerAddressState = $("#retailerAddressState option:selected").val();
|
| 23026 |
ashik.ali |
1148 |
console.log("retailerAddressState = " + retailerAddressState);
|
|
|
1149 |
$("#retailerAddressState").removeClass("border-highlight");
|
|
|
1150 |
if(retailerAddressState == ""){
|
|
|
1151 |
alert("Retailer Address State is required");
|
|
|
1152 |
$("#retailerAddressState").addClass("border-highlight");
|
|
|
1153 |
error = true;
|
|
|
1154 |
return error;
|
|
|
1155 |
}
|
|
|
1156 |
|
|
|
1157 |
|
|
|
1158 |
//start from here
|
|
|
1159 |
var shopDetailsSize = $("#shopDetailsSize").attr("size");
|
|
|
1160 |
for(var i = 0; i < shopDetailsSize; i++){
|
|
|
1161 |
var shopName = $("form#update-retailer-details-form input[name=shopName"+i+"]").val();
|
|
|
1162 |
$("form#update-retailer-details-form input[name=shopName"+i+"]").removeClass("border-highlight");
|
|
|
1163 |
if(shopName == ""){
|
|
|
1164 |
alert("Shop Name is required");
|
|
|
1165 |
$("form#update-retailer-details-form input[name=shopName"+i+"]").addClass("border-highlight");
|
|
|
1166 |
error = true;
|
|
|
1167 |
return error;
|
|
|
1168 |
}
|
|
|
1169 |
var fileSelector = $('#retailerShopDocument'+i)[0];
|
|
|
1170 |
if(fileSelector != undefined && fileSelector.files[0] == undefined){
|
|
|
1171 |
alert("Retailer Shop Document is required");
|
|
|
1172 |
error = true;
|
|
|
1173 |
return error;
|
|
|
1174 |
}
|
|
|
1175 |
var shopAddressName = $("form#update-retailer-details-form input[name=shopAddressName"+i+"]").val();
|
|
|
1176 |
$("form#update-retailer-details-form input[name=shopAddressName"+i+"]").removeClass("border-highlight");
|
|
|
1177 |
if(shopAddressName == ""){
|
|
|
1178 |
alert("Shop Address Name is required");
|
|
|
1179 |
$("form#update-retailer-details-form input[name=shopAddressName"+i+"]").addClass("border-highlight");
|
|
|
1180 |
error = true;
|
|
|
1181 |
return error;
|
|
|
1182 |
}
|
|
|
1183 |
var shopAddressLine1 = $("form#update-retailer-details-form input[name=shopAddressLine1"+i+"]").val();
|
|
|
1184 |
$("form#update-retailer-details-form input[name=shopAddressLine1"+i+"]").removeClass("border-highlight");
|
|
|
1185 |
if(shopAddressLine1 == ""){
|
|
|
1186 |
alert("Shop Address Line1 is required");
|
|
|
1187 |
$("form#update-retailer-details-form input[name=shopAddressLine1"+i+"]").addClass("border-highlight");
|
|
|
1188 |
error = true;
|
|
|
1189 |
return error;
|
|
|
1190 |
}
|
|
|
1191 |
var shopAddressLine2 = $("form#update-retailer-details-form input[name=shopAddressLine2"+i+"]").val();
|
|
|
1192 |
$("form#update-retailer-details-form input[name=shopAddressLine2"+i+"]").removeClass("border-highlight");
|
|
|
1193 |
if(shopAddressLine2 == ""){
|
|
|
1194 |
alert("Shop Address Line2 is required");
|
|
|
1195 |
$("form#update-retailer-details-form input[name=shopAddressLine2"+i+"]").addClass("border-highlight");
|
|
|
1196 |
error = true;
|
|
|
1197 |
return error;
|
|
|
1198 |
}
|
|
|
1199 |
var shopAddressCity = $("form#update-retailer-details-form input[name=shopAddressCity"+i+"]").val();
|
|
|
1200 |
$("form#update-retailer-details-form input[name=shopAddressCity"+i+"]").removeClass("border-highlight");
|
|
|
1201 |
if(shopAddressCity == ""){
|
|
|
1202 |
alert("Shop Address City is required");
|
|
|
1203 |
$("form#update-retailer-details-form input[name=shopAddressCity"+i+"]").addClass("border-highlight");
|
|
|
1204 |
error = true;
|
|
|
1205 |
return error;
|
|
|
1206 |
}
|
|
|
1207 |
var shopAddressPinCode = $("form#update-retailer-details-form input[name=shopAddressPinCode"+i+"]").val();
|
|
|
1208 |
$("form#update-retailer-details-form input[name=shopAddressPinCode"+i+"]").removeClass("border-highlight");
|
|
|
1209 |
if(shopAddressPinCode == ""){
|
|
|
1210 |
alert("Shop Address is Pin Code required");
|
|
|
1211 |
$("form#update-retailer-details-form input[name=shopAddressPinCode"+i+"]").addClass("border-highlight");
|
|
|
1212 |
error = true;
|
|
|
1213 |
return error;
|
|
|
1214 |
}
|
| 23331 |
ashik.ali |
1215 |
var shopAddressState = $("#shopAddressState"+i+" option:selected").val();
|
|
|
1216 |
$("#shopAddressState"+i+" option:selected").removeClass("border-highlight");
|
| 23026 |
ashik.ali |
1217 |
if(shopAddressState == ""){
|
|
|
1218 |
alert("Shop Address State is required");
|
| 23331 |
ashik.ali |
1219 |
$("#shopAddressState"+i+" option:selected").addClass("border-highlight");
|
| 23026 |
ashik.ali |
1220 |
error = true;
|
|
|
1221 |
return error;
|
|
|
1222 |
}
|
|
|
1223 |
}
|
|
|
1224 |
|
|
|
1225 |
console.log("validation retailer details error = " + error);
|
|
|
1226 |
return error;
|
|
|
1227 |
}
|
|
|
1228 |
|
|
|
1229 |
|
|
|
1230 |
function retailerDetailsJson(){
|
|
|
1231 |
console.log("retailerDetailsJson")
|
|
|
1232 |
var retailerDetailsObject = {};
|
| 23331 |
ashik.ali |
1233 |
retailerDetailsObject['userFirstName'] = $("form#update-retailer-details-form input[name=firstName]").val();
|
|
|
1234 |
retailerDetailsObject['userLastName'] = $("form#update-retailer-details-form input[name=lastName]").val();
|
|
|
1235 |
retailerDetailsObject['userEmailId'] = $("form#update-retailer-details-form input[name=emailId]").val();
|
|
|
1236 |
retailerDetailsObject['userMobileNumber'] = $("form#update-retailer-details-form input[name=mobileNumber]").val();
|
|
|
1237 |
|
|
|
1238 |
//retailerDetailsObject['emailIdOrMobileNumber'] = $('#retailer-details-search-text').val().trim();
|
|
|
1239 |
retailerDetailsObject['emailIdOrMobileNumber'] = $("form#update-retailer-details-form input[name=emailId]").val();
|
| 23026 |
ashik.ali |
1240 |
retailerDetailsObject['name'] = $("form#update-retailer-details-form input[name=retailerName]").val();
|
|
|
1241 |
retailerDetailsObject['number'] = $("form#update-retailer-details-form input[name=retailerNumber]").val();
|
| 23331 |
ashik.ali |
1242 |
var districtName = $("#form #update-retailer-details-form input[name=districtName] selected")
|
|
|
1243 |
retailerDetailsObject['fofo'] = $("form#update-retailer-details-form input[name=fofoPartner]").val();
|
|
|
1244 |
retailerDetailsObject['gstNumber'] = $("form#update-retailer-details-form input[name=gstNumber]").val();
|
|
|
1245 |
retailerDetailsObject['active'] = $("form#update-retailer-details-form input[name=active]").val();
|
| 23026 |
ashik.ali |
1246 |
var fileSelector = $('#retailerDocument')[0];
|
|
|
1247 |
if(fileSelector != undefined && fileSelector.files[0] != undefined){
|
|
|
1248 |
var documentId = uploadDocument(fileSelector.files[0]);
|
|
|
1249 |
retailerDetailsObject['documentId'] = documentId;
|
|
|
1250 |
}else{
|
|
|
1251 |
retailerDetailsObject['documentId'] = 0;
|
|
|
1252 |
}
|
|
|
1253 |
|
|
|
1254 |
//retailerDetailsObject['file'] = $('#retailerDocument')[0].files[0];
|
|
|
1255 |
var retailerAddressObject = {};
|
|
|
1256 |
retailerAddressObject['name'] = $("form#update-retailer-details-form input[name=retailerAddressName]").val();
|
|
|
1257 |
retailerAddressObject['line1'] = $("form#update-retailer-details-form input[name=retailerAddressLine1]").val();
|
|
|
1258 |
retailerAddressObject['line2'] = $("form#update-retailer-details-form input[name=retailerAddressLine2]").val();
|
|
|
1259 |
retailerAddressObject['city'] = $("form#update-retailer-details-form input[name=retailerAddressCity]").val();
|
|
|
1260 |
retailerAddressObject['pinCode'] = $("form#update-retailer-details-form input[name=retailerAddressPinCode]").val();
|
| 23331 |
ashik.ali |
1261 |
retailerAddressObject['state'] = $("#retailerAddressState option:selected").val();
|
| 23026 |
ashik.ali |
1262 |
|
|
|
1263 |
retailerDetailsObject['address'] = retailerAddressObject;
|
|
|
1264 |
|
|
|
1265 |
retailerDetailsObject['shops'] = [];
|
|
|
1266 |
var shopDetailsSize = $("#shopDetailsSize").attr("size");
|
|
|
1267 |
|
|
|
1268 |
for(var i = 0; i < shopDetailsSize; i++){
|
|
|
1269 |
var shopObject = {};
|
| 23080 |
ashik.ali |
1270 |
var shopId = $("form#update-retailer-details-form input[name=shopName"+i+"]").attr('shopId');
|
|
|
1271 |
shopObject['shopId'] = shopId;
|
| 23026 |
ashik.ali |
1272 |
shopObject['name'] = $("form#update-retailer-details-form input[name=shopName"+i+"]").val();
|
|
|
1273 |
|
|
|
1274 |
var fileSelector = $('#retailerShopDocument'+i)[0];
|
|
|
1275 |
if(fileSelector != undefined && fileSelector.files[0] != undefined){
|
|
|
1276 |
var documentId = uploadDocument(fileSelector.files[0]);
|
|
|
1277 |
shopObject['documentId'] = documentId;
|
|
|
1278 |
}else{
|
|
|
1279 |
shopObject['documentId'] = 0;
|
|
|
1280 |
}
|
| 23080 |
ashik.ali |
1281 |
var sameAsRetailerAddress = $("form#update-retailer-details-form input[name=sameAsRetailerAddress"+i+"]").val();
|
| 23092 |
ashik.ali |
1282 |
shopObject['sameAsRetailerAddress'] = (sameAsRetailerAddress == 'true');
|
|
|
1283 |
if(shopId == '0' && sameAsRetailerAddress == 'true'){
|
| 23080 |
ashik.ali |
1284 |
shopObject['address'] = null;
|
|
|
1285 |
}else{
|
|
|
1286 |
shopObject['address'] = getShopAddressObject(i);
|
|
|
1287 |
}
|
| 23026 |
ashik.ali |
1288 |
retailerDetailsObject['shops'].push(shopObject);
|
| 23080 |
ashik.ali |
1289 |
|
| 23026 |
ashik.ali |
1290 |
}
|
|
|
1291 |
|
|
|
1292 |
return JSON.stringify(retailerDetailsObject);
|
|
|
1293 |
}
|
|
|
1294 |
|
| 23080 |
ashik.ali |
1295 |
function getShopAddressObject(counter){
|
|
|
1296 |
var shopAddressObject = {};
|
|
|
1297 |
shopAddressObject['name'] = $("form#update-retailer-details-form input[name=shopAddressName"+counter+"]").val();
|
|
|
1298 |
shopAddressObject['line1'] = $("form#update-retailer-details-form input[name=shopAddressLine1"+counter+"]").val();
|
|
|
1299 |
shopAddressObject['line2'] = $("form#update-retailer-details-form input[name=shopAddressLine2"+counter+"]").val();
|
|
|
1300 |
shopAddressObject['city'] = $("form#update-retailer-details-form input[name=shopAddressCity"+counter+"]").val();
|
|
|
1301 |
shopAddressObject['pinCode'] = $("form#update-retailer-details-form input[name=shopAddressPinCode"+counter+"]").val();
|
| 23331 |
ashik.ali |
1302 |
shopAddressObject['state'] = $("#shopAddressState"+counter+" option:selected").val();
|
| 23080 |
ashik.ali |
1303 |
return shopAddressObject;
|
|
|
1304 |
}
|
|
|
1305 |
|
| 22860 |
ashik.ali |
1306 |
function schemeDetailsJson(){
|
|
|
1307 |
console.log("schemeDetailsJson")
|
|
|
1308 |
var schemeObject = {};
|
|
|
1309 |
schemeObject['name'] = $("form#create-scheme-form input[name=schemeName]").val();
|
|
|
1310 |
schemeObject['description'] = $("form#create-scheme-form input[name=description]").val();
|
|
|
1311 |
schemeObject['type'] = $("#schemeType option:selected").val();
|
|
|
1312 |
schemeObject['amountType'] = $("#amountType option:selected").val();
|
|
|
1313 |
schemeObject['amount'] = $('#schemeAmount').val();
|
| 23299 |
ashik.ali |
1314 |
//var startEndDateTime = $("form#create-scheme-form input[name=startEndDateTime]").val().split("-");
|
|
|
1315 |
var startDateTimeString = $("form#create-scheme-form input[name=startDateTime]").val();
|
| 23026 |
ashik.ali |
1316 |
console.log("startDateTimeString : "+startDateTimeString);
|
| 23299 |
ashik.ali |
1317 |
var endDateTimeString = $("form#create-scheme-form input[name=endDateTime]").val();
|
| 23026 |
ashik.ali |
1318 |
console.log("endDateTimeString : "+endDateTimeString);
|
|
|
1319 |
|
|
|
1320 |
schemeObject['startDateTimeString'] = startDateTimeString;
|
|
|
1321 |
schemeObject['endDateTimeString'] = endDateTimeString;
|
| 22860 |
ashik.ali |
1322 |
schemeObject['itemIds'] = [];
|
| 23026 |
ashik.ali |
1323 |
var itemIds = $("#itemsDescription").val();
|
|
|
1324 |
//var itemIds = itemIdsString.substring(1, itemIdsString.length - 1).split(",");
|
|
|
1325 |
for(var i = 0; i < itemIds.length; i++){
|
|
|
1326 |
schemeObject['itemIds'].push(parseInt(itemIds[i]));
|
| 22860 |
ashik.ali |
1327 |
}
|
|
|
1328 |
schemeObject['retailerAll'] = $("form#create-scheme-form input[name=retailerAll]").val();
|
|
|
1329 |
if($("#retailerAll").val() == 'true'){
|
|
|
1330 |
schemeObject['retailerIds'] = [];
|
|
|
1331 |
}else{
|
|
|
1332 |
schemeObject['retailerIds'] = []
|
|
|
1333 |
var retailerIds = $("#retailerIds").val().split(",");
|
|
|
1334 |
for(var retailerId of retailerIds){
|
|
|
1335 |
schemeObject['retailerIds'].push(parseInt(retailerId));
|
|
|
1336 |
}
|
|
|
1337 |
}
|
|
|
1338 |
return JSON.stringify(schemeObject);
|
|
|
1339 |
}
|
|
|
1340 |
|
| 22681 |
amit.gupta |
1341 |
function getSerialNumbersFromOrder($el){
|
|
|
1342 |
var $serialNumberElement = $el.find('.serialNumber');
|
| 22860 |
ashik.ali |
1343 |
if($serialNumberElement.val() == ''){
|
|
|
1344 |
return null;
|
|
|
1345 |
}
|
| 22681 |
amit.gupta |
1346 |
var insuranceAmount = parseFloat($el.find('.insuranceAmount').val());
|
|
|
1347 |
if(insuranceAmount > 0){
|
|
|
1348 |
insurance = true;
|
|
|
1349 |
globalInsurace = true;
|
|
|
1350 |
}else{
|
|
|
1351 |
insurance = false;
|
|
|
1352 |
}
|
|
|
1353 |
return {'serialNumber':$serialNumberElement.val(),'insurance':insurance,'amount':insuranceAmount}
|
|
|
1354 |
}
|
|
|
1355 |
|
| 21987 |
kshitij.so |
1356 |
function orderDetailsPayload(){
|
|
|
1357 |
var orderObj = {};
|
|
|
1358 |
var priceQtyArray = [];
|
|
|
1359 |
var customerObj = {};
|
|
|
1360 |
var paymentOption = [];
|
| 22860 |
ashik.ali |
1361 |
var globalInsurance = false;
|
| 21987 |
kshitij.so |
1362 |
|
|
|
1363 |
$("form#cd input.serialNumber").each(function(){
|
|
|
1364 |
var itemId = parseInt($(this).attr("itemId"));
|
| 22860 |
ashik.ali |
1365 |
if (orderObj.hasOwnProperty('fofoOrderItems')){
|
|
|
1366 |
var itemDetails = orderObj['fofoOrderItems'];
|
| 21987 |
kshitij.so |
1367 |
if (itemDetails.hasOwnProperty(itemId)){
|
|
|
1368 |
var serialNumbers = itemDetails[itemId];
|
|
|
1369 |
serialNumbers.push($(this).val());
|
|
|
1370 |
itemDetails[itemId] = serialNumbers;
|
| 22245 |
ashik.ali |
1371 |
}else{
|
| 21987 |
kshitij.so |
1372 |
var serialNumbers = [];
|
|
|
1373 |
serialNumbers.push($(this).val());
|
|
|
1374 |
itemDetails[itemId] = serialNumbers;
|
|
|
1375 |
}
|
| 22245 |
ashik.ali |
1376 |
}else{
|
| 21987 |
kshitij.so |
1377 |
var serialNumbers = [];
|
|
|
1378 |
serialNumbers.push($(this).val());
|
|
|
1379 |
var tmp ={};
|
|
|
1380 |
tmp[itemId] = serialNumbers;
|
| 22860 |
ashik.ali |
1381 |
orderObj['fofoOrderItems'] = tmp;
|
| 21987 |
kshitij.so |
1382 |
}
|
|
|
1383 |
});
|
|
|
1384 |
console.log( JSON.stringify(orderObj));
|
| 22581 |
ashik.ali |
1385 |
$("#order-details").find("tr:not(:first-child)").each(function(index, el){
|
|
|
1386 |
//console.log(el);
|
|
|
1387 |
//console.log(index);
|
| 22681 |
amit.gupta |
1388 |
var $el = $(el);
|
|
|
1389 |
var $unitPriceElement = $el.find('.unitPrice');
|
|
|
1390 |
var $discountAmountElement = $el.find('.discountAmount');
|
| 22581 |
ashik.ali |
1391 |
|
|
|
1392 |
var itemId = parseInt($unitPriceElement.attr("itemId"));
|
|
|
1393 |
var unitPrice = parseFloat($unitPriceElement.val());
|
|
|
1394 |
var qty = parseInt($unitPriceElement.attr("quantity"));
|
|
|
1395 |
var discountAmount = parseFloat($discountAmountElement.val());
|
|
|
1396 |
var mop = $discountAmountElement.attr("mop");
|
|
|
1397 |
var tmpObj = {'itemId':itemId,'sellingPrice':unitPrice,'quantity':qty};
|
|
|
1398 |
tmpObj.discountAmount = discountAmount;
|
| 22860 |
ashik.ali |
1399 |
/*tmpObj['serialNumberDetails'] = [];
|
|
|
1400 |
var found = false;
|
|
|
1401 |
for(var i = 0; i < priceQtyArray.length; i++){
|
|
|
1402 |
if (priceQtyArray[i]["itemId"] == itemId){
|
|
|
1403 |
found = true;
|
|
|
1404 |
break;
|
|
|
1405 |
}
|
|
|
1406 |
}
|
|
|
1407 |
if(!found){
|
|
|
1408 |
priceQtyArray.push(tmpObj);
|
|
|
1409 |
}else{
|
|
|
1410 |
for(var i = 0; i < priceQtyArray.length; i++){
|
|
|
1411 |
if (priceQtyArray[i]["itemId"] == itemId){
|
|
|
1412 |
priceQtyArray[i]["quantity"] = priceQtyArray[i]["quantity"] + 1;
|
|
|
1413 |
break;
|
|
|
1414 |
}
|
|
|
1415 |
}
|
|
|
1416 |
}
|
|
|
1417 |
var serialNumberDetails = getSerialNumbersFromOrder($el);
|
|
|
1418 |
if(serialNumberDetails != null){
|
|
|
1419 |
for(var i = 0; i < priceQtyArray.length; i++){
|
|
|
1420 |
if (priceQtyArray[i]["itemId"] == itemId){
|
|
|
1421 |
priceQtyArray[i]["serialNumberDetails"].push(serialNumberDetails);
|
|
|
1422 |
break;
|
|
|
1423 |
}
|
|
|
1424 |
}
|
|
|
1425 |
}
|
|
|
1426 |
});*/
|
| 22581 |
ashik.ali |
1427 |
|
| 22860 |
ashik.ali |
1428 |
if (orderObj['fofoOrderItems'][itemId] === undefined){
|
|
|
1429 |
tmpObj['serialNumberDetails'] =[];
|
|
|
1430 |
}
|
|
|
1431 |
else{
|
|
|
1432 |
//tmpObj['serialNumbers'] = orderObj['fofoLineItems'][itemId];
|
|
|
1433 |
tmpObj['serialNumberDetails'] = [];
|
|
|
1434 |
}
|
|
|
1435 |
var found = false;
|
|
|
1436 |
for(var i = 0; i < priceQtyArray.length; i++){
|
|
|
1437 |
if (priceQtyArray[i]["itemId"] == itemId){
|
|
|
1438 |
priceQtyArray[i]["quantity"] = priceQtyArray[i]["quantity"] + 1;
|
|
|
1439 |
found = true;
|
|
|
1440 |
break;
|
|
|
1441 |
}
|
|
|
1442 |
}
|
|
|
1443 |
if(!found){
|
|
|
1444 |
priceQtyArray.push(tmpObj);
|
|
|
1445 |
}
|
| 21987 |
kshitij.so |
1446 |
});
|
|
|
1447 |
|
| 22860 |
ashik.ali |
1448 |
|
|
|
1449 |
$("#order-details").find("tr:not(:first-child)").each(function(index,el){
|
|
|
1450 |
//console.log(el);
|
|
|
1451 |
//console.log(index);
|
|
|
1452 |
var $serialNumberElement = $(el).find('.serialNumber');
|
|
|
1453 |
var itemId = parseInt($serialNumberElement.attr("itemId"));
|
|
|
1454 |
var insuranceAmount = parseFloat($(el).find('.insuranceAmount').val());
|
|
|
1455 |
//if (priceQtyArray['fofoLineItems'][itemId] !=undefined){
|
|
|
1456 |
|
|
|
1457 |
//}
|
|
|
1458 |
//console.log($serialNumberElement.val());
|
|
|
1459 |
//console.log(itemId);
|
|
|
1460 |
for(var i = 0; i < priceQtyArray.length; i++){
|
|
|
1461 |
console.log(priceQtyArray[i]["itemId"]);
|
|
|
1462 |
if (priceQtyArray[i]["itemId"] == itemId){
|
|
|
1463 |
if(insuranceAmount > 0){
|
|
|
1464 |
insurance = true;
|
|
|
1465 |
globalInsurance = true;
|
|
|
1466 |
}else{
|
|
|
1467 |
insurance = false;
|
|
|
1468 |
}
|
|
|
1469 |
var serialNumberDetails = {'serialNumber':$serialNumberElement.val(),'insurance':insurance,'amount':insuranceAmount}
|
|
|
1470 |
priceQtyArray[i]['serialNumberDetails'].push(serialNumberDetails);
|
|
|
1471 |
}
|
|
|
1472 |
}
|
|
|
1473 |
});
|
|
|
1474 |
|
| 22245 |
ashik.ali |
1475 |
console.log("priceQtyArray : "+JSON.stringify(priceQtyArray));
|
|
|
1476 |
customerObj['firstName'] = $("form#cd input[name=firstName]").val();
|
|
|
1477 |
customerObj['lastName'] = $("form#cd input[name=lastName]").val();
|
| 21987 |
kshitij.so |
1478 |
customerObj['mobileNumber'] = $("form#cd input[name=phone]").val();
|
|
|
1479 |
customerObj['emailId'] = $("form#cd input[name=email]").val();
|
| 22594 |
ashik.ali |
1480 |
customerObj['dateOfBirth'] = $("form#cd input[name=dateOfBirth]").val();
|
| 21987 |
kshitij.so |
1481 |
var customerAddress = {};
|
| 22245 |
ashik.ali |
1482 |
customerAddress['name'] = $("form#cd input[name=firstName]").val() + " " + $("form#cd input[name=lastName]").val();
|
| 21987 |
kshitij.so |
1483 |
customerAddress['line1'] = $("form#cd input[name=line1]").val();
|
|
|
1484 |
customerAddress['line2'] = $("form#cd input[name=line2]").val();
|
|
|
1485 |
customerAddress['landmark'] = $("form#cd input[name=landmark]").val();
|
|
|
1486 |
customerAddress['city'] = $("form#cd input[name=city]").val();
|
|
|
1487 |
customerAddress['state'] = $('select[name=state] option:selected').val();
|
| 22245 |
ashik.ali |
1488 |
customerAddress['pinCode'] = $("form#cd input[name=pinCode]").val();
|
| 21987 |
kshitij.so |
1489 |
customerAddress['phoneNumber'] = $("form#cd input[name=alternatePhone]").val();
|
|
|
1490 |
customerAddress['country'] = "India";
|
| 22860 |
ashik.ali |
1491 |
customerObj['customerAddressId'] = parseInt($("form#cd input[name=phone]").attr("addressId"));
|
| 21987 |
kshitij.so |
1492 |
customerObj['address'] = customerAddress;
|
|
|
1493 |
console.log( JSON.stringify(customerObj));
|
|
|
1494 |
$("#payment-details input").each(function(){
|
|
|
1495 |
console.log($(this).attr('name'));
|
|
|
1496 |
if ($(this).attr('name') =="" ){
|
|
|
1497 |
return;
|
|
|
1498 |
}
|
|
|
1499 |
var paymentObj = {};
|
|
|
1500 |
paymentObj['type'] = $(this).attr('name');
|
|
|
1501 |
if ($(this).val() == ""){
|
|
|
1502 |
paymentObj['amount'] = 0.0;
|
|
|
1503 |
}
|
|
|
1504 |
else{
|
|
|
1505 |
paymentObj['amount'] = parseFloat($(this).val());
|
|
|
1506 |
}
|
|
|
1507 |
paymentOption.push(paymentObj);
|
|
|
1508 |
});
|
|
|
1509 |
console.log( JSON.stringify(paymentOption));
|
|
|
1510 |
|
|
|
1511 |
var retObj = {};
|
| 22254 |
ashik.ali |
1512 |
var dateOfBirth = $("form#cd input[name=dateOfBirth]").val();
|
| 22860 |
ashik.ali |
1513 |
if(globalInsurance){
|
| 22681 |
amit.gupta |
1514 |
retObj['customerDateOfBirth'] = (dateOfBirth);
|
| 22254 |
ashik.ali |
1515 |
}
|
| 22860 |
ashik.ali |
1516 |
retObj['fofoOrderItems'] = (priceQtyArray);
|
| 21987 |
kshitij.so |
1517 |
retObj['customer'] = (customerObj);
|
|
|
1518 |
retObj['paymentOptions'] = (paymentOption);
|
| 22254 |
ashik.ali |
1519 |
|
| 21987 |
kshitij.so |
1520 |
console.log(retObj);
|
|
|
1521 |
return JSON.stringify(retObj);
|
| 23026 |
ashik.ali |
1522 |
}
|