Subversion Repositories SmartDukaan

Rev

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