diff --git a/src/components/ReportsView.tsx b/src/components/ReportsView.tsx index 00d58d3..87f7a79 100644 --- a/src/components/ReportsView.tsx +++ b/src/components/ReportsView.tsx @@ -17,12 +17,14 @@ import { } from '@phosphor-icons/react' import { useInvoicesCrud } from '@/hooks/use-invoices-crud' import { usePayrollCrud } from '@/hooks/use-payroll-crud' +import { useTranslation } from '@/hooks/use-translation' import type { MarginAnalysis, ForecastData } from '@/lib/types' import { cn } from '@/lib/utils' export function ReportsView() { const [selectedPeriod, setSelectedPeriod] = useState<'week' | 'month' | 'quarter' | 'year'>('month') const [selectedYear, setSelectedYear] = useState('2025') + const { t } = useTranslation() const { invoices } = useInvoicesCrud() const { payrollRuns } = usePayrollCrud() @@ -113,8 +115,8 @@ export function ReportsView() {
-

Reports & Analytics

-

Real-time margin analysis and forecasting

+

{t('reports.title')}

+

{t('reports.subtitle')}

@@ -138,33 +140,33 @@ export function ReportsView() {
- Total Revenue (YTD) + {t('reports.totalRevenueYTD')}
£{totalRevenue.toLocaleString()}
- Year to date + {t('reports.yearToDate')}
- Total Costs (YTD) + {t('reports.totalCostsYTD')}
£{totalCosts.toLocaleString()}
- Year to date + {t('reports.yearToDate')}
- Gross Margin (YTD) + {t('reports.grossMarginYTD')}
£{totalMargin.toLocaleString()}
@@ -176,7 +178,7 @@ export function ReportsView() { - MoM Change + {t('reports.momChange')}
)} - vs last month + {t('reports.vsLastMonth')}
@@ -201,19 +203,19 @@ export function ReportsView() { - Margin Analysis + {t('reports.tabs.marginAnalysis')} - Forecasting + {t('reports.tabs.forecasting')} - Real-Time Gross Margin by Month - Revenue, costs, and margin breakdown for {selectedYear} + {t('reports.marginAnalysisTitle')} + {t('reports.marginAnalysisDescription', { year: selectedYear })}
@@ -255,11 +257,11 @@ export function ReportsView() {
- Revenue + {t('reports.revenue')}
- Costs + {t('reports.costs')}
@@ -271,15 +273,15 @@ export function ReportsView() {
- Revenue + {t('reports.revenue')} £{data.revenue.toLocaleString()}
- Costs + {t('reports.costs')} £{data.costs.toLocaleString()}
- Margin + {t('reports.margin')}
£{data.margin.toLocaleString()}
- Predictive Revenue & Margin Forecast + {t('reports.forecastingTitle')} - AI-powered forecasting based on historical trends and growth patterns + {t('reports.forecastingDescription')} {forecast.length === 0 ? (
-

Not enough historical data to generate forecast

-

Need at least 2 months of data

+

{t('reports.notEnoughData')}

+

{t('reports.notEnoughDataDescription')}

) : (
@@ -373,19 +375,19 @@ export function ReportsView() {
- Actual Revenue + {t('reports.actualRevenue')}
- Predicted Revenue + {t('reports.predictedRevenue')}
- Actual Costs + {t('reports.actualCosts')}
- Predicted Costs + {t('reports.predictedCosts')}
@@ -407,15 +409,15 @@ export function ReportsView() {
- Predicted Revenue + {t('reports.predictedRevenue')} £{data.predictedRevenue.toLocaleString()}
- Predicted Costs + {t('reports.predictedCosts')} £{data.predictedCosts.toLocaleString()}
- Est. Margin + {t('reports.estMargin')}
£{margin.toLocaleString()}
@@ -434,10 +436,9 @@ export function ReportsView() {
-

Forecast Methodology

+

{t('reports.forecastMethodology')}

- Predictions are calculated using historical revenue trends, growth rates, and seasonal patterns. - Confidence levels decrease for longer-term forecasts. Use these insights for planning and budgeting purposes. + {t('reports.forecastMethodologyDescription')}

diff --git a/src/data/translations/en.json b/src/data/translations/en.json index 3250708..48811f6 100644 --- a/src/data/translations/en.json +++ b/src/data/translations/en.json @@ -492,8 +492,8 @@ } }, "reports": { - "title": "Reports", - "subtitle": "Generate and view reports", + "title": "Reports & Analytics", + "subtitle": "Real-time margin analysis and forecasting", "customReport": "Custom Report", "runReport": "Run Report", "scheduleReport": "Schedule Report", @@ -506,7 +506,34 @@ "complianceReport": "Compliance Report", "marginAnalysis": "Margin Analysis", "missingTimesheets": "Missing Timesheets", - "auditTrail": "Audit Trail" + "auditTrail": "Audit Trail", + "totalRevenueYTD": "Total Revenue (YTD)", + "totalCostsYTD": "Total Costs (YTD)", + "grossMarginYTD": "Gross Margin (YTD)", + "momChange": "MoM Change", + "yearToDate": "Year to date", + "vsLastMonth": "vs last month", + "tabs": { + "marginAnalysis": "Margin Analysis", + "forecasting": "Forecasting" + }, + "marginAnalysisTitle": "Real-Time Gross Margin by Month", + "marginAnalysisDescription": "Revenue, costs, and margin breakdown for {{year}}", + "revenue": "Revenue", + "costs": "Costs", + "actualRevenue": "Actual Revenue", + "actualCosts": "Actual Costs", + "predictedRevenue": "Predicted Revenue", + "predictedCosts": "Predicted Costs", + "margin": "Margin", + "estMargin": "Est. Margin", + "forecastingTitle": "Predictive Revenue & Margin Forecast", + "forecastingDescription": "AI-powered forecasting based on historical trends and growth patterns", + "notEnoughData": "Not enough historical data to generate forecast", + "notEnoughDataDescription": "Need at least 2 months of data", + "forecastMethodology": "Forecast Methodology", + "forecastMethodologyDescription": "Predictions are calculated using historical revenue trends, growth rates, and seasonal patterns. Confidence levels decrease for longer-term forecasts. Use these insights for planning and budgeting purposes.", + "confidence": "{{confidence}}% confidence" }, "notifications": { "title": "Notifications", diff --git a/src/data/translations/es.json b/src/data/translations/es.json index 9fc0dce..f94b3fd 100644 --- a/src/data/translations/es.json +++ b/src/data/translations/es.json @@ -492,8 +492,8 @@ } }, "reports": { - "title": "Informes", - "subtitle": "Generar y ver informes", + "title": "Informes & Análisis", + "subtitle": "Análisis de margen y pronósticos en tiempo real", "customReport": "Informe Personalizado", "runReport": "Ejecutar Informe", "scheduleReport": "Programar Informe", @@ -506,7 +506,34 @@ "complianceReport": "Informe de Cumplimiento", "marginAnalysis": "Análisis de Margen", "missingTimesheets": "Hojas de Tiempo Faltantes", - "auditTrail": "Registro de Auditoría" + "auditTrail": "Registro de Auditoría", + "totalRevenueYTD": "Ingresos Totales (Acumulado Anual)", + "totalCostsYTD": "Costos Totales (Acumulado Anual)", + "grossMarginYTD": "Margen Bruto (Acumulado Anual)", + "momChange": "Cambio Mensual", + "yearToDate": "Acumulado anual", + "vsLastMonth": "vs mes anterior", + "tabs": { + "marginAnalysis": "Análisis de Margen", + "forecasting": "Pronósticos" + }, + "marginAnalysisTitle": "Margen Bruto en Tiempo Real por Mes", + "marginAnalysisDescription": "Desglose de ingresos, costos y márgenes para {{year}}", + "revenue": "Ingresos", + "costs": "Costos", + "actualRevenue": "Ingresos Reales", + "actualCosts": "Costos Reales", + "predictedRevenue": "Ingresos Predichos", + "predictedCosts": "Costos Predichos", + "margin": "Margen", + "estMargin": "Margen Est.", + "forecastingTitle": "Pronóstico Predictivo de Ingresos y Márgenes", + "forecastingDescription": "Pronósticos impulsados por IA basados en tendencias históricas y patrones de crecimiento", + "notEnoughData": "No hay suficientes datos históricos para generar pronósticos", + "notEnoughDataDescription": "Se necesitan al menos 2 meses de datos", + "forecastMethodology": "Metodología de Pronóstico", + "forecastMethodologyDescription": "Las predicciones se calculan utilizando tendencias históricas de ingresos, tasas de crecimiento y patrones estacionales. Los niveles de confianza disminuyen para pronósticos a más largo plazo. Utilice estos conocimientos para fines de planificación y presupuesto.", + "confidence": "{{confidence}}% de confianza" }, "notifications": { "title": "Notificaciones", diff --git a/src/data/translations/fr.json b/src/data/translations/fr.json index 5bfbbde..1b27d4d 100644 --- a/src/data/translations/fr.json +++ b/src/data/translations/fr.json @@ -492,8 +492,8 @@ } }, "reports": { - "title": "Rapports", - "subtitle": "Générer et consulter des rapports", + "title": "Rapports & Analyses", + "subtitle": "Analyse de marge et prévisions en temps réel", "customReport": "Rapport Personnalisé", "runReport": "Exécuter un Rapport", "scheduleReport": "Planifier un Rapport", @@ -506,7 +506,34 @@ "complianceReport": "Rapport de Conformité", "marginAnalysis": "Analyse de Marge", "missingTimesheets": "Feuilles de Temps Manquantes", - "auditTrail": "Piste d'Audit" + "auditTrail": "Piste d'Audit", + "totalRevenueYTD": "Revenu Total (Cumul Annuel)", + "totalCostsYTD": "Coûts Totaux (Cumul Annuel)", + "grossMarginYTD": "Marge Brute (Cumul Annuel)", + "momChange": "Variation Mensuelle", + "yearToDate": "Cumul annuel", + "vsLastMonth": "par rapport au mois dernier", + "tabs": { + "marginAnalysis": "Analyse de Marge", + "forecasting": "Prévisions" + }, + "marginAnalysisTitle": "Marge Brute en Temps Réel par Mois", + "marginAnalysisDescription": "Répartition des revenus, coûts et marges pour {{year}}", + "revenue": "Revenu", + "costs": "Coûts", + "actualRevenue": "Revenu Réel", + "actualCosts": "Coûts Réels", + "predictedRevenue": "Revenu Prévu", + "predictedCosts": "Coûts Prévus", + "margin": "Marge", + "estMargin": "Marge Estimée", + "forecastingTitle": "Prévisions de Revenu & Marge Prédictives", + "forecastingDescription": "Prévisions alimentées par IA basées sur les tendances historiques et les modèles de croissance", + "notEnoughData": "Données historiques insuffisantes pour générer des prévisions", + "notEnoughDataDescription": "Nécessite au moins 2 mois de données", + "forecastMethodology": "Méthodologie de Prévision", + "forecastMethodologyDescription": "Les prévisions sont calculées en utilisant les tendances historiques des revenus, les taux de croissance et les modèles saisonniers. Les niveaux de confiance diminuent pour les prévisions à plus long terme. Utilisez ces informations à des fins de planification et de budgétisation.", + "confidence": "{{confidence}}% de confiance" }, "notifications": { "title": "Notifications",