Subversion Repositories SmartDukaan

Rev

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

Rev Author Line No. Line
33512 tejus.loha 1
$(document).on('click', ".onboarding_timeline", function () {
2
    doGetAjaxRequestHandler(context + "/partnerStoreTimeline",
3
        function (response) {
4
            $('#' + 'main-content').html(response);
5
        });
6
});
29061 tejbeer 7
 
35971 aman 8
$(document).on('click', ".delay-panel", function () {
9
    doGetAjaxRequestHandler(context + "/partnerDelayPanel",
10
        function (response) {
11
            $('#' + 'main-content').html(response);
12
        });
13
});
14
 
33512 tejus.loha 15
$(document).on('click', ".legal-kyc", function () {
16
    doGetAjaxRequestHandler(context + "/getOpenPartnerPendingKyc",
17
        function (response) {
18
            $('#' + 'main-content').html(response);
19
        });
20
});
29794 tejbeer 21
 
33512 tejus.loha 22
$(document).on('click', '.submit1', function () {
23
    var row = $(this).closest("tr");
24
    console.log(row);
25
    var rowIndex = $(this).closest('tr').prevAll().length;
29794 tejbeer 26
 
33512 tejus.loha 27
    var data0 = $(row).find("td:eq(0)").text();
28
    var data1 = $(row).find("input[name='outlateName']").val();
29
    var data2 = $(row).find("td:eq(2)").text();
30
    if (data2 != "") {
31
        data2 = data2 + "T00:00:00";
32
    }
33
    var data3 = $(row).find("input[name='acquireddate']").val();
34
    if (data3 != "") {
35
        data3 = data3 + "T00:00:00";
36
    }
37
    var data4 = $(row).find("input[name='updateOutlateName']").val();
28908 tejbeer 38
 
33512 tejus.loha 39
    var data5 = $(row).find("input[name='phonenumber1']").val();
28908 tejbeer 40
 
33512 tejus.loha 41
    var counterPotential = $(row).find("input[name='counterPotential']").val();
28908 tejbeer 42
 
33512 tejus.loha 43
    console.log(counterPotential)
28908 tejbeer 44
 
45
 
32843 shampa 46
//		var rbmAuthId = $(row).find("input[name='hiddenrbmAuthId']").val();
33512 tejus.loha 47
    var rbmAuthId = $(row).find("select[name='rbmAuthId']").val();
31730 tejbeer 48
 
33512 tejus.loha 49
    console.log(rbmAuthId)
28908 tejbeer 50
 
33512 tejus.loha 51
    var data6 = $(row).find("input[name='city1']").val();
29763 tejbeer 52
 
33512 tejus.loha 53
    var data7 = $(row).find("#authUserStateHead option:selected").val();
54
    var data8 = $(row).find("#authUserbdm option:selected").val();
29763 tejbeer 55
 
33512 tejus.loha 56
    var data9 = $(row).find("input[name='abrand1']").val();
57
    var data10 = $(row).find("input[name='recbrand1']").val();
58
    var data11 = $(row).find("input[name='BrandFeesdate1']").val();
59
    if (data11 != "") {
60
        data11 = data11 + "T00:00:00";
61
    }
27813 tejbeer 62
 
33512 tejus.loha 63
    var data12 = $(row).find("input[name='awallet']").val();
27833 tejbeer 64
 
33512 tejus.loha 65
    var data13 = $(row).find("input[name='idate1']").val();
66
    if (data13 != "") {
67
        data13 = data13 + "T00:00:00";
68
    }
69
    var data14 = $(row).find(".kyc input[type=hidden]").val();
70
    var data15 = $(row).find(".aadhar input[type=hidden]").val();
71
    var data16 = $(row).find(".pan input[type=hidden]").val();
72
    var data17 = $(row).find(".gst input[type=hidden]").val();
73
    var data18 = $(row).find(".cancheque input[type=hidden]").val();
74
    var data19 = $(row).find(".rent input[type=hidden]").val();
75
    console.log("data19" + data19);
76
    var data20 = $(row).find(".loi input[type=hidden]").val();
77
    console.log("data18" + data18);
29061 tejbeer 78
 
33512 tejus.loha 79
    var docCompleted = $(row).find("#allDocumentComp option:selected").val();
29061 tejbeer 80
 
81
 
33512 tejus.loha 82
    var data21 = $(row).find("input[name='code1']").val();
83
    console.log(data21);
84
    var data22 = $(row).find("input[name='rplaned1']").val();
85
    if (data22 != "") {
86
        data22 = data22 + "T00:00:00";
87
    }
88
    var data23 = $(row).find("input[name='ractual1']").val();
89
    if (data23 != "") {
90
        data23 = data23 + "T00:00:00";
91
    }
92
    var data24 = $(row).find("input[name='deploymentPlanedDate']").val();
93
    if (data24 != "") {
94
        data24 = data24 + "T00:00:00";
95
    }
96
    var data25 = $(row).find("input[name='dactual']").val();
97
    if (data25 != "") {
98
        data25 = data25 + "T00:00:00";
99
    }
100
    var data26 = $(row).find("input[name='spayment1']").val();
27813 tejbeer 101
 
33512 tejus.loha 102
    var data27 = $(row).find("input[name='exdate']").val();
103
    if (data27 != "") {
104
        data27 = data27 + "T00:00:00";
105
    }
27829 tejbeer 106
 
33512 tejus.loha 107
    var data28 = $(row).find("input[name='paydate']").val();
27833 tejbeer 108
 
33512 tejus.loha 109
    if (data28 != "") {
110
        data28 = data28 + "T00:00:00";
111
    }
112
    var data29 = $(row).find("input[name='inaugrationDate']").val();
27833 tejbeer 113
 
33512 tejus.loha 114
    if (data29 != "") {
115
        data29 = data29 + "T00:00:00";
116
    }
27884 tejbeer 117
 
33512 tejus.loha 118
    var data30 = $(row).find("#billingStatus input[type='checkbox']").is(":checked") ? 1 : 0;
33891 tejus.loha 119
    var data31 = $(row).find(".aadharBack input[type=hidden]").val();
27884 tejbeer 120
 
33512 tejus.loha 121
    var partnerOnBoardingObject = {};
122
    partnerOnBoardingObject['id'] = data0
28908 tejbeer 123
 
124
 
33512 tejus.loha 125
    partnerOnBoardingObject['createdTimestamp'] = data2
126
    partnerOnBoardingObject['acquiredDate'] = data3
127
    partnerOnBoardingObject['outletName'] = data4
128
    partnerOnBoardingObject['phoneNumber'] = data5
28908 tejbeer 129
 
33512 tejus.loha 130
    partnerOnBoardingObject['authId'] = rbmAuthId
131
    partnerOnBoardingObject['city'] = data6
132
    partnerOnBoardingObject['stateHead'] = data7
133
    partnerOnBoardingObject['bdm'] = data8
27829 tejbeer 134
 
33512 tejus.loha 135
    partnerOnBoardingObject['agreedBrandFees'] = data9
136
    partnerOnBoardingObject['receivedBrandFees'] = data10
137
    partnerOnBoardingObject['finalBrandFees'] = data11
138
    partnerOnBoardingObject['agreedWallet'] = data12
139
    partnerOnBoardingObject['investmentDate'] = data13
140
    partnerOnBoardingObject['kyc'] = data14
141
    partnerOnBoardingObject['aadharDoc'] = data15
33891 tejus.loha 142
    partnerOnBoardingObject['aadharDocBack'] = data31
33512 tejus.loha 143
    partnerOnBoardingObject['panDoc'] = data16
144
    partnerOnBoardingObject['gst'] = data17
145
    partnerOnBoardingObject['cancelCheque'] = data18
146
    partnerOnBoardingObject['rentAgreement'] = data19
147
    partnerOnBoardingObject['loi'] = data20
148
    partnerOnBoardingObject['docCompleted'] = docCompleted
149
    partnerOnBoardingObject['code'] = data21
150
    partnerOnBoardingObject['receePlaned'] = data22
151
    partnerOnBoardingObject['receeActual'] = data23
152
    partnerOnBoardingObject['deploymentPlanedDate'] = data24
153
    partnerOnBoardingObject['deploymentDate'] = data25
154
    partnerOnBoardingObject['stockPayment'] = data26
155
    partnerOnBoardingObject['expectedDate'] = data27
156
    partnerOnBoardingObject['payDate'] = data28
157
    partnerOnBoardingObject['inaugrationDate'] = data29
158
    partnerOnBoardingObject['billingStatus'] = data30
159
    partnerOnBoardingObject['counterPotential'] = counterPotential
27829 tejbeer 160
 
33512 tejus.loha 161
    var jsonObject = JSON.stringify(partnerOnBoardingObject);
27829 tejbeer 162
 
33512 tejus.loha 163
    console.log(jsonObject);
27829 tejbeer 164
 
33512 tejus.loha 165
    if (confirm("Are you sure you want to submit the request") == true) {
166
        doAjaxRequestWithJsonHandler(context + "/partnerOnBoardingListing", "POST", jsonObject, function (response) {
167
            row.html(response);
168
            row.css("background-color", "#F8F8FF");
27858 tejbeer 169
 
33512 tejus.loha 170
        });
171
    }
27829 tejbeer 172
 
33512 tejus.loha 173
});
174
$(document).on('change', "input.leadIdOnboarding", function () {
175
    var leadId = $("#leadId").val();
176
    console.log(leadId)
28908 tejbeer 177
 
33512 tejus.loha 178
    doAjaxRequestHandler(context + "/getLead?leadId=" + leadId, "GET",
179
        function (response) {
180
            console.log(response)
31370 tejbeer 181
 
33512 tejus.loha 182
            console.log(response.response)
31370 tejbeer 183
 
33512 tejus.loha 184
            var data = response.response
31370 tejbeer 185
 
33512 tejus.loha 186
            $('#outLetName1').val(data.outLetName);
187
            $('#number1').val(data.leadMobile);
31370 tejbeer 188
 
189
 
33512 tejus.loha 190
        });
31370 tejbeer 191
 
33512 tejus.loha 192
})
31370 tejbeer 193
 
