Subversion Repositories SmartDukaan

Rev

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

Rev 33879 Rev 33885
Line 18... Line 18...
18
    }
18
    }
19
 
19
 
20
});
20
});
21
 
21
 
22
 
22
 
23
$(document).on('click', ".submitLoiForm", function () {
23
$(document).on('click', ".mk_submit_loi_form", function () {
24
    // Gather input values
24
    // Gather input values
25
    const referId = $('select[name="referId"]').val();
25
    const referId = $('select[name="referId"]').val();
26
    const billingAddress = $('select[name="billingAddress"]').val();
26
    const billingAddress = $('select[name="billingAddress"]').val();
27
    const acquiredDate = $('input[name="acquiredDate"]').val();
27
    const acquiredDate = $('input[name="acquiredDate"]').val();
28
    const firstName = $('input[name="firstName"]').val();
28
    const firstName = $('input[name="firstName"]').val();
Line 88... Line 88...
88
    const brandFee = parseFloat(values[1]);
88
    const brandFee = parseFloat(values[1]);
89
    const brandFeesCollected = $('input[name="brandFeesCollected"]').val();
89
    const brandFeesCollected = $('input[name="brandFeesCollected"]').val();
90
    const paymentMode = $('select[name="paymentMode"]').val();
90
    const paymentMode = $('select[name="paymentMode"]').val();
91
    const paymentReferenceNo = $('input[name="paymentReferenceNo"]').val();
91
    const paymentReferenceNo = $('input[name="paymentReferenceNo"]').val();
92
    const feeCollectingDate = $('input[name="feeCollectingDate"]').val();
92
    const feeCollectingDate = $('input[name="feeCollectingDate"]').val();
-
 
93
    const paymentAttachment = $('input[name="paymentAttachment"]').val();
93
 
94
 
94
    let missingFields = [];
95
    let missingFields = [];
95
    if (!firstName) missingFields.push('First Name');
96
    if (!firstName) missingFields.push('First Name');
96
    if (!lastName) missingFields.push('Last Name');
97
    if (!lastName) missingFields.push('Last Name');
97
    if (mobile.length < 10 || !mobile) {
98
    if (mobile.length < 10 || !mobile) {
Line 123... Line 124...
123
    if (!brandFeesCollected) missingFields.push('Brand Fees Collected');
124
    if (!brandFeesCollected) missingFields.push('Brand Fees Collected');
124
    if (brandFeesCollected > brandFee) missingFields.push('The collected brand fee must not exceed the agreed brand fees.');
125
    if (brandFeesCollected > brandFee) missingFields.push('The collected brand fee must not exceed the agreed brand fees.');
125
    if (!paymentMode) missingFields.push('Payment Mode');
126
    if (!paymentMode) missingFields.push('Payment Mode');
126
    if (!paymentReferenceNo) missingFields.push('Payment Reference No');
127
    if (!paymentReferenceNo) missingFields.push('Payment Reference No');
127
    if (!feeCollectingDate) missingFields.push('Fee Collecting Date');
128
    if (!feeCollectingDate) missingFields.push('Fee Collecting Date');
-
 
129
    if (!paymentAttachment) missingFields.push('Payment screenshot ');
128
    if (missingFields.length > 0) {
130
    if (missingFields.length > 0) {
129
        alert('The following fields are required: ' + missingFields.join(', '));
131
        alert('The following fields are required: ' + missingFields.join(', '));
130
        return;
132
        return;
131
    }
133
    }
132
    const loiFormData = {
134
    const loiFormData = {
Line 158... Line 160...
158
        agreedBrandFees: agreedBrandFees,
160
        agreedBrandFees: agreedBrandFees,
159
        brandFeesCollected: brandFeesCollected,
161
        brandFeesCollected: brandFeesCollected,
160
        paymentMode: paymentMode,
162
        paymentMode: paymentMode,
161
        paymentReferenceNo: paymentReferenceNo,
163
        paymentReferenceNo: paymentReferenceNo,
162
        feeCollectingTimeStamp: feeCollectingDate,
164
        feeCollectingTimeStamp: feeCollectingDate,
-
 
165
        paymentAttachment: paymentAttachment,
163
        billingAddress: billingAddress,
166
        billingAddress: billingAddress,
164
        brandCommitment: brandCommitment
167
        brandCommitment: brandCommitment
165
    };
168
    };
166
 
169
 
167
    console.log("form data - ", loiFormData);
170
    console.log("form data - ", loiFormData);
Line 331... Line 334...
331
        alert("OTP not send .");
334
        alert("OTP not send .");
332
    }
335
    }
333
 
336
 
334
});
337
});
335
 
338
 
336
 
-
 
