Subversion Repositories SmartDukaan

Rev

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

Rev 36206 Rev 36299
Line 1224... Line 1224...
1224
    };
1224
    };
1225
 
1225
 
1226
    if (confirm("Are you sure you want to raise this GRN correction request?")) {
1226
    if (confirm("Are you sure you want to raise this GRN correction request?")) {
1227
        doPostAjaxRequestWithJsonHandler(context + "/raiseGrnCorrection",
1227
        doPostAjaxRequestWithJsonHandler(context + "/raiseGrnCorrection",
1228
            JSON.stringify(requestModel), function (response) {
1228
            JSON.stringify(requestModel), function (response) {
-
 
1229
                var parsed;
-
 
1230
                try { parsed = typeof response === 'string' ? JSON.parse(response) : response; }
-
 
1231
                catch (e) { parsed = null; }
1229
                if (response == 'true') {
1232
                if (parsed && parsed.status === true) {
-
 
1233
                    if (parsed.autoApproved) {
-
 
1234
                        alert("Correction applied successfully (auto-approved: no model/qty change)");
-
 
1235
                    } else {
1230
                    alert("Correction request submitted successfully");
1236
                        alert("Correction request raised for approval");
-
 
1237
                    }
1231
                    loadGrnCorrection("main-content");
1238
                    loadGrnCorrection("main-content");
1232
                }
1239
                }
1233
            });
1240
            });
1234
    }
1241
    }
1235
});
1242
});