33512 tejus.loha 194
$(document).on('click', '.submit-design', function () {
195
    var row = $(this).closest("tr");
196
    console.log(row);
197
    var rowIndex = $(this).closest('tr').prevAll().length;
28908 tejbeer 198
 
33512 tejus.loha 199
    var id = $(row).find("td:eq(0)").text();
28908 tejbeer 200
 
33512 tejus.loha 201
    var outletName = $(row).find("td:eq(1) input[type='text']").val();
202
    var createdTimestamp = $(row).find("td:eq(2)").text();
35971 aman 203
    if (createdTimestamp) {
33512 tejus.loha 204
        createdTimestamp = createdTimestamp + "T00:00:00";
35971 aman 205
    } else {
206
        createdTimestamp = "";
33512 tejus.loha 207
    }
208
    var acquiredDate = $(row).find("td:eq(3) input[type='date']").val();
35971 aman 209
    if (acquiredDate) {
33512 tejus.loha 210
        acquiredDate = acquiredDate + "T00:00:00";
35971 aman 211
    } else {
212
        acquiredDate = "";
33512 tejus.loha 213
    }
28908 tejbeer 214
 
33512 tejus.loha 215
    var phoneNumber = $(row).find("td:eq(4) input[type='number']").val();
28908 tejbeer 216
 
217
 
33512 tejus.loha 218
    var city = $(row).find("td:eq(5) input[type='text']").val();
28908 tejbeer 219
 
27829 tejbeer 220
 
33512 tejus.loha 221
    var agreedBrandFees = $(row).find("td:eq(8) input[type='text']").val();
29763 tejbeer 222
 
33512 tejus.loha 223
    console.log("agreedBrandFees" + agreedBrandFees);
27829 tejbeer 224
 
28908 tejbeer 225
 
33512 tejus.loha 226
    var investmentDate = $(row).find("td:eq(9) input[type='date']").val();
35971 aman 227
    if (investmentDate) {
33512 tejus.loha 228
        investmentDate = investmentDate + "T00:00:00";
35971 aman 229
    } else {
230
        investmentDate = "";
33512 tejus.loha 231
    }
232
    console.log("investmentDate" + investmentDate);
28908 tejbeer 233
 
33512 tejus.loha 234
    var loi = $(row).find(".loiDesign input[type=hidden]").val();
235
    console.log("loi" + loi);
28908 tejbeer 236
 
33512 tejus.loha 237
    var kycDesign = $(row).find(".kycDesign input[type=hidden]").val();
28908 tejbeer 238
 
33512 tejus.loha 239
    var code = $(row).find("td:eq(12) input[type='text']").val();
240
    console.log("code" + code);
28908 tejbeer 241
 
242
 
33512 tejus.loha 243
    var receePlaned = $(row).find("td:eq(13) input[type='date']").val();
35971 aman 244
    if (receePlaned) {
33512 tejus.loha 245
        receePlaned = receePlaned + "T00:00:00";
35971 aman 246
    } else {
247
        receePlaned = "";
33512 tejus.loha 248
    }
249
    var receeActual = $(row).find("td:eq(14) input[type='date']").val();
35971 aman 250
    if (receeActual) {
33512 tejus.loha 251
        receeActual = receeActual + "T00:00:00";
35971 aman 252
    } else {
253
        receeActual = "";
33512 tejus.loha 254
    }
255
    console.log("receeActual" + receeActual);
28908 tejbeer 256
 
257
 
33512 tejus.loha 258
    var twoDBoqPlanedDate = $(row).find("td:eq(16) input[type='date']").val();
35971 aman 259
    if (twoDBoqPlanedDate) {
33512 tejus.loha 260
        twoDBoqPlanedDate = twoDBoqPlanedDate + "T00:00:00";
35971 aman 261
    } else {
262
        twoDBoqPlanedDate = "";
33512 tejus.loha 263
    }
28908 tejbeer 264
 
33512 tejus.loha 265
    var twoDBoqdate = $(row).find("td:eq(17) input[type='date']").val();
35971 aman 266
    if (twoDBoqdate) {
33512 tejus.loha 267
        twoDBoqdate = twoDBoqdate + "T00:00:00";
35971 aman 268
    } else {
269
        twoDBoqdate = "";
33512 tejus.loha 270
    }
271
    var twodBOQ = $(row).find(".twoDBoq input[type=hidden]").val();
28908 tejbeer 272
 
33512 tejus.loha 273
    var threeDBoqPlanedDate = $(row).find("td:eq(19) input[type='date']").val();
35971 aman 274
    if (threeDBoqPlanedDate) {
33512 tejus.loha 275
        threeDBoqPlanedDate = threeDBoqPlanedDate + "T00:00:00";
35971 aman 276
    } else {
277
        threeDBoqPlanedDate = "";
33512 tejus.loha 278
    }
28908 tejbeer 279
 
33512 tejus.loha 280
    var threeDBoqdate = $(row).find("td:eq(20) input[type='date']").val();
35971 aman 281
    if (threeDBoqdate) {
33512 tejus.loha 282
        threeDBoqdate = threeDBoqdate + "T00:00:00";
35971 aman 283
    } else {
284
        threeDBoqdate = "";
33512 tejus.loha 285
    }
28908 tejbeer 286
 
33512 tejus.loha 287
    var threeDBoq = $(row).find(".threeDBoq input[type=hidden]").val();
28908 tejbeer 288
 
33512 tejus.loha 289
    var poVenderPlanedDate = $(row).find("td:eq(22) input[type='date']").val();
35971 aman 290
    if (poVenderPlanedDate) {
33512 tejus.loha 291
        poVenderPlanedDate = poVenderPlanedDate + "T00:00:00";
35971 aman 292
    } else {
293
        poVenderPlanedDate = "";
33512 tejus.loha 294
    }
295
    var poVenderDate = $(row).find("td:eq(23) input[type='date']").val();
35971 aman 296
    if (poVenderDate) {
33512 tejus.loha 297
        poVenderDate = poVenderDate + "T00:00:00";
35971 aman 298
    } else {
299
        poVenderDate = "";
33512 tejus.loha 300
    }
28908 tejbeer 301
 
302
 
33512 tejus.loha 303
    var briefingPartnerPlaned = $(row).find("td:eq(24) input[type='date']").val();
35971 aman 304
    if (briefingPartnerPlaned) {
33512 tejus.loha 305
        briefingPartnerPlaned = briefingPartnerPlaned + "T00:00:00";
35971 aman 306
    } else {
307
        briefingPartnerPlaned = "";
33512 tejus.loha 308
    }
309
    var briefingPartner = $(row).find("td:eq(25) input[type='date']").val();
35971 aman 310
    if (briefingPartner) {
33512 tejus.loha 311
        briefingPartner = briefingPartner + "T00:00:00";
35971 aman 312
    } else {
313
        briefingPartner = "";
33512 tejus.loha 314
    }
315
    var deploymentPlanedDate = $(row).find("td:eq(26) input[type='date']").val();
35971 aman 316
    if (deploymentPlanedDate) {
33512 tejus.loha 317
        deploymentPlanedDate = deploymentPlanedDate + "T00:00:00";
35971 aman 318
    } else {
319
        deploymentPlanedDate = "";
33512 tejus.loha 320
    }
321
    var deploymentDate = $(row).find("td:eq(27) input[type='date']").val();
35971 aman 322
    if (deploymentDate) {
33512 tejus.loha 323
        deploymentDate = deploymentDate + "T00:00:00";
35971 aman 324
    } else {
325
        deploymentDate = "";
33512 tejus.loha 326
    }
28908 tejbeer 327
 
328
 
33512 tejus.loha 329
    var finalPicsOutletPlanedDate = $(row).find("td:eq(28) input[type='date']").val();
35971 aman 330
    if (finalPicsOutletPlanedDate) {
33512 tejus.loha 331
        finalPicsOutletPlanedDate = finalPicsOutletPlanedDate + "T00:00:00";
35971 aman 332
    } else {
333
        finalPicsOutletPlanedDate = "";
33512 tejus.loha 334
    }
28908 tejbeer 335
 
33512 tejus.loha 336
    var finalPicsOutletDate = $(row).find("td:eq(29) input[type='date']").val();
35971 aman 337
    if (finalPicsOutletDate) {
33512 tejus.loha 338
        finalPicsOutletDate = finalPicsOutletDate + "T00:00:00";
35971 aman 339
    } else {
340
        finalPicsOutletDate = "";
33512 tejus.loha 341
    }
342
    var finalPicsOutlet = $(row).find(".finalPics input[type=hidden]").val();
28908 tejbeer 343
 
33512 tejus.loha 344
    var nocDate = $(row).find("td:eq(31) input[type='date']").val();
35971 aman 345
    if (nocDate) {
33512 tejus.loha 346
        nocDate = nocDate + "T00:00:00";
35971 aman 347
    } else {
348
        nocDate = "";
33512 tejus.loha 349
    }
350
    var noc = $(row).find(".noc input[type=hidden]").val();
351
    var partnerOnBoardingObject = {};
352
    partnerOnBoardingObject['id'] = id
353
    partnerOnBoardingObject['outletName'] = outletName
27829 tejbeer 354
 
33512 tejus.loha 355
    partnerOnBoardingObject['createdTimestamp'] = createdTimestamp
356
    partnerOnBoardingObject['acquiredDate'] = acquiredDate
28908 tejbeer 357
 
33512 tejus.loha 358
    partnerOnBoardingObject['phoneNumber'] = phoneNumber
28908 tejbeer 359
 
33512 tejus.loha 360
    partnerOnBoardingObject['city'] = city
28908 tejbeer 361
 
28600 amit.gupta 362
 
33512 tejus.loha 363
    partnerOnBoardingObject['agreedBrandFees'] = agreedBrandFees
29763 tejbeer 364
 
33512 tejus.loha 365
    partnerOnBoardingObject['investmentDate'] = investmentDate
366
    partnerOnBoardingObject['loi'] = loi
367
    partnerOnBoardingObject['kycDesign'] = kycDesign
368
    partnerOnBoardingObject['code'] = code
369
    partnerOnBoardingObject['receePlaned'] = receePlaned
370
    partnerOnBoardingObject['receeActual'] = receeActual
371
    partnerOnBoardingObject['twoDBoqPlanedDate'] = twoDBoqPlanedDate
372
    partnerOnBoardingObject['twoDBoqdate'] = twoDBoqdate
373
    partnerOnBoardingObject['twodBOQ'] = twodBOQ
374
    partnerOnBoardingObject['threeDBoqPlanedDate'] = threeDBoqPlanedDate
375
    partnerOnBoardingObject['threeDBoqdate'] = threeDBoqdate
376
    partnerOnBoardingObject['threeDBoq'] = threeDBoq
377
    partnerOnBoardingObject['poVenderPlanedDate'] = poVenderPlanedDate
378
    partnerOnBoardingObject['poVenderDate'] = poVenderDate
28908 tejbeer 379
 
33512 tejus.loha 380
    partnerOnBoardingObject['briefingPartnerPlaned'] = briefingPartnerPlaned
381
    partnerOnBoardingObject['briefingPartner'] = briefingPartner
382
    partnerOnBoardingObject['deploymentPlanedDate'] = deploymentPlanedDate
383
    partnerOnBoardingObject['deploymentDate'] = deploymentDate
384
    partnerOnBoardingObject['finalPicsOutletPlanedDate'] = finalPicsOutletPlanedDate
385
    partnerOnBoardingObject['finalPicsOutletDate'] = finalPicsOutletDate
386
    partnerOnBoardingObject['finalPicsOutlet'] = finalPicsOutlet
387
    partnerOnBoardingObject['nocDate'] = nocDate
388
    partnerOnBoardingObject['noc'] = noc
28908 tejbeer 389
 
28600 amit.gupta 390
 
33512 tejus.loha 391
    var jsonObject = JSON.stringify(partnerOnBoardingObject);
28908 tejbeer 392
 
33512 tejus.loha 393
    console.log(jsonObject);
28908 tejbeer 394
 
33512 tejus.loha 395
    if (confirm("Are you sure you want to submit the request") == true) {
396
        doAjaxRequestWithJsonHandler(context + "/partnerOnboardingDesignaTatPanel", "POST", jsonObject, function (response) {
397
            row.html(response);
398
            row.css("background-color", "#F8F8FF");
28600 amit.gupta 399
 
33512 tejus.loha 400
        });
401
    }
28600 amit.gupta 402
 
33512 tejus.loha 403
});
28600 amit.gupta 404
 
