From 83720b02581b422fc90fec632f6eeb1a8456f311 Mon Sep 17 00:00:00 2001 From: Sidney Date: Sun, 7 Jun 2026 16:18:07 -0300 Subject: [PATCH] fix(financeiro): corrige exibicao e calculo do valor pago no recibo pdf --- manager/services/pdfService.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/manager/services/pdfService.ts b/manager/services/pdfService.ts index ccb236f..2bfe8af 100644 --- a/manager/services/pdfService.ts +++ b/manager/services/pdfService.ts @@ -555,7 +555,7 @@ export const pdfService = { body: payments.map(p => [ p.description || (p.type === 'registration' ? 'Matrícula' : 'Mensalidade'), p.dueDate ? p.dueDate.split('T')[0].split('-').reverse().join('/') : '', - `R$ ${p.amount.toLocaleString('pt-BR', { minimumFractionDigits: 2 })}`, + `R$ ${(Number((p as any).valor_pago) || Number(p.amount) || 0).toLocaleString('pt-BR', { minimumFractionDigits: 2, maximumFractionDigits: 2 })}`, p.status === 'paid' ? 'Pago' : p.status === 'overdue' ? 'Atrasado' : 'Pendente' ]), headStyles: { fillColor: [0, 0, 0] } @@ -594,7 +594,8 @@ export const pdfService = { doc.setTextColor(0); doc.text(`Recebemos de: ${student.name}`, 20, 70); doc.text(`CPF: ${student.cpf || '---'}`, 20, 76); - doc.text(`A quantia de: R$ ${payment.amount.toLocaleString('pt-BR', { minimumFractionDigits: 2 })}`, 20, 85); + const valNum = Number((payment as any).valor_pago) || Number(payment.amount) || 0; + doc.text(`A quantia de: R$ ${valNum.toLocaleString('pt-BR', { minimumFractionDigits: 2, maximumFractionDigits: 2 })}`, 20, 85); const typeLabel = payment.type === 'registration' ? 'Taxa de Matrícula' : payment.type === 'monthly' ? 'Mensalidade do Curso' : 'Outros Serviços';