Subversion Repositories SmartDukaan

Rev

Rev 37455 | 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
 
37457 amit 480
    $(this).find(":selected").not('[data-gst-locked]').attr('disabled', false).show();
481
    // State stays locked when it came from the LOI's GSTIN - the GSTIN's first two
482
    // digits are its state code, so there is nothing for the operator to decide.
483
    $(this).find(":input").not('[data-gst-locked]').attr('disabled', false).show();
29763 tejbeer 484
 
485
 
33512 tejus.loha 486
});
29763 tejbeer 487
 
488
 
33512 tejus.loha 489
$(document).on('click', '.addKycdetail', function () {
490
    var row = $(this).closest("tr");
29763 tejbeer 491
 
33512 tejus.loha 492
    var onBoardingId = $(this).data('onboardingid');
29763 tejbeer 493
 
33512 tejus.loha 494
    console.log(row);
495
    var rowIndex = $(this).closest('tr').prevAll().length;
496
    var id = $(row).find("td:eq(0)").text();
497
    var firstName = $(row).find("td:eq(1) input[type='text']").val();
498
    var middleName = $(row).find("td:eq(2) input[type='text']").val();
499
    var lastName = $(row).find("td:eq(3) input[type='text']").val();
29763 tejbeer 500
 
33512 tejus.loha 501
    var fatherName = $(row).find("td:eq(4) input[type='text']").val();
29763 tejbeer 502
 
33512 tejus.loha 503
    var dob = $(row).find("td:eq(5) input[type='date']").val();
29763 tejbeer 504
 
33512 tejus.loha 505
    if (dob != "") {
29763 tejbeer 506
 
33512 tejus.loha 507
        dob = dob + "T00:00:00";
508
    }
29763 tejbeer 509
 
33512 tejus.loha 510
    var gender = $(row).find("td:eq(6) option:selected").val();
511
    var maritalStatus = $(row).find("td:eq(7) option:selected").val();
29763 tejbeer 512
 
33512 tejus.loha 513
    var email = $(row).find("td:eq(8) input[type='text']").val();
29763 tejbeer 514
 
33512 tejus.loha 515
    var mobile = $(row).find("td:eq(9) input[type='text']").val();
516
    var pan = $(row).find("td:eq(10) input[type='text']").val();
29763 tejbeer 517
 
518
 
33512 tejus.loha 519
    var pandocId = $(row).find(".pandoc input[type=hidden]").val();
29774 tejbeer 520
 
33512 tejus.loha 521
    var poaNO = $(row).find("td:eq(12) input[type='text']").val();
522
    var poaType = $(row).find("td:eq(13) option:selected").val();
29763 tejbeer 523
 
33512 tejus.loha 524
    var paoFrontd = $(row).find(".paof input[type=hidden]").val();
525
    var paoBackId = $(row).find(".paob input[type=hidden]").val();
29763 tejbeer 526
 
33512 tejus.loha 527
    var address1 = $(row).find("td:eq(16) input[type='text']").val();
29763 tejbeer 528
 
33512 tejus.loha 529
    var address2 = $(row).find("td:eq(17) input[type='text']").val();
29763 tejbeer 530
 
33512 tejus.loha 531
    var address3 = $(row).find("td:eq(18) input[type='text']").val();
29763 tejbeer 532
 
33512 tejus.loha 533
    var city = $(row).find("td:eq(19) input[type='text']").val();
29763 tejbeer 534
 
535
 
37455 amit 536
    // State is a master-backed <select>, not a text input.
537
    var state = $(row).find("td:eq(20) select[name='state']").val();
29763 tejbeer 538
 
33512 tejus.loha 539
    var pincode = $(row).find("td:eq(21) input[type='text']").val();
29763 tejbeer 540
 
541
 
33512 tejus.loha 542
    console.log(city)
543
    if (dob === "") {
544
        alert("dob is required");
545
        return;
546
    }
29763 tejbeer 547
 
548
 
33512 tejus.loha 549
    if (gender === "") {
550
        alert("gender is required");
551
        return;
552
    }
29763 tejbeer 553
 
554
 
33512 tejus.loha 555
    if (fatherName === "") {
556
        alert("Father Name is required");
557
        return;
558
    }
29763 tejbeer 559
 
33512 tejus.loha 560
    if (maritalStatus === "") {
561
        alert("Marital Status is required");
562
        return;
563
    }
29763 tejbeer 564
 
33512 tejus.loha 565
    if (email === "") {
566
        alert("email is required");
567
        return;
568
    }
29763 tejbeer 569
 
33512 tejus.loha 570
    if (mobile === "") {
571
        alert("mobile is required");
572
        return;
573
    }
29763 tejbeer 574
 
33512 tejus.loha 575
    if (pan === "") {
576
        alert("pan is required");
577
        return;
578
    }
29763 tejbeer 579
 
33512 tejus.loha 580
    if (pandocId === "") {
581
        alert("panDoc is required");
582
        return;
583
    }
29763 tejbeer 584
 
33512 tejus.loha 585
    if (poaNO === "") {
586
        alert("paoNO is required");
587
        return;
588
    }
29763 tejbeer 589
 
33512 tejus.loha 590
    if (poaType === "") {
591
        alert("paoType is required");
592
        return;
593
    }
29774 tejbeer 594
 
33512 tejus.loha 595
    if (paoFrontd === "") {
596
        alert("paoFrontd is required");
597
        return;
598
    }
29774 tejbeer 599
 
33512 tejus.loha 600
    if (paoBackId === "") {
601
        alert("paoBackId is required");
602
        return;
603
    }
29763 tejbeer 604
 
33512 tejus.loha 605
    if (address1 === "") {
606
        alert("address1 is required");
607
        return;
608
    }
609
    if (address2 === "") {
610
        alert("address2 is required");
611
        return;
612
    }
29763 tejbeer 613
 
33512 tejus.loha 614
    if (city === "") {
615
        alert("city is required");
616
        return;
617
    }
618
    if (state === "") {
619
        alert("state is required");
620
        return;
621
    }
29763 tejbeer 622
 
33512 tejus.loha 623
    if (pincode === "") {
624
        alert("pincode is required");
625
        return;
626
    }
29763 tejbeer 627
 
33512 tejus.loha 628
    var kycDetail = {};
629
    kycDetail['id'] = id
29763 tejbeer 630
 
33512 tejus.loha 631
    kycDetail['firstName'] = firstName
632
    kycDetail['middleName'] = middleName
633
    kycDetail['lastName'] = lastName
29763 tejbeer 634
 
33512 tejus.loha 635
    kycDetail['fatherName'] = fatherName
29763 tejbeer 636
 
33512 tejus.loha 637
    kycDetail['dob'] = dob
638
    kycDetail['gender'] = gender
639
    kycDetail['maritalStatus'] = maritalStatus
640
    kycDetail['email'] = email
641
    kycDetail['mobile'] = mobile
642
    kycDetail['pan'] = pan
643
    kycDetail['pandocId'] = pandocId
644
    kycDetail['poaNo'] = poaNO
645
    kycDetail['poaType'] = poaType
646
    kycDetail['paoFrontd'] = paoFrontd
647
    kycDetail['paoBackId'] = paoBackId
29763 tejbeer 648
 
33512 tejus.loha 649
    kycDetail['address1'] = address1
650
    kycDetail['address2'] = address2
651
    kycDetail['address3'] = address3
652
    kycDetail['city'] = city
653
    kycDetail['state'] = state
654
    kycDetail['pincode'] = pincode
655
    kycDetail['onboardingId'] = onBoardingId
29763 tejbeer 656
 
33512 tejus.loha 657
    var jsonObject = JSON.stringify(kycDetail);
658
    console.log("kycDetail" + jsonObject);
29763 tejbeer 659
 
33512 tejus.loha 660
    console.log(jsonObject);
29763 tejbeer 661
 
33512 tejus.loha 662
    if (confirm("Are you sure you want to submit the request") == true) {
663
        doAjaxRequestWithJsonHandler(context + "/addPartnerKyc", "POST", jsonObject, function (response) {
664
            row.html(response);
29763 tejbeer 665
 
666
 
33512 tejus.loha 667
        });
668
    }
29763 tejbeer 669
 
33512 tejus.loha 670
});
29774 tejbeer 671
 