405
 
33512 tejus.loha 406
$(document).on('click', ".noticPartneronboarding", function () {
407
    var id = $(this).data('id');
408
    console.log(id);
409
    if (confirm("Are you sure you want to Notice Isssue this Partner") == true) {
410
        doPostAjaxRequestHandler(context + "/partnerOnboardingNotice?id=" + id,
411
            function (response) {
28600 amit.gupta 412
 
33512 tejus.loha 413
                console.log("reponse" + response);
414
                if (response == 'true') {
415
                    alert("successfully Done");
28600 amit.gupta 416
 
28940 manish 417
 
33512 tejus.loha 418
                    panelListing("main-content");
419
                }
420
            });
421
    }
422
});
29061 tejbeer 423
 
424
 
33512 tejus.loha 425
$(document).on('click', ".holdPartnerOnboarding", function () {
426
    var id = $(this).data('id');
427
    console.log(id);
428
    if (confirm("Are you sure you want to hold this Partner") == true) {
429
        doPostAjaxRequestHandler(context + "/partnerOnboardingHold?id=" + id,
430
            function (response) {
29061 tejbeer 431
 
33512 tejus.loha 432
                console.log("reponse" + response);
433
                if (response == 'true') {
434
                    alert("successfully Done");
29061 tejbeer 435
 
436
 
33512 tejus.loha 437
                    panelListing("main-content");
438
                }
439
            });
440
    }
441
});
28600 amit.gupta 442
 
29061 tejbeer 443
 
33512 tejus.loha 444
$(document).on('click', ".unHoldPartnerOnboarding", function () {
445
    var id = $(this).data('id');
446
    console.log(id);
447
    if (confirm("Are you sure you want to Unhold this Partner") == true) {
448
        doPostAjaxRequestHandler(context + "/partnerOnboardingUnhold?id=" + id,
449
            function (response) {
29061 tejbeer 450
 
33512 tejus.loha 451
                console.log("reponse" + response);
452
                if (response == 'true') {
453
                    alert("successfully Done");
454
                    panelListing("main-content");
455
                }
456
            });
457
    }
458
});
29061 tejbeer 459
 
460
 
33512 tejus.loha 461
$(document).on('click', ".addKyc", function () {
462
    var id = $(this).data('id');
463
    console.log(id);
464
    doAjaxRequestHandler(context + "/getFofoKyc?onBoardingId=" + id, "GET",
465
        function (response) {
28900 manish 466
 
33512 tejus.loha 467
            console.log(response)
468
            $('.' + "fofoKycContainer").html(response);
29061 tejbeer 469
 
33512 tejus.loha 470
        });
29763 tejbeer 471
 
33512 tejus.loha 472
});
29763 tejbeer 473
 
