111 lines
4.4 KiB
JavaScript
111 lines
4.4 KiB
JavaScript
function rowStatusColorCallback(row, data) {
|
|
var statusNumber = parseInt(data.status, 10);
|
|
if (!isNaN(statusNumber)) {
|
|
|
|
if (statusNumber === 5) {
|
|
$(row).css('background-color', '#ADD8E6');
|
|
$(row).css('color', '#00008B');
|
|
} else if (statusNumber === 6) {
|
|
$(row).css('background-color', '#87CEFA');
|
|
$(row).css('color', '#000080');
|
|
} else if (statusNumber === 7) {
|
|
$(row).css('background-color', '#90EE90');
|
|
$(row).css('color', '#006400');
|
|
} else if (statusNumber === 8) {
|
|
$(row).css('background-color', '#FAFAD2');
|
|
$(row).css('color', '#DAA520');
|
|
} else if (statusNumber === 9) {
|
|
$(row).css('background-color', '#FFFFE0');
|
|
$(row).css('color', '#B8860B');
|
|
} else if (statusNumber === 10) {
|
|
$(row).css('background-color', '#F08080');
|
|
$(row).css('color', '#8B0000');
|
|
} else if (statusNumber === 12) {
|
|
$(row).css('background-color', '#E0FFFF');
|
|
$(row).css('color', '#008B8B');
|
|
} else if (statusNumber === 13) {
|
|
$(row).css('background-color', '#FFA07A');
|
|
$(row).css('color', '#E9967A');
|
|
} else if (statusNumber === 14) {
|
|
$(row).css('background-color', '#FFB6C1');
|
|
$(row).css('color', '#00008B');
|
|
} else if (statusNumber === 15) {
|
|
$(row).css('background-color', '#B0C4DE');
|
|
$(row).css('color', '#4682B4');
|
|
} else if (statusNumber === 16) {
|
|
$(row).css('background-color', '#20B2AA');
|
|
$(row).css('color', '#2F4F4F');
|
|
} else if (statusNumber === 18) {
|
|
$(row).css('background-color', '#FFCCCB');
|
|
$(row).css('color', '#8B0000');
|
|
} else if (statusNumber === 19) {
|
|
$(row).css('background-color', '#D3D3D3');
|
|
$(row).css('color', '#696969');
|
|
} else if (statusNumber === 20) {
|
|
$(row).css('background-color', '#20B2AA');
|
|
$(row).css('color', '#2F4F4F');
|
|
} else if (statusNumber === 21) {
|
|
$(row).css('background-color', '#008CC0');
|
|
$(row).css('color', '#ADD8E6');
|
|
} else if (statusNumber === 22) {
|
|
$(row).css('background-color', '#FFCCCB');
|
|
$(row).css('color', '#8B0000');
|
|
} else if (statusNumber === 23) {
|
|
$(row).css('background-color', '#008000');
|
|
$(row).css('color', '#90EE90');
|
|
} else if (statusNumber === 24) {
|
|
$(row).css('background-color', '#00FFFF');
|
|
$(row).css('color', '#0000FF');
|
|
} else if (statusNumber === 25) {
|
|
$(row).css('background-color', '#A020F0');
|
|
$(row).css('color', '#808080');
|
|
}
|
|
}
|
|
}
|
|
function rowRRDetailCallback(row, data) {
|
|
$('#poTypeName').val(data.poTypeName);
|
|
$('#poTypeId').val(data.poTypeId);
|
|
$('#poNo').val(data.poNo);
|
|
$('#rrNo').val(data.rrNo);
|
|
$('#supplierName').val(data.supplierName);
|
|
$('#creditTerm').val(data.paymentTerms);
|
|
$('#currency').val(data.currencyName);
|
|
$('#docTypeId').val(data.docTypeId);
|
|
$('#suppDocNo').val(data.drNo);
|
|
$('#remarks').val(data.remarks);
|
|
|
|
var vatRate = parseFloat($('#vatRate').val());
|
|
var vatAmount = parseFloat((data.totalAmount * vatRate).toFixed(2));
|
|
var sumWithVat = vatAmount + parseFloat(data.totalAmount);
|
|
|
|
$('#amountPHPVat').val(vatAmount.toFixed(2));
|
|
$('#amountPHP').val(sumWithVat.toFixed(2));
|
|
|
|
$('#emailAddress').val(data.emailAddress);
|
|
|
|
const currentDate = new Date().toISOString().split('T')[0];
|
|
document.getElementById('receivedDate').value = currentDate;
|
|
clearTextModal();
|
|
}
|
|
function rowPOTypeCallback(row, data) {
|
|
// Get poTypeId directly from the data object
|
|
var POTypeId = data.poTypeId;
|
|
|
|
if (POTypeId !== null && !isNaN(POTypeId)) {
|
|
var POTypeIdNumer = parseInt(POTypeId, 10);
|
|
|
|
// Set the appropriate text based on the POTypeId
|
|
var poTypeIdCell = $('td:eq(1)', row);
|
|
if (POTypeIdNumer === 1) {
|
|
poTypeIdCell.text('SI-PO').addClass('next-facilitator');
|
|
} else if (POTypeIdNumer === 2) {
|
|
poTypeIdCell.text('DR-PO').addClass('next-facilitator');
|
|
} else {
|
|
poTypeIdCell.text('Import PO').addClass('next-facilitator');
|
|
}
|
|
} else {
|
|
var poTypeIdCell = $('td:eq(1)', row);
|
|
poTypeIdCell.text('Unknown PO Type').addClass('next-facilitator');
|
|
}
|
|
}
|