Improve UI
This commit is contained in:
@@ -24,6 +24,7 @@ import type { InventoryDashboardSummary } from '../types/inventory';
|
||||
import { useSalesAnalytics } from './sales';
|
||||
import { useProcurementDashboard } from './procurement';
|
||||
import { useOrdersDashboard } from './orders';
|
||||
import { useTenantCurrency } from '../../hooks/useTenantCurrency';
|
||||
|
||||
// ============================================================================
|
||||
// Helper Functions
|
||||
@@ -355,6 +356,7 @@ export const useDepartmentPerformance = (tenantId: string, period: TimePeriod =
|
||||
const { data: inventory, isLoading: inventoryLoading } = useInventoryPerformance(tenantId);
|
||||
const { data: sales, isLoading: salesLoading } = useSalesPerformance(tenantId, period);
|
||||
const { data: procurement, isLoading: procurementLoading } = useProcurementPerformance(tenantId);
|
||||
const { currencySymbol } = useTenantCurrency();
|
||||
|
||||
// Extract primitive values before useMemo to prevent unnecessary recalculations
|
||||
const productionEfficiency = production?.efficiency || 0;
|
||||
@@ -408,7 +410,7 @@ export const useDepartmentPerformance = (tenantId: string, period: TimePeriod =
|
||||
primary_metric: {
|
||||
label: 'Ingresos totales',
|
||||
value: salesTotalRevenue,
|
||||
unit: '€',
|
||||
unit: currencySymbol,
|
||||
},
|
||||
secondary_metric: {
|
||||
label: 'Transacciones',
|
||||
@@ -418,7 +420,7 @@ export const useDepartmentPerformance = (tenantId: string, period: TimePeriod =
|
||||
tertiary_metric: {
|
||||
label: 'Valor promedio',
|
||||
value: salesAvgTransactionValue,
|
||||
unit: '€',
|
||||
unit: currencySymbol,
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user