474
 
33512 tejus.loha 475
var table = $('#fofokyctable').DataTable();
476
$(document).on('dblclick', '#fofokyctable tbody tr', function () {
477
    console.log("dblclick");
478
    var data = table.row(this).data();
29763 tejbeer 479
 
33512 tejus.loha 480
    $(this).find(":selected").attr('disabled', false).show();
481
    $(this).find(":input").attr('disabled', false).show();
29763 tejbeer 482
 
483
 
33512 tejus.loha 484
});
29763 tejbeer 485
 
486
 
33512 tejus.loha 487
$(document).on('click', '.addKycdetail', function () {
488
    var row = $(this).closest("tr");
29763 tejbeer 489
 
33512 tejus.loha 490
    var onBoardingId = $(this).data('onboardingid');
29763 tejbeer 491
 
33512 tejus.loha 492
    console.log(row);
493
    var rowIndex = $(this).closest('tr').prevAll().length;
494
    var id = $(row).find("td:eq(0)").text();
495
    var firstName = $(row).find("td:eq(1) input[type='text']").val();
496
    var middleName = $(row).find("td:eq(2) input[type='text']").val();
497
    var lastName = $(row).find("td:eq(3) input[type='text']").val();
29763 tejbeer 498
 
33512 tejus.loha 499
    var fatherName = $(row).find("td:eq(4) input[type='text']").val();
29763 tejbeer 500
 
33512 tejus.loha 501
    var dob = $(row).find("td:eq(5) input[type='date']").val();
29763 tejbeer 502
 
33512 tejus.loha 503
    if (dob != "") {
29763 tejbeer 504
 
33512 tejus.loha 505
        dob = dob + "T00:00:00";
506
    }
29763 tejbeer 507
 
33512 tejus.loha 508
    var gender = $(row).find("td:eq(6) option:selected").val();
509
    var maritalStatus = $(row).find("td:eq(7) option:selected").val();
29763 tejbeer 510
 
33512 tejus.loha 511
    var email = $(row).find("td:eq(8) input[type='text']").val();
29763 tejbeer 512
 
33512 tejus.loha 513
    var mobile = $(row).find("td:eq(9) input[type='text']").val();
514
    var pan = $(row).find("td:eq(10) input[type='text']").val();
29763 tejbeer 515
 
516
 
33512 tejus.loha 517
    var pandocId = $(row).find(".pandoc input[type=hidden]").val();
29774 tejbeer 518
 
33512 tejus.loha 519
    var poaNO = $(row).find("td:eq(12) input[type='text']").val();
520
    var poaType = $(row).find("td:eq(13) option:selected").val();
29763 tejbeer 521
 
33512 tejus.loha 522
    var paoFrontd = $(row).find(".paof input[type=hidden]").val();
523
    var paoBackId = $(row).find(".paob input[type=hidden]").val();
29763 tejbeer 524
 
33512 tejus.loha 525
    var address1 = $(row).find("td:eq(16) input[type='text']").val();
29763 tejbeer 526
 
33512 tejus.loha 527
    var address2 = $(row).find("td:eq(17) input[type='text']").val();
29763 tejbeer 528
 
33512 tejus.loha 529
    var address3 = $(row).find("td:eq(18) input[type='text']").val();
29763 tejbeer 530
 
33512 tejus.loha 531
    var city = $(row).find("td:eq(19) input[type='text']").val();
29763 tejbeer 532
 
533
 
33512 tejus.loha 534
    var state = $(row).find("td:eq(20) input[type='text']").val();
29763 tejbeer 535
 
33512 tejus.loha 536
    var pincode = $(row).find("td:eq(21) input[type='text']").val();
29763 tejbeer 537
 
538
 
33512 tejus.loha 539
    console.log(city)
540
    if (dob === "") {
541
        alert("dob is required");
542
        return;
543
    }
29763 tejbeer 544
 
545
 
33512 tejus.loha 546
    if (gender === "") {
547
        alert("gender is required");
548
        return;
549
    }
29763 tejbeer 550
 
551
 
33512 tejus.loha 552
    if (fatherName === "") {
553
        alert("Father Name is required");
554
        return;
555
    }
29763 tejbeer 556
 
33512 tejus.loha 557
    if (maritalStatus === "") {
558
        alert("Marital Status is required");
559
        return;
560
    }
29763 tejbeer 561
 
33512 tejus.loha 562
    if (email === "") {
563
        alert("email is required");
564
        return;
565
    }
29763 tejbeer 566
 
33512 tejus.loha 567
    if (mobile === "") {
568
        alert("mobile is required");
569
        return;
570
    }
29763 tejbeer 571
 
33512 tejus.loha 572
    if (pan === "") {
573
        alert("pan is required");
574
        return;
575
    }
29763 tejbeer 576
 
33512 tejus.loha 577
    if (pandocId === "") {
578
        alert("panDoc is required");
579
        return;
580
    }
29763 tejbeer 581
 
33512 tejus.loha 582
    if (poaNO === "") {
583
        alert("paoNO is required");
584
        return;
585
    }
29763 tejbeer 586
 
33512 tejus.loha 587
    if (poaType === "") {
588
        alert("paoType is required");
589
        return;
590
    }
29774 tejbeer 591
 
33512 tejus.loha 592
    if (paoFrontd === "") {
593
        alert("paoFrontd is required");
594
        return;
595
    }
29774 tejbeer 596
 
33512 tejus.loha 597
    if (paoBackId === "") {
598
        alert("paoBackId is required");
599
        return;
600
    }
29763 tejbeer 601
 
33512 tejus.loha 602
    if (address1 === "") {
603
        alert("address1 is required");
604
        return;
605
    }
606
    if (address2 === "") {
607
        alert("address2 is required");
608
        return;
609
    }
29763 tejbeer 610
 
33512 tejus.loha 611
    if (city === "") {
612
        alert("city is required");
613
        return;
614
    }
615
    if (state === "") {
616
        alert("state is required");
617
        return;
618
    }
29763 tejbeer 619
 
33512 tejus.loha 620
    if (pincode === "") {
621
        alert("pincode is required");
622
        return;
623
    }
29763 tejbeer 624
 
33512 tejus.loha 625
    var kycDetail = {};
626
    kycDetail['id'] = id
29763 tejbeer 627
 
33512 tejus.loha 628
    kycDetail['firstName'] = firstName
629
    kycDetail['middleName'] = middleName
630
    kycDetail['lastName'] = lastName
29763 tejbeer 631
 
33512 tejus.loha 632
    kycDetail['fatherName'] = fatherName
29763 tejbeer 633
 
33512 tejus.loha 634
    kycDetail['dob'] = dob
635
    kycDetail['gender'] = gender
636
    kycDetail['maritalStatus'] = maritalStatus
637
    kycDetail['email'] = email
638
    kycDetail['mobile'] = mobile
639
    kycDetail['pan'] = pan
640
    kycDetail['pandocId'] = pandocId
641
    kycDetail['poaNo'] = poaNO
642
    kycDetail['poaType'] = poaType
643
    kycDetail['paoFrontd'] = paoFrontd
644
    kycDetail['paoBackId'] = paoBackId
29763 tejbeer 645
 
33512 tejus.loha 646
    kycDetail['address1'] = address1
647
    kycDetail['address2'] = address2
648
    kycDetail['address3'] = address3
649
    kycDetail['city'] = city
650
    kycDetail['state'] = state
651
    kycDetail['pincode'] = pincode
652
    kycDetail['onboardingId'] = onBoardingId
29763 tejbeer 653
 
33512 tejus.loha 654
    var jsonObject = JSON.stringify(kycDetail);
655
    console.log("kycDetail" + jsonObject);
29763 tejbeer 656
 
33512 tejus.loha 657
    console.log(jsonObject);
29763 tejbeer 658
 
33512 tejus.loha 659
    if (confirm("Are you sure you want to submit the request") == true) {
660
        doAjaxRequestWithJsonHandler(context + "/addPartnerKyc", "POST", jsonObject, function (response) {
661
            row.html(response);
29763 tejbeer 662
 
663
 
33512 tejus.loha 664
        });
665
    }
29763 tejbeer 666
 
33512 tejus.loha 667
});
29774 tejbeer 668
 
29763 tejbeer 669
 
