fix(merchants): net spend accounting for refunds/credits

- Merchant totals now show net spend (gross debits minus refunds)
- Refund count and amount shown in profile drawer and table
- Scatter plot Y-axis uses net_spend, X-axis uses debit_count
- Per-merchant transaction history includes refunds (shown as negative)
- Monthly trend chart reflects net spend per month
This commit is contained in:
2026-03-10 00:43:58 +11:00
parent dd11019fdf
commit 7b3fd4b65f
4 changed files with 93 additions and 60 deletions
+6 -3
View File
@@ -562,9 +562,12 @@ export function useFees() {
export interface MerchantRow {
merchant: string;
category: string;
transaction_count: number;
total_spend: number;
avg_transaction: number;
debit_count: number;
refund_count: number;
gross_spend: number;
total_refunds: number;
net_spend: number;
avg_debit: number;
first_seen: string;
last_seen: string;
months_active: number;