diff --git a/src/index.html b/src/index.html index 204bebb..eebf8ee 100644 --- a/src/index.html +++ b/src/index.html @@ -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 ` ${fmtDate(item.data)} ${item.operador||'?'}