29763 tejbeer 672
 
33512 tejus.loha 673
$(document).on('click', ".addNewRow", function () {
674
    var id = $(this).data('id');
675
    console.log(id);
676
    doAjaxRequestHandler(context + "/addKycRow?onBoardingId=" + id, "GET",
677
        function (response) {
29763 tejbeer 678
 
33512 tejus.loha 679
            console.log(response)
680
            $('.' + "fofoKycContainer").html(response);
29763 tejbeer 681
 
33512 tejus.loha 682
        });
29763 tejbeer 683
 
33512 tejus.loha 684
});
29763 tejbeer 685
 
686
 
33512 tejus.loha 687
var table = $('#legalkyctable').DataTable();
688
$(document).on('dblclick', '#legalkyctable tbody tr', function () {
689
    console.log("dblclick");
690
    var data = table.row(this).data();
29763 tejbeer 691
 
37457 amit 692
    $(this).find(":selected").not('[data-gst-locked]').attr('disabled', false).show();
693
    // State stays locked when it came from the LOI's GSTIN - the GSTIN's first two
694
    // digits are its state code, so there is nothing for the operator to decide.
695
    $(this).find(":input").not('[data-gst-locked]').attr('disabled', false).show();
29763 tejbeer 696
 
697
 
33512 tejus.loha 698
});
29763 tejbeer 699
 
700
 
