Compare commits

...

2 Commits

Author SHA1 Message Date
root aa147885a8 v1.3.30: diferença tela lançamento usa sysTotal (troco+credito+debito+alimentacao+vales+receber+pix+pixcnpj) - saldo_esperado - cancelamentos
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
2026-06-28 01:52:50 +00:00
root 00fa17fa52 v1.3.29: ignora HTTP 409 duplicate (ja existe = ok)
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
2026-06-27 23:54:07 +00:00
2 changed files with 4 additions and 4 deletions
+2 -2
View File
@@ -142,7 +142,7 @@ impl SupabaseClient {
"frango": estado.get("frango").and_then(|v| v.as_i64()).unwrap_or(0), "frango": estado.get("frango").and_then(|v| v.as_i64()).unwrap_or(0),
}); });
// Upsert via POST com Prefer: resolution=merge-duplicates // Primeiro tenta INSERT (upsert via Prefer)
let resp = self let resp = self
.http .http
.post(&format!("{}/rest/v1/fechamentos_web", self.base_url)) .post(&format!("{}/rest/v1/fechamentos_web", self.base_url))
@@ -152,7 +152,7 @@ impl SupabaseClient {
.send()?; .send()?;
let status = resp.status(); let status = resp.status();
if status.is_success() { if status.is_success() || status.as_u16() == 409 {
Ok(serde_json::json!({ "ok": true, "id_fechamento": id_fechamento })) Ok(serde_json::json!({ "ok": true, "id_fechamento": id_fechamento }))
} else { } else {
let body = resp.text().unwrap_or_default(); let body = resp.text().unwrap_or_default();
+2 -2
View File
@@ -873,9 +873,9 @@ function updateTotals() {
const fr = receberTotal; const fr = receberTotal;
setText('fech-total', fmt(fd + fc + fr)); setText('fech-total', fmt(fd + fc + fr));
// Diferença = total_fechamento - saldo_esperado - cancelamentos // Diferença = total_fechamento (sysTotal: troco+credito+debito+alimentacao+vales+receber+pixCartao+pixCnpj) - saldo_esperado - cancelamentos
const cancelTotal = estado.cancelamentos.reduce((s,r) => s+(parseNum(r.valor||0)||0), 0); const cancelTotal = estado.cancelamentos.reduce((s,r) => s+(parseNum(r.valor||0)||0), 0);
const diff = (fd + fc + fr) - parseNum(val('f-saldo-esperado')) - cancelTotal; const diff = sysTotal - parseNum(val('f-saldo-esperado')) - cancelTotal;
const difEl = document.getElementById('diferenca'); const difEl = document.getElementById('diferenca');
const badgeEl = document.getElementById('dif-badge'); const badgeEl = document.getElementById('dif-badge');
if (difEl) { if (difEl) {