diff --git a/ipi-survey-platform/src/pages/Admin/ValidationReview.jsx b/ipi-survey-platform/src/pages/Admin/ValidationReview.jsx index e8d2712..bde3ccc 100644 --- a/ipi-survey-platform/src/pages/Admin/ValidationReview.jsx +++ b/ipi-survey-platform/src/pages/Admin/ValidationReview.jsx @@ -7,7 +7,6 @@ import { getBeforePreviousData, getQuarterPeriods } from '@/services/submissions import { getProductSubmissionHistory } from '@/services/submissions/submissionService'; import { Line } from 'react-chartjs-2'; - // Helper function to get months for quarter const getMonthsForQuarter = (quarter, year) => { const monthMap = { @@ -236,71 +235,6 @@ const ProductChart = ({ product, establishmentId }) => { }, plugins: { legend: { - // position: 'top', - // align: 'center', - // labels: { - // usePointStyle: true, - // boxWidth: 12, - // boxHeight: 12, - // padding: 12, - // font: { - // size: 12, - // lineHeight: '16px' - // }, - // generateLabels: function(chart) { - // const data = chart.data; - // if (data.labels.length && data.datasets.length) { - // return chart.data.datasets.map((dataset, i) => { - // const meta = chart.getDatasetMeta(i); - // let label = dataset.label || ''; - // label = ' ' + label.trim(); - - // // For Annual Capacity (dashed line) - // if (label.includes('Annual Capacity')) { - // return { - // text: label, - // fillStyle: 'transparent', - // hidden: !meta.visible, - // lineDash: [3, 3], - // lineWidth: 2, - // strokeStyle: dataset.borderColor, - // pointStyle: 'line', - // rotation: 0, - // datasetIndex: i - // }; - // } - - // // For Quantity (solid line) - // if (label.includes('Quantity')) { - // return { - // text: label, - // fillStyle: 'transparent', - // hidden: !meta.visible, - // lineDash: [], - // lineWidth: 2, - // strokeStyle: dataset.borderColor, - // pointStyle: 'line', - // rotation: 0, - // datasetIndex: i - // }; - // } - - // // For bar items (Previous, Current, Forecast) - square boxes - // return { - // text: label, - // fillStyle: dataset.backgroundColor, - // hidden: !meta.visible, - // lineWidth: 0, - // strokeStyle: 'transparent', - // pointStyle: 'rect', - // rotation: 0, - // datasetIndex: i - // }; - // }); - // } - // return []; - // } - // } display:false, }, tooltip: { @@ -618,7 +552,6 @@ const ValidationReview = () => { productId ); - let mappedDataMap = {}; submissionData?.products?.forEach((product) => { @@ -670,9 +603,6 @@ setAdditionalForecastMonths([ } }; - - - // Helper to get forecast data for a specific product const getCurrentYearForecastData = (productId) => { if (!showPreviousNext || !productId) { @@ -771,102 +701,96 @@ setAdditionalForecastMonths([ }; const calculateVariance = (previous, current) => { - const previousNum = parseFloat(previous) || 0; - const currentNum = parseFloat(current) || 0; - - if (previousNum === 0) { - return currentNum === 0 ? 0 : 100; - } - + const previousNum = Number(previous); + const currentNum = Number(current); + + if (isNaN(previousNum) || isNaN(currentNum)) return 0; + + // both 0 â no variance + if (previousNum === 0 && currentNum === 0) return 0; + + // 0 â value (special case) + if (previousNum === 0) return 100; + return ((currentNum - previousNum) / Math.abs(previousNum)) * 100; }; const formatPercentage = (variance) => { - const absVariance = Math.abs(variance); - - if (absVariance === 0) return '0%'; - - if (absVariance >= 1000) { - return `${variance > 0 ? '+' : ''}${Math.round(variance).toLocaleString()}%`; - } - - if (absVariance >= 100) { - return `${variance > 0 ? '+' : ''}${Math.round(variance)}%`; - } - - return `${variance > 0 ? '+' : ''}${variance.toFixed(1)}%`; + if (variance === 0) return '0%'; + + const sign = variance > 0 ? '+' : ''; + const abs = Math.abs(variance); + + if (abs >= 100) return `${sign}${Math.round(variance)}%`; + + return `${sign}${variance.toFixed(1)}%`; }; const getVarianceDisplay = (previousValue, currentValue, isFirstMonth = false) => { if (isFirstMonth) return null; - + if (previousValue == null || currentValue == null) return null; + const variance = calculateVariance(previousValue, currentValue); const absVariance = Math.abs(variance); - + if (absVariance === 0) { return (
| - Metric - | - - {showPreviousNext ? ( - <> - {/* 12 columns when showPreviousNext is true */} -- {previousLabel || 'Q1 2024'} (PREVIOUS QUARTER) - | -- {currentLabel || 'Q2 2024'} (CURRENT QUARTER) - | -- {additionalForecastLabel || ''} (PREVIOUS FORECAST) - | -- {forecastLabel || 'Q3 2024'} (NEXT YEAR FORECAST) - | - > - ) : ( - <> - {/* 9 columns when showPreviousNext is false */} -- {previousLabel || 'Q1 2024'} (PREVIOUS QUARTER) - | -- {currentLabel || 'Q2 2024'} (CURRENT QUARTER) - | -- {forecastLabel || 'Q3 2024'} (NEXT YEAR FORECAST) - | - > - )} -||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| + Metric + | + + {showPreviousNext ? ( + <> + {/* 12 columns when showPreviousNext is true */} ++ {previousLabel || 'Q1 2024'} (PREVIOUS QUARTER) + | ++ {currentLabel || 'Q2 2024'} (CURRENT QUARTER) + | ++ {additionalForecastLabel || ''} (PREVIOUS FORECAST) + | ++ {forecastLabel || 'Q3 2024'} (NEXT YEAR FORECAST) + | + > + ) : ( + <> + {/* 9 columns when showPreviousNext is false */} ++ {previousLabel || 'Q1 2024'} (PREVIOUS QUARTER) + | ++ {currentLabel || 'Q2 2024'} (CURRENT QUARTER) + | ++ {forecastLabel || 'Q3 2024'} (NEXT YEAR FORECAST) + | + > + )} +||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - {previousMonths?.previous_period_one || 'Jan'} - | -- {previousMonths?.previous_period_two || 'Feb'} - | -- {previousMonths?.previous_period_three || 'Mar'} - | +|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| + {previousMonths?.previous_period_one || 'Jan'} + | ++ {previousMonths?.previous_period_two || 'Feb'} + | ++ {previousMonths?.previous_period_three || 'Mar'} + | - {/* Current Quarter Months */} -- {currentMonths?.current_period_one || 'Apr'} - | -- {currentMonths?.current_period_two || 'May'} - | -- {currentMonths?.current_period_three || 'Jun'} - | + {/* Current Quarter Months */} ++ {currentMonths?.current_period_one || 'Apr'} + | ++ {currentMonths?.current_period_two || 'May'} + | ++ {currentMonths?.current_period_three || 'Jun'} + | - {/* Previous Forecast Months */} -- {additionalForecastMonths?.[0] || 'Jul'} - | -- {additionalForecastMonths?.[1] || 'Aug'} - | -- {additionalForecastMonths?.[2] || 'Sep'} - | + {/* Previous Forecast Months */} ++ {additionalForecastMonths?.[0] || 'Jul'} + | ++ {additionalForecastMonths?.[1] || 'Aug'} + | ++ {additionalForecastMonths?.[2] || 'Sep'} + | - {/* Next Year Forecast Months */} -- {forecastMonths?.forecast_period_one || 'Oct'} - | -- {forecastMonths?.forecast_period_two || 'Nov'} - | -- {forecastMonths?.forecast_period_three || 'Dec'} - | - > - ) : ( - <> - {/* Previous Quarter Months */} -- {previousMonths?.previous_period_one || 'Jan'} - | -- {previousMonths?.previous_period_two || 'Feb'} - | -- {previousMonths?.previous_period_three || 'Mar'} - | + {/* Next Year Forecast Months */} ++ {forecastMonths?.forecast_period_one || 'Oct'} + | ++ {forecastMonths?.forecast_period_two || 'Nov'} + | ++ {forecastMonths?.forecast_period_three || 'Dec'} + | + > + ) : ( + <> + {/* Previous Quarter Months */} ++ {previousMonths?.previous_period_one || 'Jan'} + | ++ {previousMonths?.previous_period_two || 'Feb'} + | ++ {previousMonths?.previous_period_three || 'Mar'} + | - {/* Current Quarter Months */} -- {currentMonths?.current_period_one || 'Apr'} - | -- {currentMonths?.current_period_two || 'May'} - | -- {currentMonths?.current_period_three || 'Jun'} - | + {/* Current Quarter Months */} ++ {currentMonths?.current_period_one || 'Apr'} + | ++ {currentMonths?.current_period_two || 'May'} + | ++ {currentMonths?.current_period_three || 'Jun'} + | - {/* Next Year Forecast Months */} -- {forecastMonths?.forecast_period_one || 'Jul'} - | -- {forecastMonths?.forecast_period_two || 'Aug'} - | -- {forecastMonths?.forecast_period_three || 'Sep'} - | - > - )} -+ {forecastMonths?.forecast_period_one || 'Jul'} + | ++ {forecastMonths?.forecast_period_two || 'Aug'} + | ++ {forecastMonths?.forecast_period_three || 'Sep'} + | + > + )} + +|||||||||||||||||||||||||||||||||||||||
|
- {product.previous_quantity_period_one || '0'}
-
- |
-
-
- {product.previous_quantity_period_two || '0'}
- {getVarianceDisplay(product.previous_quantity_period_one, product.previous_quantity_period_two, true)}
-
- |
-
-
- {product.previous_quantity_period_three || '0'}
- {getVarianceDisplay(product.previous_quantity_period_two, product.previous_quantity_period_three)}
+
+ {product.previous_quantity_period_one || "0"}
+
|
- {/* Current Quarter Data */}
- + {/* Previous Quarter â Month 2 */} + |
- {product.current_quantity_period_one || '0'}
- {getVarianceDisplay(product.previous_quantity_period_three, product.current_quantity_period_one)}
+
+ {product.previous_quantity_period_two || "0"}
+
+ {/* If previous quarter has values, show variance from 2nd column */}
+ {!isPreviousQuarterAllZeros && getVarianceDisplay(
+ product.previous_quantity_period_one,
+ product.previous_quantity_period_two
+ )}
|
- + + {/* Previous Quarter â Month 3 */} + |
- {product.current_quantity_period_two || '0'}
- {getVarianceDisplay(product.current_quantity_period_one, product.current_quantity_period_two)}
+
+ {product.previous_quantity_period_three || "0"}
+
+ {/* If previous quarter has values, show variance */}
+ {!isPreviousQuarterAllZeros && getVarianceDisplay(
+ product.previous_quantity_period_two,
+ product.previous_quantity_period_three
+ )}
|
- + + {/* Current Quarter â Month 1 */} + |
- {product.current_quantity_period_three || '0'}
- {getVarianceDisplay(product.current_quantity_period_two, product.current_quantity_period_three)}
+
+ {product.current_quantity_period_one || "0"}
+
+ {/* If previous quarter is all zeros, treat this as FIRST month */}
+ {!isPreviousQuarterAllZeros && getVarianceDisplay(
+ product.previous_quantity_period_three,
+ product.current_quantity_period_one
+ )}
+
+ |
+
+ {/* Current Quarter â Month 2 */}
+
+
+
+ {product.current_quantity_period_two || "0"}
+
+ {/* Always show variance for Month 2 (vs Month 1) */}
+ {getVarianceDisplay(
+ product.current_quantity_period_one,
+ product.current_quantity_period_two
+ )}
+
+ |
+
+ {/* Current Quarter â Month 3 */}
+
+
+
+ {product.current_quantity_period_three || "0"}
+
+ {/* Always show variance for Month 3 (vs Month 2) */}
+ {getVarianceDisplay(
+ product.current_quantity_period_two,
+ product.current_quantity_period_three
+ )}
|
@@ -1363,19 +1325,19 @@ const additionalForecastLabel = showPreviousNext
const historicalData = getCurrentYearForecastData(product?.product?.id);
return (
<>
- + |
{historicalData.forecast_quantity_period_one || '0'}
{getVarianceDisplay(product.current_quantity_period_three, historicalData.forecast_quantity_period_one)}
|
- + |
{historicalData.forecast_quantity_period_two || '0'}
{getVarianceDisplay(historicalData.forecast_quantity_period_one, historicalData.forecast_quantity_period_two)}
|
- + |
{historicalData.forecast_quantity_period_three || '0'}
{getVarianceDisplay(historicalData.forecast_quantity_period_two, historicalData.forecast_quantity_period_three)}
@@ -1386,19 +1348,19 @@ const additionalForecastLabel = showPreviousNext
})()}
{/* NEXT YEAR FORECAST Data (original from submission) */}
-
+ |
|
-
{product.forecast_quantity_period_one || '0'}
{getVarianceDisplay(product.current_quantity_period_three, product.forecast_quantity_period_one)}
+ |
|
-
{product.forecast_quantity_period_two || '0'}
{getVarianceDisplay(product.forecast_quantity_period_one, product.forecast_quantity_period_two)}
+ |
|
{product.forecast_quantity_period_three || '0'}
{getVarianceDisplay(product.forecast_quantity_period_two, product.forecast_quantity_period_three)}
@@ -1407,59 +1369,98 @@ const additionalForecastLabel = showPreviousNext
>
) : (
<>
+ {/* Previous Quarter â Month 1 */}
|
+
+ {/* Previous Quarter â Month 2 */}
{product.previous_quantity_period_one || '0'}
|
-
{product.previous_quantity_period_two || '0'}
- {getVarianceDisplay(product.previous_quantity_period_one, product.previous_quantity_period_two, true)}
+ {!isPreviousQuarterAllZeros && getVarianceDisplay(
+ product.previous_quantity_period_one,
+ product.previous_quantity_period_two
+ )}
+
+ {/* Previous Quarter â Month 3 */}
+ |
|
-
{product.previous_quantity_period_three || '0'}
- {getVarianceDisplay(product.previous_quantity_period_two, product.previous_quantity_period_three)}
+ {!isPreviousQuarterAllZeros && getVarianceDisplay(
+ product.previous_quantity_period_two,
+ product.previous_quantity_period_three
+ )}
+ {/* Current Quarter â Month 1 */}
+ |
|
-
{product.current_quantity_period_one || '0'}
- {getVarianceDisplay(product.previous_quantity_period_three, product.current_quantity_period_one)}
+ {!isPreviousQuarterAllZeros && getVarianceDisplay(
+ product.previous_quantity_period_three,
+ product.current_quantity_period_one
+ )}
+
+ {/* Current Quarter â Month 2 */}
+ |
|
-
{product.current_quantity_period_two || '0'}
- {getVarianceDisplay(product.current_quantity_period_one, product.current_quantity_period_two)}
+ {getVarianceDisplay(
+ product.current_quantity_period_one,
+ product.current_quantity_period_two
+ )}
+
+ {/* Current Quarter â Month 3 */}
+ |
|
-
{product.current_quantity_period_three || '0'}
- {getVarianceDisplay(product.current_quantity_period_two, product.current_quantity_period_three)}
+ {getVarianceDisplay(
+ product.current_quantity_period_two,
+ product.current_quantity_period_three
+ )}
+ {/* Next Year Forecast â Month 1 */}
+ |
|
-
{product.forecast_quantity_period_one || '0'}
- {getVarianceDisplay(product.current_quantity_period_three, product.forecast_quantity_period_one)}
+ {getVarianceDisplay(
+ product.current_quantity_period_three,
+ product.forecast_quantity_period_one
+ )}
+
+ {/* Next Year Forecast â Month 2 */}
+ |
|
-
{product.forecast_quantity_period_two || '0'}
- {getVarianceDisplay(product.forecast_quantity_period_one, product.forecast_quantity_period_two)}
+ {getVarianceDisplay(
+ product.forecast_quantity_period_one,
+ product.forecast_quantity_period_two
+ )}
+
+ {/* Next Year Forecast â Month 3 */}
+ |
|
>
@@ -1473,39 +1474,55 @@ const additionalForecastLabel = showPreviousNext
{showPreviousNext ? (
<>
- {/* Previous Quarter Cost */}
+ {/* Previous Cost â Month 1 (BASE) - NO VARIANCE */}
{product.forecast_quantity_period_three || '0'}
- {getVarianceDisplay(product.forecast_quantity_period_two, product.forecast_quantity_period_three)}
+ {getVarianceDisplay(
+ product.forecast_quantity_period_two,
+ product.forecast_quantity_period_three
+ )}
|
-
- {product.previous_cost_period_one || '0'}
-
-
- |
-
- {product.previous_cost_period_two || '0'}
- {getVarianceDisplay(product.previous_cost_period_one, product.previous_cost_period_two, true)}
-
-
- |
- {/* Current Quarter Cost */}
-
- {product.previous_cost_period_three || '0'}
- {getVarianceDisplay(product.previous_cost_period_two, product.previous_cost_period_three)}
+
+ {product.previous_cost_period_one || "0"}
+
+ {/* Previous Cost â Month 2 */}
+ |
|
-
- {product.current_cost_period_one || '0'}
- {getVarianceDisplay(product.previous_cost_period_three, product.current_cost_period_one)}
+
+ {product.previous_cost_period_two || "0"}
+
+ {!isPreviousQuarterCostAllZeros && getVarianceDisplay(
+ product.previous_cost_period_one,
+ product.previous_cost_period_two
+ )}
+
+ {/* Previous Cost â Month 3 */}
+ |
+ |
+
+ {/* Current Quarter Cost â Month 1 */}
+
+
+ {product.previous_cost_period_three || "0"}
+
+ {!isPreviousQuarterCostAllZeros && getVarianceDisplay(
+ product.previous_cost_period_two,
+ product.previous_cost_period_three
+ )}
+
+
+ |
+
+ {product.current_cost_period_one || '0'}
+ {!isPreviousQuarterCostAllZeros && getVarianceDisplay(product.previous_cost_period_three, product.current_cost_period_one)}
+
+
|
-
{product.current_cost_period_two || '0'}
{getVarianceDisplay(product.current_cost_period_one, product.current_cost_period_two)}
+ |
|
{product.current_cost_period_three || '0'}
{getVarianceDisplay(product.current_cost_period_two, product.current_cost_period_three)}
@@ -1517,19 +1534,19 @@ const additionalForecastLabel = showPreviousNext
const historicalData = getCurrentYearForecastData(product?.product?.id);
return (
<>
-
+ |
|
-
{historicalData.forecast_cost_period_one || '0'}
{getVarianceDisplay(product.current_cost_period_three, historicalData.forecast_cost_period_one)}
+ |
|
-
{historicalData.forecast_cost_period_two || '0'}
{getVarianceDisplay(historicalData.forecast_cost_period_one, historicalData.forecast_cost_period_two)}
+ |
|
{historicalData.forecast_cost_period_three || '0'}
{getVarianceDisplay(historicalData.forecast_cost_period_two, historicalData.forecast_cost_period_three)}
@@ -1540,19 +1557,19 @@ const additionalForecastLabel = showPreviousNext
})()}
{/* NEXT YEAR FORECAST Cost (original from submission) */}
-
+ |
|
-
{product.forecast_cost_period_one || '0'}
{getVarianceDisplay(product.current_cost_period_three, product.forecast_cost_period_one)}
+ |
|
-
{product.forecast_cost_period_two || '0'}
{getVarianceDisplay(product.forecast_cost_period_one, product.forecast_cost_period_two)}
+ |
|
{product.forecast_cost_period_three || '0'}
{getVarianceDisplay(product.forecast_cost_period_two, product.forecast_cost_period_three)}
@@ -1561,110 +1578,151 @@ const additionalForecastLabel = showPreviousNext
>
) : (
<>
+ {/* Previous Cost â Month 1 */}
|
+
+ {/* Previous Cost â Month 2 */}
{product.previous_cost_period_one || '0'}
|
-
{product.previous_cost_period_two || '0'}
- {getVarianceDisplay(product.previous_cost_period_one, product.previous_cost_period_two, true)}
+ {!isPreviousQuarterCostAllZeros && getVarianceDisplay(
+ product.previous_cost_period_one,
+ product.previous_cost_period_two
+ )}
+
+ {/* Previous Cost â Month 3 */}
+ |
|
-
{product.previous_cost_period_three || '0'}
- {getVarianceDisplay(product.previous_cost_period_two, product.previous_cost_period_three)}
+ {!isPreviousQuarterCostAllZeros && getVarianceDisplay(
+ product.previous_cost_period_two,
+ product.previous_cost_period_three
+ )}
+ {/* Current Cost â Month 1 */}
+ |
|
-
{product.current_cost_period_one || '0'}
- {getVarianceDisplay(product.previous_cost_period_three, product.current_cost_period_one)}
+ {!isPreviousQuarterCostAllZeros && getVarianceDisplay(
+ product.previous_cost_period_three,
+ product.current_cost_period_one
+ )}
+
+ {/* Current Cost â Month 2 */}
+ |
|
-
{product.current_cost_period_two || '0'}
- {getVarianceDisplay(product.current_cost_period_one, product.current_cost_period_two)}
+ {getVarianceDisplay(
+ product.current_cost_period_one,
+ product.current_cost_period_two
+ )}
+
+ {/* Current Cost â Month 3 */}
+ |
|
-
{product.current_cost_period_three || '0'}
- {getVarianceDisplay(product.current_cost_period_two, product.current_cost_period_three)}
+ {getVarianceDisplay(
+ product.current_cost_period_two,
+ product.current_cost_period_three
+ )}
+ {/* Forecast Cost â Month 1 */}
+ |
|
-
{product.forecast_cost_period_one || '0'}
- {getVarianceDisplay(product.current_cost_period_three, product.forecast_cost_period_one)}
+ {getVarianceDisplay(
+ product.current_cost_period_three,
+ product.forecast_cost_period_one
+ )}
+
+ {/* Forecast Cost â Month 2 */}
+ |
|
-
{product.forecast_cost_period_two || '0'}
- {getVarianceDisplay(product.forecast_cost_period_one, product.forecast_cost_period_two)}
+ {getVarianceDisplay(
+ product.forecast_cost_period_one,
+ product.forecast_cost_period_two
+ )}
+
+ {/* Forecast Cost â Month 3 */}
+ |
|
>
)}
{product.forecast_cost_period_three || '0'}
- {getVarianceDisplay(product.forecast_cost_period_two, product.forecast_cost_period_three)}
+ {getVarianceDisplay(
+ product.forecast_cost_period_two,
+ product.forecast_cost_period_three
+ )}
|
| - Reason (Current) - | - {showPreviousNext ? ( - <> -- â - | -- {product.other_variation_reason || - (product?.variation_reason?.reason ? - (product.variation_reason.reason.startsWith('Other (specify)') ? '' : product.variation_reason.reason) - : 'No reason provided') - } - | - {/* Previous Forecast (colSpan 3) */} -- â - | - {/* Next Year Forecast (colSpan 3) */} -- â - | - > - ) : ( - <> - {/* Previous Quarter (colSpan 3) */} -- â - | - {/* Current Quarter (colSpan 3) - āŽāŽā¯āŽā¯āŽ¤āŽžāŽŠā¯ Reason (Current) āŽāްā¯āŽā¯āŽ āŽĩā¯āŽŖā¯āŽā¯āŽŽā¯ */} -- {product.other_variation_reason || - (product?.variation_reason?.reason ? - (product.variation_reason.reason.startsWith('Other (specify)') ? '' : product.variation_reason.reason) - : 'No reason provided') - } - | - {/* Next Year Forecast (colSpan 3) */} -- â - | - > - )} -||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| + Reason (Current) + | + {showPreviousNext ? ( + <> ++ â + | ++ {product.other_variation_reason || + (product?.variation_reason?.reason ? + (product.variation_reason.reason.startsWith('Other (specify)') ? '' : product.variation_reason.reason) + : 'No reason provided') + } + | + {/* Previous Forecast (colSpan 3) */} ++ â + | + {/* Next Year Forecast (colSpan 3) */} ++ â + | + > + ) : ( + <> + {/* Previous Quarter (colSpan 3) */} ++ â + | + {/* Current Quarter (colSpan 3) */} ++ {product.other_variation_reason || + (product?.variation_reason?.reason ? + (product.variation_reason.reason.startsWith('Other (specify)') ? '' : product.variation_reason.reason) + : 'No reason provided') + } + | + {/* Next Year Forecast (colSpan 3) */} ++ â + | + > + )} +||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Reason (Forecast)
@@ -1726,7 +1784,8 @@ const additionalForecastLabel = showPreviousNext
- ))}
+ );
+ })}
) : (
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||