33512 tejus.loha 701
$(document).on('click', '.addlegalKycdetail', function () {
702
    var row = $(this).closest("tr");
29763 tejbeer 703
 
33512 tejus.loha 704
    console.log(row);
29763 tejbeer 705
 
33512 tejus.loha 706
    var id = $(row).find("td:eq(2)").text();
707
    var status = $(row).find("td:eq(3) option:selected").val();
29763 tejbeer 708
 
29794 tejbeer 709
 
33512 tejus.loha 710
    var businessType = $(row).find("td:eq(4) option:selected").val();
711
    var firstName = $(row).find("td:eq(5) input[type='text']").val();
712
    var middleName = $(row).find("td:eq(6) input[type='text']").val();
713
    var lastName = $(row).find("td:eq(7) input[type='text']").val();
29794 tejbeer 714
 
33512 tejus.loha 715
    var fatherName = $(row).find("td:eq(8) input[type='text']").val();
29794 tejbeer 716
 
33512 tejus.loha 717
    var dob = $(row).find("td:eq(9) input[type='date']").val();
29794 tejbeer 718
 
33512 tejus.loha 719
    if (dob != "") {
29794 tejbeer 720
 
33512 tejus.loha 721
        dob = dob + "T00:00:00";
722
    }
29794 tejbeer 723
 
33512 tejus.loha 724
    var gender = $(row).find("td:eq(10) option:selected").val();
725
    var maritalStatus = $(row).find("td:eq(11) option:selected").val();
29794 tejbeer 726
 
33512 tejus.loha 727
    var email = $(row).find("td:eq(12) input[type='text']").val();
29794 tejbeer 728
 
33512 tejus.loha 729
    var mobile = $(row).find("td:eq(13) input[type='text']").val();
730
    var pan = $(row).find("td:eq(14) input[type='text']").val();
29794 tejbeer 731
 
732
 
33512 tejus.loha 733
    var pandocId = $(row).find(".pandoc input[type=hidden]").val();
29794 tejbeer 734
 
33512 tejus.loha 735
    var poaNO = $(row).find("td:eq(16) input[type='text']").val();
736
    var poaType = $(row).find("td:eq(17) option:selected").val();
29884 tejbeer 737
 
33512 tejus.loha 738
    var paoFrontd = $(row).find(".paof input[type=hidden]").val();
739
    var paoBackId = $(row).find(".paob input[type=hidden]").val();
29884 tejbeer 740
 
33512 tejus.loha 741
    var address1 = $(row).find("td:eq(20) input[type='text']").val();
29794 tejbeer 742
 
33512 tejus.loha 743
    var address2 = $(row).find("td:eq(21) input[type='text']").val();
29794 tejbeer 744
 
33512 tejus.loha 745
    var address3 = $(row).find("td:eq(22) input[type='text']").val();
29794 tejbeer 746
 
33512 tejus.loha 747
    var city = $(row).find("td:eq(23) input[type='text']").val();
29794 tejbeer 748
 
749
 
37455 amit 750
    // State is a master-backed <select>, not a text input.
751
    var state = $(row).find("td:eq(24) select[name='state']").val();
29794 tejbeer 752
 
33512 tejus.loha 753
    var pincode = $(row).find("td:eq(25) input[type='text']").val();
29794 tejbeer 754
 
755
 
33512 tejus.loha 756
    var kycDetail = {};
757
    kycDetail['id'] = id
758
    kycDetail['status'] = status
759
    kycDetail['businessType'] = businessType
760
    kycDetail['firstName'] = firstName
761
    kycDetail['middleName'] = middleName
762
    kycDetail['lastName'] = lastName
29794 tejbeer 763
 
33512 tejus.loha 764
    kycDetail['fatherName'] = fatherName
29794 tejbeer 765
 
33512 tejus.loha 766
    kycDetail['dob'] = dob
767
    kycDetail['gender'] = gender
768
    kycDetail['maritalStatus'] = maritalStatus
769
    kycDetail['email'] = email
770
    kycDetail['mobile'] = mobile
771
    kycDetail['pan'] = pan
772
    kycDetail['pandocId'] = pandocId
773
    kycDetail['poaNo'] = poaNO
774
    kycDetail['poaType'] = poaType
775
    kycDetail['paoFrontd'] = paoFrontd
776
    kycDetail['paoBackId'] = paoBackId
29794 tejbeer 777
 
33512 tejus.loha 778
    kycDetail['address1'] = address1
779
    kycDetail['address2'] = address2
780
    kycDetail['address3'] = address3
781
    kycDetail['city'] = city
782
    kycDetail['state'] = state
783
    kycDetail['pincode'] = pincode
29794 tejbeer 784
 
33512 tejus.loha 785
    var jsonObject = JSON.stringify(kycDetail);
786
    console.log("kycDetail" + jsonObject);
29794 tejbeer 787
 
33512 tejus.loha 788
    console.log(jsonObject);
29794 tejbeer 789
 
33512 tejus.loha 790
    if (confirm("Are you sure you want to submit the request") == true) {
791
        doAjaxRequestWithJsonHandler(context + "/addlegalPartnerKyc", "POST", jsonObject, function (response) {
792
            row.html(response);
29794 tejbeer 793
 
794
 
33512 tejus.loha 795
        });
796
    }
29794 tejbeer 797
 
33512 tejus.loha 798
});
29794 tejbeer 799
 
33512 tejus.loha 800
$(document).on('click', ".partner-onboarding-index", function () {
801
    panelListing("main-content");
802
});
29794 tejbeer 803
 
804
 
33512 tejus.loha 805
$(document).on('click', ".partner-onboarding-open", function () {
806
    console.log("yes");
807
    partnerOnboardingOpen("main-content");
808
});
29794 tejbeer 809
 
33512 tejus.loha 810
$(document).on('click', ".design-completed", function () {
811
    console.log("yes");
812
    partnerOnboardinDesignCompleted("main-content");
813
});
29794 tejbeer 814
 
33512 tejus.loha 815
$(document).on('click', ".design_tat", function () {
816
    console.log("yes");
817
    partnerOnboardingDesign("main-content");
818
});
29794 tejbeer 819
 
33512 tejus.loha 820
$(document).on('click', ".partner-onboarding-reject", function () {
821
    console.log("helo");
29794 tejbeer 822
 
33512 tejus.loha 823
    partnerOnboardingReject("main-content");
824
});
29794 tejbeer 825
 
