Subversion Repositories SmartDukaan

Rev

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

Rev 33879 Rev 33882
Line 158... Line 158...
158
 
158
 
159
    if (confirm("Are you sure you want to submit the request") == true) {
159
    if (confirm("Are you sure you want to submit the request") == true) {
160
        doAjaxRequestWithJsonHandler(context
160
        doAjaxRequestWithJsonHandler(context
161
            + "/partnerVerificationCheckBoxSubmit", "POST",
161
            + "/partnerVerificationCheckBoxSubmit", "POST",
162
            jsonObject, function (response) {
162
            jsonObject, function (response) {
163
 
-
 
164
 
-
 
165
                alert("successfully Submitted");
163
                alert("successfully Submitted");
166
                $('.myVerificationCheckboxUpdate').html(response);
164
                $('.myVerificationCheckboxUpdate').html(response);
167
 
165
 
168
            });
166
            });
169
    }
167
    }
Line 224... Line 222...
224
    let data = [];
222
    let data = [];
225
    let isValid = true;  // To track if all validations pass
223
    let isValid = true;  // To track if all validations pass
226
    $('#requiredNoc tbody tr').each(function () {
224
    $('#requiredNoc tbody tr').each(function () {
227
        let brandId = $(this).find('.brandId').val();
225
        let brandId = $(this).find('.brandId').val();
228
        let documentId = $(this).find('.documentId').val();
226
        let documentId = $(this).find('.documentId').val();
-
 
227
        let commitAmount = $(this).find('.commitAmount').val();
-
 
228
        let isActive = $(this).find('.mk_LoiBrandCommit-isActive').val();
229
        let nocRequiredSelect = $(this).find('.noc-required');
229
        let nocRequiredSelect = $(this).find('.noc-required');
230
        let nocRequired = nocRequiredSelect.val();
230
        let nocRequired = nocRequiredSelect.val();
231
        console.log("nocRequired - ", nocRequired);
231
        console.log("nocRequired - ", nocRequired);
232
        console.log("documentId - ", documentId);
232
        console.log("documentId - ", documentId);
-
 
233
        console.log("commitAmount - ", commitAmount);
-
 
234
        console.log("isActive - ", isActive);
233
 
235
 
234
        // Validate: If document is not uploaded, user must select "Not Required"
236
        // Validate: If document is not uploaded, user must select "Not Required"
235
        if (documentId === 0 && nocRequired === "") {
237
        if (parseInt(documentId) === 0 && nocRequired.trim() === "" && isActive === 'true') {
236
            alert("Please select 'Received' or 'Not Required' for brands without an uploaded NOC.");
238
            alert("Please select 'Received' or 'Not Required' for brands without an uploaded NOC.");
237
            isValid = false;  // Mark validation as failed
239
            isValid = false;  // Mark validation as failed
238
            return;  // Exit loop early
240
            return;  // Exit loop early
239
        }
241
        }
-
 
242
 
240
        data.push({
243
        data.push({
241
            brandId: brandId,
244
            brandId: brandId,
-
 
245
            amount: commitAmount,
-
 
246
            active: isActive,
242
            nocDocId: documentId || 0,  // Use null if no document uploaded
247
            nocDocId: documentId || 0,  // Use null if no document uploaded
243
            nocGt: nocRequired
248
            nocGt: nocRequired
244
        });
249
        });
245
 
250
 
246
    });
251
    });
Line 261... Line 266...
261
        return;
266
        return;
262
    }
267
    }
263
    let payload = JSON.stringify(data);
268
    let payload = JSON.stringify(data);
264
    console.log("data - ", data);
269
    console.log("data - ", data);
265
    if (confirm("Are you sure to upload")) {
270
    if (confirm("Are you sure to upload")) {
-
 
271
        //updateLoiBrandCommintment
266
        doPostAjaxRequestWithJsonHandler(`${context}/uploadNoc?loiId=${loiId}`, payload, function (response) {
272
        doPostAjaxRequestWithJsonHandler(`${context}/uploadNoc?loiId=${loiId}`, payload, function (response) {
267
            if (response) {
273
            if (response) {
268
                $('#nocUploadModal').modal('hide');
274
                $('#nocUploadModal').modal('hide');
269
                alert("NOC uploaded successfully");
275
                alert("NOC uploaded successfully");
270
            }
276
            }