diff --git a/addons/beyond_base/static/src/webclient/beyond_panel_navbar.xml b/addons/beyond_base/static/src/webclient/beyond_panel_navbar.xml index dadfc3a..30776ea 100644 --- a/addons/beyond_base/static/src/webclient/beyond_panel_navbar.xml +++ b/addons/beyond_base/static/src/webclient/beyond_panel_navbar.xml @@ -160,9 +160,22 @@ + + + + + diff --git a/addons/beyond_expense/models/beyond_gasto_pantalla.py b/addons/beyond_expense/models/beyond_gasto_pantalla.py index c372e1d..d4d6349 100644 --- a/addons/beyond_expense/models/beyond_gasto_pantalla.py +++ b/addons/beyond_expense/models/beyond_gasto_pantalla.py @@ -8,6 +8,9 @@ distinto a la pantalla porque sale de esta misma función. """ from datetime import date, timedelta +import pytz +from babel.dates import format_date + from odoo import _, api, fields, models from odoo.exceptions import AccessError, UserError @@ -17,6 +20,14 @@ POR_PAGINA = 60 ETIQUETAS = dict(CATEGORIAS) +# El huso de la casa, el mismo que usa Inventario para el libro: una entrada +# registrada a las 18:48 en Puebla se lee «18:48», no «00:48» del día +# siguiente en UTC. +TZ_LOCAL = pytz.timezone('America/Mexico_City') + +# Lo que la tabla unificada puede enseñar: todo, o uno de los dos orígenes. +ORIGENES = ('todos', 'operacion', 'mercancia') + class BeyondGastoPantalla(models.AbstractModel): _name = 'beyond.gastos.pantalla' @@ -70,6 +81,36 @@ class BeyondGastoPantalla(models.AbstractModel): return (date(hoy.year, hoy.month, 1).isoformat(), fin.isoformat(), hoy.strftime('%Y-%m')) + @api.model + def _beyond_periodo_texto(self, filtros): + """«Septiembre 2026», «Hoy, 9 sep 2026», «2026» o «1 sep – 30 sep + 2026»: el periodo como se lee en el rótulo de la pantalla, aparte de + la etiqueta corta que ya viaja a los archivos.""" + desde, hasta, _etiqueta = self._beyond_periodo(dict(filtros or {})) + # En español siempre (regla 4 de CLAUDE.md): el idioma del usuario no + # decide cómo se lee «Septiembre 2026» en una pantalla que es toda en + # español. Con `env.lang` un usuario en en_US veía «September». + lang = 'es_MX' + desde, hasta = date.fromisoformat(desde), date.fromisoformat(hasta) + atajo = (filtros or {}).get('atajo') or 'mes' + if (filtros or {}).get('desde') and (filtros or {}).get('hasta'): + return '%s – %s' % (format_date(desde, "d MMM", locale=lang), + format_date(hasta, "d MMM y", locale=lang)) + if atajo == 'hoy': + return _('Hoy, %s') % format_date(desde, "d MMM y", locale=lang) + if atajo == 'ano': + return str(desde.year) + return format_date(desde, "LLLL y", locale=lang).capitalize() + + @api.model + def _beyond_dia_y_hora(self, momento): + """(«2026-09-08», «18:48») en hora local: las dos líneas de la + celda de fecha de una entrada de almacén.""" + if not momento: + return '', '' + local = pytz.utc.localize(momento).astimezone(TZ_LOCAL) + return local.strftime('%Y-%m-%d'), local.strftime('%H:%M') + # ── Los datos de la pantalla, de un tirón ─────────────────────────── @api.model @@ -119,8 +160,13 @@ class BeyondGastoPantalla(models.AbstractModel): groupby=['res_id'], aggregates=['__count'])} return { - 'periodo': {'desde': desde, 'hasta': hasta, 'etiqueta': etiqueta}, + 'periodo': {'desde': desde, 'hasta': hasta, 'etiqueta': etiqueta, + 'texto': self._beyond_periodo_texto(filtros)}, 'puede_elegir': self._beyond_es_director(), + # El contador del botón «Recurrentes»: los activos, que son los + # que van a volver a entrar solos. El cajón trae la lista entera. + 'recurrentes_activos': self.env['beyond.gasto.recurrente'].search_count( + [('activo', '=', True)]), 'sucursal': ({'id': sucursal.id, 'nombre': sucursal.name} if sucursal else None), 'sucursales': [{'id': b.id, 'nombre': b.name} @@ -152,6 +198,10 @@ class BeyondGastoPantalla(models.AbstractModel): @api.model def beyond_entradas_detalle(self, filtros=None): + """Las entradas del periodo. Con `solo_sin_costo` la LISTA se recorta + a las que no tienen precio —para ir a ponérselo—, pero el resumen + sigue siendo el del periodo entero: la tarjeta de arriba no cambia + por mirar un subconjunto, y el archivo baja la lista que se ve.""" filtros = dict(filtros or {}) sucursal = self._beyond_sucursal(filtros.get('branch_id')) desde, hasta = self._beyond_periodo(filtros)[:2] @@ -167,9 +217,12 @@ class BeyondGastoPantalla(models.AbstractModel): for e in entradas: con_costo = e.costo_unitario > 0 total = e.cantidad * e.costo_unitario if con_costo else None + dia, hora = self._beyond_dia_y_hora(e.fecha) filas.append({ 'id': e.id, 'fecha': fields.Datetime.to_string(e.fecha), + 'dia': dia, + 'hora': hora, 'producto': e.product_tmpl_id.name, 'sucursal': e.branch_id.name, 'cantidad': e.cantidad, @@ -184,7 +237,10 @@ class BeyondGastoPantalla(models.AbstractModel): resumen['total'] += total else: resumen['sin_costo'] += 1 + if filtros.get('solo_sin_costo'): + filas = [f for f in filas if f['costo_unitario'] is None] return {'filas': filas, 'resumen': resumen, + 'solo_sin_costo': bool(filtros.get('solo_sin_costo')), 'sucursal': sucursal.name if sucursal else None} @api.model @@ -197,7 +253,11 @@ class BeyondGastoPantalla(models.AbstractModel): etiqueta_periodo = self._beyond_periodo(dict(filtros or {}))[2] contexto = { 'encabezado': { - 'titulo': _('Beyond · Entradas de almacén'), + # Con el recorte puesto el archivo lo dice: baja la lista + # que se ve, no la del periodo entero. + 'titulo': (_('Beyond · Entradas de almacén · solo sin costo') + if datos['solo_sin_costo'] + else _('Beyond · Entradas de almacén')), 'datos': [(_('Periodo'), etiqueta_periodo), (_('Sucursal'), datos['sucursal'] or _('Toda la red'))], 'generado': self._beyond_generado(), @@ -494,13 +554,25 @@ class BeyondGastoPantalla(models.AbstractModel): dominio.append(('branch_id', '=', sucursal.id)) gastos = self.env['beyond.gasto'].search( dominio, order='fecha desc, id desc') + adjuntos = { + res_id: total for res_id, total in + self.env['ir.attachment']._read_group( + [('res_model', '=', 'beyond.gasto'), + ('res_id', 'in', gastos.ids)], + groupby=['res_id'], aggregates=['__count'])} filas = [{ 'id': g.id, 'fecha': g.fecha.isoformat(), 'concepto': g.name, 'categoria': ETIQUETAS.get(g.categoria, g.categoria), + # La clave, aparte de la etiqueta: el punto de color de la + # categoría se elige por clave, igual que la dona. + 'categoria_clave': g.categoria, 'sucursal': g.branch_id.name, + 'branch_id': g.branch_id.id, 'monto': g.monto, + 'recurrente': bool(g.recurrente_id), + 'adjuntos': adjuntos.get(g.id, 0), } for g in gastos] return {'filas': filas, 'resumen': {'total': sum(g.monto for g in gastos), @@ -556,27 +628,50 @@ class BeyondGastoPantalla(models.AbstractModel): @api.model def beyond_total_detalle(self, filtros=None): + """Operación y mercancía en UNA lista, mezcladas AQUÍ y no en el + navegador: el archivo baja la misma tabla que se ve, con el mismo + recorte por origen. Los contadores de las pastillas se cuentan + antes de recortar, para que digan cuántos hay y no cuántos se ven.""" + filtros = dict(filtros or {}) + origen = filtros.get('origen') or 'todos' + if origen not in ORIGENES: + raise UserError(_('Ese origen no existe.')) gastos = self.beyond_operacion_detalle(filtros) - entradas = self.beyond_entradas_detalle(filtros) - filas = [{ - 'id': f"g{f['id']}", 'fecha': f['fecha'], - 'origen': _('Operación'), 'concepto': f['concepto'], + entradas = self.beyond_entradas_detalle( + dict(filtros, solo_sin_costo=False)) + operacion = [{ + 'id': f"g{f['id']}", 'fecha': f['fecha'], 'hora': '', + 'origen': _('Operación'), 'origen_clave': 'operacion', + 'concepto': f['concepto'], + # La segunda línea: de qué categoría es, y si entró solo. + 'meta': (f['categoria'] + (' · ' + _('recurrente') if f['recurrente'] else '')), 'sucursal': f['sucursal'], 'monto': f['monto'], - } for f in gastos['filas']] + [{ - 'id': f"m{f['id']}", 'fecha': f['fecha'], - 'origen': _('Mercancía'), - 'concepto': _('%(producto)s · %(piezas)g pzas', - producto=f['producto'], piezas=f['cantidad']), + } for f in gastos['filas']] + mercancia = [{ + 'id': f"m{f['id']}", 'fecha': f['dia'], 'hora': f['hora'], + 'origen': _('Mercancía'), 'origen_clave': 'mercancia', + 'concepto': f['producto'], + 'meta': _('%(piezas)g pzas', piezas=f['cantidad']), 'sucursal': f['sucursal'], 'monto': f['total'], } for f in entradas['filas']] - filas.sort(key=lambda f: f['fecha'][:10], reverse=True) + conteos = {'todos': len(operacion) + len(mercancia), + 'operacion': len(operacion), 'mercancia': len(mercancia)} + filas = {'todos': operacion + mercancia, 'operacion': operacion, + 'mercancia': mercancia}[origen] + filas.sort(key=lambda f: (f['fecha'][:10], f['hora']), reverse=True) return {'filas': filas, + 'origen': origen, + 'conteos': conteos, 'resumen': { 'operacion': gastos['resumen']['total'], 'mercancia': entradas['resumen']['total'], 'total': (gastos['resumen']['total'] + entradas['resumen']['total']), 'sin_costo': entradas['resumen']['sin_costo'], + # Lo que suma LA LISTA que se ve, para su pie: con un + # origen puesto no es el total gastado. + 'listado': sum(f['monto'] or 0.0 for f in filas), + 'renglones': len(filas), }, 'sucursal': gastos['sucursal']} @@ -587,9 +682,14 @@ class BeyondGastoPantalla(models.AbstractModel): datos = self.beyond_total_detalle(filtros) resumen = datos['resumen'] etiqueta_periodo = self._beyond_periodo(dict(filtros or {}))[2] + # El archivo dice qué origen bajó: «Total gastado» a secas con la + # lista recortada a mercancía diría más de lo que trae. + titulo_origen = {'todos': _('Total gastado'), + 'operacion': _('Total gastado · solo operación'), + 'mercancia': _('Total gastado · solo mercancía')}[datos['origen']] contexto = { 'encabezado': { - 'titulo': _('Beyond · Total gastado'), + 'titulo': _('Beyond · %s') % titulo_origen, 'datos': [(_('Periodo'), etiqueta_periodo), (_('Sucursal'), datos['sucursal'] or _('Toda la red'))], 'generado': self._beyond_generado(), @@ -611,15 +711,23 @@ class BeyondGastoPantalla(models.AbstractModel): ], 'bloques': [{ 'titulo': _('Total gastado'), + # El detalle —categoría o piezas— en su propia columna, como + # la segunda línea del renglón en pantalla: pegado al + # concepto en una celda no se filtra ni se suma. 'columnas': [ {'etiqueta': _('Fecha'), 'formato': 'texto'}, {'etiqueta': _('Origen'), 'formato': 'texto'}, {'etiqueta': _('Concepto'), 'formato': 'texto'}, + {'etiqueta': _('Detalle'), 'formato': 'texto'}, {'etiqueta': _('Sucursal'), 'formato': 'texto'}, {'etiqueta': _('Monto'), 'formato': 'texto'}, ], 'filas': [[ - f['fecha'][:16], f['origen'], f['concepto'], f['sucursal'], + (f['fecha'] + (' ' + f['hora'] if f['hora'] else '')), + f['origen'], + f['concepto'], + f['meta'], + f['sucursal'], (f"${f['monto']:,.2f}" if f['monto'] is not None else _('sin costo registrado')), ] for f in datos['filas']], diff --git a/addons/beyond_expense/static/src/gastos/gastos.js b/addons/beyond_expense/static/src/gastos/gastos.js index 90ea076..a6e2975 100644 --- a/addons/beyond_expense/static/src/gastos/gastos.js +++ b/addons/beyond_expense/static/src/gastos/gastos.js @@ -10,10 +10,15 @@ const ESPERA_BUSQUEDA = 250; // Un color por categoría, fijo por CLAVE y no por orden: filtrar no puede // recolorear la dona (la lección de ADR-020). La mercancía lleva el suyo. +// La paleta es la del diseño de Gastos (09-sep-2026): el naranja de la +// casa para la renta —lo que más pesa—, el turquesa para servicios y +// mantenimiento, gris para «otro» y la tinta para la mercancía. Son +// colores de DATOS y viven aquí, no en el SCSS: la dona los pinta con +// atributos de SVG y la leyenda los repite por renglón. const COLORES = { - renta: "#0F6B5C", servicios: "#2E9B8B", insumos: "#7FB8AC", - mantenimiento: "#C97B3D", publicidad: "#8B6BB8", otro: "#9AA6A0", - mercancia: "#4A453E", + renta: "#C55A22", servicios: "#1E9FA8", insumos: "#7FB8AC", + mantenimiento: "#12666D", publicidad: "#8B6BB8", otro: "#B5AEA3", + mercancia: "#23201D", }; /** @@ -46,6 +51,8 @@ export class BeyondGastos extends Component { detalle: null, // null | 'operacion' | 'total' | 'mercancia' detalleDatos: null, // lo que el detalle abierto cargó vistaMercancia: "entradas", + origenUnificado: "todos", // la pastilla puesta en la unificada + soloSinCosto: false, // entradas: mirar solo las sin precio filtrosRec: { branch_id: false, categoria: "", diaDesde: "", diaHasta: "" }, nuevoRecurrente: null, guardando: false, @@ -82,20 +89,72 @@ export class BeyondGastos extends Component { ? "beyond_mercancia_detalle" : "beyond_entradas_detalle", }[this.state.detalle]; this.state.detalleDatos = await this.orm.call( - "beyond.gastos.pantalla", metodo, [{ ...this.state.filtros }]); + "beyond.gastos.pantalla", metodo, [this.filtrosDetalle]); } - async abrirDetalle(tipo) { + /** + * Los filtros de la pantalla MÁS los del detalle abierto —el origen de + * la unificada, el «solo sin costo» de las entradas—, en un solo sitio: + * la carga y la descarga los mandan iguales, que es lo que hace que el + * archivo baje la tabla que se está viendo. + */ + get filtrosDetalle() { + return { + ...this.state.filtros, + origen: this.state.origenUnificado, + solo_sin_costo: this.state.soloSinCosto, + }; + } + + async abrirDetalle(tipo, opciones = {}) { this.state.detalle = tipo; this.state.vistaMercancia = "entradas"; + this.state.origenUnificado = "todos"; + this.state.soloSinCosto = Boolean(opciones.soloSinCosto); await this.cargarDetalle(); } + /** Todos · Operación · Mercancía: el recorte lo hace el servidor. */ + async cambiarOrigen(origen) { + this.state.origenUnificado = origen; + await this.cargarDetalle(); + } + + /** «N sin costo» es un botón: se pica y la lista se queda con ellas, + * para ir a ponerles precio. Otra vez, y vuelven todas. */ + async alternarSoloSinCosto() { + this.state.soloSinCosto = !this.state.soloSinCosto; + await this.cargarDetalle(); + } + + /** El «revisar» de la unificada: a las entradas, ya recortadas. */ + async revisarSinCosto() { + await this.abrirDetalle("mercancia", { soloSinCosto: true }); + } + async cambiarVistaMercancia(vista) { this.state.vistaMercancia = vista; + this.state.soloSinCosto = false; await this.cargarDetalle(); } + /** «Toda la red», o la plaza que se está mirando. */ + get alcance() { + return this.state.datos?.sucursal?.nombre || _t("Toda la red"); + } + + /** El punto de color de una categoría, por su clave. */ + puntoDe(clave) { + return `background: ${this.color(clave)}`; + } + + /** La etiqueta de una categoría, para el cajón: el searchRead trae la + * clave y la lista de la pantalla ya tiene cómo se lee. */ + etiquetaCategoria(clave) { + return (this.state.datos?.categorias || []) + .find((c) => c.clave === clave)?.etiqueta || clave; + } + cerrarDetalle() { this.state.detalle = null; this.state.detalleDatos = null; @@ -422,6 +481,16 @@ export class BeyondGastos extends Component { && (!f.diaHasta || r.dia <= parseInt(f.diaHasta))); } + /** Lo que dice la cabecera del cajón: cuántos van a entrar solos y + * cuánto suman, sobre lo que se está mirando. */ + get resumenRecurrentes() { + const activos = this.recurrentesFiltrados.filter((r) => r.activo); + return { + activos: activos.length, + alMes: activos.reduce((suma, r) => suma + r.monto, 0), + }; + } + prepararRecurrente() { this.state.nuevoRecurrente = { name: "", monto: "", dia: 1, categoria: "renta", @@ -487,7 +556,7 @@ export class BeyondGastos extends Component { }[this.state.detalle] || "beyond_descargar"; await this.bajarArchivo(await this.orm.call( "beyond.gastos.pantalla", metodo, - [formato, { ...this.state.filtros }])); + [formato, this.filtrosDetalle])); } finally { this.state.descargando = false; } diff --git a/addons/beyond_expense/static/src/gastos/gastos.scss b/addons/beyond_expense/static/src/gastos/gastos.scss index fd3dfd6..18a50f3 100644 --- a/addons/beyond_expense/static/src/gastos/gastos.scss +++ b/addons/beyond_expense/static/src/gastos/gastos.scss @@ -1,348 +1,416 @@ /* Part of Beyond. Collina Systems proprietary module. - La pantalla de Gastos: misma familia visual que Inventario y el - Histórico — tarjetas blancas, línea suave, verde de la casa. */ + La pantalla de Gastos con la forma del diseño (09-sep-2026): el naranja + de la casa como acento —era verde—, tarjetas de 26 px, y las tablas como + rejillas, igual que Inventario. */ -$gastos-linea: #F3F1EB; -$gastos-tinta: #23201D; -$gastos-tinta-suave: #6E6A63; -$gastos-verde: #0F6B5C; -$gastos-fondo: #FAF9F7; +// Lo que YA es token se usa como token: $beyond-panel-acento (#C55A22) y +// su -hover/-pressed, $beyond-panel-durazno (#F6E7DC), $beyond-panel-rojo, +// $beyond-panel-tarjeta, $beyond-surface y familia, $beyond-ink y familia. +// Lo de aquí abajo es local de esta pantalla, con su porqué. + +// Turquesa: la MERCANCÍA. El origen que no es un gasto capturado sino lo +// que entró al almacén, y por eso lleva otro color que el naranja. +$gastos-turquesa: #1E9FA8; // el punto y la dona +$gastos-turquesa-tinta: #12666D; // texto sobre su tinte, y las cifras +$gastos-turquesa-tinte: #E6F1F2; // el chip y la pastilla +$gastos-turquesa-linea: #CFE3E5; // su borde + +// Ámbar: «sin costo registrado» es un aviso, no un error (ADR-029). +$gastos-ambar: #9A7420; // el triángulo y el texto de la celda +$gastos-ambar-tinta: #6B5214; // texto del aviso +$gastos-ambar-tinte: #FBF3E2; // fondo del aviso +$gastos-ambar-puesto: #F3E4C4; // el aviso cuando ES el filtro +$gastos-ambar-linea: #EBDCBB; // su borde +$gastos-ambar-renglon: #FDFAF2; // el renglón sin costo, apenas teñido + +// Verde del icono de Excel: la marca del formato, no un color de la casa. +$gastos-verde-excel: #1F8A5B; + +// Piezas del lienzo. +$gastos-linea: #E9E5DC; // borde de campos y píldoras +$gastos-renglon: #F1EEE6; // línea entre renglones +$gastos-renglon-hover: #FBF4EE; // renglón bajo el cursor +$gastos-durazno-linea: #EFD6C3; // borde del chip de operación +$gastos-tinta-tenue: #B5AEA3; // la hora, el placeholder + +// Las retículas, declaradas UNA vez cada una: encabezado, renglones y pie +// son rejillas hermanas y se desalinean si cada quien trae la suya. +$gastos-cols-lista: 130px minmax(200px, 2fr) minmax(130px, 1fr) minmax(130px, 1fr) 150px 44px; +$gastos-cols-operacion: 118px minmax(0, 2.2fr) minmax(0, 1fr) minmax(0, 1fr) 120px; +$gastos-cols-unificada: 118px 128px minmax(0, 2.2fr) minmax(0, 1fr) 120px; +$gastos-cols-entradas: 112px minmax(0, 2fr) minmax(0, 1fr) 74px 96px 110px minmax(0, 1fr) minmax(0, 1.1fr); +$gastos-cols-margen: 118px 96px minmax(0, 2fr) minmax(0, 1fr) 70px 100px 100px 130px; .o_beyond_gastos { - background: $gastos-fondo; + background: $beyond-surface; // `.o_action` de Odoo es height:100% + overflow:hidden: el que desplaza // es ESTE contenedor (misma lección que Inventario). Sin esto, la lista // se recorta y la rueda no llega — «que deje desplazar» (7-sep). height: 100%; overflow-y: auto; + color: $beyond-ink; .beyond_gastos_eje { - max-width: 1180px; + max-width: 1560px; margin: 0 auto; - padding: 18px 20px 40px; + padding: 18px 28px 40px; display: flex; flex-direction: column; - gap: 16px; - } - - .beyond_gastos_encabezado { - display: flex; - align-items: center; - gap: 10px; - } - .beyond_gastos_titulo { font-size: 22px; font-weight: 800; color: $gastos-tinta; } - .beyond_gastos_relleno { flex: 1; } - - .beyond_gastos_nuevo { - background: $gastos-verde; - color: #fff; - border-radius: 10px; - padding: 10px 16px; - font-weight: 700; - &:disabled { opacity: 0.5; } - &:hover { color: #fff; filter: brightness(1.05); } - } - .beyond_gastos_secundario { - border: 1px solid $gastos-linea; - background: #fff; - border-radius: 10px; - padding: 10px 14px; - &.beyond_activa { border-color: $gastos-verde; color: $gastos-verde; } - } - .beyond_gastos_peligro { - border: 1px solid #E8D5D2; - color: #9C0006; - background: #fff; - border-radius: 10px; - } - - // ── Filtros a la vista ─────────────────────────────────────────── - .beyond_gastos_filtros { - display: flex; - flex-wrap: wrap; gap: 18px; - background: #fff; - border: 1px solid $gastos-linea; - border-radius: 14px; - padding: 14px 16px; - - .beyond_gastos_buscador { flex: 1; min-width: 180px; } } + + // ── Piezas que se repiten ─────────────────────────────────────────── + .beyond_gastos_relleno { flex: 1; } + .beyond_num { text-align: right; font-variant-numeric: tabular-nums; } + .beyond_gastos_acento { color: $beyond-panel-acento; } + .beyond_gastos_turquesa { color: $gastos-turquesa-tinta; } + .beyond_gastos_suave { color: $beyond-ink-soft; font-weight: 700; } + + .beyond_gastos_pila { + display: flex; + flex-direction: column; + gap: 1px; + min-width: 0; + } + + // El rótulo en versalita: de dónde y de cuándo es lo que se mira. + .beyond_gastos_rotulo { + font-size: 11px; + font-weight: 800; + letter-spacing: .1em; + text-transform: uppercase; + color: $beyond-ink-muted; + white-space: nowrap; + } + .beyond_gastos_etiqueta { display: block; font-size: 11px; - font-weight: 700; - text-transform: uppercase; - letter-spacing: 0.04em; - color: $gastos-tinta-suave; - margin-bottom: 6px; - } - .beyond_gastos_pastillas { display: flex; gap: 6px; } - .beyond_gastos_pastilla { - border: 1px solid $gastos-linea; - background: #fff; - border-radius: 999px; - padding: 8px 14px; - &.beyond_activa { - background: $gastos-verde; - border-color: $gastos-verde; - color: #fff; - } - } - .beyond_gastos_fechas { display: flex; gap: 8px; } - .beyond_gastos_campo { - border: 1px solid $gastos-linea; - border-radius: 10px; - padding: 8px 10px; - background: #fff; - width: 100%; - } - - // ── Cifras ─────────────────────────────────────────────────────── - .beyond_gastos_cifras { - display: grid; - grid-template-columns: repeat(3, 1fr); - gap: 14px; - @media (max-width: 800px) { grid-template-columns: 1fr; } - } - .beyond_gastos_cifra { - background: #fff; - border: 1px solid $gastos-linea; - border-radius: 14px; - padding: 16px 18px; - display: flex; - flex-direction: column; - gap: 4px; - } - .beyond_gastos_cifra_titulo { - font-size: 12px; - font-weight: 700; - text-transform: uppercase; - letter-spacing: 0.04em; - color: $gastos-tinta-suave; - } - .beyond_gastos_cifra_valor { font-size: 26px; font-weight: 800; color: $gastos-tinta; } - .beyond_gastos_cifra_pie { font-size: 12px; color: $gastos-tinta-suave; } - - // ── Bloques (dona, lista, recurrentes) ─────────────────────────── - .beyond_gastos_bloque { - background: #fff; - border: 1px solid $gastos-linea; - border-radius: 14px; - padding: 16px 18px; - position: relative; - } - .beyond_gastos_bloque_titulo { font-weight: 800; color: $gastos-tinta; } - .beyond_gastos_bloque_sub { color: $gastos-tinta-suave; font-size: 13px; margin-left: 8px; } - .beyond_gastos_bloque_encabezado { - display: flex; - align-items: center; - gap: 8px; - margin-bottom: 12px; - .beyond_gastos_secundario { margin-left: auto; } - } - - .beyond_gastos_dona { - width: 100%; - max-height: 320px; - display: block; - } - .beyond_gastos_dona_nombre { font-size: 15px; font-weight: 700; fill: $gastos-tinta; } - .beyond_gastos_dona_monto { font-size: 13px; fill: $gastos-tinta-suave; } - .beyond_gastos_dona_total { font-size: 26px; font-weight: 800; fill: $gastos-tinta; } - .beyond_gastos_dona_leyenda { font-size: 12px; fill: $gastos-tinta-suave; } - - // ── La lista ───────────────────────────────────────────────────── - .beyond_gastos_tabla { - width: 100%; - border-collapse: collapse; - - th { - text-align: left; - font-size: 12px; - text-transform: uppercase; - letter-spacing: 0.03em; - color: $gastos-tinta-suave; - padding: 8px 10px; - border-bottom: 1px solid $gastos-linea; - cursor: pointer; - user-select: none; - white-space: nowrap; - i { margin-left: 4px; } - &.beyond_ordenada { color: $gastos-verde; } - } - td { padding: 10px; border-bottom: 1px solid $gastos-linea; } - .beyond_num { text-align: right; font-variant-numeric: tabular-nums; } - } - .beyond_gastos_grupo td { - background: $gastos-fondo; font-weight: 800; - color: $gastos-tinta; + letter-spacing: .1em; + text-transform: uppercase; + color: $beyond-ink-muted; + margin: 0; } - .beyond_gastos_fila { cursor: pointer; } - .beyond_gastos_fila:hover td { background: #FBFAF8; } - .beyond_gastos_marca { margin-left: 6px; color: $gastos-tinta-suave; font-size: 12px; } - .beyond_gastos_clip { width: 34px; text-align: center; color: $gastos-tinta-suave; } - .beyond_gastos_paginador { + .beyond_gastos_icono_excel { color: $gastos-verde-excel; } + .beyond_gastos_icono_pdf { color: $beyond-panel-rojo; } + + // ── Encabezado ────────────────────────────────────────────────────── + .beyond_gastos_encabezado { display: flex; align-items: center; - justify-content: flex-end; - gap: 8px; - padding-top: 10px; - color: $gastos-tinta-suave; - .btn { border: 1px solid $gastos-linea; } + gap: 16px; + flex-wrap: wrap; } - // ── Recurrentes ────────────────────────────────────────────────── - .beyond_gastos_recurrente, - .beyond_gastos_recurrente_alta { - display: grid; - grid-template-columns: 2fr 1fr 0.8fr 1fr auto; - gap: 10px; + .beyond_gastos_insignia { + flex: none; + width: 46px; + height: 46px; + border-radius: 14px; + background: $beyond-panel-durazno; + color: $beyond-panel-acento; + display: flex; align-items: center; - padding: 9px 4px; - border-top: 1px solid $gastos-linea; + justify-content: center; } - .beyond_gastos_recurrente_alta { grid-template-columns: 2fr 1fr 0.9fr 1.2fr 1.2fr auto; } - .beyond_gastos_recurrente.beyond_apagado { opacity: 0.45; } - // ── El panel corto ─────────────────────────────────────────────── - .beyond_gastos_velo { - position: fixed; - inset: 0; - background: rgba(35, 32, 29, 0.35); - z-index: 90; + // El billete relleno: el hueco y los puntos van en blanco sobre el + // naranja, y el naranja lo pone `currentColor` de quien lo contenga. + .beyond_gastos_insignia_hueco { fill: $beyond-panel-tarjeta; } + .beyond_gastos_insignia_puntos { stroke: $beyond-panel-tarjeta; } + + .beyond_gastos_titulo { + font-size: 26px; + font-weight: 800; + letter-spacing: -.02em; + line-height: 1.1; } - .beyond_gastos_panel { - position: fixed; - top: 0; - right: 0; - bottom: 0; - width: 400px; - max-width: 92vw; - background: #fff; - z-index: 91; - padding: 18px 20px; + + .beyond_gastos_secundario { + all: unset; + cursor: pointer; + box-sizing: border-box; + display: inline-flex; + align-items: center; + gap: 8px; + padding: 11px 18px; + border-radius: 999px; + background: $beyond-panel-tarjeta; + border: 1px solid $beyond-surface-active; + color: $beyond-ink; + font-size: 14px; + font-weight: 800; + white-space: nowrap; + transition: background 140ms ease; + + &:hover, &:focus-visible { background: $beyond-surface-hover; } + &:disabled { cursor: default; opacity: .55; } + &.beyond_activa { border-color: $beyond-panel-acento; } + } + + // Recurrentes va en gris relleno, con su contador en naranja. + .beyond_gastos_recurrentes_btn { + background: $beyond-surface-hover; + border-color: $beyond-surface-hover; + + &:hover, &:focus-visible { background: $beyond-surface-active; } + } + + .beyond_gastos_contador { + font-size: 11.5px; + font-weight: 800; + color: $beyond-panel-acento; + background: $beyond-panel-tarjeta; + border-radius: 999px; + padding: 2px 8px; + } + + .beyond_gastos_secundario_gris { + background: $beyond-surface-hover; + border-color: $beyond-surface-hover; + padding: 12px 22px; + + &:hover, &:focus-visible { background: $beyond-surface-active; } + } + + .beyond_gastos_secundario_chico { padding: 10px 16px; font-size: 13.5px; gap: 7px; } + + .beyond_gastos_nuevo { + all: unset; + cursor: pointer; + box-sizing: border-box; + display: inline-flex; + align-items: center; + gap: 9px; + padding: 12px 24px; + border-radius: 999px; + background: $beyond-panel-acento; + color: $beyond-panel-tarjeta; + font-size: 14.5px; + font-weight: 800; + white-space: nowrap; + transition: background 140ms ease; + + &:hover, &:focus-visible { background: $beyond-panel-acento-hover; } + &:active { background: $beyond-panel-acento-pressed; } + &:disabled { cursor: default; background: $beyond-surface-active; color: $beyond-ink-muted; } + } + + .beyond_gastos_nuevo_chico { padding: 11px 20px; font-size: 14px; } + + .beyond_gastos_peligro { + all: unset; + cursor: pointer; + box-sizing: border-box; + width: 44px; + height: 44px; + border-radius: 999px; + border: 1.5px solid $beyond-panel-rojo-suave; + color: $beyond-panel-rojo; + display: flex; + align-items: center; + justify-content: center; + transition: background 140ms ease, border-color 140ms ease; + + &:hover, &:focus-visible { background: $beyond-panel-rojo-suave; border-color: $beyond-panel-rojo; } + } + + // ── Filtros a la vista ────────────────────────────────────────────── + .beyond_gastos_filtros { + display: flex; + align-items: flex-end; + flex-wrap: wrap; + gap: 18px 22px; + background: $beyond-panel-tarjeta; + border: 1px solid $beyond-surface-active; + border-radius: 26px; + padding: 20px 24px; + } + + .beyond_gastos_filtro { display: flex; flex-direction: column; gap: 8px; - overflow-y: auto; - box-shadow: -12px 0 30px rgba(35, 32, 29, 0.12); + min-width: 0; } - .beyond_gastos_panel_encabezado { - display: flex; - align-items: center; - justify-content: space-between; - font-size: 17px; - margin-bottom: 6px; + + // El buscador va solo en su renglón: a lo ancho, que es donde se teclea. + .beyond_gastos_buscador { flex: 1 1 100%; } + + .beyond_gastos_pastillas { display: flex; gap: 8px; } + + .beyond_gastos_pastilla { + all: unset; + cursor: pointer; + box-sizing: border-box; + padding: 10px 20px; + border-radius: 999px; + font-size: 14px; + font-weight: 800; + background: $beyond-panel-tarjeta; + border: 1.5px solid $beyond-surface-active; + color: $beyond-ink; + white-space: nowrap; + transition: background 140ms ease, color 140ms ease, border-color 140ms ease; + + &.beyond_activa { + background: $beyond-panel-acento; + border-color: $beyond-panel-acento; + color: $beyond-panel-tarjeta; + } } - .beyond_gastos_panel_acciones { - display: flex; - gap: 8px; - margin-top: 14px; - } - .beyond_gastos_adjunto { - display: flex; - align-items: center; - justify-content: space-between; - gap: 8px; + + .beyond_gastos_fechas { display: flex; align-items: center; gap: 8px; } + .beyond_gastos_fechas_flecha { font-size: 13px; font-weight: 800; color: $gastos-tinta-tenue; } + + .beyond_gastos_campo { + all: unset; + box-sizing: border-box; + background: $beyond-surface; border: 1px solid $gastos-linea; - border-radius: 8px; - padding: 6px 10px; - } - .beyond_gastos_nota { color: $gastos-tinta-suave; font-size: 12px; } + border-radius: 999px; + padding: 10px 16px; + font-size: 14px; + font-weight: 700; + color: $beyond-ink; + min-width: 0; - .beyond_gastos_vacio { - text-align: center; - color: $gastos-tinta-suave; - padding: 26px 10px; + &::placeholder { color: $gastos-tinta-tenue; font-weight: 600; } + } + + input[type="date"].beyond_gastos_campo { width: 172px; } + + select.beyond_gastos_campo { + cursor: pointer; + padding-right: 38px; + min-width: 170px; + } + + // Sucursal y categoría, en durazno con su tinta: son los que acotan. + .beyond_gastos_elegido { + background: $beyond-panel-durazno; + border-color: $beyond-panel-acento; + color: $beyond-panel-acento-pressed; + } + + .beyond_gastos_busqueda { display: flex; - flex-direction: column; - gap: 4px; - i { font-size: 22px; } - } -} + align-items: center; + gap: 10px; + width: 100%; + color: $beyond-ink-muted; - .beyond_gastos_repetir { - display: flex; - gap: 8px; - align-items: baseline; - margin-top: 6px; - input { width: 18px; height: 18px; } + input { + all: unset; + flex: 1; + min-width: 0; + font-size: 14px; + font-weight: 700; + color: $beyond-ink; + + &::placeholder { color: $gastos-tinta-tenue; font-weight: 600; } + } } - // Cifras y dona en UN renglón bajo: la tabla arranca a la vista - // (6-sep, reportado dos veces: «no se ven los gastos»). + // ── Las tres tarjetas y la dona ───────────────────────────────────── + // Tres tarjetas iguales y la dona más ancha: el diseño las hace iguales, + // pero sus categorías se llaman «Renta» y «Otro», y las de esta casa + // «Servicios (luz, agua, internet…)». Con la cuarta columna al ancho de + // las otras, la leyenda cortaba «Mantenimiento» y «Mercancía» en «M…». .beyond_gastos_mirador { display: grid; - grid-template-columns: repeat(3, minmax(150px, 1fr)) minmax(0, 1.7fr); - gap: 12px; + grid-template-columns: repeat(3, minmax(210px, 1fr)) minmax(300px, 1.5fr); + gap: 18px; align-items: stretch; - @media (max-width: 1000px) { grid-template-columns: 1fr 1fr; } - .beyond_gastos_cifras { display: contents; } - .beyond_gastos_cifra { padding: 12px 14px; } - .beyond_gastos_cifra_valor { font-size: 21px; } - .beyond_gastos_cifra_pie { font-size: 11px; } - .beyond_gastos_dona_bloque { margin: 0; padding: 8px 12px; } - .beyond_gastos_dona { max-height: 150px; } - .beyond_gastos_bloque_titulo { font-size: 13px; } + @media (max-width: 1100px) { grid-template-columns: repeat(2, minmax(0, 1fr)); } + @media (max-width: 640px) { grid-template-columns: minmax(0, 1fr); } } - .beyond_gastos_recurrentes { width: 620px; max-width: 96vw; } - .beyond_gastos_filtros { padding: 10px 14px; row-gap: 8px; } - .beyond_gastos_tabla_barra { + + .beyond_gastos_cifra { + box-sizing: border-box; + border-radius: 26px; + padding: 22px 24px; display: flex; + flex-direction: column; gap: 6px; - margin-bottom: 10px; + background: $beyond-panel-tarjeta; + border: 1.5px solid $beyond-surface-active; + transition: background 140ms ease, border-color 140ms ease; } - .beyond_gastos_rec_filtros { - display: flex; - flex-wrap: wrap; - gap: 8px; - align-items: center; - padding-bottom: 10px; - border-bottom: 1px solid $gastos-linea; - margin-bottom: 4px; - select { width: auto; } - } - .beyond_gastos_rec_dias { - display: flex; - align-items: center; - gap: 6px; - } - - // El detalle de Mercancía: margen por venta (7-sep). + // Cada tarjeta ES una puerta a su detalle, y se ve elegida mientras el + // detalle está abierto: durazno y borde naranja, como los chips. .beyond_gastos_cifra_puerta { cursor: pointer; - &:hover { border-color: $gastos-verde; } - } - .beyond_gastos_cifra_mas { - font-size: 12px; - color: $gastos-verde; - font-weight: 700; - } - .beyond_volver_gastos { - border: 1px solid $gastos-linea; - background: #fff; - border-radius: 999px; - padding: 6px 12px; - } - .beyond_gastos_margen_resumen { - display: flex; - flex-wrap: wrap; - gap: 18px; - padding: 10px 0 14px; - color: $gastos-tinta; - } - .beyond_gastos_sin_costo_chip, - .beyond_gastos_sin_costo_celda { - color: #8a6d1a; - font-style: italic; - } - .beyond_gastos_sin_costo_celda { text-align: center; } + &:hover { border-color: $beyond-panel-anillo; } + + &.beyond_activa { + background: $beyond-panel-durazno; + border-color: $beyond-panel-acento; + + .beyond_gastos_cifra_titulo { color: $beyond-panel-acento-pressed; } + .beyond_gastos_cifra_pie { color: $beyond-panel-acento-pressed; } + .beyond_gastos_cifra_mas { color: $beyond-panel-acento-pressed; } + } + } + + .beyond_gastos_cifra_cabeza { + display: flex; + align-items: center; + gap: 10px; + color: $beyond-panel-acento; + } + + .beyond_gastos_cifra_titulo { + font-size: 11px; + font-weight: 800; + letter-spacing: .1em; + text-transform: uppercase; + color: $beyond-ink-muted; + } + + .beyond_gastos_cifra_valor { + font-size: 32px; + font-weight: 800; + letter-spacing: -.03em; + line-height: 1.1; + font-variant-numeric: tabular-nums; + } + + .beyond_gastos_cifra_pie { + font-size: 13px; + font-weight: 700; + color: $beyond-ink-softer; + } + + .beyond_gastos_cifra_mas { + margin-top: 6px; + align-self: flex-start; + font-size: 13.5px; + font-weight: 800; + color: $beyond-panel-acento; + } + + .beyond_gastos_bloque { + box-sizing: border-box; + background: $beyond-panel-tarjeta; + border: 1px solid $beyond-surface-active; + border-radius: 26px; + padding: 22px 24px; + display: flex; + flex-direction: column; + gap: 14px; + } + + .beyond_gastos_bloque_titulo { + font-size: 15px; + font-weight: 800; + letter-spacing: -.01em; + } // La dona con su leyenda de texto al lado (7-sep): las rebanadas // chicas no tienen dónde escribir su nombre en el lienzo. @@ -350,33 +418,991 @@ $gastos-fondo: #FAF9F7; display: flex; align-items: center; gap: 14px; - .beyond_gastos_dona { flex: 0 0 46%; } + flex-wrap: wrap; } + + // 104 px, los del diseño: a este tamaño la dona y su leyenda caben + // lado a lado en una tarjeta de cuatro por fila, y la tarjeta no se + // alarga con cada categoría que aparezca. + .beyond_gastos_dona { + flex: none; + width: 104px; + height: 104px; + display: block; + } + + .beyond_gastos_dona_total { + font-size: 28px; + font-weight: 800; + letter-spacing: -.01em; + fill: $beyond-ink; + } + + .beyond_gastos_dona_leyenda { + font-size: 20px; + font-weight: 800; + letter-spacing: .08em; + fill: $beyond-ink-muted; + } + .beyond_gastos_dona_lista { flex: 1; - min-width: 0; + min-width: 120px; display: flex; flex-direction: column; gap: 6px; - font-size: 13px; + font-size: 12.5px; } + .beyond_gastos_dona_item { display: flex; align-items: center; gap: 8px; + i { + flex: none; width: 10px; height: 10px; - border-radius: 3px; - flex: none; + border-radius: 999px; } + .beyond_gastos_dona_nombre { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; - font-weight: 700; + font-weight: 800; + } + + .beyond_gastos_dona_monto { font-weight: 700; color: $beyond-ink-soft; font-variant-numeric: tabular-nums; } + + .beyond_gastos_dona_pct { + width: 42px; + text-align: right; + font-size: 12px; + font-weight: 800; + color: $beyond-ink-muted; } - .beyond_gastos_dona_pct { color: $gastos-tinta-suave; } } + + .beyond_gastos_dona_vacia { font-size: 13px; font-weight: 700; color: $beyond-ink-muted; } + + // ── Las rejillas: encabezado, renglones y pie, hermanas ───────────── + .beyond_gastos_tabla, + .beyond_gastos_detalle { + padding: 0; + gap: 0; + overflow: hidden; + } + + .beyond_gastos_rejilla { + display: grid; + align-items: center; + gap: 12px; + padding: 12px 24px; + box-sizing: border-box; + } + + .beyond_gastos_rejilla_lista { grid-template-columns: $gastos-cols-lista; } + .beyond_gastos_rejilla_operacion { grid-template-columns: $gastos-cols-operacion; } + .beyond_gastos_rejilla_unificada { grid-template-columns: $gastos-cols-unificada; } + .beyond_gastos_rejilla_entradas { grid-template-columns: $gastos-cols-entradas; } + .beyond_gastos_rejilla_margen { grid-template-columns: $gastos-cols-margen; } + + .beyond_gastos_eje_columnas { + padding: 16px 24px 12px; + border-bottom: 1px solid $beyond-surface-hover; + + > * { + font-size: 11px; + font-weight: 800; + letter-spacing: .1em; + text-transform: uppercase; + color: $beyond-ink-muted; + white-space: nowrap; + } + } + + // Las columnas de la lista se pican para ordenar; la puesta va en + // naranja con su flecha. + .beyond_gastos_columna { + all: unset; + cursor: pointer; + display: inline-flex; + align-items: center; + gap: 6px; + font-size: 11px; + font-weight: 800; + letter-spacing: .1em; + text-transform: uppercase; + color: $beyond-ink-muted; + user-select: none; + + &.beyond_num { justify-self: end; } + &.beyond_ordenada { color: $beyond-panel-acento; } + } + + .beyond_gastos_renglon { + border-bottom: 1px solid $gastos-renglon; + transition: background 120ms ease; + min-height: 58px; + } + + .beyond_gastos_fila { cursor: pointer; } + .beyond_gastos_fila:hover, + .beyond_gastos_renglon_abierto { background: $gastos-renglon-hover; } + + .beyond_gastos_renglon_sin_costo { background: $gastos-ambar-renglon; } + + // El grupo del mes: su nombre, cuántos y cuánto. + .beyond_gastos_grupo { + display: flex; + align-items: baseline; + gap: 12px; + padding: 12px 24px; + background: $beyond-surface; + border-bottom: 1px solid $beyond-surface-hover; + } + + .beyond_gastos_grupo_mes { font-size: 14px; font-weight: 800; text-transform: capitalize; } + .beyond_gastos_grupo_cuenta { font-size: 12.5px; font-weight: 700; color: $beyond-ink-muted; } + .beyond_gastos_grupo_suma { + margin-left: auto; + font-size: 14px; + font-weight: 800; + padding-right: 56px; + font-variant-numeric: tabular-nums; + } + + .beyond_gastos_fecha { + font-size: 14px; + font-weight: 700; + color: $beyond-ink-soft; + font-variant-numeric: tabular-nums; + white-space: nowrap; + } + + // La fecha y su hora en dos renglones: el día se lee, la hora acompaña. + .beyond_gastos_cuando { display: flex; flex-direction: column; gap: 1px; min-width: 0; } + .beyond_gastos_hora { font-size: 11.5px; font-weight: 700; color: $gastos-tinta-tenue; font-variant-numeric: tabular-nums; } + + .beyond_gastos_concepto { + display: flex; + align-items: center; + gap: 8px; + min-width: 0; + } + + .beyond_gastos_concepto_dos { flex-direction: column; align-items: flex-start; gap: 2px; } + + .beyond_gastos_concepto_texto { + font-size: 14.5px; + font-weight: 800; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + min-width: 0; + } + + .beyond_gastos_concepto_meta { + font-size: 12px; + font-weight: 700; + color: $beyond-ink-muted; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + max-width: 100%; + } + + .beyond_gastos_marca_recurrente { + flex: none; + display: inline-flex; + align-items: center; + gap: 4px; + font-size: 11px; + font-weight: 800; + color: $beyond-panel-acento; + background: $beyond-panel-durazno; + border-radius: 999px; + padding: 2px 8px; + } + + .beyond_gastos_marca { font-size: 12px; font-weight: 700; color: $beyond-ink-muted; margin-left: 4px; } + + .beyond_gastos_categoria { + display: flex; + align-items: center; + gap: 8px; + min-width: 0; + font-size: 14px; + font-weight: 700; + color: $beyond-ink-soft; + + i { flex: none; width: 9px; height: 9px; border-radius: 999px; } + span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } + } + + .beyond_gastos_monto { font-size: 14.5px; font-weight: 800; } + + .beyond_gastos_clip { display: flex; justify-content: center; color: $beyond-ink-muted; } + .beyond_gastos_clip_icono { flex: none; color: $beyond-ink-muted; } + .beyond_gastos_nota_celda { font-size: 13px; font-weight: 700; color: $beyond-ink-muted; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } + + // Sin costo se DICE, nunca $0 (ADR-029): ámbar, no un número falso. + .beyond_gastos_sin_costo_celda { + font-size: 13.5px; + font-weight: 700; + font-style: italic; + color: $gastos-ambar; + white-space: nowrap; + } + + .beyond_gastos_pie { + background: $beyond-surface; + padding: 16px 24px; + + .beyond_gastos_pie_titulo { + grid-column: 1 / 4; + font-size: 12px; + font-weight: 800; + letter-spacing: .08em; + text-transform: uppercase; + color: $beyond-ink-muted; + } + + .beyond_gastos_pie_cuenta { font-size: 12.5px; font-weight: 700; color: $beyond-ink-muted; } + + .beyond_gastos_pie_total { + font-size: 17px; + font-weight: 800; + letter-spacing: -.02em; + } + } + + .beyond_gastos_paginador { + display: flex; + align-items: center; + justify-content: flex-end; + gap: 8px; + padding: 12px 24px; + font-size: 13px; + font-weight: 700; + color: $beyond-ink-muted; + } + + // Las tablas anchas se desplazan dentro de su tarjeta: la página nunca + // se mueve en horizontal. + .beyond_gastos_desplazable { overflow-x: auto; } + .beyond_gastos_rejilla_entradas { min-width: 940px; } + .beyond_gastos_rejilla_margen { min-width: 900px; } + + // ── Los detalles: la miga y lo que va a su derecha ────────────────── + .beyond_gastos_detalle_cabeza { + display: flex; + align-items: center; + gap: 14px; + padding: 20px 24px 16px; + flex-wrap: wrap; + + > .beyond_gastos_rotulo { margin-left: 4px; } + } + + .beyond_gastos_migas { + display: flex; + align-items: center; + gap: 14px; + min-width: 0; + } + + .beyond_volver_gastos { + all: unset; + cursor: pointer; + box-sizing: border-box; + display: inline-flex; + align-items: center; + gap: 8px; + padding: 10px 18px 10px 14px; + border-radius: 999px; + background: $beyond-surface; + border: 1px solid $gastos-linea; + font-size: 13.5px; + font-weight: 800; + color: $beyond-ink; + white-space: nowrap; + transition: background 140ms ease; + + &:hover, &:focus-visible { background: $beyond-surface-hover; } + } + + .beyond_gastos_detalle_titulo { + font-size: 20px; + font-weight: 800; + letter-spacing: -.02em; + line-height: 1.1; + } + + // Operación: el total y cuántos, en una píldora a la derecha. + .beyond_gastos_resumen_pildora { + margin-left: auto; + display: flex; + align-items: center; + gap: 26px; + flex-wrap: wrap; + padding: 10px 22px; + border-radius: 999px; + background: $beyond-surface; + border: 1px solid $gastos-linea; + } + + .beyond_gastos_resumen_dato { display: flex; flex-direction: column; gap: 2px; } + + .beyond_gastos_resumen_cifra { + font-size: 22px; + font-weight: 800; + letter-spacing: -.02em; + font-variant-numeric: tabular-nums; + } + + // La unificada: Todos · Operación · Mercancía con su punto y su cuenta. + .beyond_gastos_origenes { + margin-left: auto; + display: flex; + gap: 8px; + flex-wrap: wrap; + } + + .beyond_gastos_origen { + all: unset; + cursor: pointer; + box-sizing: border-box; + display: inline-flex; + align-items: center; + gap: 8px; + padding: 9px 16px; + border-radius: 999px; + font-size: 13.5px; + font-weight: 800; + background: $beyond-panel-tarjeta; + border: 1.5px solid $beyond-surface-active; + color: $beyond-ink; + transition: background 140ms ease, color 140ms ease, border-color 140ms ease; + + .beyond_gastos_origen_punto { width: 8px; height: 8px; border-radius: 999px; background: $beyond-ink; } + &.beyond_origen_operacion .beyond_gastos_origen_punto { background: $beyond-panel-acento; } + &.beyond_origen_mercancia .beyond_gastos_origen_punto { background: $gastos-turquesa; } + + .beyond_gastos_origen_cuenta { font-size: 12px; opacity: .65; } + + &.beyond_activa { + background: $beyond-ink; + border-color: $beyond-ink; + color: $beyond-panel-tarjeta; + + .beyond_gastos_origen_punto { background: $beyond-panel-tarjeta; } + } + } + + .beyond_gastos_origen_pastilla { + justify-self: start; + display: inline-flex; + align-items: center; + gap: 7px; + padding: 5px 12px 5px 10px; + border-radius: 999px; + font-size: 12.5px; + font-weight: 800; + white-space: nowrap; + + i { width: 8px; height: 8px; border-radius: 999px; } + + &.beyond_origen_operacion { + background: $beyond-panel-durazno; + color: $beyond-panel-acento-pressed; + i { background: $beyond-panel-acento; } + } + + &.beyond_origen_mercancia { + background: $gastos-turquesa-tinte; + color: $gastos-turquesa-tinta; + i { background: $gastos-turquesa; } + } + } + + // Los totales del encabezado del detalle y los avisos, en un renglón. + .beyond_gastos_totales { + display: flex; + align-items: center; + gap: 12px; + padding: 0 24px 18px; + flex-wrap: wrap; + } + + .beyond_gastos_total_chip { + box-sizing: border-box; + display: flex; + flex-direction: column; + gap: 2px; + padding: 10px 20px; + border-radius: 20px; + background: $beyond-surface; + border: 1px solid $gastos-linea; + + &.beyond_chip_operacion { + background: $beyond-panel-durazno; + border-color: $gastos-durazno-linea; + .beyond_gastos_etiqueta, .beyond_gastos_total_cifra { color: $beyond-panel-acento-pressed; } + } + + &.beyond_chip_mercancia { + background: $gastos-turquesa-tinte; + border-color: $gastos-turquesa-linea; + .beyond_gastos_etiqueta, .beyond_gastos_total_cifra { color: $gastos-turquesa-tinta; } + } + } + + .beyond_gastos_total_cifra { + font-size: 22px; + font-weight: 800; + letter-spacing: -.02em; + font-variant-numeric: tabular-nums; + } + + .beyond_gastos_metrica { + box-sizing: border-box; + min-width: 120px; + display: flex; + flex-direction: column; + gap: 3px; + padding: 12px 16px; + border-radius: 18px; + background: $beyond-panel-tarjeta; + border: 1px solid $beyond-surface-active; + } + + .beyond_gastos_metrica_cifra { + font-size: 22px; + font-weight: 800; + letter-spacing: -.02em; + font-variant-numeric: tabular-nums; + white-space: nowrap; + + .beyond_gastos_marca { font-size: 13px; } + } + + // El aviso de «sin costo»: ámbar, con su «revisar» donde hay a dónde ir. + .beyond_gastos_aviso { + display: flex; + align-items: center; + gap: 10px; + margin-left: auto; + box-sizing: border-box; + padding: 10px 16px; + background: $gastos-ambar-tinte; + border: 1.5px solid $gastos-ambar-linea; + border-radius: 16px; + color: $gastos-ambar; + + span { font-size: 13px; font-weight: 800; color: $gastos-ambar-tinta; } + } + + .beyond_gastos_aviso_boton { + all: unset; + cursor: pointer; + display: flex; + align-items: center; + gap: 10px; + box-sizing: border-box; + padding: 10px 16px; + background: $gastos-ambar-tinte; + border: 1.5px solid $gastos-ambar-linea; + border-radius: 16px; + color: $gastos-ambar; + transition: background 140ms ease; + + &.beyond_activa, &:hover { background: $gastos-ambar-puesto; } + } + + .beyond_gastos_totales .beyond_gastos_aviso_boton { margin-left: 0; } + + .beyond_gastos_aviso_liga { + all: unset; + cursor: pointer; + font-size: 13px; + font-weight: 800; + color: $gastos-ambar-tinta; + text-decoration: underline; + } + + // ── El vacío ──────────────────────────────────────────────────────── + .beyond_gastos_vacio { + padding: 40px 24px; + display: flex; + flex-direction: column; + align-items: center; + gap: 6px; + text-align: center; + + b { font-size: 15px; font-weight: 800; } + span { font-size: 13px; font-weight: 700; color: $beyond-ink-muted; } + } + + // ── Los cajones: el gasto y los recurrentes ───────────────────────── + .beyond_gastos_velo { + position: fixed; + inset: 0; + background: rgba(35, 32, 29, .32); + z-index: 90; + } + + .beyond_gastos_panel { + position: fixed; + top: 0; + right: 0; + bottom: 0; + // `width` y `max-width` separados y NO `min(440px, 100vw)`: el + // compilador de SCSS de Odoo no mezcla vw con px y tira la hoja + // ENTERA sin avisar (5-sep-2026, y otra vez el 9-sep). + width: 440px; + max-width: 100vw; + box-sizing: border-box; + background: $beyond-panel-tarjeta; + border-left: 1px solid $beyond-surface-active; + box-shadow: -24px 0 60px rgba(35, 32, 29, .12); + z-index: 91; + display: flex; + flex-direction: column; + } + + .beyond_gastos_recurrentes { width: 520px; } + + .beyond_gastos_panel_encabezado { + flex: none; + display: flex; + align-items: center; + gap: 12px; + padding: 22px 26px 16px; + } + + .beyond_gastos_panel_insignia { + flex: none; + width: 38px; + height: 38px; + border-radius: 12px; + background: $beyond-panel-durazno; + color: $beyond-panel-acento; + display: flex; + align-items: center; + justify-content: center; + } + + .beyond_gastos_panel_titulo { + font-size: 20px; + font-weight: 800; + letter-spacing: -.02em; + line-height: 1.1; + } + + .beyond_gastos_cerrar { + all: unset; + cursor: pointer; + margin-left: auto; + flex: none; + width: 36px; + height: 36px; + border-radius: 999px; + display: flex; + align-items: center; + justify-content: center; + color: $beyond-ink-softer; + transition: background 140ms ease; + + &:hover, &:focus-visible { background: $beyond-surface-hover; } + } + + .beyond_gastos_cerrar_chico { width: 30px; height: 30px; margin-left: 0; } + + .beyond_gastos_panel_cuerpo { + flex: 1; + min-height: 0; + overflow: auto; + padding: 6px 26px 20px; + display: flex; + flex-direction: column; + gap: 10px; + } + + .beyond_gastos_panel_campos { gap: 20px; } + + .beyond_gastos_panel_acciones_arriba { + flex: none; + display: flex; + align-items: center; + gap: 8px; + padding: 0 26px 16px; + flex-wrap: wrap; + } + + .beyond_gastos_nota_caja { + flex: none; + margin: 0 26px; + box-sizing: border-box; + display: flex; + gap: 10px; + align-items: flex-start; + padding: 12px 14px; + background: $beyond-surface; + border: 1px solid $gastos-linea; + border-radius: 16px; + color: $beyond-panel-acento; + + span { font-size: 13px; font-weight: 700; color: $beyond-ink-soft; line-height: 1.45; text-wrap: pretty; } + svg { flex: none; margin-top: 2px; } + } + + .beyond_gastos_rec_filtros { + flex: none; + display: flex; + align-items: center; + gap: 8px; + padding: 16px 26px 12px; + flex-wrap: wrap; + } + + .beyond_gastos_campo_chico { padding: 9px 14px; font-size: 13.5px; min-width: 0; } + + .beyond_gastos_rec_dias { + display: flex; + align-items: center; + gap: 6px; + box-sizing: border-box; + background: $beyond-surface; + border: 1px solid $gastos-linea; + border-radius: 999px; + padding: 6px 8px 6px 14px; + } + + .beyond_gastos_dia { + all: unset; + cursor: pointer; + box-sizing: border-box; + width: 44px; + text-align: center; + background: $beyond-panel-tarjeta; + border: 1px solid $beyond-surface-active; + border-radius: 999px; + padding: 4px 0; + font-size: 13.5px; + font-weight: 800; + color: $beyond-ink; + } + + .beyond_gastos_nota { font-size: 12px; font-weight: 700; color: $beyond-ink-muted; } + + .beyond_gastos_recurrente_alta { + flex: none; + margin: 0 26px 12px; + display: flex; + flex-direction: column; + gap: 8px; + padding: 14px 16px; + border: 1px solid $gastos-linea; + border-radius: 18px; + background: $beyond-surface; + + .beyond_gastos_campo { width: 100%; background: $beyond-panel-tarjeta; } + } + + .beyond_gastos_recurrente_alta_fila { + display: grid; + grid-template-columns: 1fr 1fr; + gap: 8px; + } + + // Cada recurrente es una tarjeta: el día en su cuadro, el concepto con + // su categoría y plaza, el monto con su estado, y el interruptor. + .beyond_gastos_recurrente { + box-sizing: border-box; + display: flex; + align-items: center; + gap: 14px; + padding: 14px 16px; + border: 1px solid $gastos-linea; + border-radius: 18px; + background: $beyond-panel-tarjeta; + transition: opacity 140ms ease; + + &.beyond_apagado { opacity: .62; background: $beyond-surface; } + } + + .beyond_gastos_recurrente_dia { + flex: none; + width: 46px; + height: 46px; + border-radius: 14px; + background: $beyond-surface; + border: 1px solid $gastos-linea; + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; + line-height: 1; + + span { font-size: 9px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: $beyond-ink-muted; } + b { font-size: 17px; font-weight: 800; color: $beyond-panel-acento; margin-top: 2px; } + } + + .beyond_gastos_recurrente_texto { + flex: 1; + min-width: 0; + display: flex; + flex-direction: column; + gap: 3px; + } + + .beyond_gastos_recurrente_meta { + display: flex; + align-items: center; + gap: 6px; + font-size: 12.5px; + font-weight: 700; + color: $beyond-ink-softer; + min-width: 0; + + i { flex: none; width: 8px; height: 8px; border-radius: 999px; } + span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } + } + + .beyond_gastos_punto_medio { color: $beyond-panel-anillo; } + + .beyond_gastos_recurrente_monto { + flex: none; + display: flex; + flex-direction: column; + align-items: flex-end; + gap: 3px; + + b { font-size: 15px; font-weight: 800; font-variant-numeric: tabular-nums; } + span { font-size: 11.5px; font-weight: 800; } + } + + .beyond_gastos_activo { color: $gastos-verde-excel; } + .beyond_gastos_pausado { color: $beyond-ink-muted; } + + // El interruptor: naranja puesto, gris quitado, y la perilla corre. + .beyond_gastos_interruptor { + all: unset; + cursor: pointer; + flex: none; + width: 38px; + height: 22px; + border-radius: 999px; + position: relative; + background: $beyond-panel-anillo; + transition: background 140ms ease; + + i { + position: absolute; + top: 3px; + left: 3px; + width: 16px; + height: 16px; + border-radius: 999px; + background: $beyond-panel-tarjeta; + transition: left 140ms ease; + } + + &.beyond_puesto { + background: $beyond-panel-acento; + i { left: 19px; } + } + } + + // ── El panel corto: los campos con su raya abajo ──────────────────── + .beyond_gastos_panel_campo { + display: flex; + flex-direction: column; + gap: 6px; + min-width: 0; + + .beyond_gastos_campo { + width: 100%; + background: transparent; + border: 0; + border-bottom: 1.5px solid $beyond-surface-hover; + border-radius: 0; + padding: 2px 0 8px; + font-size: 15px; + } + + select.beyond_gastos_campo { padding-right: 0; min-width: 0; } + } + + .beyond_gastos_panel_concepto .beyond_gastos_campo { + font-size: 22px; + font-weight: 800; + letter-spacing: -.02em; + border-bottom-width: 2px; + padding-bottom: 10px; + } + + .beyond_gastos_panel_rejilla { + display: grid; + grid-template-columns: repeat(2, minmax(0, 1fr)); + gap: 18px 20px; + } + + .beyond_gastos_panel_monto { + display: flex; + align-items: center; + gap: 6px; + border-bottom: 1.5px solid $beyond-surface-hover; + padding: 2px 0 8px; + + > span { font-size: 17px; font-weight: 800; } + + .beyond_gastos_campo { + flex: 1; + border: 0; + padding: 0; + font-size: 17px; + font-weight: 800; + text-align: left; + } + } + + .beyond_gastos_repetir { + display: flex; + align-items: center; + gap: 12px; + box-sizing: border-box; + padding: 12px 14px; + border-radius: 16px; + background: $beyond-surface; + border: 1px solid $gastos-linea; + cursor: pointer; + margin: 0; + + } + + // La casilla nativa vestida de interruptor (`appearance: none`): el + // control es la casilla misma, así que se toca, se enfoca y la guarda + // de alcance la encuentra donde se ve. La perilla es su ::after. + .beyond_gastos_interruptor_casilla { + appearance: none; + -webkit-appearance: none; + flex: none; + width: 38px; + height: 22px; + margin: 0; + border: 0; + border-radius: 999px; + position: relative; + background: $beyond-panel-anillo; + cursor: pointer; + transition: background 140ms ease; + + &::after { + content: ""; + position: absolute; + top: 3px; + left: 3px; + width: 16px; + height: 16px; + border-radius: 999px; + background: $beyond-panel-tarjeta; + transition: left 140ms ease; + } + + &:checked { background: $beyond-panel-acento; } + &:checked::after { left: 19px; } + &:focus-visible { outline: 2px solid $beyond-panel-acento; outline-offset: 2px; } + } + + .beyond_gastos_repetir_texto { + display: flex; + flex-direction: column; + gap: 1px; + + b { font-size: 14px; font-weight: 800; } + } + + .beyond_gastos_panel_archivos_titulo { + display: flex; + align-items: baseline; + gap: 10px; + } + + .beyond_gastos_adjunto { + box-sizing: border-box; + display: flex; + align-items: center; + gap: 12px; + padding: 10px 12px; + background: $beyond-surface; + border: 1px solid $gastos-linea; + border-radius: 14px; + + a { + flex: 1; + min-width: 0; + font-size: 14px; + font-weight: 700; + color: $beyond-ink; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + } + } + + .beyond_gastos_adjunto_tipo { + flex: none; + width: 38px; + height: 38px; + border-radius: 10px; + background: $beyond-panel-tarjeta; + border: 1px solid $beyond-surface-active; + display: flex; + align-items: center; + justify-content: center; + font-size: 10px; + font-weight: 800; + letter-spacing: .06em; + color: $beyond-panel-rojo; + } + + .beyond_gastos_subir { + box-sizing: border-box; + display: flex; + align-items: center; + justify-content: center; + gap: 9px; + padding: 14px; + border-radius: 16px; + border: 1.5px dashed $beyond-surface-active; + color: $beyond-ink-softer; + font-size: 13.5px; + font-weight: 800; + cursor: pointer; + margin: 0; + transition: background 140ms ease, color 140ms ease, border-color 140ms ease; + + &:hover { background: $beyond-panel-durazno; color: $beyond-panel-acento-pressed; border-color: $beyond-panel-acento; } + + input { display: none; } + } + + .beyond_gastos_panel_acciones { + flex: none; + box-sizing: border-box; + display: flex; + align-items: center; + gap: 10px; + padding: 16px 26px 22px; + border-top: 1px solid $gastos-linea; + background: $beyond-surface; + flex-wrap: wrap; + } + + .beyond_gastos_guardar { padding: 12px 28px; font-size: 15px; } +} diff --git a/addons/beyond_expense/static/src/gastos/gastos.xml b/addons/beyond_expense/static/src/gastos/gastos.xml index e413266..b39456f 100644 --- a/addons/beyond_expense/static/src/gastos/gastos.xml +++ b/addons/beyond_expense/static/src/gastos/gastos.xml @@ -1,37 +1,65 @@ + - + +
- Gastos + + + +
+ + · + + Gastos +
- - - -
-
+
-
+
+ →
-
+
-
-
+
-
-
+
- +
+ + +
- +
-
- Total gastado +
+ + Total gastado +
- + + · movimientos + ver tabla unificada →
- Operación +
+ + Operación +
gastos capturados ver gastos →
-
- Mercancía +
+ + Mercancía +
entradas de inventario con costo - - ver entradas de almacén → - + ver entradas de almacén →
-
- -
- ¿En qué se fue? -
- - - - - - - - total - - -
-
- - - - + +
+ ¿En qué se fue? +
+ + + + + + + + TOTAL + + +
+
+ + + + +
+
+ Nada gastado en este periodo.
-
-
-
-
- - Operación - -
-
- Total de operación - Gastos +
+
+ + Gastos de operación + +
+
+ Total de operación + +
+
+ Gastos + +
+
- Sin gastos de operación en este periodo. + Sin gastos de operación en este periodo + Cambia el periodo o la sucursal.
- - - - - - - - - - -
FechaConceptoCategoríaSucursalMonto
- - - - -
+ +
+ FechaConceptoCategoría + SucursalMonto +
+
+ +
+ + recurrente + +
+
+ + +
+ + +
+
+ Total de operación + + gastos + + +
+
-
-
- - Total gastado - + Operación y mercancía en un solo listado con su origen, + mezclados en el SERVIDOR: el archivo baja esta misma + tabla, con el mismo recorte (8-sep). --> +
+
+ + Tabla unificada + +
+ + + +
-
- Total - Operación - Mercancía - +
+
+ Total + +
+
+ Operación + +
+
+ Mercancía + +
+ +
+ + + + entrada sin costo registrado + entradas sin costo registrado + + +
- Nada gastado en este periodo. + Nada gastado en este periodo + Cambia el periodo, la sucursal o el origen.
- - - - - - - - - - - -
FechaOrigenConceptoSucursalMonto
- - - - - - sin costo registrado -
+ +
+ FechaOrigenConcepto + SucursalMonto +
+
+
+ + +
+ + + +
+ + +
+ + + sin costo registrado +
+
+ Total del listado + + movimientos + + +
+
- -
-
- - + + · +
-
- Costo de lo ingresado - Entradas - Piezas - +
+ + + +
+ Costo de lo ingresado + +
+
+ Entradas + +
+
+ Piezas + +
- Sin entradas de almacén en este periodo. + Todas las entradas tienen costo + Sin entradas de almacén en este periodo + Cambia el periodo o la sucursal.
- - - - - - - - - - - - - -
FechaProductoSucursalPiezasCosto u.TotalQuiénNota
- - - +
+
+
+ FechaProductoSucursal + Piezas + Costo u. + Total + QuiénNota +
+
+
+ + +
+ + + -
- + + - - sin costo registrado - - -
+ + sin costo + — + + + +
+
+
+ -
- Venta - Costo - Margen - · % - -
-
- Sin ventas en este periodo con estos filtros. -
- - - - - - - - - - - - - - - - - -
FechaTicketProductoSucursalCant.VentaCosto u.Margen
- - - - servicio - - - - - - - - - - sin costo registrado -
+
+
+ + ventas sin costo registrado +
+ +
+ Venta con costo + +
+
+ Costo de lo vendido + +
+
+ Margen (con costo) + + · % + +
+
+
+ Sin ventas en este periodo + Cambia el periodo o la sucursal. +
+
+
+
+ FechaTicketProducto + Sucursal + Cant. + Venta + Costo u. + Margen +
+
+ + +
+ + servicio +
+ + + + + + + + + + + + sin costo registrado + — + +
+
+
-
+
- - Sin gastos en este periodo - Cambia el filtro, o captura el primero con «Nuevo gasto». + Sin gastos con estos filtros + Cambia el periodo, la sucursal o la categoría, o captura el primero con «Nuevo gasto».
- - - - - - - - - - - - - - - - + + + - -
+
+ +
-
- - -
- - - - - - - - -
+ +
+ +
+ + + movimientos + + +
+
+ +
+ + + recurrente + +
+
+ + +
+ + + + + +
+
+
- - + + t-on-click="() => this.paginar(1)">›
-
- Gastos recurrentes - - +
+
+ + + + - -
-
- Se generan solos cada mes, el día que digas. Si el día ya pasó, el de este mes entra al momento. - +
+ + Se generan solos cada mes, el día que digas. Si el día ya pasó, el de este mes entra al momento.
- Día + al - - - - - -
+
+ + +
+
-
- Nada programado todavía. La renta y la luz son las candidatas. -
-
- Nada programado con esos filtros. -
-
- - - - - +
@@ -541,97 +759,149 @@ + + + +
+ +
+ + · + + +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/addons/beyond_expense/tests/test_pantalla_navegador.py b/addons/beyond_expense/tests/test_pantalla_navegador.py index a5c15f7..9edbbcf 100644 --- a/addons/beyond_expense/tests/test_pantalla_navegador.py +++ b/addons/beyond_expense/tests/test_pantalla_navegador.py @@ -43,11 +43,13 @@ class TestBeyondGastosEnNavegador(HttpCase): // El color EXACTO del token, no «algún fondo»: con el // bundle caído el botón conserva el gris por defecto del // navegador, y una aserción floja lo dio por bueno en el - // primer intento de esta prueba. + // primer intento de esta prueba. Desde el 09-sep-2026 el + // acento de Gastos es el naranja de la casa + // ($beyond-panel-acento, #C55A22), no el verde. const pastilla = await hasta('.beyond_gastos_pastilla.beyond_activa'); const fondo = getComputedStyle(pastilla).backgroundColor; - if (fondo !== 'rgb(15, 107, 92)') { - throw new Error('la pastilla activa no trae el verde de la ' + if (fondo !== 'rgb(197, 90, 34)') { + throw new Error('la pastilla activa no trae el naranja de la ' + 'casa: el bundle de estilos no aplicó (' + fondo + ')'); }