This commit is contained in:
Sander Dorigo
2025-10-07 09:52:29 +02:00
parent b29c35864c
commit 435ca994cf

View File

@@ -82,10 +82,9 @@ class SubscriptionEnrichment implements EnrichmentInterface
// TODO clean me up. // TODO clean me up.
$notes = $this->notes; $notes = $this->notes;
$objectGroups = $this->objectGroups;
$paidDates = $this->paidDates; $paidDates = $this->paidDates;
$payDates = $this->payDates; $payDates = $this->payDates;
$this->collection = $this->collection->map(function (Bill $item) use ($notes, $objectGroups, $paidDates, $payDates) { $this->collection = $this->collection->map(function (Bill $item) use ($notes, $paidDates, $payDates) {
$id = (int)$item->id; $id = (int)$item->id;
$currency = $item->transactionCurrency; $currency = $item->transactionCurrency;
$nem = $this->getNextExpectedMatch($payDates[$id] ?? []); $nem = $this->getNextExpectedMatch($payDates[$id] ?? []);
@@ -123,9 +122,11 @@ class SubscriptionEnrichment implements EnrichmentInterface
// add object group if available // add object group if available
if (array_key_exists($id, $this->mappedObjects)) { if (array_key_exists($id, $this->mappedObjects)) {
$key = $this->mappedObjects[$id]; $key = $this->mappedObjects[$id];
$meta['object_group_id'] = (string)$objectGroups[$key]['id']; if(array_key_exists($key, $this->objectGroups)) {
$meta['object_group_title'] = $objectGroups[$key]['title']; $meta['object_group_id'] = (string)$this->objectGroups[$key]['id'];
$meta['object_group_order'] = $objectGroups[$key]['order']; $meta['object_group_title'] = $this->objectGroups[$key]['title'];
$meta['object_group_order'] = $this->objectGroups[$key]['order'];
}
} }
// Add notes if available. // Add notes if available.