33512 tejus.loha 670
$(document).on('click', ".addNewRow", function () {
671
    var id = $(this).data('id');
672
    console.log(id);
673
    doAjaxRequestHandler(context + "/addKycRow?onBoardingId=" + id, "GET",
674
        function (response) {
29763 tejbeer 675
 
33512 tejus.loha 676
            console.log(response)
677
            $('.' + "fofoKycContainer").html(response);
29763 tejbeer 678
 
33512 tejus.loha 679
        });
29763 tejbeer 680
 
33512 tejus.loha 681
});
29763 tejbeer 682
 
683
 
33512 tejus.loha 684
var table = $('#legalkyctable').DataTable();
685
$(document).on('dblclick', '#legalkyctable tbody tr', function () {
686
    console.log("dblclick");
687
    var data = table.row(this).data();
29763 tejbeer 688
 
33512 tejus.loha 689
    $(this).find(":selected").attr('disabled', false).show();
690
    $(this).find(":input").attr('disabled', false).show();
29763 tejbeer 691
 
692
 
33512 tejus.loha 693
});
29763 tejbeer 694
 
695
 
33512 tejus.loha 696
$(document).on('click', '.addlegalKycdetail', function () {
697
    var row = $(this).closest("tr");
29763 tejbeer 698
 
33512 tejus.loha 699
    console.log(row);
29763 tejbeer 700
 
33512 tejus.loha 701
    var id = $(row).find("td:eq(2)").text();
702
    var status = $(row).find("td:eq(3) option:selected").val();
29763 tejbeer 703
 
29794 tejbeer 704
 
33512 tejus.loha 705
    var businessType = $(row).find("td:eq(4) option:selected").val();
706
    var firstName = $(row).find("td:eq(5) input[type='text']").val();
707
    var middleName = $(row).find("td:eq(6) input[type='text']").val();
708
    var lastName = $(row).find("td:eq(7) input[type='text']").val();
29794 tejbeer 709
 
33512 tejus.loha 710
    var fatherName = $(row).find("td:eq(8) input[type='text']").val();
29794 tejbeer 711
 
33512 tejus.loha 712
    var dob = $(row).find("td:eq(9) input[type='date']").val();
29794 tejbeer 713
 
33512 tejus.loha 714
    if (dob != "") {
29794 tejbeer 715
 
33512 tejus.loha 716
        dob = dob + "T00:00:00";
717
    }
29794 tejbeer 718
 
33512 tejus.loha 719
    var gender = $(row).find("td:eq(10) option:selected").val();
720
    var maritalStatus = $(row).find("td:eq(11) option:selected").val();
29794 tejbeer 721
 
33512 tejus.loha 722
    var email = $(row).find("td:eq(12) input[type='text']").val();
29794 tejbeer 723
 
33512 tejus.loha 724
    var mobile = $(row).find("td:eq(13) input[type='text']").val();
725
    var pan = $(row).find("td:eq(14) input[type='text']").val();
29794 tejbeer 726
 
727
 
33512 tejus.loha 728
    var pandocId = $(row).find(".pandoc input[type=hidden]").val();
29794 tejbeer 729
 
33512 tejus.loha 730
    var poaNO = $(row).find("td:eq(16) input[type='text']").val();
731
    var poaType = $(row).find("td:eq(17) option:selected").val();
29884 tejbeer 732
 
33512 tejus.loha 733
    var paoFrontd = $(row).find(".paof input[type=hidden]").val();
734
    var paoBackId = $(row).find(".paob input[type=hidden]").val();
29884 tejbeer 735
 
33512 tejus.loha 736
    var address1 = $(row).find("td:eq(20) input[type='text']").val();
29794 tejbeer 737
 
33512 tejus.loha 738
    var address2 = $(row).find("td:eq(21) input[type='text']").val();
29794 tejbeer 739
 
33512 tejus.loha 740
    var address3 = $(row).find("td:eq(22) input[type='text']").val();
29794 tejbeer 741
 
33512 tejus.loha 742
    var city = $(row).find("td:eq(23) input[type='text']").val();
29794 tejbeer 743
 
744
 
33512 tejus.loha 745
    var state = $(row).find("td:eq(24) input[type='text']").val();
29794 tejbeer 746
 
33512 tejus.loha 747
    var pincode = $(row).find("td:eq(25) input[type='text']").val();
29794 tejbeer 748
 
749
 
33512 tejus.loha 750
    var kycDetail = {};
751
    kycDetail['id'] = id
752
    kycDetail['status'] = status
753
    kycDetail['businessType'] = businessType
754
    kycDetail['firstName'] = firstName
755
    kycDetail['middleName'] = middleName
756
    kycDetail['lastName'] = lastName
29794 tejbeer 757
 
33512 tejus.loha 758
    kycDetail['fatherName'] = fatherName
29794 tejbeer 759
 
33512 tejus.loha 760
    kycDetail['dob'] = dob
761
    kycDetail['gender'] = gender
762
    kycDetail['maritalStatus'] = maritalStatus
763
    kycDetail['email'] = email
764
    kycDetail['mobile'] = mobile
765
    kycDetail['pan'] = pan
766
    kycDetail['pandocId'] = pandocId
767
    kycDetail['poaNo'] = poaNO
768
    kycDetail['poaType'] = poaType
769
    kycDetail['paoFrontd'] = paoFrontd
770
    kycDetail['paoBackId'] = paoBackId
29794 tejbeer 771
 
33512 tejus.loha 772
    kycDetail['address1'] = address1
773
    kycDetail['address2'] = address2
774
    kycDetail['address3'] = address3
775
    kycDetail['city'] = city
776
    kycDetail['state'] = state
777
    kycDetail['pincode'] = pincode
29794 tejbeer 778
 
33512 tejus.loha 779
    var jsonObject = JSON.stringify(kycDetail);
780
    console.log("kycDetail" + jsonObject);
29794 tejbeer 781
 
33512 tejus.loha 782
    console.log(jsonObject);
29794 tejbeer 783
 
33512 tejus.loha 784
    if (confirm("Are you sure you want to submit the request") == true) {
785
        doAjaxRequestWithJsonHandler(context + "/addlegalPartnerKyc", "POST", jsonObject, function (response) {
786
            row.html(response);
29794 tejbeer 787
 
788
 
33512 tejus.loha 789
        });
790
    }
29794 tejbeer 791
 
33512 tejus.loha 792
});
29794 tejbeer 793
 
33512 tejus.loha 794
$(document).on('click', ".partner-onboarding-index", function () {
795
    panelListing("main-content");
796
});
29794 tejbeer 797
 
798
 
33512 tejus.loha 799
$(document).on('click', ".partner-onboarding-open", function () {
800
    console.log("yes");
801
    partnerOnboardingOpen("main-content");
802
});
29794 tejbeer 803
 
33512 tejus.loha 804
$(document).on('click', ".design-completed", function () {
805
    console.log("yes");
806
    partnerOnboardinDesignCompleted("main-content");
807
});
29794 tejbeer 808
 
33512 tejus.loha 809
$(document).on('click', ".design_tat", function () {
810
    console.log("yes");
811
    partnerOnboardingDesign("main-content");
812
});
29794 tejbeer 813
 
33512 tejus.loha 814
$(document).on('click', ".partner-onboarding-reject", function () {
815
    console.log("helo");
29794 tejbeer 816
 
33512 tejus.loha 817
    partnerOnboardingReject("main-content");
818
});
29794 tejbeer 819
 
33512 tejus.loha 820
$(document).on('input', 'table#legalkyctable input[type=file]', function () {
821
    if (confirm('Confirm upload ?')) {
822
        var fileSelector = $(this)[0];
823
        if (fileSelector != undefined
824
            && fileSelector.files[0] != undefined) {
825
            var url = `${context}/document-upload`;
826
            console.log(url);
827
            var file = this.files[0];
828
            console.log("file" + file);
829
            let fileInput = $(this);
830
            console.log("fileInput" + file);
831
            doAjaxUploadRequestHandler(
832
                url,
833
                'POST',
834
                file,
835
                function (response) {
836
                    console.log(response);
837
                    var documentId = response.response.document_id;
838
                    console.log("documentId : " + documentId);
839
                    fileInput.closest('td').find("input[type=hidden]").val(documentId);
840
                });
841
            // alert("Retailer Shop Document
842
            // is required");
843
        }
844
    } else {
845
        // Do nothing!
846
    }
847
});
29794 tejbeer 848
 
