mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-12 15:35:15 +00:00
Fix transaction lists.
This commit is contained in:
@@ -23,6 +23,7 @@ declare(strict_types=1);
|
||||
namespace FireflyIII\Transformers\V2;
|
||||
|
||||
use FireflyIII\Models\Account;
|
||||
use Illuminate\Support\Collection;
|
||||
|
||||
/**
|
||||
* Class AccountTransformer
|
||||
@@ -83,4 +84,11 @@ class AccountTransformer extends AbstractTransformer
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
public function collectMetaData(Collection $objects): void
|
||||
{
|
||||
// TODO: Implement collectMetaData() method.
|
||||
}
|
||||
}
|
||||
|
@@ -24,6 +24,7 @@ declare(strict_types=1);
|
||||
namespace FireflyIII\Transformers\V2;
|
||||
|
||||
use FireflyIII\Models\Preference;
|
||||
use Illuminate\Support\Collection;
|
||||
|
||||
/**
|
||||
* Class PreferenceTransformer
|
||||
@@ -49,4 +50,11 @@ class PreferenceTransformer extends AbstractTransformer
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
public function collectMetaData(Collection $objects): void
|
||||
{
|
||||
// TODO: Implement collectMetaData() method.
|
||||
}
|
||||
}
|
||||
|
@@ -89,13 +89,13 @@ class TransactionGroupTransformer extends AbstractTransformer
|
||||
$type = $this->stringFromArray($transaction, 'transaction_type_type', TransactionType::WITHDRAWAL);
|
||||
$amount = app('steam')->positive((string) ($transaction['amount'] ?? '0'));
|
||||
$foreignAmount = null;
|
||||
$foreignNativeAmount = null;
|
||||
$nativeForeignAmount = null;
|
||||
if (null !== $transaction['foreign_amount']) {
|
||||
$foreignAmount = app('steam')->positive($transaction['foreign_amount']);
|
||||
$foreignNativeAmount = $foreignAmount;
|
||||
$nativeForeignAmount = $foreignAmount;
|
||||
if ($transaction['foreign_currency_id'] !== $this->default->id) {
|
||||
$rate = $this->getRate($this->currencies[$transaction['foreign_currency_id']], $this->default, $transaction['date']);
|
||||
$foreignNativeAmount = bcmul($foreignAmount, $rate);
|
||||
$nativeForeignAmount = bcmul($foreignAmount, $rate);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -137,7 +137,7 @@ class TransactionGroupTransformer extends AbstractTransformer
|
||||
'amount' => $amount,
|
||||
'native_amount' => $nativeAmount,
|
||||
'foreign_amount' => $foreignAmount,
|
||||
'foreign_native_amount' => $foreignNativeAmount,
|
||||
'native_foreign_amount' => $nativeForeignAmount,
|
||||
'description' => $transaction['description'],
|
||||
'source_id' => (string) $transaction['source_account_id'],
|
||||
'source_name' => $transaction['source_account_name'],
|
||||
|
Reference in New Issue
Block a user