diff --git a/src/index.html b/src/index.html
index b4785da..7aa4295 100644
--- a/src/index.html
+++ b/src/index.html
@@ -873,9 +873,9 @@ function updateTotals() {
const fr = receberTotal;
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 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 badgeEl = document.getElementById('dif-badge');
if (difEl) {