Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| a11db54ffc |
+5
-4
@@ -2425,7 +2425,7 @@ window.salvarEdicaoConsulta = async function() {
|
||||
let uuid = full.uuid;
|
||||
if (!uuid && full.id_fechamento) {
|
||||
// Buscar uuid pelo id_fechamento primeiro
|
||||
const found = await window.__TAURI__.core.invoke('sb_buscar_por_id_fechamento', { id_fechamento: full.id_fechamento });
|
||||
const found = await window.__TAURI__.core.invoke('sb_buscar_por_id_fechamento', { idFechamento: full.id_fechamento });
|
||||
if (found && found.uuid) uuid = found.uuid;
|
||||
}
|
||||
|
||||
@@ -2442,6 +2442,10 @@ window.salvarEdicaoConsulta = async function() {
|
||||
|
||||
// Converte o registro "full" do Supabase para o formato usado pelo buildPrintHTML
|
||||
function consultaToPrintData(full) {
|
||||
const fmtDiff = v => 'R$ ' + Math.abs(v || 0).toFixed(2).replace('.', ',');
|
||||
const fmtDiffNeg = v => (v < 0 ? '-' : '') + 'R$ ' + Math.abs(v || 0).toFixed(2).replace('.', ',');
|
||||
const fmt = v => 'R$ ' + (v || 0).toFixed(2).replace('.', ',');
|
||||
|
||||
const cartCred = parseFloat(full.saldo_credito || 0);
|
||||
const cartDeb = parseFloat(full.saldo_debito || 0);
|
||||
const cartAli = parseFloat(full.saldo_alimentacao || 0);
|
||||
@@ -2460,9 +2464,6 @@ function consultaToPrintData(full) {
|
||||
const diffOk = diferenca === 0;
|
||||
const diffStr = diferenca >= 0 ? `+${fmtDiff(diferenca)}` : fmtDiffNeg(diferenca);
|
||||
const dados = full.dados || {};
|
||||
const fmtDiff = v => 'R$ ' + Math.abs(v || 0).toFixed(2).replace('.', ',');
|
||||
const fmtDiffNeg = v => (v < 0 ? '-' : '') + 'R$ ' + Math.abs(v || 0).toFixed(2).replace('.', ',');
|
||||
const fmt = v => 'R$ ' + (v || 0).toFixed(2).replace('.', ',');
|
||||
|
||||
const despesas_arr = (dados.despesas || []).map(d => ({ desc: d.desc || '', obs: d.obs || '', valor: parseFloat(d.valor || 0) }));
|
||||
const sangrias_arr = (dados.sangrias || []).map(s => ({ hora: s.hora || '', retirada: parseFloat(s.retirada || 0), gerente: s.gerente || '', valor: parseFloat(s.valor || 0) }));
|
||||
|
||||
Reference in New Issue
Block a user