feat: diferenca OK±4.50 + limpar rascunho completo
Build Fechamento de Caixa / build (macos-14, app) (push) Has been cancelled
Build Fechamento de Caixa / build (ubuntu-22.04, deb) (push) Has been cancelled
Build Fechamento de Caixa / build (windows-2022, msi) (push) Has been cancelled

This commit is contained in:
root
2026-07-02 14:44:33 +00:00
parent fbed0e57c2
commit 9b1d45ae50
+18 -4
View File
@@ -2113,12 +2113,26 @@ document.getElementById('btn-limpar').addEventListener('click', () => {
fechamento_contado: { dinheiro: 0, cartoes: 0, receber: 0 },
observacoes: '', id_local: null, sync_status: 'local'
};
// Limpa todos os campos do formulário principal
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('sys-troco', '');
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', '');
// Limpa tables
renderTable('cancel-table', [], 'cancelamentos');
renderTable('vales-table', [], 'vales');
renderTable('pixcnpj-table', [], 'pixcnpj');
renderTable('receber-table', [], 'receber');
renderTable('despesas-table', [], 'despesas');
renderTable('sangrias-table', [], 'sangrias');
renderCartoesTable('cartao-credito-table', [], 'credito');
renderCartoesTable('cartao-debito-table', [], 'debito');
renderCartoesTable('cartao-alimentacao-table', [], 'alimentacao');
renderCartoesTable('cartao-pix-table', [], 'pix');
updateTotals();
renderAllTables();
syncUI();
showToast('Rascunho limpo.', 'info');
});
@@ -2213,8 +2227,8 @@ function buildConsultaModal(recentList) {
const saldoCaixa = calcSaldoCaixa(item);
const canc = calcCancelamentos(item);
const diff = saldoCaixa - (parseFloat(item.saldo_esperado)||0) - canc;
const diffClass = diff === 0 ? '#2e7d32' : diff > 0 ? '#e65100' : '#c0272d';
const diffLabel = diff === 0 ? '✓ OK' : diff > 0 ? `+R$ ${diff.toFixed(2).replace('.',',')}` : `-R$ ${Math.abs(diff).toFixed(2).replace('.',',')}`;
const diffClass = Math.abs(diff) <= 4.50 ? '#2e7d32' : diff > 0 ? '#e65100' : '#c0272d';
const diffLabel = Math.abs(diff) <= 4.50 ? `✓ OK (${diff===0?'0':(diff>0?'+':'-')+Math.abs(diff).toFixed(2).replace('.',',')})` : diff > 0 ? `+R$ ${diff.toFixed(2).replace('.',',')} SOBRANDO` : `-R$ ${Math.abs(diff).toFixed(2).replace('.',',')} FALTANDO`;
return `<tr data-idx="${recentList.indexOf(item)}" style="background:${i%2===0?'#fff':'#fafafa'}" onmouseover="this.style.background='#fff3e0'" onmouseout="this.style.background='${i%2===0?'#fff':'#fafafa'}'">
<td style="padding:6px 8px;border-bottom:1px solid #eee;font-size:12px;cursor:pointer" onclick="openConsultaRegistro(${recentList.indexOf(item)})">${fmtDate(item.data)}</td>
<td style="padding:6px 8px;border-bottom:1px solid #eee;font-size:12px;cursor:pointer" onclick="openConsultaRegistro(${recentList.indexOf(item)})">${item.operador||'?'}</td>