🤖 Auto commit for release 'develop' on 2025-07-31

This commit is contained in:
JC5
2025-07-31 06:39:56 +02:00
parent a7973190c2
commit 03904ffcde
4 changed files with 81 additions and 79 deletions

View File

@@ -1,8 +1,9 @@
<?php <?php
declare(strict_types=1);
namespace FireflyIII\Support\JsonApi\Enrichments; namespace FireflyIII\Support\JsonApi\Enrichments;
use FireflyIII\Models\Account;
use FireflyIII\Models\Bill; use FireflyIII\Models\Bill;
use FireflyIII\Models\Note; use FireflyIII\Models\Note;
use FireflyIII\Models\ObjectGroup; use FireflyIII\Models\ObjectGroup;
@@ -72,17 +73,18 @@ class SubscriptionEnrichment implements EnrichmentInterface
'amount_min' => Steam::bcround($converter->convert($item->transactionCurrency, $this->nativeCurrency, today(), $item->amount_min), $this->nativeCurrency->decimal_places), 'amount_min' => Steam::bcround($converter->convert($item->transactionCurrency, $this->nativeCurrency, today(), $item->amount_min), $this->nativeCurrency->decimal_places),
'amount_max' => Steam::bcround($converter->convert($item->transactionCurrency, $this->nativeCurrency, today(), $item->amount_max), $this->nativeCurrency->decimal_places), 'amount_max' => Steam::bcround($converter->convert($item->transactionCurrency, $this->nativeCurrency, today(), $item->amount_max), $this->nativeCurrency->decimal_places),
]; ];
$amounts['average'] =Steam::bcround(bcdiv(bcadd($amounts['amount_min'], $amounts['amount_max']), '2'), $this->nativeCurrency->decimal_places); $amounts['average'] = Steam::bcround(bcdiv(bcadd($amounts['amount_min'], $amounts['amount_max']), '2'), $this->nativeCurrency->decimal_places);
} }
$item->amounts = $amounts; $item->amounts = $amounts;
$item->meta = $meta; $item->meta = $meta;
return $item; return $item;
}); });
return $collection; return $collection;
} }
public function enrichSingle(Model|array $model): array|Model public function enrichSingle(array|Model $model): array|Model
{ {
Log::debug(__METHOD__); Log::debug(__METHOD__);
$collection = new Collection([$model]); $collection = new Collection([$model]);
@@ -124,6 +126,7 @@ class SubscriptionEnrichment implements EnrichmentInterface
{ {
$this->nativeCurrency = $nativeCurrency; $this->nativeCurrency = $nativeCurrency;
} }
private function collectSubscriptionIds(): void private function collectSubscriptionIds(): void
{ {
/** @var Bill $bill */ /** @var Bill $bill */
@@ -138,20 +141,20 @@ class SubscriptionEnrichment implements EnrichmentInterface
$set = DB::table('object_groupables') $set = DB::table('object_groupables')
->whereIn('object_groupable_id', $this->subscriptionIds) ->whereIn('object_groupable_id', $this->subscriptionIds)
->where('object_groupable_type', Bill::class) ->where('object_groupable_type', Bill::class)
->get(['object_groupable_id','object_group_id']); ->get(['object_groupable_id', 'object_group_id'])
;
$ids = array_unique($set->pluck('object_group_id')->toArray()); $ids = array_unique($set->pluck('object_group_id')->toArray());
foreach($set as $entry) { foreach ($set as $entry) {
$this->mappedObjects[(int)$entry->object_groupable_id] = (int)$entry->object_group_id; $this->mappedObjects[(int)$entry->object_groupable_id] = (int)$entry->object_group_id;
} }
$groups = ObjectGroup::whereIn('id', $ids)->get(['id', 'title','order'])->toArray(); $groups = ObjectGroup::whereIn('id', $ids)->get(['id', 'title', 'order'])->toArray();
foreach($groups as $group) { foreach ($groups as $group) {
$group['id'] = (int) $group['id']; $group['id'] = (int) $group['id'];
$group['order'] = (int) $group['order']; $group['order'] = (int) $group['order'];
$this->objectGroups[(int)$group['id']] = $group; $this->objectGroups[(int)$group['id']] = $group;
} }
} }
} }

View File

@@ -27,7 +27,6 @@ namespace FireflyIII\Transformers;
use Carbon\Carbon; use Carbon\Carbon;
use Carbon\CarbonInterface; use Carbon\CarbonInterface;
use FireflyIII\Models\Bill; use FireflyIII\Models\Bill;
use FireflyIII\Models\ObjectGroup;
use FireflyIII\Models\TransactionCurrency; use FireflyIII\Models\TransactionCurrency;
use FireflyIII\Models\TransactionJournal; use FireflyIII\Models\TransactionJournal;
use FireflyIII\Repositories\Bill\BillRepositoryInterface; use FireflyIII\Repositories\Bill\BillRepositoryInterface;
@@ -172,7 +171,7 @@ class BillTransformer extends AbstractTransformer
'links' => [ 'links' => [
[ [
'rel' => 'self', 'rel' => 'self',
'uri' => '/bills/' . $bill->id, 'uri' => '/bills/'.$bill->id,
], ],
], ],
]; ];

View File

@@ -78,8 +78,8 @@ return [
'running_balance_column' => env('USE_RUNNING_BALANCE', false), 'running_balance_column' => env('USE_RUNNING_BALANCE', false),
// see cer.php for exchange rates feature flag. // see cer.php for exchange rates feature flag.
], ],
'version' => 'develop/2025-07-30', 'version' => 'develop/2025-07-31',
'build_time' => 1753878970, 'build_time' => 1753936691,
'api_version' => '2.1.0', // field is no longer used. 'api_version' => '2.1.0', // field is no longer used.
'db_version' => 26, 'db_version' => 26,