mirror of
				https://github.com/firefly-iii/firefly-iii.git
				synced 2025-11-04 05:15:39 +00:00 
			
		
		
		
	Make sure amounts are always positive.
This commit is contained in:
		@@ -275,13 +275,10 @@ class TransactionGroupTransformer extends AbstractTransformer
 | 
			
		||||
 | 
			
		||||
            // amount:
 | 
			
		||||
            $type          = $row['transaction_type_type'] ?? TransactionType::WITHDRAWAL;
 | 
			
		||||
            $amount = $row['amount'] ?? '0';
 | 
			
		||||
            if (TransactionType::WITHDRAWAL !== $type) {
 | 
			
		||||
                $amount = bcmul($amount, '-1');
 | 
			
		||||
            }
 | 
			
		||||
            $amount        = app('steam')->positive($row['amount'] ?? '0');
 | 
			
		||||
            $foreignAmount = null;
 | 
			
		||||
            if (null !== $row['foreign_amount']) {
 | 
			
		||||
                $foreignAmount = TransactionType::WITHDRAWAL !== $type ? bcmul($row['foreign_amount'], '-1') : $row['foreign_amount']; // @codeCoverageIgnore
 | 
			
		||||
                $foreignAmount = app('steam')->positive($row['foreign_amount']);
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            $metaFieldData = $this->groupRepos->getMetaFields((int)$row['transaction_journal_id'], $this->metaFields);
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user