Subversion Repositories SmartDukaan

Rev

Rev 33561 | Rev 33578 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 33561 Rev 33577
Line 35... Line 35...
35
                <td>
35
                <td>
36
                    <div>
36
                    <div>
37
                        <P>To,</P>
37
                        <P>To,</P>
38
                        <P> Store Name :
38
                        <P> Store Name :
39
                            <span style="color: blue;font-weight:bold">$pod.getCompanyName(),$address.getLoc(),($address.getPncd())</span>
39
                            <span style="color: blue;font-weight:bold">$pod.getCompanyName(),$address.getLoc(),($address.getPncd())</span>
40
 
-
 
41
                        </P>
40
                        </P>
42
                    </div>
41
                    </div>
43
                </td>
42
                </td>
44
                <td style="text-align:right;">
43
                <td style="text-align:right;">
45
                    <div style="text-align:right">
44
                    <div style="text-align:right">
Line 123... Line 122...
123
                record.
122
                record.
124
            </p>
123
            </p>
125
 
124
 
126
            <div class="container2">
125
            <div class="container2">
127
                <h4 style="text-align: center;">AGREED AND ACCEPTED</h4>
126
                <h4 style="text-align: center;">AGREED AND ACCEPTED</h4>
128
                <hr>
-
 
129
                <div style="float:left;">
127
                <div style="float:left;">
130
                    <b>For New Spice Solutions Pvt Ltd</b>
128
                    <b>For New Spice Solutions Pvt Ltd</b>
131
                    <p>Name :$pod.getReferBy()</p>
129
                    <p>Name :$pod.getReferBy()</p>
132
 
130
 
133
                    <P>SIGNED</P>
131
                    <P>SIGNED</P>
Line 180... Line 178...
180
                        <td>yes</td>
178
                        <td>yes</td>
181
                        <td>yes</td>
179
                        <td>yes</td>
182
                    </tr>
180
                    </tr>
183
                    <tr>
181
                    <tr>
184
                        <td>Store designing</td>
182
                        <td>Store designing</td>
185
                        <td style="color: red;">FCC</td>
183
                        <td style="color: red;">FOC</td>
186
                        <td style="color: red;">FCC</td>
184
                        <td style="color: red;">FOC</td>
187
                        <td>yes</td>
185
                        <td>yes</td>
188
                    </tr>
186
                    </tr>
189
                    <tr>
187
                    <tr>
190
                        <td>Initial supervision charges</td>
188
                        <td>Initial supervision charges</td>
191
                        <td>yes</td>
189
                        <td>yes</td>
Line 198... Line 196...
198
                        <td>yes</td>
196
                        <td>yes</td>
199
                        <td>yes</td>
197
                        <td>yes</td>
200
                    </tr>
198
                    </tr>
201
                    <tr>
199
                    <tr>
202
                        <td>Welcome kit</td>
200
                        <td>Welcome kit</td>
203
                        <td style="color: red;">FCC</td>
201
                        <td style="color: red;">FOC</td>
204
                        <td style="color: red;">FCC</td>
202
                        <td style="color: red;">FOC</td>
205
                        <td style="color: red;">FOC</td>
203
                        <td style="color: red;">FOC</td>
206
                    </tr>
204
                    </tr>
207
                    <tr>
205
                    <tr>
208
                        <td>Initial marketing campaign</td>
206
                        <td>Initial marketing campaign</td>
209
                        <td>yes</td>
207
                        <td>yes</td>
Line 216... Line 214...
216
                        <td>yes</td>
214
                        <td>yes</td>
217
                        <td>yes</td>
215
                        <td>yes</td>
218
                    </tr>
216
                    </tr>
219
                    <tr>
217
                    <tr>
220
                        <td>Carry bags (initial)</td>
218
                        <td>Carry bags (initial)</td>
221
                        <td style="color: red;">FCC</td>
219
                        <td style="color: red;">FOC</td>
222
                        <td style="color: red;">FCC</td>
220
                        <td style="color: red;">FOC</td>
223
                        <td style="color: red;">FOC</td>
221
                        <td style="color: red;">FOC</td>
224
                    </tr>
222
                    </tr>
225
                    <tr>
223
                    <tr>
226
                        <td>Initial branding</td>
224
                        <td>Initial branding</td>
227
                        <td>yes</td>
225
                        <td>yes</td>
Line 433... Line 431...
433
        </div>
431
        </div>
434
    </div>
432
    </div>
435
</div>
433
</div>
436
</body>
434
</body>
437
<div align="center">
435
<div align="center">
438
    #if($pod.getLoiDoc()!=0)
-
 
439
        <button type="button" class="btn-success" onclick="printDiv()">Print & Save Pdf</button>
-
 
440
    #else
-
 
441
        <button value="$pod.getId()" id="LOI_otp" class="btn-success">Send OTP</button>
436
        <button value="$pod.getId()" id="LOI_otp" class="btn-success">Send OTP</button>
442
        <button type="button" value="$pod.getId()" id="confirmSign" class="btn-success">Confirm Sign</button>
437
        <button type="button" value="$pod.getId()" id="confirmSign" class="btn-success">Confirm Sign</button>
443
    #end
438
 
444
 
439
 
445
</div>
440
</div>
446
 
441
 
