Auto commit for release 'develop' on 2024-12-30

This commit is contained in:
github-actions
2024-12-30 15:35:26 +01:00
parent 146e164f04
commit ec82105433
18 changed files with 96 additions and 93 deletions

View File

@@ -46,7 +46,7 @@ class AvailableBudgetObserver
private function updateNativeAmount(AvailableBudget $availableBudget): void
{
if (!Amount::convertToNative($availableBudget->user)) {
//Log::debug('Do not update native available amount of the available budget.');
// Log::debug('Do not update native available amount of the available budget.');
return;
}

View File

@@ -46,7 +46,7 @@ class BudgetLimitObserver
private function updateNativeAmount(BudgetLimit $budgetLimit): void
{
if (!Amount::convertToNative($budgetLimit->budget->user)) {
//Log::debug('Do not update native amount of the budget limit.');
// Log::debug('Do not update native amount of the budget limit.');
return;
}

View File

@@ -30,7 +30,6 @@ use FireflyIII\Helpers\Collector\GroupCollectorInterface;
use FireflyIII\Http\Controllers\Controller;
use FireflyIII\Models\Account;
use FireflyIII\Repositories\Account\AccountRepositoryInterface;
use FireflyIII\Support\Facades\Amount;
use FireflyIII\Support\Facades\Steam;
use FireflyIII\Support\Http\Controllers\PeriodOverview;
use Illuminate\Contracts\View\Factory;

View File

@@ -78,7 +78,8 @@ class BoxController extends Controller
$incomes = [];
$expenses = [];
$sums = [];
$currency = $this->defaultCurrency;
$currency = $this->defaultCurrency;
// collect income of user:
/** @var GroupCollectorInterface $collector */
$collector = app(GroupCollectorInterface::class);
@@ -124,7 +125,7 @@ class BoxController extends Controller
$expenses[$currencyId] = app('amount')->formatAnything($currency, $expenses[$currencyId] ?? '0', false);
}
if (0 === count($sums)) {
$currency = $this->defaultCurrency;
$currency = $this->defaultCurrency;
$sums[$this->defaultCurrency->id] = app('amount')->formatAnything($this->defaultCurrency, '0', false);
$incomes[$this->defaultCurrency->id] = app('amount')->formatAnything($this->defaultCurrency, '0', false);
$expenses[$this->defaultCurrency->id] = app('amount')->formatAnything($this->defaultCurrency, '0', false);

View File

@@ -260,7 +260,7 @@ class PreferencesController extends Controller
// convert native
$convertToNative = 1 === (int) $request->get('convertToNative');
if($convertToNative && !$this->convertToNative) {
if ($convertToNative && !$this->convertToNative) {
// set to true!
Log::debug('User sets convertToNative to true.');
event(new UserGroupChangedDefaultCurrency(auth()->user()->userGroup));

View File

@@ -216,8 +216,8 @@ class ConvertController extends Controller
private function getLiabilities(): array
{
// make repositories
$accountList = $this->accountRepository->getActiveAccountsByType([AccountType::LOAN, AccountType::DEBT, AccountType::MORTGAGE]);
$grouped = [];
$accountList = $this->accountRepository->getActiveAccountsByType([AccountType::LOAN, AccountType::DEBT, AccountType::MORTGAGE]);
$grouped = [];
// group accounts:
/** @var Account $account */
@@ -238,8 +238,8 @@ class ConvertController extends Controller
private function getAssetAccounts(): array
{
// make repositories
$accountList = $this->accountRepository->getActiveAccountsByType([AccountType::ASSET]);
$grouped = [];
$accountList = $this->accountRepository->getActiveAccountsByType([AccountType::ASSET]);
$grouped = [];
// group accounts:
/** @var Account $account */

View File

@@ -67,10 +67,10 @@ class AvailableBudget extends Model
$availableBudgetId = (int) $value;
/** @var User $user */
$user = auth()->user();
$user = auth()->user();
/** @var null|AvailableBudget $availableBudget */
$availableBudget = $user->availableBudgets()->find($availableBudgetId);
$availableBudget = $user->availableBudgets()->find($availableBudgetId);
if (null !== $availableBudget) {
return $availableBudget;
}
@@ -92,16 +92,17 @@ class AvailableBudget extends Model
protected function amount(): Attribute
{
return Attribute::make(
get: static fn($value) => (string) $value,
get: static fn ($value) => (string) $value,
);
}
protected function transactionCurrencyId(): Attribute
{
return Attribute::make(
get: static fn($value) => (int) $value,
get: static fn ($value) => (int) $value,
);
}
protected function startDate(): Attribute
{
return Attribute::make(

View File

@@ -64,7 +64,7 @@ class AvailableBudgetRepository implements AvailableBudgetRepositoryInterface
*/
public function get(?Carbon $start = null, ?Carbon $end = null): Collection
{
$query = $this->user->availableBudgets()->with(['transactionCurrency']);
$query = $this->user->availableBudgets()->with(['transactionCurrency']);
if (null !== $start && null !== $end) {
$query->where(
static function (Builder $q1) use ($start, $end): void { // @phpstan-ignore-line
@@ -75,6 +75,7 @@ class AvailableBudgetRepository implements AvailableBudgetRepositoryInterface
}
$result = $query->get(['available_budgets.*']);
Log::debug(sprintf('Found %d available budgets between %s and %s', $result->count(), $start->format('Y-m-d H:i:s'), $end->format('Y-m-d H:i:s')));
return $result;
}

View File

@@ -97,7 +97,7 @@ class TransactionSummarizer
'currency_decimal_places' => $currencyDecimalPlaces,
];
$array[$currencyId]['sum'] = bcadd($array[$currencyId]['sum'], app('steam')->{$method}($amount));
//Log::debug(sprintf('Journal #%d adds amount %s %s', $journal['transaction_journal_id'], $currencyCode, $amount));
// Log::debug(sprintf('Journal #%d adds amount %s %s', $journal['transaction_journal_id'], $currencyCode, $amount));
}
Log::debug('End of sumExpenses.', $array);