Subversion Repositories SmartDukaan

Rev

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

Rev 35556 Rev 36895
Line 394... Line 394...
394
$(document).on('click', ".allocation-request-edit", function () {
394
$(document).on('click', ".allocation-request-edit", function () {
395
	var $row = $(this).closest('tr');
395
	var $row = $(this).closest('tr');
396
	var allocationId = $(this).data('id');
396
	var allocationId = $(this).data('id');
397
	var requestedAllocation = $row.find('.reuested_allocation').val();
397
	var requestedAllocation = $row.find('.reuested_allocation').val();
398
 
398
 
399
	if (!requestedAllocation) {
399
	if (!requestedAllocation || parseInt(requestedAllocation, 10) <= 0) {
400
		alert("Please enter a requested allocation before submitting.");
400
		alert("Please enter a requested qty greater than 0 before submitting.");
401
		return;
401
		return;
402
	}
402
	}
403
 
403
 
404
	if (confirm("Are you sure you want to update the allocation?")) {
404
	if (confirm("Are you sure you want to approve this requested qty (added over and above current stock)?")) {
405
		doGetAjaxRequestHandler(`${context}/pur-sale-ratio/edit-allocation-request?allocationId=${allocationId}&requestedAllocation=${requestedAllocation}`, function (response) {
405
		doGetAjaxRequestHandler(`${context}/pur-sale-ratio/edit-allocation-request?allocationId=${allocationId}&requestedAllocation=${requestedAllocation}`, function (response) {
406
			if (response) {
406
			if (response) {
407
				alert("Allocation request has been sent.");
407
				alert("Requested qty approved.");
408
				loadRequestedAllocations();
408
				loadRequestedAllocations();
409
			}
409
			}
410
		});
410
		});
411
	}
411
	}
412
});
412
});