-
{expense.name}
+
+ {expense.name}
+
+ {expense.autopay_enabled && (
+
+
+
+ AP
+
+
+ Autopay enabled
+
+ )}
+ {expense.is_subscription && (
+
+
+
+ S
+
+
+ Subscription
+
+ )}
+ {(expense.has_merchant_rule || expense.has_linked_transactions) && (
+
+
+
+ L
+
+
+ Linked to bank transactions
+
+ )}
+
+
{expense.category_name && {expense.category_name}}
Due day {expense.due_day}
diff --git a/routes/summary.js b/routes/summary.js
index 01257b6..0697c41 100644
--- a/routes/summary.js
+++ b/routes/summary.js
@@ -238,10 +238,16 @@ function buildSummary(db, userId, year, month) {
c.name AS category_name,
m.actual_amount,
m.is_skipped,
- b.sort_order
+ b.sort_order,
+ b.autopay_enabled,
+ b.is_subscription,
+ CASE WHEN mr.bill_id IS NOT NULL THEN 1 ELSE 0 END AS has_merchant_rule,
+ CASE WHEN lt.matched_bill_id IS NOT NULL THEN 1 ELSE 0 END AS has_linked_transactions
FROM bills b
LEFT JOIN categories c ON c.id = b.category_id AND c.user_id = b.user_id AND c.deleted_at IS NULL
LEFT JOIN monthly_bill_state m ON m.bill_id = b.id AND m.year = ? AND m.month = ?
+ LEFT JOIN (SELECT DISTINCT bill_id FROM bill_merchant_rules) mr ON mr.bill_id = b.id
+ LEFT JOIN (SELECT DISTINCT matched_bill_id FROM transactions WHERE match_status = 'matched') lt ON lt.matched_bill_id = b.id
WHERE b.user_id = ? AND b.active = 1 AND b.deleted_at IS NULL
ORDER BY CASE WHEN b.sort_order IS NULL THEN 1 ELSE 0 END,
b.sort_order ASC,
@@ -292,6 +298,10 @@ function buildSummary(db, userId, year, month) {
is_skipped: !!row.is_skipped,
due_day: row.due_day,
category_name: row.category_name || null,
+ autopay_enabled: !!row.autopay_enabled,
+ is_subscription: !!row.is_subscription,
+ has_merchant_rule: !!row.has_merchant_rule,
+ has_linked_transactions: !!row.has_linked_transactions,
};
});