33512 tejus.loha 826
$(document).on('input', 'table#legalkyctable input[type=file]', function () {
827
    if (confirm('Confirm upload ?')) {
828
        var fileSelector = $(this)[0];
829
        if (fileSelector != undefined
830
            && fileSelector.files[0] != undefined) {
831
            var url = `${context}/document-upload`;
832
            console.log(url);
833
            var file = this.files[0];
834
            console.log("file" + file);
835
            let fileInput = $(this);
836
            console.log("fileInput" + file);
837
            doAjaxUploadRequestHandler(
838
                url,
839
                'POST',
840
                file,
841
                function (response) {
842
                    console.log(response);
843
                    var documentId = response.response.document_id;
844
                    console.log("documentId : " + documentId);
845
                    fileInput.closest('td').find("input[type=hidden]").val(documentId);
846
                });
847
            // alert("Retailer Shop Document
848
            // is required");
849
        }
850
    } else {
851
        // Do nothing!
852
    }
853
});
29794 tejbeer 854
 
855
 
33512 tejus.loha 856
$(document).on('input', 'table#fofokyctable input[type=file]', function () {
857
    if (confirm('Confirm upload ?')) {
858
        var fileSelector = $(this)[0];
859
        if (fileSelector != undefined
860
            && fileSelector.files[0] != undefined) {
861
            var url = `${context}/document-upload`;
862
            console.log(url);
863
            var file = this.files[0];
864
            console.log("file" + file);
865
            let fileInput = $(this);
866
            console.log("fileInput" + file);
867
            doAjaxUploadRequestHandler(
868
                url,
869
                'POST',
870
                file,
871
                function (response) {
872
                    console.log(response);
873
                    var documentId = response.response.document_id;
874
                    console.log("documentId : " + documentId);
875
                    fileInput.closest('td').find("input[type=hidden]").val(documentId);
876
                });
877
            // alert("Retailer Shop Document
878
            // is required");
879
        }
880
    } else {
881
        // Do nothing!
882
    }
883
});
29794 tejbeer 884
 
33512 tejus.loha 885
$(document).on('input', 'table#example input[type=file]', function () {
886
    if (confirm('Confirm upload ?')) {
887
        var fileSelector = $(this)[0];
888
        if (fileSelector != undefined
889
            && fileSelector.files[0] != undefined) {
890
            var url = `${context}/document-upload`;
891
            console.log(url);
892
            var file = this.files[0];
893
            console.log("file" + file);
894
            let fileInput = $(this);
895
            console.log("fileInput" + file);
896
            doAjaxUploadRequestHandler(
897
                url,
898
                'POST',
899
                file,
900
                function (response) {
901
                    console.log(response);
902
                    var documentId = response.response.document_id;
903
                    console.log("documentId : " + documentId);
904
                    fileInput.closest('td').find("input[type=hidden]").val(documentId);
905
                });
906
            // alert("Retailer Shop Document
907
            // is required");
908
        }
909
    } else {
910
        // Do nothing!
911
    }
912
});
29794 tejbeer 913
 
914
 
33512 tejus.loha 915
$(document).on('input', 'table#partnerVerification input[type=file]', function () {
916
    if (confirm('Confirm upload ?')) {
917
        var fileSelector = $(this)[0];
918
        if (fileSelector != undefined
919
            && fileSelector.files[0] != undefined) {
920
            var url = `${context}/document-upload`;
921
            console.log(url);
922
            var file = this.files[0];
923
            console.log("file" + file);
924
            let fileInput = $(this);
925
            console.log("fileInput" + file);
926
            doAjaxUploadRequestHandler(
927
                url,
928
                'POST',
929
                file,
930
                function (response) {
931
                    console.log(response);
932
                    var documentId = response.response.document_id;
933
                    console.log("documentId : " + documentId);
934
                    fileInput.closest('td').find("input[type=hidden]").val(documentId);
935
                });
936
            // alert("Retailer Shop Document
937
            // is required");
938
        }
939
    } else {
940
        // Do nothing!
941
    }
942
});
27813 tejbeer 943
 
944
 
33512 tejus.loha 945
$(document).on('input', 'table#OnboardingDesign input[type=file]', function () {
946
    if (confirm('Confirm upload ?')) {
947
        var fileSelector = $(this)[0];
948
        if (fileSelector != undefined
949
            && fileSelector.files[0] != undefined) {
950
            var url = `${context}/document-upload`;
951
            console.log(url);
952
            var file = this.files[0];
953
            console.log("file" + file);
954
            let fileInput = $(this);
955
            console.log("fileInput" + file);
956
            doAjaxUploadRequestHandler(
957
                url,
958
                'POST',
959
                file,
960
                function (response) {
961
                    console.log(response);
962
                    var documentId = response.response.document_id;
963
                    console.log("documentId : " + documentId);
964
                    fileInput.closest('td').find("input[type=hidden]").val(documentId);
965
                });
966
            // alert("Retailer Shop Document
967
            // is required");
968
        }
969
    } else {
970
        // Do nothing!
971
    }
972
});
28908 tejbeer 973
 