447
</html>
442
</html>
448
<style>
443
<style>
Line 461... Line 456...
461
        document.body.innerHTML = originalContents;
456
        document.body.innerHTML = originalContents;
462
    }
457
    }
463
 
458
 
464
    function validateOTP() {
459
    function validateOTP() {
465
 
460
 
466
        let otp = prompt("Enter your OTP here");
461
        let otp = prompt("Enter received OTP here");
467
        if (otp != null) {
462
        if (otp != null) {
468
            let regex = new RegExp(/^[0-9]{5}$/);
463
            let regex = new RegExp(/^[0-9]{5}$/);
469
            if (otp != null && regex.test(otp)) {
464
            if (otp != null && regex.test(otp)) {
470
 
-
 
471
                console.log('otp-flag-', otp);
465
                console.log('otp-flag-', otp);
472
                return otp;
466
                return otp;
473
            } else {
467
            } else {
474
                alert('Please enter a valid 5-digit numeric OTP');
468
                alert('Please enter a valid 5-digit numeric OTP');
475
                return validateOTP();
469
                return validateOTP();
476
            }
470
            }
-
 
471
        } else {
-
 
472
            alert('Enter received OTP and Try again')
477
        }
473
        }
478
 
474
 
479
    }
475
    }
480
 
476
 
481
    document.getElementById('confirmSign').addEventListener('click', function () {
477
    document.getElementById('confirmSign').addEventListener('click', function () {
Line 483... Line 479...
483
        let otp = validateOTP();
479
        let otp = validateOTP();
484
        console.log("loiId-", loiId, ",otp-", otp);
480
        console.log("loiId-", loiId, ",otp-", otp);
485
        let validateOtpUrl = `${context}/validateLoiOtp?loiId=${loiId}&provideOtp=${otp}`;
481
        let validateOtpUrl = `${context}/validateLoiOtp?loiId=${loiId}&provideOtp=${otp}`;
486
        doPutAjaxRequestHandler(validateOtpUrl, function (response) {
482
        doPutAjaxRequestHandler(validateOtpUrl, function (response) {
487
            if (response) {
483
            if (response) {
-
 
484
                const element = document.getElementById('content');
-
 
485
                console.log("element- ", element);
-
 
486
                const opt = {
-
 
487
                    margin: 0.5,
-
 
488
                    filename: 'document.pdf',
-
 
489
                    image: {type: 'jpeg', quality: 0.98},
-
 
490
                    html2canvas: {scale: 2, logging: true, useCORS: true},
-
 
491
                    jsPDF: {unit: 'in', format: 'letter', orientation: 'portrait'}
-
 
492
                };
-
 
493
                html2pdf().from(element).set(opt).outputPdf("arraybuffer").then(function (pdf) {
-
 
494
                    console.log("pdf- ", pdf);
-
 
495
                    const file = new Blob([pdf], {type: 'application/pdf'});
-
 
496
                    uploadDocument(file, function (documentId) {
-
 
497
                        console.log("documentIdddd-", documentId);
-
 
498
                        saveLoiDoc(loiId, documentId);
-
 
499
                        doGetAjaxRequestHandler(`${context}/pendingOnboardingForm`,
-
 
500
                                function (response) {
-
 
501
                                    $('#' + 'main-content').html(response);
-
 
502
                                });
-
 
503
                    });
-
 
504
                });
488
                alert("OTP verified successfully ");
505
                alert("OTP verified successfully ");
-
 
506
            } else {
-
 
507
                alert("OTP not verified,Please try again");
489
            }
508
            }
490
        });
509
        });
491
        const element = document.getElementById('content');
-
 
492
        console.log("element- ", element);
-
 
493
        const opt = {
-
 
494
            margin: 0.5,
-
 
495
            filename: 'document.pdf',
-
 
496
            image: {type: 'jpeg', quality: 0.98},
-
 
497
            html2canvas: {scale: 2, logging: true, useCORS: true},
-
 
498
            jsPDF: {unit: 'in', format: 'letter', orientation: 'portrait'}
-
 
499
        };
-
 
500
        html2pdf().from(element).set(opt).outputPdf("arraybuffer").then(function (pdf) {
-
 
501
            console.log("pdf- ", pdf);
-
 
502
            const file = new Blob([pdf], {type: 'application/pdf'});
-
 
503
            uploadDocument(file, function (documentId) {
-
 
504
                console.log("documentIdddd-", documentId);
-
 
505
                saveLoiDoc(loiId, documentId);
-
 
506
                doGetAjaxRequestHandler(`${context}/pendingOnboardingForm`,
-
 
507
                        function (response) {
-
 
508
                            $('#' + 'main-content').html(response);
-
 
509
                        });
-
 
510
            });
-
 
511
 
-
 
512
        });
-
 
513
 
-
 
514
    });
510
    });
515
 
511
 
516
    function saveLoiDoc(loiId, documentId) {
512
    function saveLoiDoc(loiId, documentId) {
517
        let saveLoiDocUrl = `${context}/saveLoiDoc?loiId=` + loiId + `&loiDocId=` + documentId
513
        let saveLoiDocUrl = `${context}/saveLoiDoc?loiId=` + loiId + `&loiDocId=` + documentId
518
        doPostAjaxRequestHandler(saveLoiDocUrl, function (response) {
514
        doPostAjaxRequestHandler(saveLoiDocUrl, function (response) {