From 56896766652b2b7116a7f0ad26293e7f98b0c0ad Mon Sep 17 00:00:00 2001 From: oxpoe Date: Fri, 9 Oct 2026 10:40:30 +0700 Subject: [PATCH] fix(telegram): /pendapatan tangani getTodayRevenue (objek total/count) --- services/telegramBot.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/services/telegramBot.js b/services/telegramBot.js index 7cdd472..d995c01 100644 --- a/services/telegramBot.js +++ b/services/telegramBot.js @@ -811,7 +811,8 @@ function initTelegram() { } catch (e) { bot.sendMessage(msg.chat.id, 'Gagal: ' + e.message); } }); function tgPendapatanText() { - const today = Number(billingSvc.getTodayRevenue() || 0); + const tr = billingSvc.getTodayRevenue(); + const today = Number((tr && tr.total != null) ? tr.total : (tr || 0)) || 0; const stats = billingSvc.getDashboardStats() || {}; const month = Number(stats.thisMonth || 0); return `šŸ’° *PENDAPATAN*\n\nšŸ“… Hari ini: *Rp ${today.toLocaleString('id-ID')}*\nšŸ—“ļø Bulan ini: *Rp ${month.toLocaleString('id-ID')}*\nā³ Belum dibayar: *${stats.unpaidCount || 0} tagihan*\n`;