33512 tejus.loha 974
$(document).on('click', '#newmodal', function () {
28908 tejbeer 975
 
27813 tejbeer 976
 
33512 tejus.loha 977
    var newOnboarding = {};
978
    var outletName = $('#outLetName1').val();
979
    var phoneNumber = $('#number1').val();
980
    var leadId = $("#leadId").val();
27763 tejbeer 981
 
27799 tejbeer 982
 
33512 tejus.loha 983
    if (outletName == "") {
29763 tejbeer 984
 
33512 tejus.loha 985
        alert("outletName is required ");
986
        return;
987
    }
988
    newOnboarding['outletName'] = $('#outLetName1').val();
29794 tejbeer 989
 
33512 tejus.loha 990
    if (phoneNumber == "") {
991
        alert("Phone Number is required ");
992
        return false;
29763 tejbeer 993
 
33512 tejus.loha 994
    }
995
    if (phoneNumber.length > 6 && phoneNumber.length < 11) {
29061 tejbeer 996
 
33512 tejus.loha 997
        newOnboarding['phoneNumber'] = $('#number1').val();
29061 tejbeer 998
 
33512 tejus.loha 999
    } else {
1000
        alert("Number should be greater then 6 and less then 11");
1001
        return false;
29061 tejbeer 1002
 
33512 tejus.loha 1003
    }
29061 tejbeer 1004
 
33512 tejus.loha 1005
    acquireddate1 = $('#acquireddate1').val();
1006
    console.log(acquireddate1)
29061 tejbeer 1007
 
33512 tejus.loha 1008
    if (acquireddate1 != "") {
27799 tejbeer 1009
 
33512 tejus.loha 1010
        alert("Acquired date is required");
29061 tejbeer 1011
 
33512 tejus.loha 1012
    }
1013
    if (acquireddate1 != "") {
1014
        acquireddate1 = acquireddate1 + "T00:00:00";
1015
    }
1016
    newOnboarding['authId'] = $('#authUserOnboarding').val();
29061 tejbeer 1017
 
33512 tejus.loha 1018
    newOnboarding['acquiredDate'] = acquireddate1
1019
    newOnboarding['leadId'] = leadId
29061 tejbeer 1020
 
31370 tejbeer 1021
 
33512 tejus.loha 1022
    var json = JSON.stringify(newOnboarding);
1023
    console.log(json);
1024
    doAjaxRequestWithJsonHandler(
1025
        context
1026
        + "/partnerOnBoardingListing",
1027
        "POST",
1028
        json,
1029
        function (response) {
29061 tejbeer 1030
 
33512 tejus.loha 1031
            panelListing("main-content");
29061 tejbeer 1032
 
1033
 
33512 tejus.loha 1034
        });
1035
});
29061 tejbeer 1036
 
33512 tejus.loha 1037
var table = $('#example').DataTable();
1038
$(document).on('dblclick', '#example tbody tr', function () {
29061 tejbeer 1039
 
33512 tejus.loha 1040
    var data = table.row(this).data();
35971 aman 1041
    // Use class-based selector instead of td:eq(N) — positional selectors break when columns are hidden
1042
    var holdBtn = $(this).find("button.holdPartnerOnboarding, button.unHoldPartnerOnboarding");
1043
    var statusHold = holdBtn.val();
29061 tejbeer 1044
 
33891 tejus.loha 1045
    console.log("statusHold=" + statusHold);
35971 aman 1046
    if (statusHold === "unhold") {
1047
        // Row is on hold — keep inputs disabled, only enable Submit and Open buttons
33512 tejus.loha 1048
        $(this).find(":input").attr('disabled', true);
35971 aman 1049
        $(this).find("button.open_outlet").attr('disabled', false);
1050
        $(this).find("button.submit1").attr('disabled', false);
33512 tejus.loha 1051
    } else {
35971 aman 1052
        // Row is not on hold — enable all inputs for editing
33512 tejus.loha 1053
        $(this).find(":input").attr('disabled', false).show();
1054
        $(this).find(":selected").attr('disabled', false).show();
29061 tejbeer 1055
 
33512 tejus.loha 1056
    }
1057
    $(this).find("input[name=rbmAuthId]").attr('disabled', true);
1058
    $(this).find("input[name=verificationStatusOnboarding]").attr('disabled', true);
1059
    $(this).find("input[name=billingStatus]").attr('disabled', true);
31370 tejbeer 1060
 
1061
 
33512 tejus.loha 1062
    $(this).css("background-color", "#87d3f8");
31370 tejbeer 1063
 
33512 tejus.loha 1064
});
27813 tejbeer 1065
 
33512 tejus.loha 1066
var table = $('#OnboardingDesign').DataTable();
1067
$(document).on('dblclick', '#OnboardingDesign tbody tr', function () {
27813 tejbeer 1068
 
33512 tejus.loha 1069
    var data = table.row(this).data();
29061 tejbeer 1070
 
33512 tejus.loha 1071
    $(this).find(":input").attr('disabled', false).show();
1072
    $(this).find(":selected").attr('disabled', true);
27813 tejbeer 1073
 
33512 tejus.loha 1074
    $(this).find("input[name=acquireddate]").attr('disabled', true);
1075
    $(this).find("input[name=outlateName]").attr('disabled', true);
1076
    $(this).find("input[name=phonenumber1]").attr('disabled', true);
1077
    $(this).find("input[name=kyc1]").attr('disabled', true);
1078
    $(this).find("input[name=city1]").attr('disabled', true);
1079
    $(this).find("input[name=shead1]").attr('disabled', true);
1080
    $(this).find("input[name=bdm1]").attr('disabled', true);
1081
    $(this).find("input[name=abrand1]").attr('disabled', true);
1082
    $(this).find("input[name=recbrand1]").attr('disabled', true);
1083
    $(this).find("input[name=BrandFeesdate1]").attr('disabled', true);
1084
    $(this).find("input[name=idate1]").attr('disabled', true);
1085
    $(this).find("input[name=loi1]").attr('disabled', true);
1086
    $(this).find("input[name=code1]").attr('disabled', true);
1087
    $(this).find("input[name=rplaned1]").attr('disabled', true);
1088
    $(this).find("input[name=stockPaymentDesign]").attr('disabled', true);
1089
    $(this).find("input[name=twoDBoq1]").attr('disabled', true);
1090
    $(this).find("input[name=threeBoqDate1]").attr('disabled', true);
1091
    $(this).find("input[name=poVenderDate1]").attr('disabled', true);
1092
    $(this).find("input[name=briefingPartnerPlanedDate1]").attr('disabled', true);
1093
    $(this).find("input[name=deploymentPlanedDate]").attr('disabled', true);
1094
    $(this).find("input[name=FinalPicsOutLets]").attr('disabled', true);
1095
    $(this).find("input[name=poVenderDate1]").attr('disabled', true);
1096
    $(this).css("background-color", "#87d3f8");
1097
    let a = 12;
1098
    let b = 12;
1099
    console.log("yes" + a == b);
28908 tejbeer 1100
 
33512 tejus.loha 1101
});
28908 tejbeer 1102
 