849
 
33512 tejus.loha 850
$(document).on('input', 'table#fofokyctable input[type=file]', function () {
851
    if (confirm('Confirm upload ?')) {
852
        var fileSelector = $(this)[0];
853
        if (fileSelector != undefined
854
            && fileSelector.files[0] != undefined) {
855
            var url = `${context}/document-upload`;
856
            console.log(url);
857
            var file = this.files[0];
858
            console.log("file" + file);
859
            let fileInput = $(this);
860
            console.log("fileInput" + file);
861
            doAjaxUploadRequestHandler(
862
                url,
863
                'POST',
864
                file,
865
                function (response) {
866
                    console.log(response);
867
                    var documentId = response.response.document_id;
868
                    console.log("documentId : " + documentId);
869
                    fileInput.closest('td').find("input[type=hidden]").val(documentId);
870
                });
871
            // alert("Retailer Shop Document
872
            // is required");
873
        }
874
    } else {
875
        // Do nothing!
876
    }
877
});
29794 tejbeer 878
 
33512 tejus.loha 879
$(document).on('input', 'table#example input[type=file]', function () {
880
    if (confirm('Confirm upload ?')) {
881
        var fileSelector = $(this)[0];
882
        if (fileSelector != undefined
883
            && fileSelector.files[0] != undefined) {
884
            var url = `${context}/document-upload`;
885
            console.log(url);
886
            var file = this.files[0];
887
            console.log("file" + file);
888
            let fileInput = $(this);
889
            console.log("fileInput" + file);
890
            doAjaxUploadRequestHandler(
891
                url,
892
                'POST',
893
                file,
894
                function (response) {
895
                    console.log(response);
896
                    var documentId = response.response.document_id;
897
                    console.log("documentId : " + documentId);
898
                    fileInput.closest('td').find("input[type=hidden]").val(documentId);
899
                });
900
            // alert("Retailer Shop Document
901
            // is required");
902
        }
903
    } else {
904
        // Do nothing!
905
    }
906
});
29794 tejbeer 907
 
908
 
33512 tejus.loha 909
$(document).on('input', 'table#partnerVerification input[type=file]', function () {
910
    if (confirm('Confirm upload ?')) {
911
        var fileSelector = $(this)[0];
912
        if (fileSelector != undefined
913
            && fileSelector.files[0] != undefined) {
914
            var url = `${context}/document-upload`;
915
            console.log(url);
916
            var file = this.files[0];
917
            console.log("file" + file);
918
            let fileInput = $(this);
919
            console.log("fileInput" + file);
920
            doAjaxUploadRequestHandler(
921
                url,
922
                'POST',
923
                file,
924
                function (response) {
925
                    console.log(response);
926
                    var documentId = response.response.document_id;
927
                    console.log("documentId : " + documentId);
928
                    fileInput.closest('td').find("input[type=hidden]").val(documentId);
929
                });
930
            // alert("Retailer Shop Document
931
            // is required");
932
        }
933
    } else {
934
        // Do nothing!
935
    }
936
});
27813 tejbeer 937
 
938
 
33512 tejus.loha 939
$(document).on('input', 'table#OnboardingDesign input[type=file]', function () {
940
    if (confirm('Confirm upload ?')) {
941
        var fileSelector = $(this)[0];
942
        if (fileSelector != undefined
943
            && fileSelector.files[0] != undefined) {
944
            var url = `${context}/document-upload`;
945
            console.log(url);
946
            var file = this.files[0];
947
            console.log("file" + file);
948
            let fileInput = $(this);
949
            console.log("fileInput" + file);
950
            doAjaxUploadRequestHandler(
951
                url,
952
                'POST',
953
                file,
954
                function (response) {
955
                    console.log(response);
956
                    var documentId = response.response.document_id;
957
                    console.log("documentId : " + documentId);
958
                    fileInput.closest('td').find("input[type=hidden]").val(documentId);
959
                });
960
            // alert("Retailer Shop Document
961
            // is required");
962
        }
963
    } else {
964
        // Do nothing!
965
    }
966
});
28908 tejbeer 967
 
33512 tejus.loha 968
$(document).on('click', '#newmodal', function () {
28908 tejbeer 969
 
27813 tejbeer 970
 
33512 tejus.loha 971
    var newOnboarding = {};
972
    var outletName = $('#outLetName1').val();
973
    var phoneNumber = $('#number1').val();
974
    var leadId = $("#leadId").val();
27763 tejbeer 975
 
27799 tejbeer 976
 
33512 tejus.loha 977
    if (outletName == "") {
29763 tejbeer 978
 
33512 tejus.loha 979
        alert("outletName is required ");
980
        return;
981
    }
982
    newOnboarding['outletName'] = $('#outLetName1').val();
29794 tejbeer 983
 
33512 tejus.loha 984
    if (phoneNumber == "") {
985
        alert("Phone Number is required ");
986
        return false;
29763 tejbeer 987
 
33512 tejus.loha 988
    }
989
    if (phoneNumber.length > 6 && phoneNumber.length < 11) {
29061 tejbeer 990
 
33512 tejus.loha 991
        newOnboarding['phoneNumber'] = $('#number1').val();
29061 tejbeer 992
 
33512 tejus.loha 993
    } else {
994
        alert("Number should be greater then 6 and less then 11");
995
        return false;
29061 tejbeer 996
 
33512 tejus.loha 997
    }
29061 tejbeer 998
 
33512 tejus.loha 999
    acquireddate1 = $('#acquireddate1').val();
1000
    console.log(acquireddate1)
29061 tejbeer 1001
 
33512 tejus.loha 1002
    if (acquireddate1 != "") {
27799 tejbeer 1003
 
33512 tejus.loha 1004
        alert("Acquired date is required");
29061 tejbeer 1005
 
33512 tejus.loha 1006
    }
1007
    if (acquireddate1 != "") {
1008
        acquireddate1 = acquireddate1 + "T00:00:00";
1009
    }
1010
    newOnboarding['authId'] = $('#authUserOnboarding').val();
29061 tejbeer 1011
 
33512 tejus.loha 1012
    newOnboarding['acquiredDate'] = acquireddate1
1013
    newOnboarding['leadId'] = leadId
29061 tejbeer 1014
 
31370 tejbeer 1015
 
33512 tejus.loha 1016
    var json = JSON.stringify(newOnboarding);
1017
    console.log(json);
1018
    doAjaxRequestWithJsonHandler(
1019
        context
1020
        + "/partnerOnBoardingListing",
1021
        "POST",
1022
        json,
1023
        function (response) {
29061 tejbeer 1024
 
33512 tejus.loha 1025
            panelListing("main-content");
29061 tejbeer 1026
 
1027
 
33512 tejus.loha 1028
        });
1029
});
29061 tejbeer 1030
 
33512 tejus.loha 1031
var table = $('#example').DataTable();
1032
$(document).on('dblclick', '#example tbody tr', function () {
29061 tejbeer 1033
 
33512 tejus.loha 1034
    var data = table.row(this).data();
35971 aman 1035
    // Use class-based selector instead of td:eq(N) — positional selectors break when columns are hidden
1036
    var holdBtn = $(this).find("button.holdPartnerOnboarding, button.unHoldPartnerOnboarding");
1037
    var statusHold = holdBtn.val();
29061 tejbeer 1038
 
33891 tejus.loha 1039
    console.log("statusHold=" + statusHold);
35971 aman 1040
    if (statusHold === "unhold") {
1041
        // Row is on hold — keep inputs disabled, only enable Submit and Open buttons
33512 tejus.loha 1042
        $(this).find(":input").attr('disabled', true);
35971 aman 1043
        $(this).find("button.open_outlet").attr('disabled', false);
1044
        $(this).find("button.submit1").attr('disabled', false);
33512 tejus.loha 1045
    } else {
35971 aman 1046
        // Row is not on hold — enable all inputs for editing
33512 tejus.loha 1047
        $(this).find(":input").attr('disabled', false).show();
1048
        $(this).find(":selected").attr('disabled', false).show();
29061 tejbeer 1049
 
33512 tejus.loha 1050
    }
1051
    $(this).find("input[name=rbmAuthId]").attr('disabled', true);
1052
    $(this).find("input[name=verificationStatusOnboarding]").attr('disabled', true);
1053
    $(this).find("input[name=billingStatus]").attr('disabled', true);
31370 tejbeer 1054
 
1055
 
33512 tejus.loha 1056
    $(this).css("background-color", "#87d3f8");
31370 tejbeer 1057
 
33512 tejus.loha 1058
});
27813 tejbeer 1059
 
