Coil Report
2026
This page and its content are the sole property of the Overhead Door Corporation
This report pulls future demand by production line from Oracle EBS, then cross references what items are or are not in that location already. This allows one to see what material needs to be pulled from storage locations ahead of time and what can be put back.
The report starts by running a SQL job that finds upcoming demand.
A browser-based app then combines all the data that is first exported to CSV files.
Lastly, output can be filtered by mill (production line) and cross referenced against inventory locations.
Code Snippet (JS)
function findDemand(){
mill = document.getElementById("mill").value;
jobStatus = document.getElementById("jobStatus").value;
coilMap = new Map();
for (let i = 0; i < workOrderComponents.length; i++){
let workOrderCOMP = workOrderComponents[i];
if(mill == "██████████"){
if(workOrderCOMP.componentDescription.includes("COIL") && workOrderCOMP.jobStatus == jobStatus){
if(coilMap.has(workOrderCOMP.component)){
curVal = coilMap.get(workOrderCOMP.component);
coilMap.set(workOrderCOMP.component, workOrderCOMP.componentQuantity + curVal);
} else {
coilMap.set(workOrderCOMP.component, workOrderCOMP.componentQuantity);
}
}
} else {
if(workOrderCOMP.componentDescription.includes("COIL") && workOrderCOMP.mill == mill && workOrderCOMP.jobStatus == jobStatus){
if(coilMap.has(workOrderCOMP.component)){
curVal = coilMap.get(workOrderCOMP.component);
coilMap.set(workOrderCOMP.component, workOrderCOMP.componentQuantity + curVal);
} else {
coilMap.set(workOrderCOMP.component, workOrderCOMP.componentQuantity);
}
}
}
}
report(coilMap);
}
function report(coilMap){
coilArr = [];
coilArr[0] = [];
coilArr[0][0] = "Item Number";
coilArr[0][1] = "Item Description";
coilArr[0][2] = "Demand";
coilArr[0][3] = "Loc On-Hand";
coilArr[0][4] = "Transfer Qty";
let i = 1;
for (const [item, demand] of coilMap) {
coilArr[i] = [];
coilArr[i][0] = item;
coilArr[i][1] = findItemDes(item);
coilArr[i][2] = Math.ceil(demand);
coilArr[i][3] = Math.floor(findOnHand(item));
coilArr[i][4] = Math.ceil(demand - coilArr[i][3]);
i++;
}
buildTable(coilArr);
}
function findItemDes(item){
for(let i = 0; i < workOrderComponents.length; i++){
if(workOrderComponents[i].component == item){
return workOrderComponents[i].componentDescription;
}
}
}
function findOnHand(item){
loc = document.getElementById("loc").value;
let onHand = 0.0;
if(loc == "nA"){
return 0;
}
for(let i = 0; i < ██████████████████.length; i++){
if(loc == "all" && ██████████████████[i].item == item){
onHand += ██████████████████[i].onHand;
} else {
if (██████████████████[i].item == item && ██████████████████[i].locator == loc){
onHand += ██████████████████[i].onHand;
}
}
}
return onHand;
}
function buildTable(coilArr){
table = document.getElementById("reportTable");
table.innerHTML = "";
coilArr.forEach(rowData =>{
const row = document.createElement('tr');
rowData.forEach(cellData => {
const cell = document.createElement('td');
cell.textContent = cellData;
row.appendChild(cell);
});
table.appendChild(row);
});
document.body.appendChild(table);
}