Compare commits
15 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 5c9cb1905b | |||
| a2d3dcc366 | |||
| 12e3d081a7 | |||
| ad967bf0a1 | |||
| d39cc7518b | |||
| 52bec03988 | |||
| 9639048bf7 | |||
| b1585af3f9 | |||
| 155782f50a | |||
| 16972f4734 | |||
| d3d5c4fbca | |||
| 5f1d9a4e2f | |||
| cc45ed9df7 | |||
| 378a589572 | |||
| 50b0ba4498 |
+142
-135
@@ -160,7 +160,7 @@
|
|||||||
padding: 10px 16px; display: flex; justify-content: space-between; align-items: center;
|
padding: 10px 16px; display: flex; justify-content: space-between; align-items: center;
|
||||||
}
|
}
|
||||||
.dif-label { font-size: 12px; font-weight: 700; color: var(--text); text-transform: uppercase; letter-spacing: 0.5px; }
|
.dif-label { font-size: 12px; font-weight: 700; color: var(--text); text-transform: uppercase; letter-spacing: 0.5px; }
|
||||||
.dif-value { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
|
.dif-value { font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; }
|
||||||
.dif-value.pos, .dif-value.zero { color: var(--green); }
|
.dif-value.pos, .dif-value.zero { color: var(--green); }
|
||||||
.dif-value.neg { color: var(--red); }
|
.dif-value.neg { color: var(--red); }
|
||||||
|
|
||||||
@@ -565,7 +565,7 @@
|
|||||||
<p style="font-size:13px;color:#444;margin-bottom:14px">
|
<p style="font-size:13px;color:#444;margin-bottom:14px">
|
||||||
Tem certeza que deseja <strong>enviar este fechamento e encerrar o caixa?</strong>
|
Tem certeza que deseja <strong>enviar este fechamento e encerrar o caixa?</strong>
|
||||||
</p>
|
</p>
|
||||||
<div id="confirm-summary" style="border:1px solid #b3d9f7;border-radius:8px;padding:14px;background:#f0f7ff;font-size:14px;font-family:Arial,sans-serif;line-height:1.6">
|
<div id="confirm-summary" style="border:1px solid #b3d9f7;border-radius:8px;padding:18px;background:#f0f7ff;font-size:16px;font-family:Arial,sans-serif;line-height:1.8">
|
||||||
</div>
|
</div>
|
||||||
<p style="font-size:11px;color:#888;margin-top:10px">
|
<p style="font-size:11px;color:#888;margin-top:10px">
|
||||||
Após enviar, <strong>não dá pra editar este fechamento</strong> sem a senha do Filipe.
|
Após enviar, <strong>não dá pra editar este fechamento</strong> sem a senha do Filipe.
|
||||||
@@ -1370,17 +1370,17 @@ function buildConfirmHTML(data) {
|
|||||||
const al = cartAli_arr[i] || 0;
|
const al = cartAli_arr[i] || 0;
|
||||||
const px = cartPix_arr[i] || 0;
|
const px = cartPix_arr[i] || 0;
|
||||||
cartTableRows += `<tr>
|
cartTableRows += `<tr>
|
||||||
<td>${cr > 0 ? fmt(cr) : '-'}</td>
|
<td>${cr > 0 ? fmt(cr).replace('R$ ','') : '-'}</td>
|
||||||
<td>${db > 0 ? fmt(db) : '-'}</td>
|
<td>${db > 0 ? fmt(db).replace('R$ ','') : '-'}</td>
|
||||||
<td>${al > 0 ? fmt(al) : '-'}</td>
|
<td>${al > 0 ? fmt(al).replace('R$ ','') : '-'}</td>
|
||||||
<td>${px > 0 ? fmt(px) : '-'}</td>
|
<td>${px > 0 ? fmt(px).replace('R$ ','') : '-'}</td>
|
||||||
</tr>`;
|
</tr>`;
|
||||||
}
|
}
|
||||||
cartTableRows += `<tr class="total-row">
|
cartTableRows += `<tr class="total-row">
|
||||||
<td>${cartCred > 0 ? fmt(cartCred) : '-'}</td>
|
<td>${cartCred > 0 ? fmt(cartCred).replace('R$ ','') : '-'}</td>
|
||||||
<td>${cartDeb > 0 ? fmt(cartDeb) : '-'}</td>
|
<td>${cartDeb > 0 ? fmt(cartDeb).replace('R$ ','') : '-'}</td>
|
||||||
<td>${cartAli > 0 ? fmt(cartAli) : '-'}</td>
|
<td>${cartAli > 0 ? fmt(cartAli).replace('R$ ','') : '-'}</td>
|
||||||
<td>${cartPix > 0 ? fmt(cartPix) : '-'}</td>
|
<td>${cartPix > 0 ? fmt(cartPix).replace('R$ ','') : '-'}</td>
|
||||||
</tr>`;
|
</tr>`;
|
||||||
|
|
||||||
let html = `<!DOCTYPE html>
|
let html = `<!DOCTYPE html>
|
||||||
@@ -1389,28 +1389,28 @@ function buildConfirmHTML(data) {
|
|||||||
<title>Fechamento de Caixa</title>
|
<title>Fechamento de Caixa</title>
|
||||||
<style>
|
<style>
|
||||||
* { box-sizing: border-box; margin: 0; padding: 0; }
|
* { box-sizing: border-box; margin: 0; padding: 0; }
|
||||||
body { font-family: 'Courier New', monospace; font-size: 15px; width: 80mm; margin: 0 auto; padding: 8px; font-weight: bold !important; print-color-adjust: exact; -webkit-print-color-adjust: exact; }
|
body { font-family: 'Courier New', monospace; font-size: 18px; font-weight: bold !important; width: 80mm; margin: 0 auto; padding: 8px; font-weight: bold !important; print-color-adjust: exact; -webkit-print-color-adjust: exact; }
|
||||||
.header { text-align: center; margin-bottom: 8px; }
|
.header { text-align: center; margin-bottom: 8px; }
|
||||||
.header h1 { font-size: 20px; font-weight: bold !important; }
|
.header h1 { font-size: 24px; font-weight: bold !important; }
|
||||||
.header h2 { font-size: 16px; font-weight: bold !important; }
|
.header h2 { font-size: 18px; font-weight: bold !important; }
|
||||||
hr { border: none; border-top: 2px solid #000; margin: 6px 0; }
|
hr { border: none; border-top: 2px solid #000; margin: 6px 0; }
|
||||||
.section-title { font-weight: bold !important; font-size: 14px; border-top: 2px solid #000; padding-top: 4px; margin-top: 8px; }
|
.section-title { font-weight: bold !important; font-size: 18px; border-top: 2px solid #000; padding-top: 4px; margin-top: 8px; }
|
||||||
.row { display: flex; justify-content: space-between; padding: 2px 0; font-size: 14px; font-weight: bold !important; }
|
.row { display: flex; justify-content: space-between; padding: 2px 0; font-size: 18px; font-weight: bold !important; }
|
||||||
.row.total-row { font-weight: bold !important; }
|
.row.total-row { font-weight: bold !important; }
|
||||||
.cart-table { table-layout: fixed; width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 4px; font-weight: bold !important; }
|
.cart-table { table-layout: fixed; width: 100%; border-collapse: collapse; font-size: 12px; margin-top: 4px; font-weight: bold !important; }
|
||||||
.cart-table th { font-weight: bold !important; border-bottom: 2px solid #000; padding: 3px; font-size: 13px; width: 25%; }
|
.cart-table th { font-weight: bold !important; border-bottom: 2px solid #000; padding: 2px 3px; font-size: 12px; width: 25%; }
|
||||||
.cart-table td { padding: 3px 5px; text-align: right; font-weight: bold !important; font-size: 13px; }
|
.cart-table td { padding: 2px 3px; text-align: right; font-weight: bold !important; font-size: 12px; }
|
||||||
.cart-table td:first-child { text-align: left; }
|
.cart-table td:first-child { text-align: left; }
|
||||||
.cart-table tr.total-row { font-weight: bold !important; border-top: 2px solid #000; }
|
.cart-table tr.total-row { font-weight: bold !important; border-top: 2px solid #000; }
|
||||||
.subtotal { font-size: 13px; margin-top: 4px; }
|
.subtotal { font-size: 12px; margin-top: 4px; }
|
||||||
.subtotal .row { padding: 1px 0; font-weight: bold !important; }
|
.subtotal .row { padding: 1px 0; font-weight: bold !important; }
|
||||||
.diff-ok { color: #2e7d32; font-weight: bold !important; }
|
.diff-ok { color: #2e7d32; font-weight: bold !important; }
|
||||||
.diff-bad { color: #c0272d; font-weight: bold !important; }
|
.diff-bad { color: #c0272d; font-weight: bold !important; }
|
||||||
.obs { font-size: 12px; color: #555; margin-top: 6px; white-space: pre-wrap; font-weight: bold !important; }
|
.obs { font-size: 16px; color: #555; margin-top: 6px; white-space: pre-wrap; font-weight: bold !important; }
|
||||||
.footer { text-align: center; font-size: 12px; color: #555; margin-top: 8px; font-weight: bold !important; }
|
.footer { text-align: center; font-size: 14px; color: #555; margin-top: 8px; font-weight: bold !important; }
|
||||||
@media print { body { background: #fff; font-weight: bold !important; font-size: 15px !important; } }
|
@media print { body { background: #fff; font-weight: bold !important; font-size: 18px !important; } }
|
||||||
</head><body>
|
</head><body>
|
||||||
<div class="header">
|
<div class="header">
|
||||||
<h1>${data.loja}</h1>
|
<h1>${data.loja}</h1>
|
||||||
<h2>Fechamento de Caixa</h2>
|
<h2>Fechamento de Caixa</h2>
|
||||||
</div>
|
</div>
|
||||||
@@ -1447,7 +1447,7 @@ ${cancelamentos_arr.map(c => `<div class="row"><span>${c.numero ? `Nº ${c.numer
|
|||||||
<table class="cart-table">
|
<table class="cart-table">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th>CRÉDITO</th><th>DÉBITO</th><th>ALIMENT.</th><th>PIX</th>
|
<th>CRÉD</th><th>DÉBIT</th><th>ALIM</th><th>PIX</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
@@ -1585,18 +1585,18 @@ function buildPrintHTML(data) {
|
|||||||
const al = cartAli_arr[i] || 0;
|
const al = cartAli_arr[i] || 0;
|
||||||
const px = cartPix_arr[i] || 0;
|
const px = cartPix_arr[i] || 0;
|
||||||
cartTableRows += `<tr>
|
cartTableRows += `<tr>
|
||||||
<td>${cr > 0 ? fmt(cr) : '-'}</td>
|
<td>${cr > 0 ? fmt(cr).replace('R$ ','') : '-'}</td>
|
||||||
<td>${db > 0 ? fmt(db) : '-'}</td>
|
<td>${db > 0 ? fmt(db).replace('R$ ','') : '-'}</td>
|
||||||
<td>${al > 0 ? fmt(al) : '-'}</td>
|
<td>${al > 0 ? fmt(al).replace('R$ ','') : '-'}</td>
|
||||||
<td>${px > 0 ? fmt(px) : '-'}</td>
|
<td>${px > 0 ? fmt(px).replace('R$ ','') : '-'}</td>
|
||||||
</tr>`;
|
</tr>`;
|
||||||
}
|
}
|
||||||
// Totals row
|
// Totals row
|
||||||
cartTableRows += `<tr class="total-row">
|
cartTableRows += `<tr class="total-row">
|
||||||
<td>${cartCred > 0 ? fmt(cartCred) : '-'}</td>
|
<td>${cartCred > 0 ? fmt(cartCred).replace('R$ ','') : '-'}</td>
|
||||||
<td>${cartDeb > 0 ? fmt(cartDeb) : '-'}</td>
|
<td>${cartDeb > 0 ? fmt(cartDeb).replace('R$ ','') : '-'}</td>
|
||||||
<td>${cartAli > 0 ? fmt(cartAli) : '-'}</td>
|
<td>${cartAli > 0 ? fmt(cartAli).replace('R$ ','') : '-'}</td>
|
||||||
<td>${cartPix > 0 ? fmt(cartPix) : '-'}</td>
|
<td>${cartPix > 0 ? fmt(cartPix).replace('R$ ','') : '-'}</td>
|
||||||
</tr>`;
|
</tr>`;
|
||||||
|
|
||||||
const sysTotal = data.sys_total || 0;
|
const sysTotal = data.sys_total || 0;
|
||||||
@@ -1609,26 +1609,26 @@ function buildPrintHTML(data) {
|
|||||||
<title>Fechamento de Caixa</title>
|
<title>Fechamento de Caixa</title>
|
||||||
<style>
|
<style>
|
||||||
* { box-sizing: border-box; margin: 0; padding: 0; }
|
* { box-sizing: border-box; margin: 0; padding: 0; }
|
||||||
body { font-family: 'Courier New', monospace; font-size: 15px; width: 80mm; margin: 0 auto; padding: 8px; font-weight: bold !important; print-color-adjust: exact; -webkit-print-color-adjust: exact; }
|
body { font-family: 'Courier New', monospace; font-size: 18px; font-weight: bold !important; width: 80mm; margin: 0 auto; padding: 8px; print-color-adjust: exact; -webkit-print-color-adjust: exact; }
|
||||||
.header { text-align: center; margin-bottom: 8px; }
|
.header { text-align: center; margin-bottom: 8px; }
|
||||||
.header h1 { font-size: 20px; font-weight: bold !important; }
|
.header h1 { font-size: 24px; font-weight: bold !important; }
|
||||||
.header h2 { font-size: 16px; font-weight: bold !important; }
|
.header h2 { font-size: 18px; font-weight: bold !important; }
|
||||||
hr { border: none; border-top: 2px solid #000; margin: 6px 0; }
|
hr { border: none; border-top: 2px solid #000; margin: 6px 0; }
|
||||||
.section-title { font-weight: bold !important; font-size: 14px; border-top: 2px solid #000; padding-top: 4px; margin-top: 8px; }
|
.section-title { font-weight: bold !important; font-size: 18px; border-top: 2px solid #000; padding-top: 4px; margin-top: 8px; }
|
||||||
.row { display: flex; justify-content: space-between; padding: 2px 0; font-size: 14px; font-weight: bold !important; }
|
.row { display: flex; justify-content: space-between; padding: 2px 0; font-size: 18px; font-weight: bold !important; }
|
||||||
.row.total-row { font-weight: bold !important; }
|
.row.total-row { font-weight: bold !important; }
|
||||||
.cart-table { table-layout: fixed; width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 4px; font-weight: bold !important; }
|
.cart-table { table-layout: fixed; width: 100%; border-collapse: collapse; font-size: 12px; margin-top: 4px; font-weight: bold !important; }
|
||||||
.cart-table th { font-weight: bold !important; border-bottom: 2px solid #000; padding: 3px; font-size: 13px; width: 25%; }
|
.cart-table th { font-weight: bold !important; border-bottom: 2px solid #000; padding: 2px 3px; font-size: 12px; width: 25%; }
|
||||||
.cart-table td { padding: 3px 5px; text-align: right; font-weight: bold !important; font-size: 13px; }
|
.cart-table td { padding: 2px 3px; text-align: right; font-weight: bold !important; font-size: 12px; }
|
||||||
.cart-table td:first-child { text-align: left; }
|
.cart-table td:first-child { text-align: left; }
|
||||||
.cart-table tr.total-row { font-weight: bold !important; border-top: 2px solid #000; }
|
.cart-table tr.total-row { font-weight: bold !important; border-top: 2px solid #000; }
|
||||||
.subtotal { font-size: 13px; margin-top: 4px; }
|
.subtotal { font-size: 12px; margin-top: 4px; }
|
||||||
.subtotal .row { padding: 1px 0; font-weight: bold !important; }
|
.subtotal .row { padding: 1px 0; font-weight: bold !important; }
|
||||||
.diff-ok { color: #2e7d32; font-weight: bold !important; }
|
.diff-ok { color: #2e7d32; font-weight: bold !important; }
|
||||||
.diff-bad { color: #c0272d; font-weight: bold !important; }
|
.diff-bad { color: #c0272d; font-weight: bold !important; }
|
||||||
.obs { font-size: 12px; color: #555; margin-top: 6px; white-space: pre-wrap; font-weight: bold !important; }
|
.obs { font-size: 16px; color: #555; margin-top: 6px; white-space: pre-wrap; font-weight: bold !important; }
|
||||||
.footer { text-align: center; font-size: 12px; color: #555; margin-top: 8px; font-weight: bold !important; }
|
.footer { text-align: center; font-size: 14px; color: #555; margin-top: 8px; font-weight: bold !important; }
|
||||||
@media print { body { background: #fff; font-weight: bold !important; font-size: 15px !important; } }
|
@media print { body { background: #fff; font-weight: bold !important; font-size: 18px !important; } }
|
||||||
</style>
|
</style>
|
||||||
</head><body>
|
</head><body>
|
||||||
<div class="header">
|
<div class="header">
|
||||||
@@ -1668,7 +1668,7 @@ ${cancLines.map(l => `<div class="row"><span>${l.label}</span><span>${fmt(l.valo
|
|||||||
<table class="cart-table">
|
<table class="cart-table">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th>CRÉDITO</th><th>DÉBITO</th><th>ALIMENT.</th><th>PIX</th>
|
<th>CRÉD</th><th>DÉBIT</th><th>ALIM</th><th>PIX</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
@@ -1738,17 +1738,20 @@ function buildReportHTML(data) {
|
|||||||
<title>Relatório de Fechamento</title>
|
<title>Relatório de Fechamento</title>
|
||||||
<style>
|
<style>
|
||||||
* { box-sizing: border-box; margin: 0; padding: 0; }
|
* { box-sizing: border-box; margin: 0; padding: 0; }
|
||||||
body { font-family: 'Courier New', monospace; font-size: 13px; width: 80mm; margin: 0 auto; padding: 8px; }
|
body { font-family: 'Courier New', monospace; font-size: 18px; font-weight: bold; width: 80mm; margin: 0 auto; padding: 8px; }
|
||||||
.header { text-align: center; margin-bottom: 8px; }
|
.header { text-align: center; margin-bottom: 10px; }
|
||||||
hr { border: none; border-top: 1px dashed #000; margin: 6px 0; }
|
hr { border: none; border-top: 1px dashed #000; margin: 6px 0; }
|
||||||
.row { display: flex; justify-content: space-between; padding: 2px 0; font-size: 12px; }
|
.row { display: flex; justify-content: space-between; padding: 3px 0; font-size: 18px; font-weight: bold; }
|
||||||
.row .val { font-weight: bold; }
|
.row .val { font-weight: bold; }
|
||||||
.footer { text-align: center; font-size: 11px; color: #555; margin-top: 8px; }
|
.footer { text-align: center; font-size: 13px; color: #555; margin-top: 8px; }
|
||||||
@media print { body { margin: 0; } }
|
@media print { body { margin: 0; font-size: 18px !important; font-weight: bold !important; } }
|
||||||
</style>
|
</style>
|
||||||
</head><body>
|
</head><body>
|
||||||
<div class="header">
|
<div class="header">
|
||||||
<div>📅 Data: ${data.data} 👤 Operador: ${data.operador} ⏰ Turno: ${data.turno} 🏪 Loja: ${data.loja}</div>
|
<div>📅 Data: ${data.data}</div>
|
||||||
|
<div>👤 Operador: ${data.operador}</div>
|
||||||
|
<div>⏰ Turno: ${data.turno}</div>
|
||||||
|
<div>🏪 Loja: ${data.loja}</div>
|
||||||
</div>
|
</div>
|
||||||
<hr>
|
<hr>
|
||||||
<div class="row"><span>💸 Sangrias:</span><span class="val">${fmt(sangrias)}</span></div>
|
<div class="row"><span>💸 Sangrias:</span><span class="val">${fmt(sangrias)}</span></div>
|
||||||
@@ -1771,7 +1774,7 @@ function buildReportHTML(data) {
|
|||||||
<div class="row"><span>🍗 Frango Assado:</span><span class="val">${data.frango || 0}</span></div>
|
<div class="row"><span>🍗 Frango Assado:</span><span class="val">${data.frango || 0}</span></div>
|
||||||
<div class="row"><span>💰 Vendas:</span><span class="val">${fmt(data.vendas || 0)}</span></div>
|
<div class="row"><span>💰 Vendas:</span><span class="val">${fmt(data.vendas || 0)}</span></div>
|
||||||
<hr>
|
<hr>
|
||||||
<div style="text-align:center;font-size:10px;color:#888">ID: ${data.loja}_${data.data}_${data.operador}</div>
|
<div style="text-align:center;font-size:12px;color:#888">ID: ${data.loja}_${data.data}_${data.operador}</div>
|
||||||
<div class="footer">Gerado em ${new Date().toLocaleString('pt-BR')}</div>
|
<div class="footer">Gerado em ${new Date().toLocaleString('pt-BR')}</div>
|
||||||
</body></html>`;
|
</body></html>`;
|
||||||
}
|
}
|
||||||
@@ -1795,21 +1798,21 @@ function openPrintPreview(data, mode) {
|
|||||||
|
|
||||||
const previewStyle = `
|
const previewStyle = `
|
||||||
<style>
|
<style>
|
||||||
body { width: 80mm; margin: 0 auto; font-family: 'Courier New', monospace; font-size: 13px; background: #fff; padding: 10px; }
|
body { width: 80mm; margin: 0 auto; font-family: 'Courier New', monospace; font-size: 6px; background: #fff; padding: 10px; font-weight: bold; }
|
||||||
.header { text-align: center; margin-bottom: 8px; }
|
.header { text-align: center; margin-bottom: 8px; }
|
||||||
.header h1 { font-size: 18px; }
|
.header h1 { font-size: 18px; font-weight: bold; }
|
||||||
.header h2 { font-size: 14px; font-weight: normal; }
|
.header h2 { font-size: 6px; font-weight: bold; }
|
||||||
hr { border: none; border-top: 1px dashed #000; margin: 6px 0; }
|
hr { border: none; border-top: 1px dashed #000; margin: 6px 0; }
|
||||||
.section-title { font-weight: bold; font-size: 14px; border-top: 1px dashed #000; padding-top: 4px; margin-top: 6px; }
|
.section-title { font-weight: bold; font-size: 6px; border-top: 1px dashed #000; padding-top: 4px; margin-top: 6px; }
|
||||||
.row { display: flex; justify-content: space-between; padding: 2px 0; }
|
.row { display: flex; justify-content: space-between; padding: 2px 0; font-size: 6px; font-weight: bold; }
|
||||||
table { width: 100%; border-collapse: collapse; font-size: 12px; }
|
table { width: 100%; border-collapse: collapse; font-size: 6px; font-weight: bold; }
|
||||||
td { padding: 2px 4px; vertical-align: top; }
|
td { padding: 2px 4px; vertical-align: top; font-weight: bold; }
|
||||||
td:nth-child(2) { text-align: right; }
|
td:nth-child(2) { text-align: right; }
|
||||||
td:nth-child(3) { text-align: right; color: #555; font-size: 11px; }
|
td:nth-child(3) { text-align: right; color: #555; font-size: 5px; }
|
||||||
.grand-total { font-size: 16px; font-weight: bold; text-align: center; padding: 6px; border: 2px solid #000; margin: 8px 0; }
|
.grand-total { font-size: 18px; font-weight: bold; text-align: center; padding: 6px; border: 2px solid #000; margin: 8px 0; }
|
||||||
.obs { font-size: 11px; color: #555; margin-top: 6px; white-space: pre-wrap; }
|
.obs { font-size: 5px; color: #555; margin-top: 6px; white-space: pre-wrap; font-weight: normal; }
|
||||||
.footer { text-align: center; font-size: 11px; color: #555; margin-top: 8px; }
|
.footer { text-align: center; font-size: 5px; color: #555; margin-top: 8px; font-weight: normal; }
|
||||||
@media print { body { background: #fff; } }
|
@media print { body { background: #fff; font-size: 6px !important; font-weight: bold !important; } }
|
||||||
</style>
|
</style>
|
||||||
`;
|
`;
|
||||||
|
|
||||||
@@ -2005,26 +2008,26 @@ function openConfirmModal() {
|
|||||||
const diferenca = sysTotal - saldoEsp - cancelamentos;
|
const diferenca = sysTotal - saldoEsp - cancelamentos;
|
||||||
const diffClass = diferenca === 0 ? '#2e7d32' : (diferenca > 0 ? '#e65100' : '#c0272d');
|
const diffClass = diferenca === 0 ? '#2e7d32' : (diferenca > 0 ? '#e65100' : '#c0272d');
|
||||||
document.getElementById('confirm-summary').innerHTML =
|
document.getElementById('confirm-summary').innerHTML =
|
||||||
`<div style="margin-bottom:6px"><strong>📅 Data:</strong> ${estado.data} <strong>👤 Operador:</strong> ${operador} <strong>⏰ Turno:</strong> ${turno} <strong>🏪 Loja:</strong> ${loja}</div>
|
`<div style="margin-bottom:6px;font-size:17px"><strong>📅 Data:</strong> ${estado.data} <strong>👤 Operador:</strong> ${operador} <strong>⏰ Turno:</strong> ${turno} <strong>🏪 Loja:</strong> ${loja}</div>
|
||||||
<hr style="border:none;border-top:1px dashed #b3d9f7;margin:6px 0">
|
<hr style="border:none;border-top:1px dashed #b3d9f7;margin:6px 0">
|
||||||
<div>💸 Sangrias: <strong>${fmt(sangrias)}</strong></div>
|
<div style="font-size:16px">💸 Sangrias: <strong>${fmt(sangrias)}</strong></div>
|
||||||
<div>📝 Despesas: <strong>${fmt(despesas)}</strong></div>
|
<div style="font-size:16px">📝 Despesas: <strong>${fmt(despesas)}</strong></div>
|
||||||
<div>💰 Vales: <strong>${fmt(vales)}</strong></div>
|
<div style="font-size:16px">💰 Vales: <strong>${fmt(vales)}</strong></div>
|
||||||
<div>👥 À Receber: <strong>${fmt(receber)}</strong></div>
|
<div style="font-size:16px">👥 À Receber: <strong>${fmt(receber)}</strong></div>
|
||||||
<div>🔵 PIX CNPJ: <strong>${fmt(pixcnpj)}</strong></div>
|
<div style="font-size:16px">🔵 PIX CNPJ: <strong>${fmt(pixcnpj)}</strong></div>
|
||||||
<div>💳 Crédito: <strong>${fmt(cartCred)}</strong></div>
|
<div style="font-size:16px">💳 Crédito: <strong>${fmt(cartCred)}</strong></div>
|
||||||
<div>💳 Débito: <strong>${fmt(cartDeb)}</strong></div>
|
<div style="font-size:16px">💳 Débito: <strong>${fmt(cartDeb)}</strong></div>
|
||||||
<div>💳 Alimentação: <strong>${fmt(cartAli)}</strong></div>
|
<div style="font-size:16px">💳 Alimentação: <strong>${fmt(cartAli)}</strong></div>
|
||||||
<div>❌ Cancelamentos: <strong>${fmt(cancelamentos)}</strong></div>
|
<div style="font-size:16px">❌ Cancelamentos: <strong>${fmt(cancelamentos)}</strong></div>
|
||||||
<div>👥 Clientes: <strong>${estado.clientes || 0}</strong></div>
|
<div style="font-size:16px">👥 Clientes: <strong>${estado.clientes || 0}</strong></div>
|
||||||
<div>🍗 Frango Assado: <strong>${estado.frango || 0}</strong></div>
|
<div style="font-size:16px">🍗 Frango Assado: <strong>${estado.frango || 0}</strong></div>
|
||||||
<div>💰 Vendas: <strong>${fmt(estado.vendas || 0)}</strong></div>
|
<div style="font-size:16px">💰 Vendas: <strong>${fmt(estado.vendas || 0)}</strong></div>
|
||||||
<div>📋 Fechamento (contado): <strong>${fmt(fechamento)}</strong></div>
|
<div style="font-size:16px">📋 Fechamento (contado): <strong>${fmt(fechamento)}</strong></div>
|
||||||
<div>🖥️ Total Sistema: <strong>${fmt(sysTotal)}</strong></div>
|
<div style="font-size:16px">🖥️ Total Sistema: <strong>${fmt(sysTotal)}</strong></div>
|
||||||
<hr style="border:none;border-top:1px dashed #b3d9f7;margin:6px 0">
|
<hr style="border:none;border-top:1px dashed #b3d9f7;margin:6px 0">
|
||||||
<div>🎯 Saldo Esperado (contado): <strong>${fmt(saldoEsp)}</strong></div>
|
<div style="font-size:16px">🎯 Saldo Esperado (contado): <strong>${fmt(saldoEsp)}</strong></div>
|
||||||
<div style="margin-top:4px">📐 Diferença: <strong style="color:${diffClass}">${fmt(diferenca)}</strong></div>
|
<div style="margin-top:4px;font-size:16px">📐 Diferença: <strong style="color:${diffClass}">${fmt(diferenca)}</strong></div>
|
||||||
<div style="margin-top:4px;font-size:10px;color:#888">ID: ${estado.loja}_${estado.data}_${estado.operador}</div>`;
|
<div style="margin-top:8px;font-size:12px;color:#888">ID: ${estado.loja}_${estado.data}_${estado.operador}</div>`;
|
||||||
console.log('[DEBUG] openConfirmModal: tentando abrir modal');
|
console.log('[DEBUG] openConfirmModal: tentando abrir modal');
|
||||||
document.getElementById('modal-confirm').classList.add('open');
|
document.getElementById('modal-confirm').classList.add('open');
|
||||||
}
|
}
|
||||||
@@ -2105,36 +2108,48 @@ document.getElementById('btn-recibo').addEventListener('click', async () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
document.getElementById('btn-limpar').addEventListener('click', () => {
|
document.getElementById('btn-limpar').addEventListener('click', () => {
|
||||||
try {
|
const overlay = document.createElement('div');
|
||||||
if (!confirm('Tem certeza? Irá apagar todas as informações para iniciar uma nova.')) return;
|
overlay.style.cssText = 'position:fixed;top:0;left:0;right:0;bottom:0;background:rgba(0,0,0,0.5);z-index:999999;display:flex;align-items:center;justify-content:center;';
|
||||||
} catch(e) { return; }
|
overlay.id = 'clear-modal';
|
||||||
localStorage.removeItem(LS_KEY);
|
overlay.innerHTML = `
|
||||||
estado = {
|
<div style="background:#fff;border-radius:10px;padding:28px;width:340px;text-align:center">
|
||||||
uuid: crypto.randomUUID ? crypto.randomUUID() : Date.now().toString(),
|
<div style="font-size:20px;margin-bottom:12px">⚠️ Limpar Rascunho</div>
|
||||||
loja: estado.loja, data: estado.data, operador: '', turno: '',
|
<div style="font-size:13px;color:#555;margin-bottom:20px;line-height:1.5">Tem certeza?<br>Irá <strong>apagar todas as informações</strong> lançadas para iniciar uma nova.</div>
|
||||||
saldo_troco: 0, fechamento: 0, saldo_esperado: 0, diferenca: 0,
|
<div style="display:flex;gap:10px;justify-content:center">
|
||||||
despesas: [], sangrias: [], pixcnpj: [], vales: [], receber: [], cancelamentos: [],
|
<button id="clear-cancel-btn" style="padding:9px 20px;background:#888;color:#fff;border:none;border-radius:6px;cursor:pointer;font-size:13px">Cancelar</button>
|
||||||
cartoes: { credito: [], debito: [], alimentacao: [], pix: [] },
|
<button id="clear-ok-btn" style="padding:9px 20px;background:#c0272d;color:#fff;border:none;border-radius:6px;cursor:pointer;font-size:13px">Apagar tudo</button>
|
||||||
fechamento_contado: { dinheiro: 0, cartoes: 0, receber: 0 },
|
</div>
|
||||||
observacoes: '', id_local: null, sync_status: 'local'
|
</div>`;
|
||||||
};
|
document.body.appendChild(overlay);
|
||||||
// Limpa arrays
|
document.getElementById('clear-cancel-btn').addEventListener('click', () => overlay.remove());
|
||||||
estado.sangrias = []; estado.despesas = []; estado.pixcnpj = [];
|
document.getElementById('clear-ok-btn').addEventListener('click', () => {
|
||||||
estado.vales = []; estado.receber = []; estado.cancelamentos = [];
|
overlay.remove();
|
||||||
estado.cartoes = { credito: [], debito: [], alimentacao: [], pix: [] };
|
localStorage.removeItem(LS_KEY);
|
||||||
estado.fechamento_contado = { dinheiro: 0, cartoes: 0, receber: 0 };
|
estado = {
|
||||||
// Limpa todos os campos do formulário principal
|
uuid: crypto.randomUUID ? crypto.randomUUID() : Date.now().toString(),
|
||||||
setVal('f-operador', ''); setVal('f-turno', '');
|
loja: estado.loja, data: estado.data, operador: '', turno: '',
|
||||||
setVal('f-fech-dinheiro', ''); setVal('f-fech-cartoes', ''); setVal('f-fech-receber', '');
|
saldo_troco: 0, fechamento: 0, saldo_esperado: 0, diferenca: 0,
|
||||||
setVal('f-saldo-esperado', ''); setVal('f-obs', '');
|
despesas: [], sangrias: [], pixcnpj: [], vales: [], receber: [], cancelamentos: [],
|
||||||
setVal('f-vendas', ''); setVal('f-clientes', ''); setVal('f-frango', '');
|
cartoes: { credito: [], debito: [], alimentacao: [], pix: [] },
|
||||||
setVal('sys-troco', ''); setVal('sys-total', '');
|
fechamento_contado: { dinheiro: 0, cartoes: 0, receber: 0 },
|
||||||
setVal('sys-credito', ''); setVal('sys-debito', '');
|
observacoes: '', id_local: null, sync_status: 'local'
|
||||||
setVal('sys-alimentacao', ''); setVal('sys-pixcnpj', '');
|
};
|
||||||
Object.keys(TABLES).forEach(renderTable);
|
estado.sangrias = []; estado.despesas = []; estado.pixcnpj = [];
|
||||||
updateTotals();
|
estado.vales = []; estado.receber = []; estado.cancelamentos = [];
|
||||||
syncUI();
|
estado.cartoes = { credito: [], debito: [], alimentacao: [], pix: [] };
|
||||||
showToast('Rascunho limpo.', 'info');
|
estado.fechamento_contado = { dinheiro: 0, cartoes: 0, receber: 0 };
|
||||||
|
setVal('f-operador', ''); setVal('f-turno', '');
|
||||||
|
setVal('f-fech-dinheiro', ''); setVal('f-fech-cartoes', ''); setVal('f-fech-receber', '');
|
||||||
|
setVal('f-saldo-esperado', ''); setVal('f-obs', '');
|
||||||
|
setVal('f-vendas', ''); setVal('f-clientes', ''); setVal('f-frango', '');
|
||||||
|
setVal('sys-troco', ''); setVal('sys-total', '');
|
||||||
|
setVal('sys-credito', ''); setVal('sys-debito', '');
|
||||||
|
setVal('sys-alimentacao', ''); setVal('sys-pixcnpj', '');
|
||||||
|
Object.keys(TABLES).forEach(renderTable);
|
||||||
|
updateTotals();
|
||||||
|
syncUI();
|
||||||
|
showToast('Rascunho limpo.', 'info');
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
// ─── Dia Anterior — seleção + consulta + edição de registros do Supabase ───
|
// ─── Dia Anterior — seleção + consulta + edição de registros do Supabase ───
|
||||||
@@ -2351,6 +2366,7 @@ window.abrirEditaFechamentoIndex = async function(idx) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
closeConsultaModal();
|
closeConsultaModal();
|
||||||
|
if (!await askPassword()) return;
|
||||||
window.abrirEditaFechamento(full);
|
window.abrirEditaFechamento(full);
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -2635,16 +2651,8 @@ window.toggleEditConsulta = async function() {
|
|||||||
// Se já está editando, apenas fecha
|
// Se já está editando, apenas fecha
|
||||||
if (window._editModalOpen) { closeEditModal(); return; }
|
if (window._editModalOpen) { closeEditModal(); return; }
|
||||||
|
|
||||||
// Pede senha admin primeiro — sempre, para proteger edições
|
// Pede senha — sempre, uma vez (aceita fixa ou dinâmica)
|
||||||
const pw = config.admin_password;
|
if (!await askPassword()) return;
|
||||||
if (pw) {
|
|
||||||
const ok = await askPassword();
|
|
||||||
if (!ok) return;
|
|
||||||
} else {
|
|
||||||
// Sem senha configurada — avisa e abre mesmo assim (primeiro uso)
|
|
||||||
const ok = await askPassword(); // mostra diálogo vazio para o admin configurar mentalmente
|
|
||||||
if (!ok) return;
|
|
||||||
}
|
|
||||||
|
|
||||||
openEditModal(full);
|
openEditModal(full);
|
||||||
closeRelatorioModal();
|
closeRelatorioModal();
|
||||||
@@ -2669,7 +2677,6 @@ function askPassword() {
|
|||||||
overlay.innerHTML = `
|
overlay.innerHTML = `
|
||||||
<div style="background:#fff;border-radius:10px;padding:24px;width:300px;text-align:center">
|
<div style="background:#fff;border-radius:10px;padding:24px;width:300px;text-align:center">
|
||||||
<div style="font-size:18px;margin-bottom:16px">🔐 Senha Admin</div>
|
<div style="font-size:18px;margin-bottom:16px">🔐 Senha Admin</div>
|
||||||
<div style="font-size:11px;color:#888;margin-bottom:12px">Dinâmica hoje: <strong>${getDynamicPw()}</strong></div>
|
|
||||||
<input type="password" id="pw-input" placeholder="Digite a senha..." style="width:100%;padding:10px;font-size:14px;border:1px solid #ccc;border-radius:6px;box-sizing:border-box;margin-bottom:12px" />
|
<input type="password" id="pw-input" placeholder="Digite a senha..." style="width:100%;padding:10px;font-size:14px;border:1px solid #ccc;border-radius:6px;box-sizing:border-box;margin-bottom:12px" />
|
||||||
<div id="pw-error" style="color:#c0272d;font-size:12px;margin-bottom:8px;display:none">Senha incorreta</div>
|
<div id="pw-error" style="color:#c0272d;font-size:12px;margin-bottom:8px;display:none">Senha incorreta</div>
|
||||||
<div style="display:flex;gap:8px;justify-content:center">
|
<div style="display:flex;gap:8px;justify-content:center">
|
||||||
@@ -2688,7 +2695,7 @@ function askPassword() {
|
|||||||
inp.addEventListener('keydown', e => { if (e.key === 'Enter') document.getElementById('pw-ok-btn').click(); });
|
inp.addEventListener('keydown', e => { if (e.key === 'Enter') document.getElementById('pw-ok-btn').click(); });
|
||||||
document.getElementById('pw-ok-btn').addEventListener('click', () => {
|
document.getElementById('pw-ok-btn').addEventListener('click', () => {
|
||||||
const val = document.getElementById('pw-input').value;
|
const val = document.getElementById('pw-input').value;
|
||||||
if (val === fixedPw || val === dynPw) {
|
if (val === fixedPw || val === dynPw || val === config.dynamic_password) {
|
||||||
document.getElementById('pw-modal').remove();
|
document.getElementById('pw-modal').remove();
|
||||||
resolve(true);
|
resolve(true);
|
||||||
} else {
|
} else {
|
||||||
@@ -3546,26 +3553,26 @@ window.printRelatorio = function() {
|
|||||||
<title>Fechamento de Caixa</title>
|
<title>Fechamento de Caixa</title>
|
||||||
<style>
|
<style>
|
||||||
* { box-sizing: border-box; margin: 0; padding: 0; }
|
* { box-sizing: border-box; margin: 0; padding: 0; }
|
||||||
body { font-family: 'Courier New', monospace; font-size: 14px; width: 80mm; margin: 0 auto; padding: 8px; font-weight: bold; print-color-adjust: exact; -webkit-print-color-adjust: exact; }
|
body { font-family: 'Courier New', monospace; font-size: 18px; width: 80mm; margin: 0 auto; padding: 8px; font-weight: bold; print-color-adjust: exact; -webkit-print-color-adjust: exact; }
|
||||||
.header { text-align: center; margin-bottom: 8px; }
|
.header { text-align: center; margin-bottom: 8px; }
|
||||||
.header h1 { font-size: 20px; font-weight: bold; }
|
.header h1 { font-size: 24px; font-weight: bold; }
|
||||||
.header h2 { font-size: 15px; font-weight: normal; }
|
.header h2 { font-size: 18px; font-weight: normal; }
|
||||||
hr { border: none; border-top: 2px solid #000; margin: 6px 0; }
|
hr { border: none; border-top: 2px solid #000; margin: 6px 0; }
|
||||||
.section-title { font-weight: bold; font-size: 14px; border-top: 2px solid #000; padding-top: 4px; margin-top: 8px; }
|
.section-title { font-weight: bold; font-size: 17px; border-top: 2px solid #000; padding-top: 4px; margin-top: 8px; }
|
||||||
.row { display: flex; justify-content: space-between; padding: 2px 0; font-size: 13px; font-weight: bold; }
|
.row { display: flex; justify-content: space-between; padding: 2px 0; font-size: 16px; font-weight: bold; }
|
||||||
.row.total-row { font-weight: bold; }
|
.row.total-row { font-weight: bold; }
|
||||||
.cart-table { table-layout: fixed; width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 4px; font-weight: bold; }
|
.cart-table { table-layout: fixed; width: 100%; border-collapse: collapse; font-size: 16px; margin-top: 4px; font-weight: bold; }
|
||||||
.cart-table th { font-weight: bold; border-bottom: 2px solid #000; padding: 2px; width: 25%; }
|
.cart-table th { font-weight: bold; border-bottom: 2px solid #000; padding: 2px; width: 25%; }
|
||||||
.cart-table td { padding: 2px 4px; text-align: right; font-weight: bold; }
|
.cart-table td { padding: 2px 4px; text-align: right; font-weight: bold; }
|
||||||
.cart-table td:first-child { text-align: left; }
|
.cart-table td:first-child { text-align: left; }
|
||||||
.cart-table tr.total-row { font-weight: bold; border-top: 2px solid #000; }
|
.cart-table tr.total-row { font-weight: bold; border-top: 2px solid #000; }
|
||||||
.subtotal { font-size: 13px; margin-top: 4px; }
|
.subtotal { font-size: 16px; margin-top: 4px; }
|
||||||
.subtotal .row { padding: 2px 0; }
|
.subtotal .row { padding: 2px 0; }
|
||||||
.diff-ok { color: #2e7d32; font-weight: bold; }
|
.diff-ok { color: #2e7d32; font-weight: bold; }
|
||||||
.diff-bad { color: #c0272d; font-weight: bold; }
|
.diff-bad { color: #c0272d; font-weight: bold; }
|
||||||
.obs { font-size: 11px; color: #555; margin-top: 6px; white-space: pre-wrap; font-weight: normal; }
|
.obs { font-size: 13px; color: #555; margin-top: 6px; white-space: pre-wrap; font-weight: normal; }
|
||||||
.footer { text-align: center; font-size: 11px; color: #555; margin-top: 8px; }
|
.footer { text-align: center; font-size: 13px; color: #555; margin-top: 8px; }
|
||||||
@media print { body { background: #fff; font-weight: bold !important; } }
|
@media print { body { background: #fff; font-weight: bold !important; font-size: 18px !important; } }
|
||||||
</style>
|
</style>
|
||||||
</head><body>
|
</head><body>
|
||||||
${buildPrintHTML(data)}
|
${buildPrintHTML(data)}
|
||||||
|
|||||||
Reference in New Issue
Block a user