Workload Time Predictor

1. Define Your Workload

2. Set Your Productivity & Schedule

3. Optional: Set Start Date

Prediction Results

Time Estimation

Total Estimated Hours Required: - hours

Estimated Work Days Required: - days

Estimated Calendar Duration: -

Planned Start Date: ${startDate}

` : ''} `; // Populate Prediction Results document.getElementById('wtp-res-total-hours').textContent = totalEstimatedHours.toFixed(1); document.getElementById('wtp-res-work-days').textContent = estimatedWorkDays.toFixed(1); document.getElementById('wtp-res-calendar-duration').textContent = calendarDuration; const startDateInfo = document.getElementById('wtp-res-start-date-info'); if (startDate) { document.getElementById('wtp-res-start-date-val').textContent = startDate; startDateInfo.style.display = 'block'; } else { startDateInfo.style.display = 'none'; } // Switch to prediction tab wtpCurrentTabIndex = 1; // Index of prediction tab const tabButtons = document.querySelectorAll('.wtp-tab-button'); tabButtons[wtpCurrentTabIndex].click(); // Simulate click to switch } function wtpClearResultsAndSwitchToInput() { wtpPredictionData = null; document.getElementById('wtp-inputs-summary-display').innerHTML = "

Please fill in the details on the first tab and click 'Calculate & View Prediction'.

"; document.getElementById('wtp-res-total-hours').textContent = "-"; document.getElementById('wtp-res-work-days').textContent = "-"; document.getElementById('wtp-res-calendar-duration').textContent = "-"; document.getElementById('wtp-res-start-date-info').style.display = 'none'; // Ensure the input tab is active for error correction wtpCurrentTabIndex = 0; const tabButtons = document.querySelectorAll('.wtp-tab-button'); tabButtons[wtpCurrentTabIndex].click(); } function wtpDownloadPDF() { if (!wtpPredictionData) { alert("Please calculate a prediction first by filling the details on the 'Define Workload & Pace' tab and clicking 'Calculate & View Prediction'."); // Switch to input tab if no data wtpCurrentTabIndex = 0; const tabButtons = document.querySelectorAll('.wtp-tab-button'); if (tabButtons[wtpCurrentTabIndex]) { tabButtons[wtpCurrentTabIndex].click(); } return; } const doc = new jsPDF(); const FONT_FAMILY = "helvetica"; const ACCENT_COLOR_HEX = getComputedStyle(document.documentElement).getPropertyValue('--accent-color').trim(); const PRIMARY_TEXT_COLOR_HEX = getComputedStyle(document.documentElement).getPropertyValue('--primary-text').trim(); const BUTTON_TEXT_COLOR_HEX = getComputedStyle(document.documentElement).getPropertyValue('--button-text-color').trim(); let yPos = 20; // Initial Y position // Header doc.setFillColor(ACCENT_COLOR_HEX); doc.rect(0, 0, doc.internal.pageSize.getWidth(), yPos, 'F'); doc.setFont(FONT_FAMILY, "bold"); doc.setFontSize(16); doc.setTextColor(BUTTON_TEXT_COLOR_HEX); doc.text("Workload Time Prediction Report", doc.internal.pageSize.getWidth() / 2, 14, { align: "center" }); yPos += 10; // Move yPos down // Date of Report doc.setFont(FONT_FAMILY, "normal"); doc.setFontSize(10); doc.setTextColor(PRIMARY_TEXT_COLOR_HEX); const reportDate = new Date().toLocaleDateString(undefined, { year: 'numeric', month: 'long', day: 'numeric' }); doc.text(`Report Generated: ${reportDate}`, 14, yPos); yPos += 10; // Section: Input Summary doc.setFont(FONT_FAMILY, "bold"); doc.setFontSize(12); doc.setTextColor(ACCENT_COLOR_HEX); doc.text("Your Input Parameters", 14, yPos); yPos += 7; doc.setFont(FONT_FAMILY, "normal"); doc.setFontSize(10); doc.setTextColor(PRIMARY_TEXT_COLOR_HEX); const addTextLine = (label, value) => { if (value && value !== "N/A" && value !== "Not specified") { doc.text(`${label}:`, 16, yPos); doc.text(String(value), 65, yPos); // Adjust X for value based on label length yPos += 6; } else if (value === "Not specified" && label === "Planned Start Date") { doc.text(`${label}:`, 16, yPos); doc.text(String(value), 65, yPos); yPos += 6; } }; if (wtpPredictionData.workloadTitle && wtpPredictionData.workloadTitle !== "N/A") { addTextLine("Workload Title", wtpPredictionData.workloadTitle); } addTextLine("Total Workload", `${wtpPredictionData.totalUnits.toFixed(1)} ${wtpPredictionData.unitName}`); addTextLine("Pace", `${wtpPredictionData.unitsPerHour.toFixed(1)} ${wtpPredictionData.unitName}/hour`); addTextLine("Daily Work Hours", `${wtpPredictionData.hoursPerDay.toFixed(1)} hours`); addTextLine("Weekly Work Days", `${wtpPredictionData.daysPerWeek.toFixed(1)} days`); addTextLine("Planned Start Date", wtpPredictionData.startDate); yPos += 5; // Extra space before next section // Section: Prediction Results doc.setFont(FONT_FAMILY, "bold"); doc.setFontSize(12); doc.setTextColor(ACCENT_COLOR_HEX); doc.text("Prediction Summary", 14, yPos); yPos += 7; doc.setFont(FONT_FAMILY, "normal"); doc.setFontSize(10); doc.setTextColor(PRIMARY_TEXT_COLOR_HEX); addTextLine("Total Estimated Hours", `${wtpPredictionData.totalEstimatedHours.toFixed(1)} hours`); addTextLine("Estimated Work Days", `${wtpPredictionData.estimatedWorkDays.toFixed(1)} days`); addTextLine("Estimated Calendar Duration", wtpPredictionData.calendarDuration); if (wtpPredictionData.startDate !== "Not specified") { yPos += 4; doc.setFont(FONT_FAMILY, "italic"); doc.setFontSize(9); doc.text(`Note: The calendar duration begins from your specified start date.`, 16, yPos); doc.text(`Actual end date may vary based on non-working days not explicitly covered.`, 16, yPos + 4); yPos += 8; } // Footer const pageHeight = doc.internal.pageSize.getHeight(); doc.setLineWidth(0.5); doc.setDrawColor(ACCENT_COLOR_HEX); doc.line(14, pageHeight - 15, doc.internal.pageSize.getWidth() - 14, pageHeight - 15); doc.setFont(FONT_FAMILY, "normal"); // Reset font style doc.setFontSize(8); doc.setTextColor(PRIMARY_TEXT_COLOR_HEX); doc.text("Workload Time Predictor Tool", doc.internal.pageSize.getWidth() / 2, pageHeight - 10, { align: "center" }); doc.save("Workload_Time_Prediction.pdf"); }
Scroll to Top