Rediseña la venta: ticket con cabecera y pie propios, catálogo como lista
Punto 2 del rediseño de la caja. El ticket es un panel blanco con Cliente y Atendió arriba —avatar con iniciales, hueco punteado cuando faltan—, los renglones con sus mandos a la vista (− cantidad +, importe, quitar; tocar el renglón ya no es requisito para corregir un error de dedo) y un pie con Descuento · Nota · Eliminar orden y el botón Cobrar con el total encima. Los totales dicen subtotal con piezas, impuestos incluidos y descuento; la cifra de impuestos y el total los sigue calculando el core. El catálogo pasa a lista de renglones sin fotos —decisión del encargo, consultada contra el brief §3 ese mismo día—: nombre, chip de categoría, nota «por servicio / por pieza», precio de la lista de la sucursal (ADR-009) y botón de agregar. El buscador vive en el catálogo, con «Escanear» al lado respondiendo por el lector rápido de beyond_base, y las categorías son pastillas con «Todos» al frente — sin él, con una elegida no había forma visible de volver al catálogo entero. La elegida se detecta por las clases reales de category_selector.js, leídas, no supuestas. La barra de control del core deja de dibujarse: Atendió y Descuento se anclan ahora en ProductScreen (mismos guardias: el descuento solo lo ve quien puede aplicarlo, ADR-025), la Nota es el NoteButton del core con otra piel, y venta_limpia suelta los tres bloques que el pie nuevo deja sin objeto — dos herencias no pueden pelear por el mismo nodo. Todo método nuevo del core que el ticket llama queda declarado en contrato.js (selectPartner, pay, onDeleteOrder, navigate, isEmpty, clickLine, setSelectedCategory), y los campos nuevos (partner_id, type, pos_categ_ids) en CAMPOS: un renombre suyo sale en la suite, no en el mostrador. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
dbec630bcf
commit
b85e18c732
14 files changed
+1100
-197
No files matched your search
@@ -38,6 +38,11 @@ El veredicto del spike está en docs/adr/ADR-001-spike-pos.md.
|
||||
# y todo el rediseño lee sus variables.
|
||||
'beyond_pos_theme/static/src/scss/beyond_caja_tokens.scss',
|
||||
'beyond_pos_theme/static/src/scss/beyond_pos.scss',
|
||||
'beyond_pos_theme/static/src/scss/beyond_venta.scss',
|
||||
# venta.js define ayudantes que empleados_linea y descuento
|
||||
# importan: va antes que ellos en el bundle.
|
||||
'beyond_pos_theme/static/src/venta/venta.js',
|
||||
'beyond_pos_theme/static/src/venta/venta.xml',
|
||||
'beyond_pos_theme/static/src/product_card/product_card.js',
|
||||
'beyond_pos_theme/static/src/xml/product_card.xml',
|
||||
'beyond_pos_theme/static/src/empleados_linea/empleados_linea.js',
|
||||
|
||||
@@ -23,12 +23,15 @@
|
||||
|
||||
// Campos de los modelos del POS. Se leen y se escriben directamente.
|
||||
export const CAMPOS = {
|
||||
'pos.order': ['lines', 'tip_amount', 'is_tipped'],
|
||||
'pos.order': ['lines', 'tip_amount', 'is_tipped', 'partner_id'],
|
||||
'pos.order.line': [
|
||||
'price_unit', 'qty', 'discount', 'uuid', 'product_id', 'price_type',
|
||||
'full_product_name', 'refunded_orderline_id',
|
||||
],
|
||||
'pos.config': ['iface_tipproduct', 'tip_product_id'],
|
||||
// La tarjeta del catálogo (rediseño 2-sep-2026): el chip de categoría y
|
||||
// la nota «por servicio / por pieza» salen de estos dos.
|
||||
'product.template': ['type', 'pos_categ_ids'],
|
||||
'res.users': ['beyond_puede_descontar'],
|
||||
};
|
||||
|
||||
@@ -75,6 +78,24 @@ export const METODOS = {
|
||||
// que estorbe.
|
||||
'update': 'escribir campos de una línea de venta (quién atendió)',
|
||||
|
||||
// ── El rediseño de la caja (2-sep-2026) ─────────────────────────────
|
||||
// La pantalla de venta dejó de dibujar la barra de control del core y
|
||||
// sus piezas viven en el ticket: cada botón llama a lo MISMO que
|
||||
// llamaba el core desde su plantilla, declarado aquí para que un
|
||||
// renombre salga en la suite y no en el mostrador.
|
||||
'selectPartner': 'elegir el cliente de la orden (cabecera del ticket)',
|
||||
'pay': 'pasar a la pantalla de cobro (botón Cobrar)',
|
||||
'onDeleteOrder': 'eliminar la orden en curso (pie del ticket)',
|
||||
'navigate': 'fijar la ruta antes de encender el escáner del catálogo',
|
||||
'isEmpty': 'si la orden está vacía, para apagar Cobrar y Descuento',
|
||||
'clickLine': 'seleccionar un renglón del ticket al tocarlo',
|
||||
'setSelectedCategory': 'la pastilla «Todos» del catálogo (0 = ninguna)',
|
||||
// El formateador de moneda del entorno del POS. Es display, no cuenta:
|
||||
// los importes se calculan de los CAMPOS y esto solo los viste con el
|
||||
// mismo «$ 1,090.00» que pinta el core al lado — dos formatos de moneda
|
||||
// en la misma pantalla se leen como dos sistemas.
|
||||
'formatCurrency': 'vestir un importe como lo viste el core',
|
||||
|
||||
// `numpad_mx.js` — el teclado numérico del POS. Es un servicio entero
|
||||
// suyo, no un dato: sin él no hay dónde teclear. Es la dependencia más
|
||||
// profunda que tenemos y la que menos alternativa tiene.
|
||||
|
||||
@@ -2,10 +2,9 @@
|
||||
|
||||
import { Component, useState } from "@odoo/owl";
|
||||
import { Dialog } from "@web/core/dialog/dialog";
|
||||
import { ControlButtons } from "@point_of_sale/app/screens/product_screen/control_buttons/control_buttons";
|
||||
import { ProductScreen } from "@point_of_sale/app/screens/product_screen/product_screen";
|
||||
import { makeAwaitable } from "@point_of_sale/app/utils/make_awaitable_dialog";
|
||||
import { patch } from "@web/core/utils/patch";
|
||||
import { useService } from "@web/core/utils/hooks";
|
||||
import { _t } from "@web/core/l10n/translation";
|
||||
|
||||
import { valorSinDescuento } from "../api_pos/contrato";
|
||||
@@ -161,13 +160,10 @@ export class BeyondDescuento extends Component {
|
||||
}
|
||||
}
|
||||
|
||||
patch(ControlButtons.prototype, {
|
||||
setup() {
|
||||
super.setup(...arguments);
|
||||
this.beyondDialog = useService("dialog");
|
||||
this.beyondNotificacion = useService("notification");
|
||||
},
|
||||
|
||||
/* Anclado en ProductScreen desde el rediseño (2-sep-2026): la barra de
|
||||
* control del core ya no se dibuja y «Descuento» vive en el pie del
|
||||
* ticket. La pantalla ya trae dialog y notification. */
|
||||
patch(ProductScreen.prototype, {
|
||||
/**
|
||||
* El botón solo se dibuja a quien puede, pero la comprobación real está
|
||||
* en el servidor: `pos.order` rechaza un descuento sin autoridad y anota
|
||||
@@ -195,11 +191,11 @@ patch(ControlButtons.prototype, {
|
||||
valor: valorSinDescuento(l),
|
||||
}));
|
||||
if (!lineas.length) {
|
||||
this.beyondNotificacion.add(
|
||||
this.notification.add(
|
||||
_t("No hay nada sobre lo que descontar todavía."));
|
||||
return;
|
||||
}
|
||||
const reparto = await makeAwaitable(this.beyondDialog, BeyondDescuento,
|
||||
const reparto = await makeAwaitable(this.dialog, BeyondDescuento,
|
||||
{ lineas });
|
||||
if (!reparto) {
|
||||
return;
|
||||
|
||||
@@ -1,27 +1,10 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<templates xml:space="preserve">
|
||||
|
||||
<!--
|
||||
El botón vive en la barra de la venta, no dentro del diálogo de «más
|
||||
opciones»: un descuento se decide con el cliente enfrente y no se va
|
||||
a buscar en un submenú. Solo lo ve quien puede aplicarlo — un botón
|
||||
en gris ocupa el mismo espacio para decir que no sirve.
|
||||
-->
|
||||
<t t-name="beyond_pos_theme.ControlButtonsDescuento"
|
||||
t-inherit="point_of_sale.ControlButtons" t-inherit-mode="extension">
|
||||
<!-- Anclado en el ⋮ y no en el botón de cliente: el orden pedido es
|
||||
Cliente · Atendió · Descuento · ⋮, y «Atendió» también se
|
||||
inserta tras el de cliente — anclarse ahí dejaba el orden al
|
||||
azar del orden de carga de los assets (01-sep-2026). -->
|
||||
<xpath expr="//button[hasclass('more-btn')]" position="before">
|
||||
<button t-if="!props.showRemainingButtons and beyondPuedeDescontar"
|
||||
class="btn btn-secondary btn-lg border-0 beyond_descuento_btn"
|
||||
t-att-disabled="currentOrder.isEmpty()"
|
||||
t-on-click="() => this.beyondDescuento()">
|
||||
<i class="fa fa-tag me-1"/>Descuento
|
||||
</button>
|
||||
</xpath>
|
||||
</t>
|
||||
<!-- El botón de «Descuento» ya no vive aquí: desde el rediseño
|
||||
(2-sep-2026) está en el pie del ticket (venta/venta.xml), con la
|
||||
misma regla de siempre — solo lo ve quien puede aplicarlo
|
||||
(ADR-025). Este archivo conserva el diálogo. -->
|
||||
|
||||
<t t-name="beyond_pos_theme.Descuento">
|
||||
<Dialog title="'Descuento'" size="'lg'">
|
||||
|
||||
@@ -5,7 +5,9 @@ import { Dialog } from "@web/core/dialog/dialog";
|
||||
import { _t } from "@web/core/l10n/translation";
|
||||
import { patch } from "@web/core/utils/patch";
|
||||
import { makeAwaitable } from "@point_of_sale/app/utils/make_awaitable_dialog";
|
||||
import { ControlButtons } from "@point_of_sale/app/screens/product_screen/control_buttons/control_buttons";
|
||||
import { ProductScreen } from "@point_of_sale/app/screens/product_screen/product_screen";
|
||||
|
||||
import { inicialesDe } from "../venta/venta";
|
||||
|
||||
/**
|
||||
* C-024: diálogo de atribución múltiple. El POS solo carga empleados de la
|
||||
@@ -53,7 +55,30 @@ export class EmpleadosLineaDialog extends Component {
|
||||
* escribe en TODAS de una vez, así que el reparto en partes iguales opera
|
||||
* sobre el total de la orden.
|
||||
*/
|
||||
patch(ControlButtons.prototype, {
|
||||
/* Anclado en ProductScreen desde el rediseño (2-sep-2026): la barra de
|
||||
* control del core ya no se dibuja y «Atendió» vive en la cabecera del
|
||||
* ticket. La pantalla trae los mismos servicios (dialog, notification). */
|
||||
patch(ProductScreen.prototype, {
|
||||
/** Lo que enseña el avatar: iniciales, o cuántos si son varios. */
|
||||
get beyondIniAtendio() {
|
||||
const quienes = this.beyondEmpleadosDeLaOrden;
|
||||
if (!quienes.length) {
|
||||
return "+";
|
||||
}
|
||||
return quienes.length > 1 ? String(quienes.length) : inicialesDe(quienes[0].name);
|
||||
},
|
||||
|
||||
get beyondNombreAtendio() {
|
||||
const quienes = this.beyondEmpleadosDeLaOrden;
|
||||
if (!quienes.length) {
|
||||
return _t("Agregar colaborador");
|
||||
}
|
||||
if (quienes.length === 1) {
|
||||
return quienes[0].name;
|
||||
}
|
||||
return `${quienes[0].name} +${quienes.length - 1}`;
|
||||
},
|
||||
|
||||
get beyondLineasAtribuibles() {
|
||||
const propina = this.pos.config.tip_product_id?.id;
|
||||
return (this.currentOrder?.lines || []).filter(
|
||||
@@ -65,10 +90,6 @@ patch(ControlButtons.prototype, {
|
||||
// basta mirar la primera porque se escriben todas juntas.
|
||||
return this.beyondLineasAtribuibles[0]?.beyond_empleado_ids || [];
|
||||
},
|
||||
get beyondEtiquetaEmpleados() {
|
||||
const cuantos = this.beyondEmpleadosDeLaOrden.length;
|
||||
return cuantos ? _t("Atendió (%s)", cuantos) : _t("Atendió");
|
||||
},
|
||||
async clickBeyondEmpleados() {
|
||||
const lineas = this.beyondLineasAtribuibles;
|
||||
if (!lineas.length) {
|
||||
|
||||
@@ -19,20 +19,9 @@
|
||||
</Dialog>
|
||||
</t>
|
||||
|
||||
<!-- Botón primario en la barra de control: 2 toques (línea → Atendió) -->
|
||||
<t t-name="beyond_pos_theme.ControlButtons"
|
||||
t-inherit="point_of_sale.ControlButtons"
|
||||
t-inherit-mode="extension">
|
||||
<!-- Se ancla en el botón de cliente y no en el de nota: aquel es
|
||||
estable y este módulo RETIRA el de nota (sin_nota.xml), así que
|
||||
depender de él era depender del orden de carga de los assets. -->
|
||||
<xpath expr="//SelectPartnerButton" position="after">
|
||||
<button t-if="!props.showRemainingButtons"
|
||||
t-att-class="buttonClass"
|
||||
t-on-click="() => this.clickBeyondEmpleados()">
|
||||
<i class="fa fa-user-plus me-1" role="img" title="Atendió"/>
|
||||
<t t-esc="beyondEtiquetaEmpleados"/>
|
||||
</button>
|
||||
</xpath>
|
||||
</t>
|
||||
<!-- El botón de «Atendió» ya no vive aquí: desde el rediseño
|
||||
(2-sep-2026) es la segunda tarjeta de la cabecera del ticket
|
||||
(venta/venta.xml), con avatar e iniciales. Este archivo conserva
|
||||
el diálogo, que es la parte que le da nombre. -->
|
||||
|
||||
</templates>
|
||||
@@ -15,6 +15,24 @@ import { ProductCard } from "@point_of_sale/app/components/product_card/product_
|
||||
* pricelist of their own changes it — and the register's default otherwise.
|
||||
*/
|
||||
patch(ProductCard.prototype, {
|
||||
/** «Servicios» o «Productos», para el chip y la nota del renglón. */
|
||||
get beyondEsServicio() {
|
||||
return this.props.product?.type === "service";
|
||||
},
|
||||
|
||||
/** El chip: la categoría del POS si la hay; si no, la familia. */
|
||||
get beyondEtiquetaCategoria() {
|
||||
const categoria = this.props.product?.pos_categ_ids?.[0]?.name;
|
||||
if (categoria) {
|
||||
return categoria;
|
||||
}
|
||||
return this.beyondEsServicio ? "Servicios" : "Productos";
|
||||
},
|
||||
|
||||
get beyondNotaVenta() {
|
||||
return this.beyondEsServicio ? "por servicio" : "por pieza";
|
||||
},
|
||||
|
||||
get beyondPrice() {
|
||||
const template = this.props.product;
|
||||
if (!template) {
|
||||
|
||||
@@ -40,66 +40,9 @@
|
||||
}
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Retícula de productos: tarjetas grandes (la lista de categorías comparte
|
||||
// la clase product-list, por eso el :not)
|
||||
// ---------------------------------------------------------------------------
|
||||
.pos .product-list:not(.category-list) {
|
||||
grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr));
|
||||
gap: 0.75rem;
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Tarjeta de producto: imagen protagonista cuadrada, nombre legible,
|
||||
// esquinas suaves y sombra de tarjeta (look app, no ERP)
|
||||
// ---------------------------------------------------------------------------
|
||||
.pos .product {
|
||||
overflow: hidden;
|
||||
border: 0;
|
||||
border-radius: 1rem !important;
|
||||
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.10), 0 1px 2px rgba(0, 0, 0, 0.06);
|
||||
background: #fff;
|
||||
|
||||
&:hover {
|
||||
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
|
||||
}
|
||||
|
||||
.product-img {
|
||||
// Bootstrap ratio: 100% = cuadrada; la imagen domina la tarjeta
|
||||
--bs-aspect-ratio: 100%;
|
||||
}
|
||||
|
||||
.product-name {
|
||||
font-size: 1rem;
|
||||
font-weight: 600;
|
||||
line-height: 1.25;
|
||||
color: var(--beyond-ink);
|
||||
}
|
||||
}
|
||||
|
||||
// Precio visible en la tarjeta (añadido vía herencia de la plantilla
|
||||
// point_of_sale.ProductCard, ver static/src/xml/product_card.xml)
|
||||
.pos .beyond-price {
|
||||
top: 0.5rem;
|
||||
inset-inline-end: 0.5rem;
|
||||
padding: 0.3rem 0.7rem;
|
||||
border-radius: 2rem;
|
||||
background: rgba(255, 255, 255, 0.94);
|
||||
color: var(--beyond-ink);
|
||||
font-size: 0.9rem;
|
||||
font-weight: 700;
|
||||
box-shadow: 0 1px 4px rgba(0, 0, 0, 0.18);
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Categorías: botones táctiles altos y tipografía firme
|
||||
// ---------------------------------------------------------------------------
|
||||
.pos .category-button {
|
||||
min-height: 3rem;
|
||||
font-weight: 600;
|
||||
border-radius: 0.75rem !important;
|
||||
}
|
||||
// (La retícula de tarjetas, la tarjeta con foto y las categorías del
|
||||
// spike se fueron con el rediseño 2-sep-2026: viven en beyond_venta.scss
|
||||
// como lista de renglones.)
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// C-024: opciones del diálogo "¿Quién atendió?" — táctiles y con estado claro
|
||||
@@ -191,32 +134,6 @@
|
||||
|
||||
.beyond_propina .btn-lg { min-height: 4rem; }
|
||||
|
||||
// ── La barra de la venta y los mandos del renglón (01-sep-2026) ─────────
|
||||
// Cuatro botones centrados: Cliente · Atendió · Descuento · ⋮. El core la
|
||||
// reparte con justify-content-between, que con pocos botones los avienta a
|
||||
// las esquinas.
|
||||
.pos .control-buttons {
|
||||
justify-content: center !important;
|
||||
}
|
||||
|
||||
// Los mandos del renglón sustituyen al teclado de cantidades: aparecen solo
|
||||
// en el renglón SELECCIONADO — en todos a la vez serían ruido, y tocar el
|
||||
// renglón ya es el gesto de «este» — con dedos en mente (≥48px, brief §3).
|
||||
.pos .beyond_linea_controles {
|
||||
display: none;
|
||||
gap: .5rem;
|
||||
padding: .25rem 0 .25rem .5rem;
|
||||
|
||||
.btn {
|
||||
min-width: 48px;
|
||||
min-height: 44px;
|
||||
}
|
||||
.beyond_quitar_linea {
|
||||
margin-left: .75rem;
|
||||
color: var(--bs-danger);
|
||||
}
|
||||
}
|
||||
|
||||
.pos .orderline.selected .beyond_linea_controles {
|
||||
display: flex;
|
||||
}
|
||||
// (La barra de control y los mandos del renglón del 01-sep-2026 se
|
||||
// fueron con el rediseño: el pie del ticket es de beyond_venta.scss y el
|
||||
// renglón trae sus mandos de fábrica.)
|
||||
@@ -0,0 +1,601 @@
|
||||
// =============================================================================
|
||||
// Beyond — Pantalla de venta (rediseño 2-sep-2026, punto 2).
|
||||
//
|
||||
// El ticket a la izquierda como panel blanco con sombra; el catálogo a la
|
||||
// derecha como lista de renglones. Todo el valor viene de los tokens.
|
||||
// =============================================================================
|
||||
|
||||
.pos .product-screen {
|
||||
|
||||
// ── El panel del ticket ─────────────────────────────────────────────
|
||||
.leftpane {
|
||||
width: 428px;
|
||||
flex-basis: 428px !important; // el core reparte con flex-basis propio
|
||||
background: $caja-tarjeta;
|
||||
border-right: 1px solid rgba(96, 171, 106, 0.22);
|
||||
box-shadow: $caja-sombra-panel;
|
||||
padding-bottom: 0 !important;
|
||||
}
|
||||
|
||||
.beyond_ticket_cabecera {
|
||||
flex: none;
|
||||
box-sizing: border-box;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 10px;
|
||||
padding: 12px 18px;
|
||||
border-bottom: 1px solid $caja-linea;
|
||||
}
|
||||
|
||||
.beyond_divisor_v {
|
||||
flex: none;
|
||||
width: 1px;
|
||||
height: 30px;
|
||||
background: $caja-linea;
|
||||
}
|
||||
|
||||
.beyond_persona {
|
||||
all: unset;
|
||||
cursor: pointer;
|
||||
box-sizing: border-box;
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 10px;
|
||||
padding: 8px 10px;
|
||||
border-radius: $caja-radio-control;
|
||||
transition: background 140ms ease;
|
||||
|
||||
&:hover { background: $caja-fondo; }
|
||||
}
|
||||
|
||||
.beyond_persona_avatar {
|
||||
flex: none;
|
||||
box-sizing: border-box;
|
||||
width: 30px;
|
||||
height: 30px;
|
||||
border-radius: 10px;
|
||||
background: $caja-suave;
|
||||
color: $caja-tinta-media;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
font-size: 12px;
|
||||
font-weight: 800;
|
||||
|
||||
&.beyond_avatar_verde {
|
||||
background: $caja-verde-tinte;
|
||||
color: $caja-verde-tinta;
|
||||
}
|
||||
|
||||
// Sin nadie elegido: el hueco punteado que invita a llenarlo.
|
||||
&.beyond_vacia {
|
||||
background: transparent;
|
||||
border: 1.5px dashed $caja-deshabilitado;
|
||||
color: $caja-tinta-apagada;
|
||||
}
|
||||
}
|
||||
|
||||
.beyond_persona_datos {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 1px;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.beyond_persona_nombre {
|
||||
font-size: 14px;
|
||||
font-weight: 800;
|
||||
color: $caja-tinta;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
|
||||
&.beyond_apagado { color: $caja-tinta-apagada; }
|
||||
}
|
||||
|
||||
// ── Los renglones ───────────────────────────────────────────────────
|
||||
.beyond_renglon {
|
||||
box-sizing: border-box;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 12px;
|
||||
padding: 13px 18px;
|
||||
border-bottom: 1px solid $caja-fondo;
|
||||
cursor: default;
|
||||
transition: background 140ms ease;
|
||||
|
||||
&:hover { background: #FAF9F6; }
|
||||
}
|
||||
|
||||
.beyond_cantidad_pill {
|
||||
flex: none;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 2px;
|
||||
padding: 3px;
|
||||
border-radius: $caja-radio-pill;
|
||||
background: $caja-suave;
|
||||
|
||||
> .beyond_num {
|
||||
min-width: 22px;
|
||||
text-align: center;
|
||||
font-size: 14.5px;
|
||||
font-weight: 800;
|
||||
}
|
||||
}
|
||||
|
||||
.beyond_paso {
|
||||
all: unset;
|
||||
cursor: pointer;
|
||||
box-sizing: border-box;
|
||||
width: 28px;
|
||||
height: 28px;
|
||||
border-radius: $caja-radio-pill;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
color: $caja-tinta-suave;
|
||||
font-size: 11px;
|
||||
transition: background 140ms ease;
|
||||
|
||||
&:hover { background: $caja-tarjeta; }
|
||||
&.beyond_paso_mas { color: $caja-verde-tinta; }
|
||||
}
|
||||
|
||||
.beyond_cantidad_sola {
|
||||
flex: none;
|
||||
min-width: 34px;
|
||||
height: 30px;
|
||||
box-sizing: border-box;
|
||||
padding: 0 8px;
|
||||
border-radius: 10px;
|
||||
background: $caja-rojo-chip;
|
||||
color: $caja-rojo-tinta;
|
||||
font-size: 14px;
|
||||
font-weight: 800;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.beyond_renglon_datos {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 2px;
|
||||
}
|
||||
|
||||
.beyond_renglon_nombre {
|
||||
font-size: 15px;
|
||||
font-weight: 800;
|
||||
letter-spacing: -0.01em;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.beyond_renglon_meta {
|
||||
font-size: 12px;
|
||||
font-weight: 700;
|
||||
color: $caja-tinta-apagada;
|
||||
}
|
||||
|
||||
.beyond_renglon_importe {
|
||||
flex: none;
|
||||
font-size: 15px;
|
||||
font-weight: 800;
|
||||
}
|
||||
|
||||
.beyond_quitar {
|
||||
all: unset;
|
||||
cursor: pointer;
|
||||
box-sizing: border-box;
|
||||
flex: none;
|
||||
width: 30px;
|
||||
height: 30px;
|
||||
border-radius: 10px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
color: $caja-deshabilitado;
|
||||
transition: background 140ms ease, color 140ms ease;
|
||||
|
||||
&:hover { background: $caja-rojo-tinte; color: $caja-rojo; }
|
||||
}
|
||||
|
||||
.beyond_resta { color: $caja-rojo; font-weight: 800; }
|
||||
|
||||
// ── Los totales ─────────────────────────────────────────────────────
|
||||
.beyond_totales {
|
||||
border-top: 1px solid $caja-linea;
|
||||
border-bottom: 0 !important;
|
||||
padding: 14px 18px 4px !important;
|
||||
gap: 7px !important;
|
||||
}
|
||||
|
||||
.beyond_total_fila {
|
||||
display: flex;
|
||||
align-items: baseline;
|
||||
justify-content: space-between;
|
||||
gap: 12px;
|
||||
font-size: 13.5px;
|
||||
font-weight: 700;
|
||||
color: $caja-tinta-media;
|
||||
|
||||
> .beyond_num { color: $caja-tinta-suave; font-weight: 700; font-size: 14px; }
|
||||
.beyond_nulo { color: $caja-deshabilitado; }
|
||||
.beyond_resta { color: $caja-rojo; font-weight: 800; }
|
||||
}
|
||||
|
||||
.beyond_total_grande {
|
||||
padding-top: 8px;
|
||||
border-top: 1.5px solid $caja-linea;
|
||||
font-size: 15px;
|
||||
font-weight: 800;
|
||||
color: $caja-tinta;
|
||||
|
||||
> .total {
|
||||
font-size: 30px;
|
||||
font-weight: 800;
|
||||
letter-spacing: -0.03em;
|
||||
line-height: 1.05;
|
||||
color: $caja-tinta;
|
||||
}
|
||||
}
|
||||
|
||||
// ── El pie ──────────────────────────────────────────────────────────
|
||||
.beyond_ticket_pie {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 12px;
|
||||
padding: 14px 18px 16px;
|
||||
border-top: 1px solid $caja-linea;
|
||||
}
|
||||
|
||||
.beyond_pie_botones {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
|
||||
> * { flex: 1; }
|
||||
}
|
||||
|
||||
.beyond_cobrar {
|
||||
all: unset;
|
||||
cursor: pointer;
|
||||
box-sizing: border-box;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: 14px;
|
||||
min-height: $caja-toque-comodo;
|
||||
padding: 0 24px;
|
||||
border-radius: $caja-radio-tarjeta;
|
||||
background: $caja-verde;
|
||||
color: #FFFFFF;
|
||||
font-size: 17px;
|
||||
font-weight: 800;
|
||||
letter-spacing: -0.01em;
|
||||
transition: background 140ms ease;
|
||||
|
||||
> .beyond_num { font-size: 19px; }
|
||||
|
||||
&:hover { background: $caja-verde-hover; }
|
||||
&:disabled, &[disabled] {
|
||||
background: $caja-suave-hover;
|
||||
color: $caja-tinta-apagada;
|
||||
cursor: not-allowed;
|
||||
}
|
||||
}
|
||||
|
||||
// ── El catálogo ─────────────────────────────────────────────────────
|
||||
.rightpane { background: $caja-fondo !important; }
|
||||
|
||||
// Las categorías, como pastillas en una sola tira.
|
||||
.category-list {
|
||||
display: flex !important;
|
||||
flex-wrap: wrap;
|
||||
width: max-content;
|
||||
max-width: calc(100% - 44px);
|
||||
align-items: center;
|
||||
gap: 4px !important;
|
||||
margin: 16px 22px 0;
|
||||
padding: 4px !important;
|
||||
border-radius: $caja-radio-pill;
|
||||
background: $caja-suave-hover;
|
||||
|
||||
.category-button {
|
||||
box-sizing: border-box;
|
||||
min-height: 0;
|
||||
padding: 9px 18px !important;
|
||||
border: 0 !important;
|
||||
border-radius: $caja-radio-pill !important;
|
||||
background: transparent !important; // gana al color de categoría
|
||||
box-shadow: none !important;
|
||||
color: $caja-tinta-media !important;
|
||||
font-size: 13.5px;
|
||||
font-weight: 800;
|
||||
white-space: nowrap;
|
||||
opacity: 1 !important;
|
||||
|
||||
.ratio { display: none; } // pastillas sin miniatura
|
||||
.line-clamp-3 { width: auto !important; }
|
||||
|
||||
// La elegida: el core no marca una clase estable, pero es la
|
||||
// ÚNICA sin `opacity-75` (hermana no elegida) ni `border-0`
|
||||
// (raíz con nada elegido) — leído de category_selector.js, no
|
||||
// supuesto. Con nada elegido, ninguna se pinta y «Todos» toma
|
||||
// el verde por su propia clase.
|
||||
&:not(.opacity-75):not(.border-0):not(.beyond_pastilla_todos) {
|
||||
background: $caja-verde !important;
|
||||
color: #FFFFFF !important;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.beyond_pastilla_todos.beyond_todos_activa {
|
||||
background: $caja-verde !important;
|
||||
color: #FFFFFF !important;
|
||||
}
|
||||
|
||||
.beyond_catalogo_controles {
|
||||
flex: none;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 10px;
|
||||
padding: 10px 22px 12px;
|
||||
}
|
||||
|
||||
.beyond_buscador {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 11px;
|
||||
box-sizing: border-box;
|
||||
padding: 11px 14px;
|
||||
border-radius: $caja-radio-campo;
|
||||
background: $caja-tarjeta;
|
||||
border: 1.5px solid $caja-borde;
|
||||
|
||||
&:focus-within { border-color: $caja-verde; }
|
||||
|
||||
.fa { color: $caja-tinta-apagada; }
|
||||
|
||||
input {
|
||||
all: unset;
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
font-size: 14.5px;
|
||||
font-weight: 700;
|
||||
color: $caja-tinta;
|
||||
}
|
||||
}
|
||||
|
||||
.beyond_escanear {
|
||||
all: unset;
|
||||
cursor: pointer;
|
||||
box-sizing: border-box;
|
||||
flex: none;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 9px;
|
||||
min-height: $caja-toque;
|
||||
padding: 0 18px;
|
||||
border-radius: $caja-radio-campo;
|
||||
background: $caja-tarjeta;
|
||||
border: 1.5px solid $caja-borde;
|
||||
color: $caja-tinta;
|
||||
font-size: 13.5px;
|
||||
font-weight: 800;
|
||||
white-space: nowrap;
|
||||
transition: background 140ms ease, border-color 140ms ease;
|
||||
|
||||
.fa { color: $caja-verde-tinta; }
|
||||
|
||||
&:hover { background: $caja-verde-tinte; border-color: $caja-verde; }
|
||||
}
|
||||
|
||||
// La lista de productos: una columna de renglones.
|
||||
.product-list:not(.category-list) {
|
||||
grid-template-columns: 1fr;
|
||||
gap: 6px;
|
||||
padding: 4px 22px 26px !important;
|
||||
}
|
||||
|
||||
.product {
|
||||
// `flex-column` viene en el markup del core como utilitaria de
|
||||
// Bootstrap (!important): la fila solo se gana igual de fuerte.
|
||||
// Deuda declarada desde ADR-001, concentrada aquí.
|
||||
flex-direction: row !important;
|
||||
align-items: center !important;
|
||||
gap: 14px;
|
||||
min-height: $caja-catalogo-renglon-alto;
|
||||
padding: 13px 16px !important;
|
||||
background: $caja-tarjeta;
|
||||
border: 1.5px solid $caja-borde !important;
|
||||
border-radius: $caja-radio-campo !important;
|
||||
box-shadow: none;
|
||||
transition: border-color 140ms ease, background 140ms ease;
|
||||
|
||||
&:hover {
|
||||
border-color: $caja-verde !important;
|
||||
background: #FAFCFA;
|
||||
box-shadow: none;
|
||||
}
|
||||
|
||||
.product-img { display: none; } // lista sin fotos (encargo)
|
||||
|
||||
.product-content {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
display: flex !important;
|
||||
flex-direction: column;
|
||||
gap: 1px;
|
||||
height: auto !important;
|
||||
padding: 0 !important;
|
||||
margin: 0 !important;
|
||||
}
|
||||
|
||||
.product-name {
|
||||
display: block !important;
|
||||
text-align: start !important;
|
||||
justify-content: flex-start !important;
|
||||
font-size: 16px;
|
||||
font-weight: 800;
|
||||
letter-spacing: -0.015em;
|
||||
color: $caja-tinta;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
// La cantidad la pinta nuestro chip, junto al precio.
|
||||
.product-cart-qty { display: none; }
|
||||
}
|
||||
|
||||
.beyond_prod_meta {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 7px;
|
||||
}
|
||||
|
||||
.beyond_prod_chip {
|
||||
flex: none;
|
||||
padding: 2px 8px;
|
||||
border-radius: 7px;
|
||||
font-size: 9.5px;
|
||||
font-weight: 800;
|
||||
letter-spacing: 0.09em;
|
||||
text-transform: uppercase;
|
||||
|
||||
&.beyond_srv { background: $caja-servicio-tinte; color: $caja-servicio-tinta; }
|
||||
&.beyond_prd { background: $caja-producto-tinte; color: $caja-producto-tinta; }
|
||||
}
|
||||
|
||||
.beyond_prod_nota {
|
||||
font-size: 11.5px;
|
||||
font-weight: 700;
|
||||
color: $caja-tinta-apagada;
|
||||
}
|
||||
|
||||
.beyond_prod_qty {
|
||||
flex: none;
|
||||
min-width: 26px;
|
||||
height: 26px;
|
||||
box-sizing: border-box;
|
||||
padding: 0 8px;
|
||||
border-radius: $caja-radio-pill;
|
||||
background: $caja-verde;
|
||||
color: #FFFFFF;
|
||||
font-size: 13px;
|
||||
font-weight: 800;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
// El precio deja de flotar sobre una foto: es una columna del renglón.
|
||||
.beyond-price {
|
||||
position: static !important;
|
||||
flex: none;
|
||||
min-width: 92px;
|
||||
text-align: right;
|
||||
padding: 0;
|
||||
border-radius: 0;
|
||||
background: transparent;
|
||||
box-shadow: none;
|
||||
font-size: 19px;
|
||||
font-weight: 800;
|
||||
letter-spacing: -0.02em;
|
||||
color: $caja-tinta;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.beyond_prod_mas {
|
||||
flex: none;
|
||||
width: 32px;
|
||||
height: 32px;
|
||||
border-radius: 11px;
|
||||
background: $caja-suave;
|
||||
color: $caja-tinta-media;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
font-size: 13px;
|
||||
transition: background 140ms ease, color 140ms ease;
|
||||
}
|
||||
|
||||
.product:hover .beyond_prod_mas {
|
||||
background: $caja-verde;
|
||||
color: #FFFFFF;
|
||||
}
|
||||
|
||||
// ── Los vacíos ──────────────────────────────────────────────────────
|
||||
.beyond_ticket_vacio,
|
||||
.beyond_catalogo_vacio {
|
||||
box-sizing: border-box;
|
||||
padding: 40px 30px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.beyond_vacio_titulo {
|
||||
font-size: 16px;
|
||||
font-weight: 800;
|
||||
color: $caja-tinta;
|
||||
}
|
||||
|
||||
.beyond_vacio_nota {
|
||||
font-size: 13.5px;
|
||||
font-weight: 700;
|
||||
color: $caja-tinta-apagada;
|
||||
max-width: 280px;
|
||||
text-wrap: pretty;
|
||||
}
|
||||
}
|
||||
|
||||
// El botón llano del pie del ticket (y de quien lo reutilice): gris cálido,
|
||||
// texto firme, rojo solo al ofrecer borrar.
|
||||
.pos .beyond_boton_llano {
|
||||
all: unset;
|
||||
cursor: pointer;
|
||||
box-sizing: border-box;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
gap: 7px;
|
||||
min-height: 44px;
|
||||
padding: 0 12px;
|
||||
border-radius: 14px;
|
||||
background: $caja-suave;
|
||||
color: $caja-tinta;
|
||||
font-size: 13px;
|
||||
font-weight: 800;
|
||||
white-space: nowrap;
|
||||
transition: background 140ms ease, color 140ms ease;
|
||||
|
||||
.fa { color: $caja-tinta-media; }
|
||||
|
||||
&:hover { background: $caja-suave-hover; }
|
||||
|
||||
&:disabled, &[disabled] {
|
||||
opacity: 0.5;
|
||||
cursor: not-allowed;
|
||||
}
|
||||
|
||||
&.beyond_boton_peligro:hover {
|
||||
background: $caja-rojo-tinte;
|
||||
color: $caja-rojo;
|
||||
|
||||
.fa { color: $caja-rojo; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,137 @@
|
||||
/* Part of Beyond. Collina Systems proprietary module. */
|
||||
import { patch } from "@web/core/utils/patch";
|
||||
import { ProductScreen } from "@point_of_sale/app/screens/product_screen/product_screen";
|
||||
import { OrderSummary } from "@point_of_sale/app/screens/product_screen/order_summary/order_summary";
|
||||
import { OrderDisplay } from "@point_of_sale/app/components/order_display/order_display";
|
||||
import { NoteButton } from "@point_of_sale/app/screens/product_screen/control_buttons/orderline_note_button/orderline_note_button";
|
||||
|
||||
import { valorDeLinea, valorSinDescuento } from "../api_pos/contrato";
|
||||
|
||||
/**
|
||||
* La pantalla de venta del rediseño (2-sep-2026): el ticket a la izquierda
|
||||
* con Cliente y Atendió arriba y el pie con Descuento · Nota · Eliminar y
|
||||
* el botón Cobrar; el catálogo a la derecha como lista, con su buscador y
|
||||
* su botón de escanear.
|
||||
*
|
||||
* La barra de control del core (ControlButtons) deja de dibujarse: sus
|
||||
* piezas viven ahora en el ticket. Por eso los mandos de descuento y de
|
||||
* atribución se anclan aquí (ProductScreen) y no en aquella.
|
||||
*/
|
||||
|
||||
/** Iniciales para el avatar: «Mr. Worldwide» → «MW». */
|
||||
export function inicialesDe(nombre) {
|
||||
return String(nombre || "")
|
||||
.split(" ")
|
||||
.filter(Boolean)
|
||||
.slice(0, 2)
|
||||
.map((parte) => parte[0])
|
||||
.join("")
|
||||
.toUpperCase();
|
||||
}
|
||||
|
||||
patch(ProductScreen, {
|
||||
components: { ...ProductScreen.components, NoteButton },
|
||||
});
|
||||
|
||||
patch(ProductScreen.prototype, {
|
||||
// ── Cabecera del ticket ─────────────────────────────────────────────
|
||||
|
||||
get beyondCliente() {
|
||||
return this.currentOrder?.partner_id || null;
|
||||
},
|
||||
|
||||
get beyondIniCliente() {
|
||||
const cliente = this.beyondCliente;
|
||||
return cliente ? inicialesDe(cliente.name) : "+";
|
||||
},
|
||||
|
||||
// ── El pie ──────────────────────────────────────────────────────────
|
||||
|
||||
/**
|
||||
* Lo que va a cobrar el botón: la suma de las líneas por sus CAMPOS
|
||||
* (`price_unit`, `qty`, `discount`). Con IVA incluido (ADR-010) eso ES
|
||||
* el total a pagar — la misma cuenta que hacen la propina y el
|
||||
* descuento, y que el servidor repite en `_compute_beyond_descuento`.
|
||||
*/
|
||||
get beyondTotalCobrar() {
|
||||
const orden = this.currentOrder;
|
||||
if (!orden) {
|
||||
return 0;
|
||||
}
|
||||
return orden.lines.reduce((suma, linea) => suma + valorDeLinea(linea), 0);
|
||||
},
|
||||
|
||||
// ── El catálogo ─────────────────────────────────────────────────────
|
||||
|
||||
beyondBuscar(ev) {
|
||||
// La misma palabra que leía el buscador de la barra: la pantalla ya
|
||||
// reacciona a ella; solo cambió dónde se teclea.
|
||||
this.pos.searchProductWord = ev.target.value;
|
||||
},
|
||||
|
||||
/**
|
||||
* El escáner, con el mismo camino que seguía el botón de la barra
|
||||
* (navbar.js): fijar la ruta antes de encender para que el lector caiga
|
||||
* en esta orden, y limpiar el aviso de la cámara para que reintentar
|
||||
* sea reintentar (camara_pos.js).
|
||||
*/
|
||||
beyondEscanear() {
|
||||
this.pos.beyondErrorCamara = "";
|
||||
if (!this.pos.scanning) {
|
||||
this.pos.navigate("ProductScreen", { orderUuid: this.pos.getOrder().uuid });
|
||||
}
|
||||
this.pos.mobile_pane = "right";
|
||||
this.pos.scanning = !this.pos.scanning;
|
||||
},
|
||||
});
|
||||
|
||||
patch(OrderSummary.prototype, {
|
||||
/** El importe del renglón, de los campos y con la moneda de la caja. */
|
||||
beyondImporteDe(linea) {
|
||||
return this.env.utils.formatCurrency(valorDeLinea(linea));
|
||||
},
|
||||
|
||||
beyondPrecioUnitario(linea) {
|
||||
return this.env.utils.formatCurrency(linea.price_unit || 0);
|
||||
},
|
||||
|
||||
/** «−10%», sin decimales fantasma: 10.0 → 10, 12.5 → 12.5. */
|
||||
beyondEtiquetaDescuento(linea) {
|
||||
const valor = Math.round((linea.discount || 0) * 10) / 10;
|
||||
return `−${valor}%`;
|
||||
},
|
||||
});
|
||||
|
||||
patch(OrderDisplay.prototype, {
|
||||
/** Cuántas piezas lleva el ticket, sin contar la propina. */
|
||||
get beyondPiezas() {
|
||||
const propina = this.beyondProductoPropina;
|
||||
const piezas = this.props.order.lines
|
||||
.filter((linea) => linea.product_id?.id !== propina)
|
||||
.reduce((suma, linea) => suma + (linea.qty || 0), 0);
|
||||
const redondas = Math.round(piezas * 100) / 100;
|
||||
return `${redondas} ${Math.abs(redondas) === 1 ? "pieza" : "piezas"}`;
|
||||
},
|
||||
|
||||
get beyondProductoPropina() {
|
||||
return this.env.services.pos?.config?.tip_product_id?.id;
|
||||
},
|
||||
|
||||
/** El bruto: las líneas sin su descuento, que es sobre lo que se habla. */
|
||||
get beyondSubtotal() {
|
||||
const bruto = this.props.order.lines.reduce(
|
||||
(suma, linea) => suma + valorSinDescuento(linea), 0);
|
||||
return this.env.utils.formatCurrency(bruto);
|
||||
},
|
||||
|
||||
/** Lo que se dejó de cobrar. Vacío si no hay descuento. */
|
||||
get beyondDescuento() {
|
||||
const lineas = this.props.order.lines;
|
||||
const rebaja = lineas.reduce(
|
||||
(suma, linea) => suma + valorSinDescuento(linea) - valorDeLinea(linea), 0);
|
||||
if (rebaja <= 0.004) {
|
||||
return "";
|
||||
}
|
||||
return `−${this.env.utils.formatCurrency(rebaja)}`;
|
||||
},
|
||||
});
|
||||
@@ -0,0 +1,211 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<templates xml:space="preserve">
|
||||
|
||||
<!--
|
||||
La pantalla de venta del rediseño (2-sep-2026).
|
||||
|
||||
Tres herencias sobre plantillas del core, todas ancladas en nodos
|
||||
SUYOS (el guardia de anclas solo mira el core):
|
||||
|
||||
· ProductScreen — la cabecera del ticket (Cliente · Atendió) antes
|
||||
del resumen, el pie nuevo en lugar de los pads, y el buscador con
|
||||
«Escanear» dentro del catálogo.
|
||||
· OrderSummary — el renglón del ticket con sus mandos a la vista
|
||||
(− cantidad +, importe, quitar) y el vacío del ticket.
|
||||
· OrderDisplay — los totales del pie: subtotal con piezas,
|
||||
impuestos incluidos, descuento y total.
|
||||
-->
|
||||
|
||||
<t t-name="beyond_pos_theme.VentaTicket"
|
||||
t-inherit="point_of_sale.ProductScreen" t-inherit-mode="extension">
|
||||
|
||||
<!-- Cliente y Atendió arriba del ticket: son lo primero que se
|
||||
decide con el cliente enfrente, no un botón perdido abajo. -->
|
||||
<xpath expr="//OrderSummary" position="before">
|
||||
<div class="beyond_ticket_cabecera">
|
||||
<button class="beyond_persona" t-on-click="() => this.pos.selectPartner()">
|
||||
<span class="beyond_persona_avatar"
|
||||
t-att-class="beyondCliente ? '' : 'beyond_vacia'"
|
||||
t-esc="beyondIniCliente"/>
|
||||
<span class="beyond_persona_datos">
|
||||
<span class="beyond_rotulito">Cliente</span>
|
||||
<span class="beyond_persona_nombre"
|
||||
t-att-class="beyondCliente ? '' : 'beyond_apagado'">
|
||||
<t t-if="beyondCliente" t-esc="beyondCliente.name"/>
|
||||
<t t-else="">Agregar cliente</t>
|
||||
</span>
|
||||
</span>
|
||||
</button>
|
||||
<span class="beyond_divisor_v"/>
|
||||
<button class="beyond_persona" t-on-click="() => this.clickBeyondEmpleados()">
|
||||
<span class="beyond_persona_avatar beyond_avatar_verde"
|
||||
t-att-class="beyondEmpleadosDeLaOrden.length ? '' : 'beyond_vacia'"
|
||||
t-esc="beyondIniAtendio"/>
|
||||
<span class="beyond_persona_datos">
|
||||
<span class="beyond_rotulito">Atendió</span>
|
||||
<span class="beyond_persona_nombre"
|
||||
t-att-class="beyondEmpleadosDeLaOrden.length ? '' : 'beyond_apagado'"
|
||||
t-esc="beyondNombreAtendio"/>
|
||||
</span>
|
||||
</button>
|
||||
</div>
|
||||
</xpath>
|
||||
|
||||
<!-- El pie: Descuento · Nota · Eliminar y el botón de Cobrar con el
|
||||
total a la vista. Sustituye a los pads del core, y con ellos se
|
||||
van la barra de control, el teclado de cantidades (retirado el
|
||||
01-sep-2026) y el actionpad. -->
|
||||
<xpath expr="//div[hasclass('pads')]" position="replace">
|
||||
<div class="pads beyond_ticket_pie">
|
||||
<div class="beyond_pie_botones">
|
||||
<!-- Solo lo ve quien puede aplicarlo (ADR-025): la
|
||||
comprobación real vive en el servidor. -->
|
||||
<button t-if="beyondPuedeDescontar"
|
||||
class="beyond_boton_llano"
|
||||
t-att-disabled="currentOrder?.isEmpty()"
|
||||
t-on-click="() => this.beyondDescuento()">
|
||||
<i class="fa fa-tag me-1"/>Descuento
|
||||
</button>
|
||||
<NoteButton label.translate="Nota" class="'beyond_boton_llano'"/>
|
||||
<button class="beyond_boton_llano beyond_boton_peligro"
|
||||
t-att-disabled="!currentOrder"
|
||||
t-on-click="() => this.pos.onDeleteOrder(currentOrder)">
|
||||
<i class="fa fa-trash-o me-1"/>Eliminar orden
|
||||
</button>
|
||||
</div>
|
||||
<button class="beyond_cobrar"
|
||||
t-att-disabled="currentOrder?.isEmpty()"
|
||||
t-on-click="() => this.pos.pay()">
|
||||
<span>Cobrar</span>
|
||||
<span class="beyond_num" t-esc="env.utils.formatCurrency(beyondTotalCobrar)"/>
|
||||
</button>
|
||||
</div>
|
||||
</xpath>
|
||||
|
||||
<!-- El buscador vive en el catálogo, no en la barra: se busca
|
||||
mirando la lista que se va a filtrar. «Escanear» a su lado,
|
||||
respondiendo con el lector rápido de beyond_base. -->
|
||||
<xpath expr="//CategorySelector" position="after">
|
||||
<div class="beyond_catalogo_controles">
|
||||
<div class="beyond_buscador">
|
||||
<i class="fa fa-search" role="img" aria-label="Buscar"/>
|
||||
<input placeholder="Buscar producto o servicio"
|
||||
t-att-value="pos.searchProductWord or ''"
|
||||
t-on-input="beyondBuscar"/>
|
||||
</div>
|
||||
<button class="beyond_escanear" title="Leer código de barras"
|
||||
t-on-click="() => this.beyondEscanear()">
|
||||
<i class="fa fa-barcode" role="img" aria-label="Escanear"/>
|
||||
Escanear
|
||||
</button>
|
||||
</div>
|
||||
</xpath>
|
||||
|
||||
<!-- El vacío del buscador, en el idioma de la caja. -->
|
||||
<xpath expr="//p[@t-if='searchWord']" position="replace">
|
||||
<div t-if="searchWord" class="beyond_catalogo_vacio">
|
||||
<span class="beyond_vacio_titulo">Nada con «<t t-esc="searchWord"/>»</span>
|
||||
<span class="beyond_vacio_nota">Revisa el nombre o escanea el código del producto.</span>
|
||||
</div>
|
||||
</xpath>
|
||||
</t>
|
||||
|
||||
<t t-name="beyond_pos_theme.VentaRenglon"
|
||||
t-inherit="point_of_sale.OrderSummary" t-inherit-mode="extension">
|
||||
|
||||
<!-- El renglón del rediseño: mandos a la vista en TODOS los
|
||||
renglones — tocar el renglón ya no es requisito para corregir
|
||||
un error de dedo. En devoluciones no hay mandos: su cantidad la
|
||||
fijó la venta original (flujo de reembolso). -->
|
||||
<xpath expr="//Orderline" position="replace">
|
||||
<li class="orderline beyond_renglon" t-on-click="(ev) => this.clickLine(ev, line)">
|
||||
<t t-if="!line.refunded_orderline_id">
|
||||
<span class="beyond_cantidad_pill">
|
||||
<button class="beyond_paso" title="Una menos"
|
||||
t-on-click.stop="() => this.beyondMenos(line)">
|
||||
<i class="fa fa-minus" role="img" aria-label="Una menos"/>
|
||||
</button>
|
||||
<span class="beyond_num" t-esc="line.qty"/>
|
||||
<button class="beyond_paso beyond_paso_mas" title="Una más"
|
||||
t-on-click.stop="() => this.beyondMas(line)">
|
||||
<i class="fa fa-plus" role="img" aria-label="Una más"/>
|
||||
</button>
|
||||
</span>
|
||||
</t>
|
||||
<t t-else="">
|
||||
<span class="beyond_cantidad_sola beyond_num" t-esc="line.qty"/>
|
||||
</t>
|
||||
<span class="beyond_renglon_datos">
|
||||
<span class="beyond_renglon_nombre" t-esc="line.full_product_name"/>
|
||||
<span class="beyond_renglon_meta beyond_num">
|
||||
<t t-esc="beyondPrecioUnitario(line)"/> c/u<t
|
||||
t-if="line.discount"> · <span class="beyond_resta"
|
||||
t-esc="beyondEtiquetaDescuento(line)"/></t>
|
||||
</span>
|
||||
</span>
|
||||
<span class="beyond_renglon_importe beyond_num" t-esc="beyondImporteDe(line)"/>
|
||||
<button t-if="!line.refunded_orderline_id"
|
||||
class="beyond_quitar" title="Quitar renglón"
|
||||
t-on-click.stop="() => this.beyondQuitar(line)">
|
||||
<i class="fa fa-times" role="img" aria-label="Quitar"/>
|
||||
</button>
|
||||
</li>
|
||||
</xpath>
|
||||
|
||||
<!-- El ticket vacío dice qué hacer, no se queda en blanco. -->
|
||||
<xpath expr="//OrderDisplay" position="inside">
|
||||
<t t-set-slot="emptyCart">
|
||||
<div class="beyond_ticket_vacio">
|
||||
<span class="beyond_vacio_titulo">Ticket vacío</span>
|
||||
<span class="beyond_vacio_nota">Toca un producto o escanea un código para empezar la venta.</span>
|
||||
</div>
|
||||
</t>
|
||||
</xpath>
|
||||
</t>
|
||||
|
||||
<t t-name="beyond_pos_theme.VentaTotales"
|
||||
t-inherit="point_of_sale.OrderDisplay" t-inherit-mode="extension">
|
||||
|
||||
<!-- Los totales de la maqueta: subtotal con piezas, impuestos
|
||||
incluidos (la cifra la calcula el core, igual que su total),
|
||||
descuento y total. El subtotal del core estaba escondido con
|
||||
IVA incluido, y el descuento no existía. -->
|
||||
<xpath expr="//div[hasclass('order-summary')]" position="replace">
|
||||
<div t-if="props.mode !== 'receipt'"
|
||||
class="order-summary beyond_totales">
|
||||
<div class="beyond_total_fila">
|
||||
<span>Subtotal · <t t-esc="beyondPiezas"/></span>
|
||||
<span class="beyond_num" t-esc="beyondSubtotal"/>
|
||||
</div>
|
||||
<div class="beyond_total_fila">
|
||||
<span>Impuestos incluidos</span>
|
||||
<span class="beyond_num" t-esc="order.currencyAmountTaxes"/>
|
||||
</div>
|
||||
<div class="beyond_total_fila">
|
||||
<span>Descuento</span>
|
||||
<span class="beyond_num"
|
||||
t-att-class="beyondDescuento ? 'beyond_resta' : 'beyond_nulo'"
|
||||
t-esc="beyondDescuento || '—'"/>
|
||||
</div>
|
||||
<div class="beyond_total_fila beyond_total_grande">
|
||||
<span>Total</span>
|
||||
<span class="total beyond_num" t-esc="order.currencyDisplayPriceIncl"/>
|
||||
</div>
|
||||
</div>
|
||||
</xpath>
|
||||
</t>
|
||||
|
||||
<t t-name="beyond_pos_theme.VentaCategorias"
|
||||
t-inherit="point_of_sale.CategorySelector" t-inherit-mode="extension">
|
||||
<!-- «Todos» delante de las categorías: sin él, con una elegida no
|
||||
hay forma visible de volver a ver el catálogo entero. -->
|
||||
<xpath expr="//t[@t-foreach]" position="before">
|
||||
<button class="category-button beyond_pastilla_todos"
|
||||
t-att-class="!pos.selectedCategory ? 'beyond_todos_activa' : ''"
|
||||
t-on-click="() => this.pos.setSelectedCategory(0)">
|
||||
Todos
|
||||
</button>
|
||||
</xpath>
|
||||
</t>
|
||||
|
||||
</templates>
|
||||
@@ -1,58 +1,15 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<templates xml:space="preserve">
|
||||
|
||||
<!--
|
||||
La barra de la venta, reducida a lo que se usa con el cliente
|
||||
enfrente: Cliente · Atendió · Descuento · ⋮ (encargo del
|
||||
01-sep-2026). El ⋮ se queda porque ahí vive el reembolso.
|
||||
<!-- Los tres bloques que vivían aquí —quitar el botón de subir orden,
|
||||
quitar el teclado de cantidades y los mandos del renglón— se fueron
|
||||
con el rediseño (2-sep-2026): el pie del ticket se reemplaza entero
|
||||
en venta/venta.xml y el renglón trae sus mandos de fábrica. Queda
|
||||
la pantalla de apertura, que es lo que este archivo aún limpia. -->
|
||||
|
||||
|
||||
Fuera el botón de subir/guardar la orden: es flujo de «vender en
|
||||
varias tandas» que el mostrador de un salón no usa, y era el único
|
||||
con `ms-auto`, así que quitarlo además deja la barra lista para
|
||||
centrarse por CSS.
|
||||
-->
|
||||
<t t-name="beyond_pos_theme.SinSubirOrden"
|
||||
t-inherit="point_of_sale.ControlButtons" t-inherit-mode="extension">
|
||||
<xpath expr="//button[.//i[hasclass('fa-upload')]]" position="replace"/>
|
||||
</t>
|
||||
|
||||
<!--
|
||||
El teclado de cantidades se retira (encargo del 01-sep-2026): la
|
||||
cantidad se lleva con toques en la tarjeta y con los controles del
|
||||
renglón de abajo. El de la pantalla de cobro no se toca — ahí sí se
|
||||
teclean importes.
|
||||
-->
|
||||
<t t-name="beyond_pos_theme.SinTecladoCantidades"
|
||||
t-inherit="point_of_sale.ProductScreen" t-inherit-mode="extension">
|
||||
<xpath expr="//Numpad" position="replace"/>
|
||||
</t>
|
||||
|
||||
<!--
|
||||
Sin teclado, el renglón necesita sus propios mandos: − · + · quitar.
|
||||
Sin ellos, un error de dedo solo se arregla cancelando la venta
|
||||
entera. En las devoluciones no aparecen: su cantidad la fijó la
|
||||
venta original y se cambia desde el flujo de reembolso.
|
||||
-->
|
||||
<t t-name="beyond_pos_theme.ControlesDeLinea"
|
||||
t-inherit="point_of_sale.OrderSummary" t-inherit-mode="extension">
|
||||
<xpath expr="//Orderline" position="inside">
|
||||
<div t-if="!line.refunded_orderline_id"
|
||||
class="beyond_linea_controles">
|
||||
<button class="btn btn-secondary" title="Una menos"
|
||||
t-on-click.stop="() => this.beyondMenos(line)">
|
||||
<i class="fa fa-minus" role="img" aria-label="Una menos"/>
|
||||
</button>
|
||||
<button class="btn btn-secondary" title="Una más"
|
||||
t-on-click.stop="() => this.beyondMas(line)">
|
||||
<i class="fa fa-plus" role="img" aria-label="Una más"/>
|
||||
</button>
|
||||
<button class="btn btn-secondary beyond_quitar_linea" title="Quitar"
|
||||
t-on-click.stop="() => this.beyondQuitar(line)">
|
||||
<i class="fa fa-trash-o" role="img" aria-label="Quitar"/>
|
||||
</button>
|
||||
</div>
|
||||
</xpath>
|
||||
</t>
|
||||
|
||||
<!--
|
||||
La pantalla de apertura: la casita en lugar de «Backend» —palabra
|
||||
|
||||
@@ -1,9 +1,13 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<templates xml:space="preserve">
|
||||
<!--
|
||||
Extensión de la tarjeta de producto del POS: precio visible sobre la
|
||||
imagen (patrón app de consumo, BRIEF §3). Herencia OWL pura: el core
|
||||
no se toca.
|
||||
La tarjeta de producto, como renglón de lista (rediseño 2-sep-2026,
|
||||
decisión del encargo: la maqueta manda sobre la retícula con foto
|
||||
del brief §3 — consultado y resuelto ese mismo día).
|
||||
|
||||
Herencia OWL pura sobre point_of_sale.ProductCard; el core no se
|
||||
toca. El renglón: nombre con su chip de categoría y su nota, la
|
||||
cantidad ya en el ticket, el precio y el botón de agregar.
|
||||
|
||||
El precio sale del getter beyondPrice (product_card/product_card.js),
|
||||
que aplica la lista de precios de la sucursal (ADR-009). Antes se
|
||||
@@ -13,10 +17,24 @@
|
||||
<t t-name="beyond_pos_theme.ProductCard"
|
||||
t-inherit="point_of_sale.ProductCard"
|
||||
t-inherit-mode="extension">
|
||||
<xpath expr="//div[hasclass('product-content')]" position="inside">
|
||||
<span class="beyond_prod_meta">
|
||||
<span class="beyond_prod_chip"
|
||||
t-att-class="beyondEsServicio ? 'beyond_srv' : 'beyond_prd'"
|
||||
t-esc="beyondEtiquetaCategoria"/>
|
||||
<span class="beyond_prod_nota" t-esc="beyondNotaVenta"/>
|
||||
</span>
|
||||
</xpath>
|
||||
<xpath expr="//article" position="inside">
|
||||
<span t-if="props.productCartQty"
|
||||
class="beyond_prod_qty beyond_num"
|
||||
t-esc="props.productCartQty"/>
|
||||
<span t-if="beyondPrice"
|
||||
class="beyond-price position-absolute"
|
||||
class="beyond-price beyond_num"
|
||||
t-esc="env.utils.formatCurrency(beyondPrice)"/>
|
||||
<span class="beyond_prod_mas" aria-hidden="true">
|
||||
<i class="fa fa-plus"/>
|
||||
</span>
|
||||
</xpath>
|
||||
</t>
|
||||
</templates>
|
||||
@@ -165,6 +165,35 @@ class TestBeyondPosThemeAssets(TransactionCase):
|
||||
self.assertEqual(len(plantilla.xpath(expresiones[0])), 1,
|
||||
f'el xpath {expresiones[0]} ya no acierta en el core')
|
||||
|
||||
def test_la_venta_arma_ticket_catalogo_y_pie(self):
|
||||
"""Rediseño 2-sep-2026, punto 2: el ticket lleva su cabecera
|
||||
(Cliente · Atendió) y su pie (Descuento · Nota · Eliminar · Cobrar),
|
||||
el catálogo es lista con buscador y «Escanear», y el renglón trae
|
||||
sus mandos a la vista — salvo en devoluciones, cuya cantidad la
|
||||
fija el flujo de reembolso."""
|
||||
with file_open('beyond_pos_theme/static/src/venta/venta.xml') as handle:
|
||||
venta = handle.read()
|
||||
for pieza in ('beyond_ticket_cabecera', 'beyond_cobrar',
|
||||
'beyond_buscador', 'beyondEscanear',
|
||||
'beyond_cantidad_pill', 'beyond_pastilla_todos',
|
||||
't-inherit="point_of_sale.ProductScreen"',
|
||||
't-inherit="point_of_sale.OrderSummary"'):
|
||||
self.assertIn(pieza, venta)
|
||||
# La devolución no lleva mandos: el renglón los condiciona.
|
||||
self.assertIn('refunded_orderline_id', venta)
|
||||
# El pie sustituye a los pads del core (y con ellos, al teclado y a
|
||||
# la barra de control): si esta sustitución se cae, habría dos pies.
|
||||
self.assertIn('hasclass(\'pads\')', venta.replace('"', "'"))
|
||||
|
||||
def test_la_tarjeta_de_catalogo_es_renglon_con_chip(self):
|
||||
"""El catálogo del rediseño es lista sin fotos (decisión del
|
||||
encargo 2-sep-2026 sobre el brief §3, consultada): chip de
|
||||
categoría, nota de venta y botón de agregar."""
|
||||
with file_open('beyond_pos_theme/static/src/xml/product_card.xml') as handle:
|
||||
tarjeta = handle.read()
|
||||
for pieza in ('beyond_prod_chip', 'beyond_prod_nota', 'beyond_prod_mas'):
|
||||
self.assertIn(pieza, tarjeta)
|
||||
|
||||
def test_el_teclado_de_venta_pierde_precio_y_descuento(self):
|
||||
"""Cambiar el precio de una línea deja sin efecto el precio por
|
||||
sucursal (ADR-009) y el IVA incluido (ADR-010) para esa venta."""
|
||||
|
||||
Reference in new issue
Block a user