Subversion Repositories SmartDukaan

Rev

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

Rev 34198 Rev 34295
Line 383... Line 383...
383
            }
383
            }
384
        });
384
        });
385
	}
385
	}
386
});
386
});
387
 
387
 
-
 
388
$(document).on('click', '.edit-allocation', function () {
-
 
389
	var $row = $(this).closest('tr'); // Get the closest table row
-
 
390
	var $input = $row.find('.reuested_allocation'); // Find the input inside the row
-
 
391
	$input.prop('disabled', false).focus(); // Enable input and focus on it
-
 
392
});
-
 
393
 
-
 
394
$(document).on('click', ".allocation-request-edit", function () {
-
 
395
	var $row = $(this).closest('tr');
-
 
396
	var allocationId = $(this).data('id');
-
 
397
	var requestedAllocation = $row.find('.reuested_allocation').val();
-
 
398
 
-
 
399
	if (!requestedAllocation) {
-
 
400
		alert("Please enter a requested allocation before submitting.");
-
 
401
		return;
-
 
402
	}
-
 
403
 
-
 
404
	if (confirm("Are you sure you want to update the allocation?")) {
-
 
405
		doGetAjaxRequestHandler(`${context}/pur-sale-ratio/edit-allocation-request?allocationId=${allocationId}&requestedAllocation=${requestedAllocation}`, function (response) {
-
 
406
			if (response) {
-
 
407
				alert("Allocation request has been sent.");
-
 
408
				loadRequestedAllocations();
-
 
409
			}
-
 
410
		});
-
 
411
	}
-
 
412
});
-
 
413
 
388
 
414
 
389
$(document).on('click', ".reuested-allocations", function () {
415
$(document).on('click', ".reuested-allocations", function () {
390
    loadRequestedAllocations();
416
    loadRequestedAllocations();
391
});
417
});
392
 
418