mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-14 08:11:20 +00:00
Fix missing filter
This commit is contained in:
@@ -181,11 +181,10 @@ class SubscriptionEnrichment implements EnrichmentInterface
|
|||||||
|
|
||||||
private function collectPaidDates(): void
|
private function collectPaidDates(): void
|
||||||
{
|
{
|
||||||
|
$this->paidDates = [];
|
||||||
Log::debug('Now in collectPaidDates for bills');
|
Log::debug('Now in collectPaidDates for bills');
|
||||||
if (null === $this->start || null === $this->end) {
|
if (null === $this->start || null === $this->end) {
|
||||||
Log::debug('Parameters are NULL, return empty array');
|
Log::debug('Parameters are NULL, set empty array');
|
||||||
$this->paidDates = [];
|
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -219,6 +218,7 @@ class SubscriptionEnrichment implements EnrichmentInterface
|
|||||||
[
|
[
|
||||||
'transaction_journals.id',
|
'transaction_journals.id',
|
||||||
'transaction_journals.date',
|
'transaction_journals.date',
|
||||||
|
'transaction_journals.bill_id',
|
||||||
'transaction_journals.transaction_group_id',
|
'transaction_journals.transaction_group_id',
|
||||||
'transactions.transaction_currency_id',
|
'transactions.transaction_currency_id',
|
||||||
'currency.code AS transaction_currency_code',
|
'currency.code AS transaction_currency_code',
|
||||||
@@ -249,6 +249,7 @@ class SubscriptionEnrichment implements EnrichmentInterface
|
|||||||
'transaction_journal_id' => (string)$entry->id,
|
'transaction_journal_id' => (string)$entry->id,
|
||||||
'date' => $entry->date->toAtomString(),
|
'date' => $entry->date->toAtomString(),
|
||||||
'date_object' => $entry->date,
|
'date_object' => $entry->date,
|
||||||
|
'bill_id' => $entry->bill_id,
|
||||||
'currency_id' => $entry->transaction_currency_id,
|
'currency_id' => $entry->transaction_currency_id,
|
||||||
'currency_code' => $entry->transaction_currency_code,
|
'currency_code' => $entry->transaction_currency_code,
|
||||||
'currency_decimal_places' => $entry->transaction_currency_decimal_places,
|
'currency_decimal_places' => $entry->transaction_currency_decimal_places,
|
||||||
@@ -263,7 +264,7 @@ class SubscriptionEnrichment implements EnrichmentInterface
|
|||||||
|
|
||||||
$result[] = $array;
|
$result[] = $array;
|
||||||
}
|
}
|
||||||
$this->paidDates[$subscription->id] = $result;
|
$this->paidDates[(int) $subscription->id] = $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -284,7 +285,7 @@ class SubscriptionEnrichment implements EnrichmentInterface
|
|||||||
protected function lastPaidDate(Bill $subscription, Collection $dates, Carbon $default): Carbon
|
protected function lastPaidDate(Bill $subscription, Collection $dates, Carbon $default): Carbon
|
||||||
{
|
{
|
||||||
$filtered = $dates->filter(function (TransactionJournal $journal) use ($subscription) {
|
$filtered = $dates->filter(function (TransactionJournal $journal) use ($subscription) {
|
||||||
return $journal->bill_id === $subscription->id;
|
return (int) $journal->bill_id === (int) $subscription->id;
|
||||||
});
|
});
|
||||||
if (0 === $filtered->count()) {
|
if (0 === $filtered->count()) {
|
||||||
return $default;
|
return $default;
|
||||||
|
Reference in New Issue
Block a user