mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-12 15:35:15 +00:00
Rename many references from native to primary.
This commit is contained in:
@@ -54,7 +54,7 @@ class TransactionGroupEnrichment implements EnrichmentInterface
|
||||
private array $notes; // @phpstan-ignore-line
|
||||
private array $tags;
|
||||
private User $user;
|
||||
private readonly TransactionCurrency $nativeCurrency;
|
||||
private readonly TransactionCurrency $primaryCurrency;
|
||||
private UserGroup $userGroup;
|
||||
|
||||
public function __construct()
|
||||
@@ -66,7 +66,7 @@ class TransactionGroupEnrichment implements EnrichmentInterface
|
||||
$this->locations = [];
|
||||
$this->attachmentCount = [];
|
||||
$this->dateFields = ['interest_date', 'book_date', 'process_date', 'due_date', 'payment_date', 'invoice_date'];
|
||||
$this->nativeCurrency = Amount::getNativeCurrency();
|
||||
$this->primaryCurrency = Amount::getPrimaryCurrency();
|
||||
}
|
||||
|
||||
#[Override]
|
||||
@@ -198,9 +198,9 @@ class TransactionGroupEnrichment implements EnrichmentInterface
|
||||
$metaData = $this->metaData;
|
||||
$locations = $this->locations;
|
||||
$attachmentCount = $this->attachmentCount;
|
||||
$nativeCurrency = $this->nativeCurrency;
|
||||
$primaryCurrency = $this->primaryCurrency;
|
||||
|
||||
$this->collection = $this->collection->map(function (array $item) use ($nativeCurrency, $notes, $tags, $metaData, $locations, $attachmentCount) {
|
||||
$this->collection = $this->collection->map(function (array $item) use ($primaryCurrency, $notes, $tags, $metaData, $locations, $attachmentCount) {
|
||||
foreach ($item['transactions'] as $index => $transaction) {
|
||||
$journalId = (int) $transaction['transaction_journal_id'];
|
||||
|
||||
@@ -220,13 +220,13 @@ class TransactionGroupEnrichment implements EnrichmentInterface
|
||||
'zoom_level' => null,
|
||||
];
|
||||
|
||||
// native currency
|
||||
$item['transactions'][$index]['native_currency'] = [
|
||||
'id' => (string) $nativeCurrency->id,
|
||||
'code' => $nativeCurrency->code,
|
||||
'name' => $nativeCurrency->name,
|
||||
'symbol' => $nativeCurrency->symbol,
|
||||
'decimal_places' => $nativeCurrency->decimal_places,
|
||||
// primary currency
|
||||
$item['transactions'][$index]['primary_currency'] = [
|
||||
'id' => (string) $primaryCurrency->id,
|
||||
'code' => $primaryCurrency->code,
|
||||
'name' => $primaryCurrency->name,
|
||||
'symbol' => $primaryCurrency->symbol,
|
||||
'decimal_places' => $primaryCurrency->decimal_places,
|
||||
];
|
||||
|
||||
// append meta data
|
||||
|
Reference in New Issue
Block a user