33512 tejus.loha 1060
var table = $('#OnboardingDesign').DataTable();
1061
$(document).on('dblclick', '#OnboardingDesign tbody tr', function () {
27813 tejbeer 1062
 
33512 tejus.loha 1063
    var data = table.row(this).data();
29061 tejbeer 1064
 
33512 tejus.loha 1065
    $(this).find(":input").attr('disabled', false).show();
1066
    $(this).find(":selected").attr('disabled', true);
27813 tejbeer 1067
 
33512 tejus.loha 1068
    $(this).find("input[name=acquireddate]").attr('disabled', true);
1069
    $(this).find("input[name=outlateName]").attr('disabled', true);
1070
    $(this).find("input[name=phonenumber1]").attr('disabled', true);
1071
    $(this).find("input[name=kyc1]").attr('disabled', true);
1072
    $(this).find("input[name=city1]").attr('disabled', true);
1073
    $(this).find("input[name=shead1]").attr('disabled', true);
1074
    $(this).find("input[name=bdm1]").attr('disabled', true);
1075
    $(this).find("input[name=abrand1]").attr('disabled', true);
1076
    $(this).find("input[name=recbrand1]").attr('disabled', true);
1077
    $(this).find("input[name=BrandFeesdate1]").attr('disabled', true);
1078
    $(this).find("input[name=idate1]").attr('disabled', true);
1079
    $(this).find("input[name=loi1]").attr('disabled', true);
1080
    $(this).find("input[name=code1]").attr('disabled', true);
1081
    $(this).find("input[name=rplaned1]").attr('disabled', true);
1082
    $(this).find("input[name=stockPaymentDesign]").attr('disabled', true);
1083
    $(this).find("input[name=twoDBoq1]").attr('disabled', true);
1084
    $(this).find("input[name=threeBoqDate1]").attr('disabled', true);
1085
    $(this).find("input[name=poVenderDate1]").attr('disabled', true);
1086
    $(this).find("input[name=briefingPartnerPlanedDate1]").attr('disabled', true);
1087
    $(this).find("input[name=deploymentPlanedDate]").attr('disabled', true);
1088
    $(this).find("input[name=FinalPicsOutLets]").attr('disabled', true);
1089
    $(this).find("input[name=poVenderDate1]").attr('disabled', true);
1090
    $(this).css("background-color", "#87d3f8");
1091
    let a = 12;
1092
    let b = 12;
1093
    console.log("yes" + a == b);
28908 tejbeer 1094
 
33512 tejus.loha 1095
});
28908 tejbeer 1096
 
27813 tejbeer 1097
 
33512 tejus.loha 1098
var billingtable = $('#partnerbilling').DataTable();
1099
$(document).on('dblclick', '#partnerbilling tbody tr', function () {
1100
    var data = billingtable.row(this).data();
27813 tejbeer 1101
 
33512 tejus.loha 1102
    $(this).find(":input").attr('disabled', false).show();
29061 tejbeer 1103
 
1104
 
33512 tejus.loha 1105
});
29061 tejbeer 1106
 
33882 tejus.loha 1107
/*$(document)
33512 tejus.loha 1108
    .on(
1109
        'click',
1110
        ".submitOnboardingBilling",
1111
        function () {
29088 tejbeer 1112
 
33512 tejus.loha 1113
            var row = $(this).closest("tr");
1114
            console.log(row);
29061 tejbeer 1115
 
33512 tejus.loha 1116
            var onboardingId = $(row).find("td:eq(0)").text();
1117
            var stockPayment = $(row).find("td:eq(5) input[type='text']").val();
1118
            var advStock = $(row).find("td:eq(4) input[type='date']").val();
1119
            if (advStock != "") {
1120
                advStock = advStock + "T00:00:00";
1121
            }
28908 tejbeer 1122
 
33512 tejus.loha 1123
            var billingStatus = $(row)
1124
                .find("td:eq(6) input[type='checkbox']").is(":checked") ? 1 : 0;
27813 tejbeer 1125
 
33512 tejus.loha 1126
            doPostAjaxRequestHandler(context + "/partnerOnBoardingBillingSubmission?billingStatus=" + billingStatus + "&onBoardingId=" + onboardingId + "&advStock=" + advStock + "&stockPayment=" + stockPayment,
1127
                function (response) {
1128
                    row.html(response);
1129
                    alert("successfully submit");
28908 tejbeer 1130
 
1131
 
33512 tejus.loha 1132
                });
33882 tejus.loha 1133
        });*/
28908 tejbeer 1134
 
28600 amit.gupta 1135
 
33891 tejus.loha 1136
$(document).on('click', ".open_outlet", function () {
28600 amit.gupta 1137
 
33512 tejus.loha 1138
    var id = $(this).data('id');
1139
    console.log('helo');
1140
    var id = $(this).data('id');
1141
    console.log(id);
1142
    if (confirm("Are you sure your outlet is open") == true) {
1143
        doPostAjaxRequestHandler(context + "/partnerOnBoardingOpen?id=" + id,
1144
            function (response) {
29088 tejbeer 1145
 
33512 tejus.loha 1146
                console.log("reponse" + response);
1147
                if (response == 'true') {
1148
                    alert("congratulations your outlet is successfully open");
29088 tejbeer 1149
 
33512 tejus.loha 1150
                    panelListing("main-content");
1151
                }
1152
            });
1153
    }
29088 tejbeer 1154
 
33512 tejus.loha 1155
});
1156
$(document).on('click', ".design-complete", function () {
1157
    var id = $(this).data('id');
1158
    var row = $(this).closest("tr");
1159
    console.log('helo');
1160
    var receeActual = $(row).find("td:eq(14) input[type='date']").val();
1161
    if (receeActual != "") {
1162
        receeActual = receeActual + "T00:00:00";
1163
    }
1164
    var twoDBoqdate = $(row).find("td:eq(17) input[type='date']").val();
1165
    if (twoDBoqdate != "") {
1166
        twoDBoqdate = twoDBoqdate + "T00:00:00";
1167
    }
29088 tejbeer 1168
 
33512 tejus.loha 1169
    var poVenderDate = $(row).find("td:eq(23) input[type='date']").val();
1170
    if (poVenderDate != "") {
1171
        poVenderDate = poVenderDate + "T00:00:00";
1172
    }
1173
    var briefingPartner = $(row).find("td:eq(25) input[type='date']").val();
1174
    if (briefingPartner != "") {
1175
        briefingPartner = briefingPartner + "T00:00:00";
1176
    }
29088 tejbeer 1177
 
33512 tejus.loha 1178
    var deploymentDate = $(row).find("td:eq(27) input[type='date']").val();
1179
    if (deploymentDate != "") {
1180
        deploymentDate = deploymentDate + "T00:00:00";
1181
    }
29088 tejbeer 1182
 
33512 tejus.loha 1183
    var nocDate = $(row).find("td:eq(31) input[type='date']").val();
1184
    if (nocDate != "") {
1185
        nocDate = nocDate + "T00:00:00";
1186
    }
29763 tejbeer 1187
 
33512 tejus.loha 1188
    if (receeActual == "") {
1189
        alert("Please Fill The Recee Actual Date");
1190
        return
29088 tejbeer 1191
 
33512 tejus.loha 1192
    }
1193
    if (twoDBoqdate == "") {
35971 aman 1194
        alert("Please Fill The BOQ Actual Date");
33512 tejus.loha 1195
        return
29088 tejbeer 1196
 
33512 tejus.loha 1197
    }
35971 aman 1198
    // Removed validations for hidden columns: PO Vendor, Briefing Partner, Deployment, NOC
29088 tejbeer 1199
 
1200
 
33512 tejus.loha 1201
    var id = $(this).data('id');
1202
    console.log(id);
1203
    if (confirm("Are you sure your Design TAT is Complete") == true) {
1204
        doPostAjaxRequestHandler(context + "/partnerDesignTatCompleted?id=" + id,
1205
            function (response) {
27813 tejbeer 1206
 
33512 tejus.loha 1207
                console.log("reponse" + response);
1208
                if (response == 'true') {
1209
                    alert("congratulations your Desiging is successfully Done");
1210
                    partnerOnboardingDesign("main-content");
1211
                }
1212
            });
1213
    }
29061 tejbeer 1214
 
33512 tejus.loha 1215
});
29061 tejbeer 1216
 