27813 tejbeer 1103
 
33512 tejus.loha 1104
var billingtable = $('#partnerbilling').DataTable();
1105
$(document).on('dblclick', '#partnerbilling tbody tr', function () {
1106
    var data = billingtable.row(this).data();
27813 tejbeer 1107
 
33512 tejus.loha 1108
    $(this).find(":input").attr('disabled', false).show();
29061 tejbeer 1109
 
1110
 
33512 tejus.loha 1111
});
29061 tejbeer 1112
 
33882 tejus.loha 1113
/*$(document)
33512 tejus.loha 1114
    .on(
1115
        'click',
1116
        ".submitOnboardingBilling",
1117
        function () {
29088 tejbeer 1118
 
33512 tejus.loha 1119
            var row = $(this).closest("tr");
1120
            console.log(row);
29061 tejbeer 1121
 
33512 tejus.loha 1122
            var onboardingId = $(row).find("td:eq(0)").text();
1123
            var stockPayment = $(row).find("td:eq(5) input[type='text']").val();
1124
            var advStock = $(row).find("td:eq(4) input[type='date']").val();
1125
            if (advStock != "") {
1126
                advStock = advStock + "T00:00:00";
1127
            }
28908 tejbeer 1128
 
33512 tejus.loha 1129
            var billingStatus = $(row)
1130
                .find("td:eq(6) input[type='checkbox']").is(":checked") ? 1 : 0;
27813 tejbeer 1131
 
33512 tejus.loha 1132
            doPostAjaxRequestHandler(context + "/partnerOnBoardingBillingSubmission?billingStatus=" + billingStatus + "&onBoardingId=" + onboardingId + "&advStock=" + advStock + "&stockPayment=" + stockPayment,
1133
                function (response) {
1134
                    row.html(response);
1135
                    alert("successfully submit");
28908 tejbeer 1136
 
1137
 
33512 tejus.loha 1138
                });
33882 tejus.loha 1139
        });*/
28908 tejbeer 1140
 
28600 amit.gupta 1141
 
33891 tejus.loha 1142
$(document).on('click', ".open_outlet", function () {
28600 amit.gupta 1143
 
33512 tejus.loha 1144
    var id = $(this).data('id');
1145
    console.log('helo');
1146
    var id = $(this).data('id');
1147
    console.log(id);
1148
    if (confirm("Are you sure your outlet is open") == true) {
1149
        doPostAjaxRequestHandler(context + "/partnerOnBoardingOpen?id=" + id,
1150
            function (response) {
29088 tejbeer 1151
 
33512 tejus.loha 1152
                console.log("reponse" + response);
1153
                if (response == 'true') {
1154
                    alert("congratulations your outlet is successfully open");
29088 tejbeer 1155
 
33512 tejus.loha 1156
                    panelListing("main-content");
1157
                }
1158
            });
1159
    }
29088 tejbeer 1160
 
33512 tejus.loha 1161
});
1162
$(document).on('click', ".design-complete", function () {
1163
    var id = $(this).data('id');
1164
    var row = $(this).closest("tr");
1165
    console.log('helo');
1166
    var receeActual = $(row).find("td:eq(14) input[type='date']").val();
1167
    if (receeActual != "") {
1168
        receeActual = receeActual + "T00:00:00";
1169
    }
1170
    var twoDBoqdate = $(row).find("td:eq(17) input[type='date']").val();
1171
    if (twoDBoqdate != "") {
1172
        twoDBoqdate = twoDBoqdate + "T00:00:00";
1173
    }
29088 tejbeer 1174
 
33512 tejus.loha 1175
    var poVenderDate = $(row).find("td:eq(23) input[type='date']").val();
1176
    if (poVenderDate != "") {
1177
        poVenderDate = poVenderDate + "T00:00:00";
1178
    }
1179
    var briefingPartner = $(row).find("td:eq(25) input[type='date']").val();
1180
    if (briefingPartner != "") {
1181
        briefingPartner = briefingPartner + "T00:00:00";
1182
    }
29088 tejbeer 1183
 
33512 tejus.loha 1184
    var deploymentDate = $(row).find("td:eq(27) input[type='date']").val();
1185
    if (deploymentDate != "") {
1186
        deploymentDate = deploymentDate + "T00:00:00";
1187
    }
29088 tejbeer 1188
 
33512 tejus.loha 1189
    var nocDate = $(row).find("td:eq(31) input[type='date']").val();
1190
    if (nocDate != "") {
1191
        nocDate = nocDate + "T00:00:00";
1192
    }
29763 tejbeer 1193
 
33512 tejus.loha 1194
    if (receeActual == "") {
1195
        alert("Please Fill The Recee Actual Date");
1196
        return
29088 tejbeer 1197
 
33512 tejus.loha 1198
    }
1199
    if (twoDBoqdate == "") {
35971 aman 1200
        alert("Please Fill The BOQ Actual Date");
33512 tejus.loha 1201
        return
29088 tejbeer 1202
 
33512 tejus.loha 1203
    }
35971 aman 1204
    // Removed validations for hidden columns: PO Vendor, Briefing Partner, Deployment, NOC
29088 tejbeer 1205
 
1206
 
33512 tejus.loha 1207
    var id = $(this).data('id');
1208
    console.log(id);
1209
    if (confirm("Are you sure your Design TAT is Complete") == true) {
1210
        doPostAjaxRequestHandler(context + "/partnerDesignTatCompleted?id=" + id,
1211
            function (response) {
27813 tejbeer 1212
 
33512 tejus.loha 1213
                console.log("reponse" + response);
1214
                if (response == 'true') {
1215
                    alert("congratulations your Desiging is successfully Done");
1216
                    partnerOnboardingDesign("main-content");
1217
                }
1218
            });
1219
    }
29061 tejbeer 1220
 
33512 tejus.loha 1221
});
29061 tejbeer 1222
 
