From 6a8881d41d13fa08286164099f8b79b613d88ff0 Mon Sep 17 00:00:00 2001 From: root Date: Tue, 30 Jun 2026 20:00:07 +0000 Subject: [PATCH] fix: cartoes do dados JSONB no print; listar_recentes com dados; table-layout fixed; modal conf font 14px --- src-tauri/src/plugins/supabase.rs | 2 +- src/index.html | 22 +++++++++++----------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src-tauri/src/plugins/supabase.rs b/src-tauri/src/plugins/supabase.rs index 5790326..8c53e8c 100644 --- a/src-tauri/src/plugins/supabase.rs +++ b/src-tauri/src/plugins/supabase.rs @@ -279,7 +279,7 @@ impl SupabaseClient { pub fn listar_recentes(&self, loja: &str, limite: i64) -> Result, SupabaseError> { let loja_normalized = sem_acento(&loja.to_lowercase()); let url = format!( - "{}/rest/v1/fechamentos_web?loja=eq.{}&order=data.desc,atualizado_em.desc&limit={}&select=id,id_fechamento,data,operador,turno,saldo_troco,saldo_esperado,fechamento_dinheiro,fechamento_cartoes,fechamento_areceber,diferenca,status_diferenca,observacoes,atualizado_em", + "{}/rest/v1/fechamentos_web?loja=eq.{}&order=data.desc,atualizado_em.desc&limit={}&select=id,id_fechamento,data,operador,turno,saldo_troco,saldo_esperado,fechamento_dinheiro,fechamento_cartoes,fechamento_areceber,diferenca,status_diferenca,observacoes,atualizado_em,dados", self.base_url, urlencoding::encode(&loja_normalized), limite, diff --git a/src/index.html b/src/index.html index d337b00..a9139ad 100644 --- a/src/index.html +++ b/src/index.html @@ -564,7 +564,7 @@

Tem certeza que deseja enviar este fechamento e encerrar o caixa?

-
+

Após enviar, não dá pra editar este fechamento sem a senha do Filipe. @@ -1394,8 +1394,8 @@ function buildConfirmHTML(data) { .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 { 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; } + .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 !important; border-top: 2px solid #000; } @@ -1612,8 +1612,8 @@ function buildPrintHTML(data) { .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 { 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; } + .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 !important; border-top: 2px solid #000; } @@ -3085,10 +3085,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); @@ -3170,8 +3170,8 @@ window.printRelatorio = function() { .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; } .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 { table-layout: fixed; width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 4px; font-weight: bold; } + .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:first-child { text-align: left; } .cart-table tr.total-row { font-weight: bold; border-top: 2px solid #000; }