|
|
|
@@ -564,7 +564,7 @@
|
|
|
|
|
<p style="font-size:13px;color:#444;margin-bottom:14px">
|
|
|
|
|
Tem certeza que deseja <strong>enviar este fechamento e encerrar o caixa?</strong>
|
|
|
|
|
</p>
|
|
|
|
|
<div id="confirm-summary" style="border:1px solid #b3d9f7;border-radius:8px;padding:12px;background:#f0f7ff;font-size:12px;font-family:monospace">
|
|
|
|
|
<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>
|
|
|
|
|
<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.
|
|
|
|
@@ -1320,9 +1320,12 @@ function buildConfirmHTML(data) {
|
|
|
|
|
// Relatório completo — mesmo layout do PDF
|
|
|
|
|
const fmt = v => 'R$ ' + (v || 0).toFixed(2).replace('.', ',');
|
|
|
|
|
const fmtNeg = v => (v < 0 ? '-' : '') + 'R$ ' + Math.abs(v || 0).toFixed(2).replace('.', ',');
|
|
|
|
|
// Diferença = fechamento - saldo_esperado - cancelamentos
|
|
|
|
|
const diferenca = data.diferenca !== undefined ? data.diferenca
|
|
|
|
|
: ((data.fechamento || 0) - (data.saldo_esperado || 0) - (data.cancelamentos || 0));
|
|
|
|
|
// Diferença = Total Sistema - Saldo Esperado - Cancelamentos
|
|
|
|
|
// sys_total = troco + crédito + débito + alimentação + pix + vales + pixcnpj + receber (lançamentos do sistema)
|
|
|
|
|
const sysTotal = data.sys_total || 0;
|
|
|
|
|
const saldoEsperado = data.saldo_esperado || 0;
|
|
|
|
|
const cancelamentos = data.cancelamentos || 0;
|
|
|
|
|
const diferenca = sysTotal - saldoEsperado - cancelamentos;
|
|
|
|
|
const diffStr = diferenca >= 0 ? `+${fmt(diferenca)}` : fmtNeg(diferenca);
|
|
|
|
|
const diffOk = diferenca === 0;
|
|
|
|
|
|
|
|
|
@@ -1386,26 +1389,26 @@ function buildConfirmHTML(data) {
|
|
|
|
|
<title>Fechamento de Caixa</title>
|
|
|
|
|
<style>
|
|
|
|
|
* { box-sizing: border-box; margin: 0; padding: 0; }
|
|
|
|
|
body { font-family: 'Courier New', monospace; font-size: 13px; 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: 15px; 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 h1 { font-size: 18px; font-weight: bold; }
|
|
|
|
|
.header h2 { font-size: 14px; font-weight: normal; }
|
|
|
|
|
hr { border: none; border-top: 1px dashed #000; margin: 5px 0; }
|
|
|
|
|
.section-title { font-weight: bold; font-size: 13px; border-top: 1px dashed #000; padding-top: 3px; margin-top: 6px; }
|
|
|
|
|
.row { display: flex; justify-content: space-between; padding: 1px 0; font-size: 12px; font-weight: bold; }
|
|
|
|
|
.row.total-row { font-weight: bold; }
|
|
|
|
|
.cart-table { width: 100%; border-collapse: collapse; font-size: 11px; margin-top: 4px; font-weight: bold; }
|
|
|
|
|
.cart-table th { font-weight: bold; border-bottom: 1px solid #000; padding: 2px; }
|
|
|
|
|
.cart-table td { padding: 2px 4px; text-align: right; font-weight: bold; }
|
|
|
|
|
.header h1 { font-size: 20px; font-weight: bold !important; }
|
|
|
|
|
.header h2 { font-size: 16px; font-weight: bold !important; }
|
|
|
|
|
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; }
|
|
|
|
|
.row { display: flex; justify-content: space-between; padding: 2px 0; font-size: 14px; 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 th { font-weight: bold !important; border-bottom: 2px solid #000; padding: 3px; font-size: 13px; width: 25%; }
|
|
|
|
|
.cart-table td { padding: 3px 5px; text-align: right; font-weight: bold !important; font-size: 13px; }
|
|
|
|
|
.cart-table td:first-child { text-align: left; }
|
|
|
|
|
.cart-table tr.total-row { font-weight: bold; border-top: 1px dashed #000; }
|
|
|
|
|
.subtotal { font-size: 12px; margin-top: 4px; }
|
|
|
|
|
.subtotal .row { padding: 1px 0; }
|
|
|
|
|
.diff-ok { color: #2e7d32; 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; }
|
|
|
|
|
.footer { text-align: center; font-size: 11px; color: #555; margin-top: 8px; }
|
|
|
|
|
@media print { body { background: #fff; font-weight: bold !important; } }
|
|
|
|
|
.cart-table tr.total-row { font-weight: bold !important; border-top: 2px solid #000; }
|
|
|
|
|
.subtotal { font-size: 13px; margin-top: 4px; }
|
|
|
|
|
.subtotal .row { padding: 1px 0; font-weight: bold !important; }
|
|
|
|
|
.diff-ok { color: #2e7d32; 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; }
|
|
|
|
|
.footer { text-align: center; font-size: 12px; color: #555; margin-top: 8px; font-weight: bold !important; }
|
|
|
|
|
@media print { body { background: #fff; font-weight: bold !important; font-size: 15px !important; } }
|
|
|
|
|
</head><body>
|
|
|
|
|
<div class="header">
|
|
|
|
|
<h1>${data.loja}</h1>
|
|
|
|
@@ -1486,9 +1489,13 @@ ${data.observacoes ? `<div class="obs">${data.observacoes}</div>` : ''}
|
|
|
|
|
function buildPrintHTML(data) {
|
|
|
|
|
const fmt = v => 'R$ ' + (v || 0).toFixed(2).replace('.', ',');
|
|
|
|
|
const fmtNeg = v => (v < 0 ? '-' : '') + 'R$ ' + Math.abs(v || 0).toFixed(2).replace('.', ',');
|
|
|
|
|
// Diferença = fechamento - saldo_esperado - cancelamentos
|
|
|
|
|
const diferenca = data.diferenca !== undefined ? data.diferenca
|
|
|
|
|
: ((data.fechamento || 0) - (data.saldo_esperado || 0) - (data.cancelamentos || 0));
|
|
|
|
|
// Diferença = Total Sistema - Saldo Esperado - Cancelamentos
|
|
|
|
|
// data.fechaemento = fechamento contado (dinheiro + cartões + receber)
|
|
|
|
|
// data.sys_total = troco + crédito + débito + alimentação + pix + vales + pixcnpj + receber (do sistema)
|
|
|
|
|
const sysTotal = (data.sys_total || 0);
|
|
|
|
|
const saldoEsperado = (data.saldo_esperado || 0);
|
|
|
|
|
const cancelamentos = (data.cancelamentos || 0);
|
|
|
|
|
const diferenca = sysTotal - saldoEsperado - cancelamentos;
|
|
|
|
|
const diffStr = diferenca >= 0 ? `+${fmt(diferenca)}` : fmtNeg(diferenca);
|
|
|
|
|
const diffColor = diferenca === 0 ? '#2e7d32' : (diferenca > 0 ? '#e65100' : '#c0272d');
|
|
|
|
|
|
|
|
|
@@ -1604,26 +1611,26 @@ function buildPrintHTML(data) {
|
|
|
|
|
<title>Fechamento de Caixa</title>
|
|
|
|
|
<style>
|
|
|
|
|
* { box-sizing: border-box; margin: 0; padding: 0; }
|
|
|
|
|
body { font-family: 'Courier New', monospace; font-size: 13px; 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: 15px; 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 h1 { font-size: 18px; font-weight: bold; }
|
|
|
|
|
.header h2 { font-size: 14px; font-weight: normal; }
|
|
|
|
|
hr { border: none; border-top: 1px dashed #000; margin: 5px 0; }
|
|
|
|
|
.section-title { font-weight: bold; font-size: 13px; border-top: 1px dashed #000; padding-top: 3px; margin-top: 6px; }
|
|
|
|
|
.row { display: flex; justify-content: space-between; padding: 1px 0; font-size: 12px; font-weight: bold; }
|
|
|
|
|
.row.total-row { font-weight: bold; }
|
|
|
|
|
.cart-table { width: 100%; border-collapse: collapse; font-size: 11px; margin-top: 4px; font-weight: bold; }
|
|
|
|
|
.cart-table th { font-weight: bold; border-bottom: 1px solid #000; padding: 2px; }
|
|
|
|
|
.cart-table td { padding: 2px 4px; text-align: right; font-weight: bold; }
|
|
|
|
|
.header h1 { font-size: 20px; font-weight: bold !important; }
|
|
|
|
|
.header h2 { font-size: 16px; font-weight: bold !important; }
|
|
|
|
|
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; }
|
|
|
|
|
.row { display: flex; justify-content: space-between; padding: 2px 0; font-size: 14px; 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 th { font-weight: bold !important; border-bottom: 2px solid #000; padding: 3px; font-size: 13px; width: 25%; }
|
|
|
|
|
.cart-table td { padding: 3px 5px; text-align: right; font-weight: bold !important; font-size: 13px; }
|
|
|
|
|
.cart-table td:first-child { text-align: left; }
|
|
|
|
|
.cart-table tr.total-row { font-weight: bold; border-top: 1px dashed #000; }
|
|
|
|
|
.subtotal { font-size: 12px; margin-top: 4px; }
|
|
|
|
|
.subtotal .row { padding: 1px 0; }
|
|
|
|
|
.diff-ok { color: #2e7d32; 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; }
|
|
|
|
|
.footer { text-align: center; font-size: 11px; color: #555; margin-top: 8px; }
|
|
|
|
|
@media print { body { background: #fff; font-weight: bold !important; } }
|
|
|
|
|
.cart-table tr.total-row { font-weight: bold !important; border-top: 2px solid #000; }
|
|
|
|
|
.subtotal { font-size: 13px; margin-top: 4px; }
|
|
|
|
|
.subtotal .row { padding: 1px 0; font-weight: bold !important; }
|
|
|
|
|
.diff-ok { color: #2e7d32; 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; }
|
|
|
|
|
.footer { text-align: center; font-size: 12px; color: #555; margin-top: 8px; font-weight: bold !important; }
|
|
|
|
|
@media print { body { background: #fff; font-weight: bold !important; font-size: 15px !important; } }
|
|
|
|
|
</style>
|
|
|
|
|
</head><body>
|
|
|
|
|
<div class="header">
|
|
|
|
@@ -1722,8 +1729,7 @@ function buildReportHTML(data) {
|
|
|
|
|
const fechamento = data.fechamento || 0;
|
|
|
|
|
const sysTotal = data.sys_total || 0;
|
|
|
|
|
const saldoEsp = data.saldo_esperado || 0;
|
|
|
|
|
const diferenca = data.diferenca !== undefined ? data.diferenca
|
|
|
|
|
: (fechamento - saldoEsp - cancelamentos);
|
|
|
|
|
const diferenca = sysTotal - saldoEsp - cancelamentos;
|
|
|
|
|
const diffStr = diferenca >= 0 ? `+${fmt(diferenca)}` : fmtNeg(diferenca);
|
|
|
|
|
const diffColor = diferenca === 0 ? '#2e7d32' : '#c0272d';
|
|
|
|
|
|
|
|
|
@@ -2283,10 +2289,10 @@ function buildRelatorioModal(full) {
|
|
|
|
|
const totalSangrias = parseFloat(full.total_sangrias || 0);
|
|
|
|
|
const totalCancelamentos = parseFloat(full.total_cancelamentos || 0);
|
|
|
|
|
|
|
|
|
|
// Esperado e diferença
|
|
|
|
|
// Esperado e diferença — calculada: Total Sistema - Saldo Esperado - Cancelamentos
|
|
|
|
|
const saldoEsperado = parseFloat(full.saldo_esperado || 0);
|
|
|
|
|
const diferenca = parseFloat(full.diferenca || 0);
|
|
|
|
|
const statusDif = full.status_diferenca || '?';
|
|
|
|
|
const diferenca = sysTotal - saldoEsperado - totalCancelamentos;
|
|
|
|
|
const statusDif = diferenca === 0 ? 'ok' : (diferenca > 0 ? 'sobrando' : 'faltando');
|
|
|
|
|
|
|
|
|
|
const diffClass = statusDif === 'ok' ? '#2e7d32' : (statusDif === 'sobrando' ? '#e65100' : '#c0272d');
|
|
|
|
|
const diffLabel = statusDif === 'ok' ? '✓ OK' : (statusDif === 'sobrando' ? '⚠ SOBRANDO' : (statusDif === 'faltando' ? '⚠ FALTANDO' : statusDif));
|
|
|
|
@@ -2389,6 +2395,10 @@ window.abrirFechamentoEdicao = function(full) {
|
|
|
|
|
const dados = full.dados || full;
|
|
|
|
|
if (!dados) { alert('Dados detalhados não encontrados neste registro.'); return; }
|
|
|
|
|
|
|
|
|
|
// IDs do registro — CRÍTICO para o salvamento via Supabase
|
|
|
|
|
estado.uuid = full.uuid || null;
|
|
|
|
|
estado.id = full.id || full.uuid || null;
|
|
|
|
|
|
|
|
|
|
// Preenche o estado global com todos os campos do JSONB
|
|
|
|
|
estado.loja = dados.loja || full.loja || '';
|
|
|
|
|
estado.data = dados.data || full.data || '';
|
|
|
|
@@ -2463,7 +2473,7 @@ window.abrirFechamentoEdicao = function(full) {
|
|
|
|
|
renderTable('tbl-cartao-pix', estado.cartoes.pix);
|
|
|
|
|
|
|
|
|
|
// Recalcula totais
|
|
|
|
|
calcAll();
|
|
|
|
|
updateTotals();
|
|
|
|
|
|
|
|
|
|
// Rola para o topo do formulário
|
|
|
|
|
window.scrollTo(0, 0);
|
|
|
|
@@ -2479,14 +2489,19 @@ window.toggleEditConsulta = async function() {
|
|
|
|
|
// Se já está editando, apenas fecha
|
|
|
|
|
if (window._editModalOpen) { closeEditModal(); return; }
|
|
|
|
|
|
|
|
|
|
// Pede senha admin primeiro (se configurada)
|
|
|
|
|
// Pede senha admin primeiro — sempre, para proteger edições
|
|
|
|
|
const pw = config.admin_password;
|
|
|
|
|
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);
|
|
|
|
|
closeRelatorioModal();
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// Pede senha admin — retorna Promise<boolean>
|
|
|
|
@@ -2944,14 +2959,14 @@ window.salvarEdicaoModal = async function() {
|
|
|
|
|
total_cartao_alimentacao: cartAli_tot,
|
|
|
|
|
total_cartao_pix: cartPix_tot,
|
|
|
|
|
|
|
|
|
|
// Saldo de caixa (editável via tabela saldo)
|
|
|
|
|
// Saldo de caixa — soma automática dos itens editados (não dos campos readonly)
|
|
|
|
|
saldo_troco: p(inp('edit-troco')),
|
|
|
|
|
saldo_credito: p(inp('edit-sld-credito')),
|
|
|
|
|
saldo_debito: p(inp('edit-sld-debito')),
|
|
|
|
|
saldo_alimentacao: p(inp('edit-sld-alimentacao')),
|
|
|
|
|
saldo_vales: p(inp('edit-sld-vales')),
|
|
|
|
|
total_pixcnpj: p(inp('edit-sld-pixcnpj')),
|
|
|
|
|
saldo_areceber: p(inp('edit-sld-areceber')),
|
|
|
|
|
saldo_credito: cartCred_tot,
|
|
|
|
|
saldo_debito: cartDeb_tot,
|
|
|
|
|
saldo_alimentacao: cartAli_tot,
|
|
|
|
|
saldo_vales: vales_tot,
|
|
|
|
|
total_pixcnpj: pixcnpj_tot,
|
|
|
|
|
saldo_areceber: recv_tot,
|
|
|
|
|
|
|
|
|
|
// Totais
|
|
|
|
|
total_vales: vales_tot,
|
|
|
|
@@ -2991,7 +3006,7 @@ window.salvarEdicaoModal = async function() {
|
|
|
|
|
if (!uuid) { alert('UUID do registro não encontrado.'); return; }
|
|
|
|
|
console.log('[DEBUG] salvarEdicaoModal uuid:', uuid, 'updates:', JSON.stringify(updates));
|
|
|
|
|
|
|
|
|
|
await window.__TAURI__.core.invoke('sb_atualizar_fechamento', { uuid, updates: JSON.stringify(updates) });
|
|
|
|
|
await window.__TAURI__.core.invoke('sb_atualizar_fechamento', { id: uuid, updates: JSON.stringify(updates) });
|
|
|
|
|
closeEditModal();
|
|
|
|
|
closeRelatorioModal();
|
|
|
|
|
alert('✅ Atualizado com sucesso!');
|
|
|
|
@@ -3077,10 +3092,10 @@ function consultaToPrintData(full) {
|
|
|
|
|
const vales_arr = (dados.vales || []).map(v => ({ nome: v.nome || '', obs: v.obs || '', valor: parseFloat(v.valor || 0) }));
|
|
|
|
|
const receber_arr = (dados.receber || []).map(r => ({ nome: r.nome || '', valor: parseFloat(r.valor || 0) }));
|
|
|
|
|
const cancelamentos_arr = (dados.cancelamentos || []).map(c => ({ numero: c.numero || '', valor: parseFloat(c.valor || 0), motivo: c.motivo || '' }));
|
|
|
|
|
const cartoes_credito = (full.cartoes_credito || []).map(v => parseFloat(v || 0));
|
|
|
|
|
const cartoes_debito = (full.cartoes_debito || []).map(v => parseFloat(v || 0));
|
|
|
|
|
const cartoes_alimentacao = (full.cartoes_alimentacao || []).map(v => parseFloat(v || 0));
|
|
|
|
|
const cartoes_pix = (full.cartoes_pix || []).map(v => parseFloat(v || 0));
|
|
|
|
|
const cartoes_credito = (dados.cartoes?.credito || full.cartoes_credito || []).map(v => parseFloat(typeof v === 'object' ? (v.valor ?? 0) : (v || 0)));
|
|
|
|
|
const cartoes_debito = (dados.cartoes?.debito || full.cartoes_debito || []).map(v => parseFloat(typeof v === 'object' ? (v.valor ?? 0) : (v || 0)));
|
|
|
|
|
const cartoes_alimentacao = (dados.cartoes?.alimentacao || full.cartoes_alimentacao || []).map(v => parseFloat(typeof v === 'object' ? (v.valor ?? 0) : (v || 0)));
|
|
|
|
|
const cartoes_pix = (dados.cartoes?.pix || full.cartoes_pix || []).map(v => parseFloat(typeof v === 'object' ? (v.valor ?? 0) : (v || 0)));
|
|
|
|
|
const totalSangrias = sangrias_arr.reduce((s, r) => s + r.retirada + r.valor, 0);
|
|
|
|
|
const totalDespesas = despesas_arr.reduce((s, r) => s + r.valor, 0);
|
|
|
|
|
const totalPixCnpj = pixcnpj_arr.reduce((s, r) => s + r.valor, 0);
|
|
|
|
@@ -3154,26 +3169,26 @@ window.printRelatorio = function() {
|
|
|
|
|
<title>Fechamento de Caixa</title>
|
|
|
|
|
<style>
|
|
|
|
|
* { 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; }
|
|
|
|
|
.header { text-align: center; margin-bottom: 8px; }
|
|
|
|
|
.header h1 { font-size: 20px; font-weight: bold; }
|
|
|
|
|
.header h2 { font-size: 15px; font-weight: normal; }
|
|
|
|
|
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; }
|
|
|
|
|
.row { display: flex; justify-content: space-between; padding: 2px 0; font-size: 13px; font-weight: bold; }
|
|
|
|
|
body { font-family: 'Courier New', monospace; font-size: 17px; width: 80mm; margin: 0 auto; padding: 10px 12px; font-weight: bold; print-color-adjust: exact; -webkit-print-color-adjust: exact; }
|
|
|
|
|
.header { text-align: center; margin-bottom: 10px; }
|
|
|
|
|
.header h1 { font-size: 22px; font-weight: bold; }
|
|
|
|
|
.header h2 { font-size: 17px; font-weight: normal; }
|
|
|
|
|
hr { border: none; border-top: 2px solid #000; margin: 8px 0; }
|
|
|
|
|
.section-title { font-weight: bold; font-size: 16px; border-top: 2px solid #000; padding-top: 6px; margin-top: 10px; }
|
|
|
|
|
.row { display: flex; justify-content: space-between; padding: 3px 0; font-size: 15px; font-weight: bold; }
|
|
|
|
|
.row.total-row { font-weight: bold; }
|
|
|
|
|
.cart-table { width: 100%; border-collapse: collapse; font-size: 12px; margin-top: 4px; font-weight: bold; }
|
|
|
|
|
.cart-table th { font-weight: bold; border-bottom: 2px solid #000; padding: 2px; }
|
|
|
|
|
.cart-table td { padding: 2px 4px; text-align: right; font-weight: bold; }
|
|
|
|
|
.cart-table { table-layout: fixed; width: 100%; border-collapse: collapse; font-size: 14px; margin-top: 6px; font-weight: bold; }
|
|
|
|
|
.cart-table th { font-weight: bold; border-bottom: 2px solid #000; padding: 3px 4px; width: 25%; font-size: 14px; }
|
|
|
|
|
.cart-table td { padding: 3px 6px; text-align: right; font-weight: bold; font-size: 14px; }
|
|
|
|
|
.cart-table td:first-child { text-align: left; }
|
|
|
|
|
.cart-table tr.total-row { font-weight: bold; border-top: 2px solid #000; }
|
|
|
|
|
.subtotal { font-size: 13px; margin-top: 4px; }
|
|
|
|
|
.subtotal .row { padding: 2px 0; }
|
|
|
|
|
.subtotal { font-size: 15px; margin-top: 6px; }
|
|
|
|
|
.subtotal .row { padding: 3px 0; }
|
|
|
|
|
.diff-ok { color: #2e7d32; 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; }
|
|
|
|
|
.footer { text-align: center; font-size: 11px; color: #555; margin-top: 8px; }
|
|
|
|
|
@media print { body { background: #fff; font-weight: bold !important; } }
|
|
|
|
|
.obs { font-size: 13px; color: #555; margin-top: 8px; white-space: pre-wrap; font-weight: normal; }
|
|
|
|
|
.footer { text-align: center; font-size: 13px; color: #555; margin-top: 10px; }
|
|
|
|
|
@media print { body { background: #fff; font-weight: bold !important; font-size: 17px !important; } }
|
|
|
|
|
</style>
|
|
|
|
|
</head><body>
|
|
|
|
|
${buildPrintHTML(data)}
|
|
|
|
@@ -3252,7 +3267,7 @@ async function salvarEdicaoSupabase() {
|
|
|
|
|
const id = estado.id || estado.uuid;
|
|
|
|
|
console.log('[DEBUG] salvando id:', id, 'data:', JSON.stringify(data));
|
|
|
|
|
const result = await window.__TAURI__.core.invoke('sb_atualizar_fechamento', {
|
|
|
|
|
uuid: id,
|
|
|
|
|
id: id,
|
|
|
|
|
updates: JSON.stringify(data)
|
|
|
|
|
});
|
|
|
|
|
console.log('[DEBUG] sb_atualizar_fechamento result:', result);
|
|
|
|
|