1223
 
33512 tejus.loha 1224
$(document).on('click', ".rejectpartneronboarding", function () {
1225
    var id = $(this).data('id');
1226
    console.log('helo');
1227
    var id = $(this).data('id');
1228
    console.log(id);
1229
    if (confirm("Are you sure you want to reject the request") == true) {
1230
        doPostAjaxRequestHandler(context + "/partnerOnBoardingReject?id=" + id,
1231
            function (response) {
29061 tejbeer 1232
 
33512 tejus.loha 1233
                console.log("reponse" + response);
1234
                if (response == 'true') {
1235
                    alert("successfully rejected");
1236
                    panelListing("main-content");
1237
                }
1238
            });
1239
    }
29061 tejbeer 1240
 
27763 tejbeer 1241
});
1242
 
27813 tejbeer 1243
 
33512 tejus.loha 1244
$(document).on('click', ".Del", function () {
1245
    if (confirm("Are you sure you want to delete this doc")) {
1246
        var $td = $(this).closest("td");
1247
        $td.find("input[type=hidden]").val('0');
1248
        $td.css({'background-color': 'pink'});
1249
        $td.find('a', ".download").hide();
1250
        $td.find('a', ".Del").hide();
1251
    }
28908 tejbeer 1252
});
28600 amit.gupta 1253
 
28908 tejbeer 1254
 
27829 tejbeer 1255
function panelListing(domId) {
33512 tejus.loha 1256
    doAjaxRequestHandler(context + "/partnerOnBoardingPanel", "GET",
1257
        function (response) {
1258
            $('#' + domId).html(response);
1259
        });
27829 tejbeer 1260
}
27813 tejbeer 1261
 
1262
 
27763 tejbeer 1263
function panelListing(domId) {
33512 tejus.loha 1264
    doAjaxRequestHandler(context + "/partnerOnBoardingPanel", "GET",
1265
        function (response) {
1266
            $('#' + domId).html(response);
1267
        });
27763 tejbeer 1268
}
33512 tejus.loha 1269
 
27799 tejbeer 1270
function partnerOnboardingOpen(domId) {
33512 tejus.loha 1271
    doAjaxRequestHandler(context + "/partnerOnBoardingOpenShow", "GET",
1272
        function (response) {
1273
            $('#' + domId).html(response);
1274
        });
27799 tejbeer 1275
}
28600 amit.gupta 1276
 
1277
function partnerOnboardinDesignCompleted(domId) {
33512 tejus.loha 1278
    doAjaxRequestHandler(context + "/DesignTatCompletedShow", "GET",
1279
        function (response) {
1280
            $('#' + domId).html(response);
1281
        });
28600 amit.gupta 1282
}
1283
 
1284
function partnerOnboardingDesign(domId) {
33512 tejus.loha 1285
    doAjaxRequestHandler(context + "/partnerOnBoardingDesign", "GET",
1286
        function (response) {
1287
            $('#' + domId).html(response);
1288
        });
28600 amit.gupta 1289
}
1290
 
27799 tejbeer 1291
function partnerOnboardingReject(domId) {
33512 tejus.loha 1292
    doAjaxRequestHandler(context + "/partnerOnBoardingRejectShow", "GET",
1293
        function (response) {
1294
            $('#' + domId).html(response);
1295
        });
27799 tejbeer 1296
}
27763 tejbeer 1297
 
27813 tejbeer 1298
 
27763 tejbeer 1299
function panelOnBoardingListing(domId) {
33512 tejus.loha 1300
    doAjaxRequestHandler(context + "/partnerOnBoardingListing", "POST",
1301
        function (response) {
1302
            $('#' + domId).html(response);
1303
        });
27763 tejbeer 1304
 
1305
}
1306
 
1307
 
28908 tejbeer 1308
function panelListing(domId) {
33512 tejus.loha 1309
    doAjaxRequestHandler(context + "/partnerOnBoardingPanel", "GET",
1310
        function (response) {
1311
            $('#' + domId).html(response);
1312
        });
28908 tejbeer 1313
}
27763 tejbeer 1314
 
