mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-09-30 10:33:30 +00:00
Fix #10773 for budget limits.
This commit is contained in:
@@ -47,6 +47,7 @@ class BudgetLimitEnrichment implements EnrichmentInterface
|
||||
$this->collectCurrencies();
|
||||
$this->collectNotes();
|
||||
$this->collectBudgets();
|
||||
$this->stringifyIds();
|
||||
$this->appendCollectedData();
|
||||
|
||||
return $this->collection;
|
||||
@@ -94,8 +95,7 @@ class BudgetLimitEnrichment implements EnrichmentInterface
|
||||
$notes = Note::query()->whereIn('noteable_id', $this->ids)
|
||||
->whereNotNull('notes.text')
|
||||
->where('notes.text', '!=', '')
|
||||
->where('noteable_type', BudgetLimit::class)->get(['notes.noteable_id', 'notes.text'])->toArray()
|
||||
;
|
||||
->where('noteable_type', BudgetLimit::class)->get(['notes.noteable_id', 'notes.text'])->toArray();
|
||||
foreach ($notes as $note) {
|
||||
$this->notes[(int)$note['noteable_id']] = (string)$note['text'];
|
||||
}
|
||||
@@ -155,4 +155,22 @@ class BudgetLimitEnrichment implements EnrichmentInterface
|
||||
$this->currencies[(int)$currency->id] = $currency;
|
||||
}
|
||||
}
|
||||
|
||||
private function stringifyIds(): void
|
||||
{
|
||||
$this->expenses = array_map(function ($first) {
|
||||
return array_map(function ($second) {
|
||||
$second['currency_id'] = (string)($second['currency_id'] ?? 0);
|
||||
return $second;
|
||||
}, $first);
|
||||
}, $this->expenses);
|
||||
|
||||
$this->pcExpenses = array_map(function ($first) {
|
||||
return array_map(function ($second) {
|
||||
$second['currency_id'] = (string)($second['currency_id'] ?? 0);
|
||||
return $second;
|
||||
}, $first);
|
||||
}, $this->expenses);
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user