Enhancement version3

This commit is contained in:
seranjivi 2026-04-29 11:44:00 +05:30
parent 9e5088eb42
commit d7bd261cea

View File

@ -1196,7 +1196,7 @@ setAdditionalForecastMonths([
</th>
{!shouldHideForecast && (
<th colSpan="3" className="bg-[#F2ECCF] text-[#92722A] px-4 py-2 text-xs font-semibold uppercase text-center border border-[#E5E7EB]">
{forecastLabel || 'Q3 2024'} (NEXT YEAR FORECAST)
{forecastLabel || 'Q3 2024'} (NEXT QUARTER FORECAST)
</th>
)}
</>
@ -1213,7 +1213,7 @@ setAdditionalForecastMonths([
</th>
{!shouldHideForecast && (
<th colSpan="3" className="bg-[#F2ECCF] text-[#92722A] px-4 py-2 text-xs font-semibold uppercase text-center border border-[#E5E7EB]">
{forecastLabel || 'Q3 2024'} (NEXT YEAR FORECAST)
{forecastLabel || 'Q3 2024'} (NEXT QUARTER FORECAST)
</th>
)}
</>
@ -1414,7 +1414,7 @@ setAdditionalForecastMonths([
</td>
{/* HISTORICAL Data (from API) */}
{(() => {
{showPreviousNext && (() => {
const historicalData = getCurrentYearForecastData(product?.product?.id);
return (
<>
@ -1522,7 +1522,7 @@ setAdditionalForecastMonths([
)}
</div>
</td>
{/* Current Quarter Month 3 */}
<td className={`px-3 py-3 border border-[#E5E7EB] text-center ${getCellClass(product.current_quantity_period_two, product.current_quantity_period_three, false)} ${getBorderClass(product.current_quantity_period_two, product.current_quantity_period_three, false)}`}>
<div className="flex flex-col items-center justify-center">
@ -1535,37 +1535,43 @@ setAdditionalForecastMonths([
</td>
{/* Next Year Forecast Month 1 */}
<td className={`px-3 py-3 border border-[#E5E7EB] text-center ${getCellClass(product.current_quantity_period_three, product.forecast_quantity_period_one, false)} ${getBorderClass(product.current_quantity_period_three, product.forecast_quantity_period_one, false)}`}>
<div className="flex flex-col items-center justify-center">
<span className="font-medium">{product.forecast_quantity_period_one || '0'}</span>
{getVarianceDisplay(
product.current_quantity_period_three,
product.forecast_quantity_period_one
)}
</div>
</td>
{!shouldHideForecast && (
<td className={`px-3 py-3 border border-[#E5E7EB] text-center ${getCellClass(product.current_quantity_period_three, product.forecast_quantity_period_one, false)} ${getBorderClass(product.current_quantity_period_three, product.forecast_quantity_period_one, false)}`}>
<div className="flex flex-col items-center justify-center">
<span className="font-medium">{product.forecast_quantity_period_one || '0'}</span>
{getVarianceDisplay(
product.current_quantity_period_three,
product.forecast_quantity_period_one
)}
</div>
</td>
)}
{/* Next Year Forecast Month 2 */}
<td className={`px-3 py-3 border border-[#E5E7EB] text-center ${getCellClass(product.forecast_quantity_period_one, product.forecast_quantity_period_two, false)} ${getBorderClass(product.forecast_quantity_period_one, product.forecast_quantity_period_two, false)}`}>
<div className="flex flex-col items-center justify-center">
<span className="font-medium">{product.forecast_quantity_period_two || '0'}</span>
{getVarianceDisplay(
product.forecast_quantity_period_one,
product.forecast_quantity_period_two
)}
</div>
</td>
{!shouldHideForecast && (
<td className={`px-3 py-3 border border-[#E5E7EB] text-center ${getCellClass(product.forecast_quantity_period_one, product.forecast_quantity_period_two, false)} ${getBorderClass(product.forecast_quantity_period_one, product.forecast_quantity_period_two, false)}`}>
<div className="flex flex-col items-center justify-center">
<span className="font-medium">{product.forecast_quantity_period_two || '0'}</span>
{getVarianceDisplay(
product.forecast_quantity_period_one,
product.forecast_quantity_period_two
)}
</div>
</td>
)}
{/* Next Year Forecast Month 3 */}
<td className={`px-3 py-3 border border-[#E5E7EB] text-center ${getCellClass(product.forecast_quantity_period_two, product.forecast_quantity_period_three, false)} ${getBorderClass(product.forecast_quantity_period_two, product.forecast_quantity_period_three, false)}`}>
<div className="flex flex-col items-center justify-center">
<span className="font-medium">{product.forecast_quantity_period_three || '0'}</span>
{getVarianceDisplay(
product.forecast_quantity_period_two,
product.forecast_quantity_period_three
)}
</div>
</td>
{!shouldHideForecast && (
<td className={`px-3 py-3 border border-[#E5E7EB] text-center ${getCellClass(product.forecast_quantity_period_two, product.forecast_quantity_period_three, false)} ${getBorderClass(product.forecast_quantity_period_two, product.forecast_quantity_period_three, false)}`}>
<div className="flex flex-col items-center justify-center">
<span className="font-medium">{product.forecast_quantity_period_three || '0'}</span>
{getVarianceDisplay(
product.forecast_quantity_period_two,
product.forecast_quantity_period_three
)}
</div>
</td>
)}
</>
)}
</tr>
@ -1637,7 +1643,7 @@ setAdditionalForecastMonths([
</td>
{/* HISTORICAL Cost (from API) */}
{(() => {
{showPreviousNext && (() => {
const historicalData = getCurrentYearForecastData(product?.product?.id);
return (
<>