fix(telegram): /pendapatan tangani getTodayRevenue (objek total/count)

This commit is contained in:
oxpoe committed 2026-10-09 10:40:30 +07:00
1 parent 7e7356af1c
commit 5689676665
1 file changed
+2 -1
+2 -1
View File
@@ -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`;