1217
 
33512 tejus.loha 1218
$(document).on('click', ".rejectpartneronboarding", function () {
1219
    var id = $(this).data('id');
1220
    console.log('helo');
1221
    var id = $(this).data('id');
1222
    console.log(id);
1223
    if (confirm("Are you sure you want to reject the request") == true) {
1224
        doPostAjaxRequestHandler(context + "/partnerOnBoardingReject?id=" + id,
1225
            function (response) {
29061 tejbeer 1226
 
33512 tejus.loha 1227
                console.log("reponse" + response);
1228
                if (response == 'true') {
1229
                    alert("successfully rejected");
1230
                    panelListing("main-content");
1231
                }
1232
            });
1233
    }
29061 tejbeer 1234
 
27763 tejbeer 1235
});
1236
 
27813 tejbeer 1237
 
33512 tejus.loha 1238
$(document).on('click', ".Del", function () {
1239
    if (confirm("Are you sure you want to delete this doc")) {
1240
        var $td = $(this).closest("td");
1241
        $td.find("input[type=hidden]").val('0');
1242
        $td.css({'background-color': 'pink'});
1243
        $td.find('a', ".download").hide();
1244
        $td.find('a', ".Del").hide();
1245
    }
28908 tejbeer 1246
});
28600 amit.gupta 1247
 
28908 tejbeer 1248
 
27829 tejbeer 1249
function panelListing(domId) {
33512 tejus.loha 1250
    doAjaxRequestHandler(context + "/partnerOnBoardingPanel", "GET",
1251
        function (response) {
1252
            $('#' + domId).html(response);
1253
        });
27829 tejbeer 1254
}
27813 tejbeer 1255
 
1256
 
27763 tejbeer 1257
function panelListing(domId) {
33512 tejus.loha 1258
    doAjaxRequestHandler(context + "/partnerOnBoardingPanel", "GET",
1259
        function (response) {
1260
            $('#' + domId).html(response);
1261
        });
27763 tejbeer 1262
}
33512 tejus.loha 1263
 
27799 tejbeer 1264
function partnerOnboardingOpen(domId) {
33512 tejus.loha 1265
    doAjaxRequestHandler(context + "/partnerOnBoardingOpenShow", "GET",
1266
        function (response) {
1267
            $('#' + domId).html(response);
1268
        });
27799 tejbeer 1269
}
28600 amit.gupta 1270
 
1271
function partnerOnboardinDesignCompleted(domId) {
33512 tejus.loha 1272
    doAjaxRequestHandler(context + "/DesignTatCompletedShow", "GET",
1273
        function (response) {
1274
            $('#' + domId).html(response);
1275
        });
28600 amit.gupta 1276
}
1277
 
1278
function partnerOnboardingDesign(domId) {
33512 tejus.loha 1279
    doAjaxRequestHandler(context + "/partnerOnBoardingDesign", "GET",
1280
        function (response) {
1281
            $('#' + domId).html(response);
1282
        });
28600 amit.gupta 1283
}
1284
 
27799 tejbeer 1285
function partnerOnboardingReject(domId) {
33512 tejus.loha 1286
    doAjaxRequestHandler(context + "/partnerOnBoardingRejectShow", "GET",
1287
        function (response) {
1288
            $('#' + domId).html(response);
1289
        });
27799 tejbeer 1290
}
27763 tejbeer 1291
 
27813 tejbeer 1292
 
27763 tejbeer 1293
function panelOnBoardingListing(domId) {
33512 tejus.loha 1294
    doAjaxRequestHandler(context + "/partnerOnBoardingListing", "POST",
1295
        function (response) {
1296
            $('#' + domId).html(response);
1297
        });
27763 tejbeer 1298
 
1299
}
1300
 
1301
 
28908 tejbeer 1302
function panelListing(domId) {
33512 tejus.loha 1303
    doAjaxRequestHandler(context + "/partnerOnBoardingPanel", "GET",
1304
        function (response) {
1305
            $('#' + domId).html(response);
1306
        });
28908 tejbeer 1307
}
27763 tejbeer 1308
 
35971 aman 1309
// Full Stock Payment Panel - menu click handler
1310
$(document).on('click', ".full-stock-payment-panel", function () {
1311
    fullStockPaymentListing("main-content");
1312
});
27763 tejbeer 1313
 
35971 aman 1314
function fullStockPaymentListing(domId) {
1315
    doAjaxRequestHandler(context + "/fullStockPaymentPanel", "GET",
1316
        function (response) {
1317
            $('#' + domId).html(response);
1318
        });
1319
}
27842 tejbeer 1320
 
35971 aman 1321
// Welcome Call Panel - menu click handler
1322
$(document).on('click', ".welcome-call-panel", function () {
1323
    welcomeCallListing("main-content");
1324
});
28908 tejbeer 1325
 
35971 aman 1326
function welcomeCallListing(domId) {
1327
    doAjaxRequestHandler(context + "/welcomeCallPanel", "GET",
1328
        function (response) {
1329
            $('#' + domId).html(response);
1330
        });
1331
}
1332
 
1333
// Open checklist modal for welcome call
1334
$(document).on('click', ".welcome-call-checkbox", function () {
1335
    var onboardingId = $(this).data("id");
1336
    doAjaxRequestHandler(context + "/welcomeCallCheckbox?onboardingId=" + onboardingId, "GET",
1337
        function (response) {
1338
            $('#myModal').html(response);
1339
            $('#myModal').modal('toggle');
1340
        });
1341
});
1342
 
1343
// Submit welcome call checklist
1344
$(document).on('click', '.welcome-call-submit', function () {
1345
    var onboardingId = $(this).data('id');
1346
 
1347
    var trainingVerifi = $('input[name="trainingVerifi"]').is(":checked") ? 1 : 0;
1348
    var recceVerifi = $('input[name="recceVerifi"]').is(":checked") ? 1 : 0;
1349
    var advStockPayment = $('input[name="advStockPayment"]').is(":checked") ? 1 : 0;
1350
    var brandingVerifi = $('input[name="brandingVerifi"]').is(":checked") ? 1 : 0;
1351
    var stockPay = $('input[name="stockPay"]').is(":checked") ? 1 : 0;
1352
    var billingVerifi = $('input[name="billingVerifi"]').is(":checked") ? 1 : 0;
1353
    var inaugrationVerifi = $('input[name="inaugrationVerifi"]').is(":checked") ? 1 : 0;
1354
    var financialServices = $('input[name="financialServices"]').is(":checked") ? 1 : 0;
1355
    var promotorVerifi = $('input[name="promotorVerifi"]').is(":checked") ? 1 : 0;
1356
    var verifiComments = $('input[name="verifiCommentCheckbox"]').val();
1357
 
1358
    var partnerVerficationCheckBoxObject = {};
1359
    partnerVerficationCheckBoxObject['onboardingId'] = onboardingId;
1360
    partnerVerficationCheckBoxObject['trainingVerifi'] = trainingVerifi;
1361
    partnerVerficationCheckBoxObject['recceVerifi'] = recceVerifi;
1362
    partnerVerficationCheckBoxObject['advStockPayment'] = advStockPayment;
1363
    partnerVerficationCheckBoxObject['brandingVerifi'] = brandingVerifi;
1364
    partnerVerficationCheckBoxObject['stockPay'] = stockPay;
1365
    partnerVerficationCheckBoxObject['billingVerifi'] = billingVerifi;
1366
    partnerVerficationCheckBoxObject['inaugrationVerifi'] = inaugrationVerifi;
1367
    partnerVerficationCheckBoxObject['financialServices'] = financialServices;
1368
    partnerVerficationCheckBoxObject['promotorVerifi'] = promotorVerifi;
1369
    partnerVerficationCheckBoxObject['verifiCheckboxComment'] = verifiComments;
1370
 
1371
    var jsonObject = JSON.stringify(partnerVerficationCheckBoxObject);
1372
 
1373
    if (confirm("Are you sure you want to submit the welcome call?") == true) {
1374
        doAjaxRequestWithJsonHandler(context + "/welcomeCallCheckboxSubmit", "POST",
1375
            jsonObject, function (response) {
1376
                alert("Welcome call successfully submitted");
1377
                $('#myModal').modal('hide');
1378
                welcomeCallListing("main-content");
1379
            });
1380
    }
1381
});
1382
 
1383
 
1384