Fix fee calculation: use payments table (gross income - refunds)
Instead of reading invoices.total_amount, now queries the payments table:
- Sums inbound/confirmed payments (gross income)
- Subtracts inbound/refunded payments (refunds)
- Applies plan.platform_fee_percent on the net feeable amount
Co-Authored-By:
Claude Opus 4.6 <noreply@anthropic.com>
Showing
Please register or sign in to comment