fix(boletos): diferencia pagamentos e recebimentos

This commit is contained in:
Felipe Coutinho
2026-05-31 15:18:55 -03:00
parent 35abe1b0bf
commit 99bc049cf4
10 changed files with 130 additions and 58 deletions

View File

@@ -81,6 +81,8 @@ const renderLancamento = (
const renderBoleto = (event: Extract<CalendarEvent, { type: "boleto" }>) => {
const isPaid = Boolean(event.transaction.isSettled);
const isIncome = event.transaction.transactionType === "Receita";
const settlementLabel = isIncome ? "Recebido" : "Pago";
const dueDateLabel = formatFinancialDateLabel(
event.transaction.dueDate,
"Vence em",
@@ -89,7 +91,7 @@ const renderBoleto = (event: Extract<CalendarEvent, { type: "boleto" }>) => {
const paymentDateLabel = isPaid
? formatFinancialDateLabel(
event.transaction.boletoPaymentDate,
"Pago em",
`${settlementLabel} em`,
DATE_FORMAT,
)
: null;
@@ -109,7 +111,9 @@ const renderBoleto = (event: Extract<CalendarEvent, { type: "boleto" }>) => {
<span className="text-success">{paymentDateLabel}</span>
)}
</div>
<Badge variant="outline">{isPaid ? "Pago" : "Pendente"}</Badge>
<Badge variant="outline">
{isPaid ? settlementLabel : "Pendente"}
</Badge>
</div>
<MoneyValues
className="font-medium whitespace-nowrap"