337
$(document).on('click', ".onboardingFormDone", function () {
-
 
338
    let loiId = $(this).val();
-
 
339
    var loi = $(document).find(".upload-form-loi input[type=file]").val();
-
 
340
    console.log("form id - ", loiId);
-
 
341
    doPostAjaxRequestHandler(`${context}/uploadLoi?loiId=${loiId}&loi=${loi}`,
-
 
342
        function (response) {
-
 
343
            $('#' + 'main-content').html(response);
-
 
344
        });
-
 
345
});
-
 
346
 
-
 
347
//confirmPayment
339
//confirmPayment
348
$(document).on('click', ".paymentConfirmBtn", function () {
340
$(document).on('click', ".paymentConfirmBtn", function () {
349
    let approval = $(this).data('approval');
341
    let approval = $(this).data('approval');
350
    let bfcId = $(this).val();
342
    let bfcId = $(this).val();
351
    let description = "All details are correct";
343
    let description = "All details are correct";
Line 396... Line 388...
396
                fileInput.closest('td').find(".documentId").val(documentId);
388
                fileInput.closest('td').find(".documentId").val(documentId);
397
            });
389
            });
398
        }
390
        }
399
    }
391
    }
400
});
392
});
-
 
393
 
-
 
394
$(document).on('input', 'table#OnboardingDocumentTable input[type=file],table#mk_brand-fee-collection-details input[type=file]', function () {
-
 
395
    if (confirm('Confirm file upload ?')) {
-
 
396
        var fileSelector = $(this)[0];
-
 
397
        if (fileSelector != undefined
-
 
398
            && fileSelector.files[0] != undefined) {
-
 
399
            var file = this.files[0];
-
 
400
            console.log("file", file);
-
 
401
            let fileInput = $(this);
-
 
402
            console.log("fileInput", file);
-
 
403
            uploadDocument(file, function (documentId) {
-
 
404
                console.log("documentIdzzz  : ", documentId);
-
 
405
                fileInput.closest('td').find(".documentId").val(documentId);
-
 
406
            });
-
 
407
        }
-
 
408
    }
-
 
409
});
-
 
410
 
-
 
411
$(document).on('input', '#payment-sc-doc', function () {
-
 
412
    if (confirm('Confirm file upload ?')) {
-
 
413
        var file = this.files[0];
-
 
414
        uploadDocument(file, function (documentId) {
-
 
415
            $('#payment-sc-docId').val(documentId);
-
 
416
        });
-
 
417
    }
-
 
418
});
-
 
419
 
-
 
420
 
401
$(document).on('click', ".mk_docApproval", function () {
421
$(document).on('click', ".mk_docApproval", function () {
402
    let loiId = $(this).data('form_id');
422
    let loiId = $(this).data('form_id');
403
    let docMasterId = $(this).data('doc_master_id');
423
    let docMasterId = $(this).data('doc_master_id');
404
    let flag = $(this).data('flag');
424
    let flag = $(this).data('flag');
405
    console.log("flag -", flag);
425
    console.log("flag -", flag);
Line 498... Line 518...
498
    console.log("row - ", $row);
518
    console.log("row - ", $row);
499
    var feeCollectingTimeStamp = $row.find('input[name="feeCollectingTimeStamp"]').val();
519
    var feeCollectingTimeStamp = $row.find('input[name="feeCollectingTimeStamp"]').val();
500
    var collectedAmount = $row.find('input[name="collectedAmount"]').val();
520
    var collectedAmount = $row.find('input[name="collectedAmount"]').val();
501
    var paymentReferenceNo = $row.find('input[name="paymentReferenceNo"]').val();
521
    var paymentReferenceNo = $row.find('input[name="paymentReferenceNo"]').val();
502
    var paymentMode = $row.find('select[name="paymentMode"]').val();
522
    var paymentMode = $row.find('select[name="paymentMode"]').val();
-
 
523
    var documentId = $row.find('input[name="documentId"]').val();
-
 
524
 
503
    const Data = {
525
    const Data = {
504
        id: bfcId,
526
        id: bfcId,
505
        feeCollectingTimeStamp: feeCollectingTimeStamp,
527
        feeCollectingTimeStamp: feeCollectingTimeStamp,
506
        collectedAmount: collectedAmount,
528
        collectedAmount: collectedAmount,
507
        paymentReferenceNo: paymentReferenceNo,
529
        paymentReferenceNo: paymentReferenceNo,
-
 
530
        attachment: documentId,
508
        paymentMode: paymentMode
531
        paymentMode: paymentMode
509
    };
532
    };
510
    var jsonData = JSON.stringify(Data);
533
    var jsonData = JSON.stringify(Data);
511
    if (confirm("Are you sure to update details")) {
534
    if (confirm("Are you sure to update details")) {
512
        doPostAjaxRequestWithJsonHandler(`${context}/updatePayment`, jsonData,
535
        doPostAjaxRequestWithJsonHandler(`${context}/updatePayment`, jsonData,