fase 3.2: compras y proveedores (modulo skeen_compras: proveedores, ordenes de compra con recepcion total/parcial, costo promedio ponderado con lote y caducidad, pagos a proveedor, cuentas por pagar con antiguedad, reportes de compras y margen por articulo); apagado por defecto
This commit is contained in:
@@ -37,6 +37,7 @@ import {
|
||||
Layers,
|
||||
Download,
|
||||
Repeat,
|
||||
Truck,
|
||||
} from 'lucide-react';
|
||||
import { Button, Modal, Input } from './ui';
|
||||
import QuickLinksDock, { QuickLinksModePicker } from './QuickLinksDock';
|
||||
@@ -113,25 +114,32 @@ const MENU_SECTIONS = [
|
||||
];
|
||||
|
||||
const HOME_MEMBRESIA_ITEM = { label: 'Membresías', icon: Repeat, href: '/membresias' };
|
||||
const HOME_COMPRAS_ITEM = { label: 'Compras', icon: Truck, href: '/compras' };
|
||||
|
||||
export const HomeNestLayout: FC<LayoutProps> = ({ children, title: _title, subtitle: _subtitle }) => {
|
||||
const location = useLocation();
|
||||
const navigate = useNavigate();
|
||||
const { user, canSee, hasRole, logout, brand } = useAuth();
|
||||
const { term } = useGlosario();
|
||||
const { membresias: membresiasCfg } = useClinicSettings();
|
||||
const { membresias: membresiasCfg, compras: comprasCfg } = useClinicSettings();
|
||||
const topNavItems = useMemo(
|
||||
() => TOP_NAV_ITEMS.map((it) => ({ ...it, label: traducirEtiqueta(it.label, term) })),
|
||||
[term]
|
||||
);
|
||||
const menuSections = useMemo(() => {
|
||||
const base = membresiasCfg.activo
|
||||
? MENU_SECTIONS.map((s) => (s.label === 'Clínica'
|
||||
? { ...s, items: [...s.items, HOME_MEMBRESIA_ITEM] }
|
||||
: s))
|
||||
: MENU_SECTIONS;
|
||||
let base = MENU_SECTIONS;
|
||||
if (membresiasCfg.activo) {
|
||||
base = base.map((s) => (s.label === 'Clínica'
|
||||
? { ...s, items: [...s.items, HOME_MEMBRESIA_ITEM] }
|
||||
: s));
|
||||
}
|
||||
if (comprasCfg.activo) {
|
||||
base = base.map((s) => (s.label === 'Operaciones'
|
||||
? { ...s, items: [...s.items, HOME_COMPRAS_ITEM] }
|
||||
: s));
|
||||
}
|
||||
return traducirMenu(base, term);
|
||||
}, [term, membresiasCfg.activo]);
|
||||
}, [term, membresiasCfg.activo, comprasCfg.activo]);
|
||||
const [menuOpen, setMenuOpen] = useState(false);
|
||||
const [expanded, setExpanded] = useState<string[]>(['Clínica']);
|
||||
const chatUnread = useChatUnread();
|
||||
|
||||
Reference in New Issue
Block a user