feat(pos): add Cut Z (close register) UI flow
- Add 'Corte Z' button in secondary actions panel - Add modal showing register summary before closing: - opening amount, total sales, cash sales, change given - cash movements in/out, cancellations, expected cash - payment method breakdown and movement detail list - loadCutX() fetches current register summary (read-only) - confirmCutZ() calls POST /pos/api/register/cut-z with counted amount - Auto-fills closing amount with expected cash - Shows toast with difference after closing - Resets register state to 'Sin caja abierta' after close - Bump pos.css and pos.js cache-bust to v=3
This commit is contained in:
@@ -14,7 +14,7 @@
|
||||
<meta name="theme-color" content="#F5A623" />
|
||||
<script src="/pos/static/js/native-bridge.js" defer></script>
|
||||
|
||||
<link rel="stylesheet" href="/pos/static/css/pos.css?v=2">
|
||||
<link rel="stylesheet" href="/pos/static/css/pos.css?v=3">
|
||||
</head>
|
||||
|
||||
<body class="pos-shell" id="appBody">
|
||||
@@ -202,6 +202,7 @@
|
||||
<div class="secondary-actions" role="toolbar" aria-label="Acciones secundarias">
|
||||
<button class="btn-secondary-action" onclick="POS.saveQuotation()" title="Cotizacion (F4)">Cotizar</button>
|
||||
<button class="btn-secondary-action" onclick="POS.showLastSale()" title="Ultima venta (F5)">Ult.Venta</button>
|
||||
<button class="btn-secondary-action" onclick="POS.showCutZModal()" title="Corte Z - Cerrar caja">Corte Z</button>
|
||||
<button class="btn-secondary-action danger" id="btnCancelSale" title="Cancelar (Esc)">Cancelar</button>
|
||||
</div>
|
||||
</div>
|
||||
@@ -490,6 +491,35 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- ================================================================
|
||||
CUT Z MODAL (Cerrar Caja)
|
||||
================================================================ -->
|
||||
<div class="modal-overlay" id="cutZModal">
|
||||
<div class="modal-pago" style="width:520px;max-height:90vh;overflow-y:auto;">
|
||||
<div class="modal-header">
|
||||
<h3>Corte Z — Cerrar Caja</h3>
|
||||
<button class="modal-close" onclick="POS.closeCutZModal()">✕</button>
|
||||
</div>
|
||||
<div style="padding:var(--space-6);">
|
||||
<div id="cutZSummary" style="margin-bottom:var(--space-4);">
|
||||
<p style="color:var(--color-text-muted);font-size:var(--text-body-sm);">Cargando resumen...</p>
|
||||
</div>
|
||||
<div style="border-top:1px solid var(--color-border);padding-top:var(--space-4);">
|
||||
<div class="form-group">
|
||||
<label class="form-label">Efectivo contado en caja *</label>
|
||||
<input type="number" class="form-input" id="cutZClosingAmount" value="0" min="0" step="0.01" />
|
||||
</div>
|
||||
</div>
|
||||
<div id="cutZResult" style="min-height:1.5em;font-size:var(--text-body-sm);margin-top:var(--space-3);"></div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button class="btn btn-ghost" onclick="POS.closeCutZModal()">Cancelar</button>
|
||||
<button class="btn btn-secondary" onclick="POS.loadCutX()">Ver Resumen (Corte X)</button>
|
||||
<button class="btn btn-primary" onclick="POS.confirmCutZ()">Cerrar Caja</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- ================================================================
|
||||
OPEN REGISTER MODAL
|
||||
================================================================ -->
|
||||
@@ -533,7 +563,7 @@
|
||||
<script src="/pos/static/js/app-init.js" defer></script>
|
||||
<script src="/pos/static/js/push.js" defer></script>
|
||||
<script src="/pos/static/js/printer.js" defer></script>
|
||||
<script src="/pos/static/js/pos.js?v=2" defer></script>
|
||||
<script src="/pos/static/js/pos.js?v=3" defer></script>
|
||||
|
||||
<script>
|
||||
// Cancel sale button wiring
|
||||
|
||||
Reference in New Issue
Block a user