mirror of
				https://github.com/firefly-iii/firefly-iii.git
				synced 2025-10-31 02:36:28 +00:00 
			
		
		
		
	fix: include foreign_amount in transaction sum calculation
This commit is contained in:
		| @@ -58,7 +58,7 @@ class ReportSum extends Command | ||||
| 
 | ||||
|         /** @var User $user */ | ||||
|         foreach ($userRepository->all() as $user) { | ||||
|             $sum = (string)$user->transactions()->sum('amount'); | ||||
|             $sum = (string)$user->transactions()->selectRaw('SUM(amount) + SUM(foreign_amount) as total')->value('total'); | ||||
|             if (!is_numeric($sum)) { | ||||
|                 $message = sprintf('Error: Transactions for user #%d (%s) have an invalid sum ("%s").', $user->id, $user->email, $sum); | ||||
|                 $this->friendlyError($message); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user