Subversion Repositories SmartDukaan

Rev

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

Rev 34163 Rev 34198
Line 347... Line 347...
347
function partnerHidAllocationList() {
347
function partnerHidAllocationList() {
348
	if (typeof partnerId != "undefined") {
348
	if (typeof partnerId != "undefined") {
349
		doGetAjaxRequestHandler(context + "/pur-sale-ratio/stock/hid-catalog-allocation-list?fofoId=" + partnerId,
349
		doGetAjaxRequestHandler(context + "/pur-sale-ratio/stock/hid-catalog-allocation-list?fofoId=" + partnerId,
350
			function (response) {
350
			function (response) {
351
				$('.hid-allocation-conatiner').html(response);
351
				$('.hid-allocation-conatiner').html(response);
352
				$('#hidCatalogAllocationList').DataTable({
-
 
353
					"scrollX": true,
-
 
354
					"bPaginate": true,
-
 
355
					"bLengthChange": true,
-
 
356
					"bFilter": true,
-
 
357
					"bInfo": false,
-
 
358
					"bAutoWidth": false
-
 
359
				});
-
 
360
			});
352
			});
361
	} else {
353
	} else {
362
		doGetAjaxRequestHandler(context + "/pur-sale-ratio/stock/hid-catalog-allocation-list?fofoId=0",
354
		doGetAjaxRequestHandler(context + "/pur-sale-ratio/stock/hid-catalog-allocation-list?fofoId=0",
363
			function (response) {
355
			function (response) {
364
				$('.hid-allocation-conatiner').html(response);
356
				$('.hid-allocation-conatiner').html(response);
-
 
357
            });
-
 
358
    }
-
 
359
 
-
 
360
}
-
 
361
 
365
				$('#hidCatalogAllocationList').DataTable({
362
var table = $('.hidCatalogAllocationList').DataTable();
-
 
363
$(document).on('dblclick', '.hidCatalogAllocationList tbody tr', function () {
366
					"scrollX": true,
364
    var data = table.row(this).data();
-
 
365
    $(this).find(":input").attr('disabled', false).show();
-
 
366
});
-
 
367
 
-
 
368
$(document).on('click', ".generate-allocation-request", function () {
-
 
369
    var catalogid = $(this).data('catalogid');
367
					"bPaginate": true,
370
    const self = this;
-
 
371
    if (confirm("Are you sure you want to generate a request for allocation limit")) {
-
 
372
        var requestedAllocation = $(this).closest('tr').find('input[name="allocation-limit"]').val();
-
 
373
 
368
					"bLengthChange": true,
374
        if (!requestedAllocation) {
-
 
375
            alert("Please enter a requested allocation before submitting.");
369
					"bFilter": true,
376
            return;
370
					"bInfo": false,
377
        }
-
 
378
 
-
 
379
        doGetAjaxRequestHandler(`${context}/pur-sale-ratio/generate-allocation-request?catalogId=${catalogid}&fofoId=${partnerId}&requestedAllocation=${requestedAllocation}`, function (response) {
371
					"bAutoWidth": false
380
            if (response) {
-
 
381
                alert("Allocation request has been sent.");
-
 
382
                partnerHidAllocationList();
372
				});
383
            }
373
			});
384
        });
374
	}
385
	}
-
 
386
});
-
 
387
 
-
 
388
 
-
 
389
$(document).on('click', ".reuested-allocations", function () {
-
 
390
    loadRequestedAllocations();
-
 
391
});
-
 
392
 
-
 
393
$(document).on('click', ".allocation-request-approve-reject", function () {
-
 
394
    var id = $(this).data('id');
-
 
395
    var status = $(this).data('status');
-
 
396
    doGetAjaxRequestHandler(context + `/pur-sale-ratio/allocation-request-approve-reject?id=${id}&status=${status}`,
-
 
397
        function (response) {
-
 
398
            loadRequestedAllocations();
-
 
399
        });
-
 
400
});
-
 
401
 
-
 
402
function loadRequestedAllocations() {
-
 
403
    doGetAjaxRequestHandler(context + "/pur-sale-ratio/requested-allocations",
-
 
404
        function (response) {
-
 
405
            $('#' + 'main-content').html(response);
-
 
406
        });
375
}
407
}
376
 
408
 
377
 
409