Fix: Calculate summary from ALL bets and stats, not just synced ones

- Pass 'bets' and 'stats' (all items in date range) to _calculate_summary()
- Previously passed 'bets_to_sync' and 'stats_to_sync' (only new/changed items)
- Summary now correctly reflects total payin, payout, and net profit for entire date range
- Fixes net payout showing 0 when only incremental data is being synced
parent cdc46597
......@@ -1162,7 +1162,7 @@ class ReportsSyncResponseHandler(ResponseHandler):
'bets': [],
'extraction_stats': [],
'cap_compensation_balance': cap_compensation_balance,
'summary': self._calculate_summary(bets_to_sync, stats_to_sync),
'summary': self._calculate_summary(bets, stats), # Use ALL bets and stats for summary, not just synced ones
'is_incremental': True, # Flag to indicate this is an incremental sync
'sync_type': 'incremental' if last_sync_time else 'full'
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment