41 lines
1.3 KiB
JavaScript
41 lines
1.3 KiB
JavaScript
function postPayment() {
|
|
loader = $('#overlay, #loader').css('z-index', 1070);
|
|
Remarks = $('#reject-remarks').val();
|
|
ItemList = [];
|
|
tableElement = $('#FRRdataTable').DataTable();
|
|
PONo = $('#poNo').val();
|
|
PoTypeId = $('#poTypeId').val();
|
|
tableElement.rows().every(function () {
|
|
rowData = this.data();
|
|
var prDetailsId = rowData.prDetailsId;
|
|
var itemData = {
|
|
PRDetailsId: prDetailsId,
|
|
};
|
|
ItemList.push(itemData);
|
|
});
|
|
console.log('itemlinist', ItemList);
|
|
console.log('PONo', PONo);
|
|
if (ItemList.length <= 0) {
|
|
alert("You don't have a list to be denied!");
|
|
return;
|
|
}
|
|
const confirmation = confirm('Are you sure you want to proceed?');
|
|
|
|
if (confirmation) {
|
|
$.ajax($.extend({
|
|
url: '/RRMgmt/PostPutPayment',
|
|
type: 'POST',
|
|
data: { ItemList, PONo, PoTypeId },
|
|
success: function (response) {
|
|
if (response.success) {
|
|
$('#viewRRDetailByPO').modal('hide');
|
|
forPaymentTable.ajax.reload();
|
|
alert('Payment successfully!');
|
|
} else {
|
|
alert('Failed: ' + response.response);
|
|
}
|
|
},
|
|
error: errorHandler
|
|
}, beforeComplete(loader)));
|
|
}
|
|
} |