diff --git a/frontend/src/App.vue b/frontend/src/App.vue index f83b3c1..9849628 100644 --- a/frontend/src/App.vue +++ b/frontend/src/App.vue @@ -159,6 +159,23 @@ function dividendIsEstimate(method) { // only dated_ledger rows are real dated cash flows; everything else is an estimate/proxy return method !== 'dated_ledger' } +function dividendIsDated(method) { + // real dated cash-flow ledger (per-share x qty on actual ex/pay dates) + return method === 'dated_ledger' +} +function dividendBadge(method) { + // cls: use classes known to exist in this project (status-tag/neutral-tag/ + // warning-tag); dated gets an inline green style so "real cash flow" reads + // as clearly better than "estimate". + if (dividendIsDated(method)) return { label: 'ตามวันจริง', cls: 'status-tag', style: 'background:#1a7f37;color:#fff' } + if (method === 'dps_annual_proxy') return { label: 'Proxy (ต่อหุ้น)', cls: 'status-tag warning-tag' } + return { label: 'Proxy', cls: 'status-tag warning-tag' } +} +function dividendFootnote(method) { + if (dividendIsDated(method)) return 'ปันผลตามวันจริงจาก ledger (ex-date × จำนวนหุ้น) — กระแสเงินสดจริง' + if (method === 'dps_annual_proxy') return 'ประมาณการปันผลต่อหุ้น (DPS ล่าสุด × จำนวนหุ้น) ไม่ใช่กระแสเงินสดตามวันจริง' + return 'ประมาณจาก dividend yield ของพอร์ตสุดท้าย ไม่ใช่กระแสเงินสดปันผลจริง' +} function formatDate(value) { if (!value) return '—' @@ -777,12 +794,12 @@ onMounted(async () => { await loadDashboard(); await loadBacktestRuns() })