35971 aman 1315
// Full Stock Payment Panel - menu click handler
1316
$(document).on('click', ".full-stock-payment-panel", function () {
1317
    fullStockPaymentListing("main-content");
1318
});
27763 tejbeer 1319
 
35971 aman 1320
function fullStockPaymentListing(domId) {
1321
    doAjaxRequestHandler(context + "/fullStockPaymentPanel", "GET",
1322
        function (response) {
1323
            $('#' + domId).html(response);
1324
        });
1325
}
27842 tejbeer 1326
 
37110 aman 1327
// Agreement E-Sign Panel - menu click handler
1328
$(document).on('click', ".agreement-esign-panel", function () {
1329
    agreementEsignListing("main-content");
1330
});
1331
 
1332
function agreementEsignListing(domId) {
1333
    doAjaxRequestHandler(context + "/agreementEsignPanel", "GET",
1334
        function (response) {
1335
            $('#' + domId).html(response);
1336
        });
1337
}
1338
 
37264 ranu 1339
// RBM Assignment Panel - menu click handler (auth.menu action_class = 'rbm-assignment')
1340
$(document).on('click', ".rbm-assignment", function (e) {
1341
    e.preventDefault();
1342
    console.log('[rbm-assignment] menu click fired, loading /rbmAssignmentPanel');
1343
    doAjaxRequestHandler(context + "/rbmAssignmentPanel", "GET",
1344
        function (response) {
1345
            $('#main-content').html(response);
1346
        });
1347
});
1348
 
35971 aman 1349
// Welcome Call Panel - menu click handler
1350
$(document).on('click', ".welcome-call-panel", function () {
1351
    welcomeCallListing("main-content");
1352
});
28908 tejbeer 1353
 
35971 aman 1354
function welcomeCallListing(domId) {
1355
    doAjaxRequestHandler(context + "/welcomeCallPanel", "GET",
1356
        function (response) {
1357
            $('#' + domId).html(response);
1358
        });
1359
}
1360
 
1361
// Open checklist modal for welcome call
1362
$(document).on('click', ".welcome-call-checkbox", function () {
1363
    var onboardingId = $(this).data("id");
1364
    doAjaxRequestHandler(context + "/welcomeCallCheckbox?onboardingId=" + onboardingId, "GET",
1365
        function (response) {
1366
            $('#myModal').html(response);
1367
            $('#myModal').modal('toggle');
1368
        });
1369
});
1370
 
1371
// Submit welcome call checklist
1372
$(document).on('click', '.welcome-call-submit', function () {
1373
    var onboardingId = $(this).data('id');
1374
 
1375
    var trainingVerifi = $('input[name="trainingVerifi"]').is(":checked") ? 1 : 0;
1376
    var recceVerifi = $('input[name="recceVerifi"]').is(":checked") ? 1 : 0;
1377
    var advStockPayment = $('input[name="advStockPayment"]').is(":checked") ? 1 : 0;
1378
    var brandingVerifi = $('input[name="brandingVerifi"]').is(":checked") ? 1 : 0;
1379
    var stockPay = $('input[name="stockPay"]').is(":checked") ? 1 : 0;
1380
    var billingVerifi = $('input[name="billingVerifi"]').is(":checked") ? 1 : 0;
1381
    var inaugrationVerifi = $('input[name="inaugrationVerifi"]').is(":checked") ? 1 : 0;
1382
    var financialServices = $('input[name="financialServices"]').is(":checked") ? 1 : 0;
1383
    var promotorVerifi = $('input[name="promotorVerifi"]').is(":checked") ? 1 : 0;
1384
    var verifiComments = $('input[name="verifiCommentCheckbox"]').val();
1385
 
1386
    var partnerVerficationCheckBoxObject = {};
1387
    partnerVerficationCheckBoxObject['onboardingId'] = onboardingId;
1388
    partnerVerficationCheckBoxObject['trainingVerifi'] = trainingVerifi;
1389
    partnerVerficationCheckBoxObject['recceVerifi'] = recceVerifi;
1390
    partnerVerficationCheckBoxObject['advStockPayment'] = advStockPayment;
1391
    partnerVerficationCheckBoxObject['brandingVerifi'] = brandingVerifi;
1392
    partnerVerficationCheckBoxObject['stockPay'] = stockPay;
1393
    partnerVerficationCheckBoxObject['billingVerifi'] = billingVerifi;
1394
    partnerVerficationCheckBoxObject['inaugrationVerifi'] = inaugrationVerifi;
1395
    partnerVerficationCheckBoxObject['financialServices'] = financialServices;
1396
    partnerVerficationCheckBoxObject['promotorVerifi'] = promotorVerifi;
1397
    partnerVerficationCheckBoxObject['verifiCheckboxComment'] = verifiComments;
1398
 
1399
    var jsonObject = JSON.stringify(partnerVerficationCheckBoxObject);
1400
 
1401
    if (confirm("Are you sure you want to submit the welcome call?") == true) {
1402
        doAjaxRequestWithJsonHandler(context + "/welcomeCallCheckboxSubmit", "POST",
1403
            jsonObject, function (response) {
1404
                alert("Welcome call successfully submitted");
1405
                $('#myModal').modal('hide');
1406
                welcomeCallListing("main-content");
1407
            });
1408
    }
1409
});
1410
 
1411
 
1412