white-label: brand de la clinica por configuracion (fase 1 de instancia sin branding SKEEN)
- backend: GET/PUT /skeen/frontend/v1/brand leyendo ir.config_parameter skeen.clinic.brand (JSON: nombre, logo_claro, logo_oscuro, pie) con defaults SKEEN; GET publico (el login lo necesita sin sesion), PUT admin con auditoria. frontend_users.xml: 'Administrador SKEEN' -> 'Administrador' - frontend: ClinicBrand + BRAND_DEFAULT en odoo.ts; brand y setBrand en el contexto de auth (fetch al boot + cache localStorage + document.title) - Login/layouts/mensajes/exports leen el brand en vez de strings SKEEN: Login.tsx, SkeenLayout, HomeNestLayout, Cumpleanos (wa + export), Pacientes/Ventas/Cortes/Reportes/Kpis/Alertas/AgendaPrint (titulos), useClinicaPrint (fallback nombre), Login hace GET publico al montar - Configuracion > Clinica: tarjeta 'Identidad de la clinica' (solo admin) para editar nombre/pie/logos con preview - no renombrado (invisible al usuario): rutas API /skeen/*, claves localStorage, nombres de modulos, parametros skeen.* Verificacion API: 11/11 tests OK (defaults, PUT merge, campo invalido ignorado, restore, admin neutral). Deploy: build + rsync + Odoo reiniciado
This commit is contained in:
@@ -6,6 +6,7 @@ import { ExportButton } from '../ui/ExportButton';
|
||||
import MovimientoModal from './MovimientoModal';
|
||||
import { exportToExcel } from '../../lib/exporter';
|
||||
import { odooApi, type CaducidadRow, type SugerenciaRow } from '../../services/odoo';
|
||||
import { useAuth } from '../../lib/auth';
|
||||
import type { BadgeVariant } from '../ui/Badge';
|
||||
|
||||
const fmtMoney = (n: number) =>
|
||||
@@ -18,6 +19,7 @@ const caducidadBadge = (row: CaducidadRow): { variant: BadgeVariant; label: stri
|
||||
};
|
||||
|
||||
const AlertasPanel: FC = () => {
|
||||
const { brand } = useAuth();
|
||||
const [caducidades, setCaducidades] = useState<CaducidadRow[]>([]);
|
||||
const [sugerencia, setSugerencia] = useState<SugerenciaRow[]>([]);
|
||||
const [totalSugerencia, setTotalSugerencia] = useState({ items: 0, costo_total: 0 });
|
||||
@@ -51,7 +53,7 @@ const AlertasPanel: FC = () => {
|
||||
await exportToExcel({
|
||||
filename: `sugerencia-compra-${new Date().toISOString().split('T')[0]}`,
|
||||
sheetName: 'Sugerencia de compra',
|
||||
title: 'Sugerencia de compra — inventario SKEEN',
|
||||
title: `Sugerencia de compra — inventario ${brand.nombre}`,
|
||||
subtitle: `${totalSugerencia.items} artículos bajo mínimo · costo estimado ${fmtMoney(totalSugerencia.costo_total)}`,
|
||||
columns: [
|
||||
{ header: 'Artículo', key: 'name' },
|
||||
|
||||
Reference in New Issue
Block a user