mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-15 16:57:09 +00:00
Auto commit for release 'develop' on 2024-12-30
This commit is contained in:
26
.ci/php-cs-fixer/composer.lock
generated
26
.ci/php-cs-fixer/composer.lock
generated
@@ -406,16 +406,16 @@
|
||||
},
|
||||
{
|
||||
"name": "friendsofphp/php-cs-fixer",
|
||||
"version": "v3.65.0",
|
||||
"version": "v3.66.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer.git",
|
||||
"reference": "79d4f3e77b250a7d8043d76c6af8f0695e8a469f"
|
||||
"reference": "5f5f2a142ff36b93c41885bca29cc5f861c013e6"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/zipball/79d4f3e77b250a7d8043d76c6af8f0695e8a469f",
|
||||
"reference": "79d4f3e77b250a7d8043d76c6af8f0695e8a469f",
|
||||
"url": "https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/zipball/5f5f2a142ff36b93c41885bca29cc5f861c013e6",
|
||||
"reference": "5f5f2a142ff36b93c41885bca29cc5f861c013e6",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -441,7 +441,7 @@
|
||||
"symfony/polyfill-mbstring": "^1.28",
|
||||
"symfony/polyfill-php80": "^1.28",
|
||||
"symfony/polyfill-php81": "^1.28",
|
||||
"symfony/process": "^5.4 || ^6.0 || ^7.0",
|
||||
"symfony/process": "^5.4 || ^6.0 || ^7.0 <7.2",
|
||||
"symfony/stopwatch": "^5.4 || ^6.0 || ^7.0"
|
||||
},
|
||||
"require-dev": {
|
||||
@@ -497,7 +497,7 @@
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues",
|
||||
"source": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/tree/v3.65.0"
|
||||
"source": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/tree/v3.66.0"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
@@ -505,7 +505,7 @@
|
||||
"type": "github"
|
||||
}
|
||||
],
|
||||
"time": "2024-11-25T00:39:24+00:00"
|
||||
"time": "2024-12-29T13:46:23+00:00"
|
||||
},
|
||||
{
|
||||
"name": "psr/container",
|
||||
@@ -2246,16 +2246,16 @@
|
||||
},
|
||||
{
|
||||
"name": "symfony/process",
|
||||
"version": "v7.2.0",
|
||||
"version": "v7.1.8",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/process.git",
|
||||
"reference": "d34b22ba9390ec19d2dd966c40aa9e8462f27a7e"
|
||||
"reference": "42783370fda6e538771f7c7a36e9fa2ee3a84892"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/process/zipball/d34b22ba9390ec19d2dd966c40aa9e8462f27a7e",
|
||||
"reference": "d34b22ba9390ec19d2dd966c40aa9e8462f27a7e",
|
||||
"url": "https://api.github.com/repos/symfony/process/zipball/42783370fda6e538771f7c7a36e9fa2ee3a84892",
|
||||
"reference": "42783370fda6e538771f7c7a36e9fa2ee3a84892",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -2287,7 +2287,7 @@
|
||||
"description": "Executes commands in sub-processes",
|
||||
"homepage": "https://symfony.com",
|
||||
"support": {
|
||||
"source": "https://github.com/symfony/process/tree/v7.2.0"
|
||||
"source": "https://github.com/symfony/process/tree/v7.1.8"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
@@ -2303,7 +2303,7 @@
|
||||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"time": "2024-11-06T14:24:19+00:00"
|
||||
"time": "2024-11-06T14:23:19+00:00"
|
||||
},
|
||||
{
|
||||
"name": "symfony/service-contracts",
|
||||
|
@@ -94,8 +94,8 @@ abstract class Controller extends BaseController
|
||||
if ($page < 1) {
|
||||
$page = 1;
|
||||
}
|
||||
if ($page > pow(2,16)) {
|
||||
$page = pow(2, 16);
|
||||
if ($page > 2 ** 16) {
|
||||
$page = 2 ** 16;
|
||||
}
|
||||
$bag->set('page', $page);
|
||||
|
||||
|
@@ -93,8 +93,8 @@ class Controller extends BaseController
|
||||
if ($page < 1) {
|
||||
$page = 1;
|
||||
}
|
||||
if ($page > pow(2,16)) {
|
||||
$page = pow(2, 16);
|
||||
if ($page > 2 ** 16) {
|
||||
$page = 2 ** 16;
|
||||
}
|
||||
$bag->set('page', $page);
|
||||
|
||||
|
@@ -62,10 +62,6 @@ class PiggyBankFactory
|
||||
|
||||
/**
|
||||
* Store a piggy bank or come back with an exception.
|
||||
*
|
||||
* @param array $data
|
||||
*
|
||||
* @return PiggyBank
|
||||
*/
|
||||
public function store(array $data): PiggyBank
|
||||
{
|
||||
@@ -117,6 +113,7 @@ class PiggyBankFactory
|
||||
$piggyBank->encrypted = false;
|
||||
$piggyBank->save();
|
||||
$piggyBank->touch();
|
||||
|
||||
return $piggyBank;
|
||||
}
|
||||
|
||||
@@ -132,6 +129,7 @@ class PiggyBankFactory
|
||||
$currency = $this->currencyRepository->find((int) ($data['transaction_currency_id'] ?? 0));
|
||||
}
|
||||
$currency ??= $defaultCurrency;
|
||||
|
||||
return $currency;
|
||||
}
|
||||
|
||||
@@ -144,12 +142,12 @@ class PiggyBankFactory
|
||||
}
|
||||
// first find by ID:
|
||||
if ($piggyBankId > 0) {
|
||||
$piggyBank = PiggyBank
|
||||
::leftJoin('account_piggy_bank', 'account_piggy_bank.piggy_bank_id', '=', 'piggy_banks.id')
|
||||
$piggyBank = PiggyBank::leftJoin('account_piggy_bank', 'account_piggy_bank.piggy_bank_id', '=', 'piggy_banks.id')
|
||||
->leftJoin('accounts', 'accounts.id', '=', 'account_piggy_bank.account_id')
|
||||
->where('accounts.user_id', $this->user->id)
|
||||
->where('piggy_banks.id', $piggyBankId)
|
||||
->first(['piggy_banks.*']);
|
||||
->first(['piggy_banks.*'])
|
||||
;
|
||||
if (null !== $piggyBank) {
|
||||
return $piggyBank;
|
||||
}
|
||||
@@ -169,12 +167,12 @@ class PiggyBankFactory
|
||||
|
||||
public function findByName(string $name): ?PiggyBank
|
||||
{
|
||||
return PiggyBank
|
||||
::leftJoin('account_piggy_bank', 'account_piggy_bank.piggy_bank_id', '=', 'piggy_banks.id')
|
||||
return PiggyBank::leftJoin('account_piggy_bank', 'account_piggy_bank.piggy_bank_id', '=', 'piggy_banks.id')
|
||||
->leftJoin('accounts', 'accounts.id', '=', 'account_piggy_bank.account_id')
|
||||
->where('accounts.user_id', $this->user->id)
|
||||
->where('piggy_banks.name', $name)
|
||||
->first(['piggy_banks.*']);
|
||||
->first(['piggy_banks.*'])
|
||||
;
|
||||
}
|
||||
|
||||
private function setOrder(PiggyBank $piggyBank, array $data): PiggyBank
|
||||
@@ -186,6 +184,7 @@ class PiggyBankFactory
|
||||
}
|
||||
$piggyBank->order = $order;
|
||||
$piggyBank->saveQuietly();
|
||||
|
||||
return $piggyBank;
|
||||
|
||||
}
|
||||
@@ -193,8 +192,7 @@ class PiggyBankFactory
|
||||
public function resetOrder(): void
|
||||
{
|
||||
// TODO duplicate code
|
||||
$set = PiggyBank
|
||||
::leftJoin('account_piggy_bank', 'account_piggy_bank.piggy_bank_id', '=', 'piggy_banks.id')
|
||||
$set = PiggyBank::leftJoin('account_piggy_bank', 'account_piggy_bank.piggy_bank_id', '=', 'piggy_banks.id')
|
||||
->leftJoin('accounts', 'accounts.id', '=', 'account_piggy_bank.account_id')
|
||||
->where('accounts.user_id', $this->user->id)
|
||||
->with(
|
||||
@@ -202,7 +200,8 @@ class PiggyBankFactory
|
||||
'objectGroups',
|
||||
]
|
||||
)
|
||||
->orderBy('piggy_banks.order', 'ASC')->get(['piggy_banks.*']);
|
||||
->orderBy('piggy_banks.order', 'ASC')->get(['piggy_banks.*'])
|
||||
;
|
||||
$current = 1;
|
||||
foreach ($set as $piggyBank) {
|
||||
if ($piggyBank->order !== $current) {
|
||||
@@ -214,7 +213,6 @@ class PiggyBankFactory
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private function getMaxOrder(): int
|
||||
{
|
||||
return (int) $this->piggyBankRepository->getPiggyBanks()->max('order');
|
||||
|
@@ -131,9 +131,11 @@ class PreferencesEventHandler
|
||||
->where('transaction_journals.user_group_id', $userGroup->id)
|
||||
->where(static function (Builder $q): void {
|
||||
$q->whereNotNull('native_amount')
|
||||
->orWhereNotNull('native_foreign_amount');
|
||||
->orWhereNotNull('native_foreign_amount')
|
||||
;
|
||||
})
|
||||
->update(['native_amount' => null, 'native_foreign_amount' => null]);
|
||||
->update(['native_amount' => null, 'native_foreign_amount' => null])
|
||||
;
|
||||
Log::debug(sprintf('Reset %d transactions.', $success));
|
||||
}
|
||||
}
|
||||
|
@@ -39,7 +39,7 @@ class AvailableBudgetObserver
|
||||
|
||||
public function updated(AvailableBudget $availableBudget): void
|
||||
{
|
||||
//Log::debug('Observe "updated" of an available budget.');
|
||||
// Log::debug('Observe "updated" of an available budget.');
|
||||
$this->updateNativeAmount($availableBudget);
|
||||
}
|
||||
|
||||
|
@@ -51,7 +51,7 @@ class AutoBudget extends Model
|
||||
'amount' => 'string',
|
||||
'native_amount' => 'string',
|
||||
];
|
||||
protected $fillable = ['budget_id', 'amount', 'period','native_amount'];
|
||||
protected $fillable = ['budget_id', 'amount', 'period', 'native_amount'];
|
||||
|
||||
public function budget(): BelongsTo
|
||||
{
|
||||
|
@@ -53,7 +53,7 @@ class AvailableBudget extends Model
|
||||
'native_amount' => 'string',
|
||||
];
|
||||
|
||||
protected $fillable = ['user_id', 'user_group_id', 'transaction_currency_id', 'amount', 'start_date', 'end_date', 'start_date_tz', 'end_date_tz','native_amount'];
|
||||
protected $fillable = ['user_id', 'user_group_id', 'transaction_currency_id', 'amount', 'start_date', 'end_date', 'start_date_tz', 'end_date_tz', 'native_amount'];
|
||||
|
||||
/**
|
||||
* Route binder. Converts the key in the URL to the specified object (or throw 404).
|
||||
|
@@ -56,7 +56,7 @@ class PiggyBank extends Model
|
||||
'native_target_amount' => 'string',
|
||||
];
|
||||
|
||||
protected $fillable = ['name', 'order', 'target_amount', 'start_date', 'start_date_tz', 'target_date', 'target_date_tz', 'active', 'transaction_currency_id','native_target_amount'];
|
||||
protected $fillable = ['name', 'order', 'target_amount', 'start_date', 'start_date_tz', 'target_date', 'target_date_tz', 'active', 'transaction_currency_id', 'native_target_amount'];
|
||||
|
||||
/**
|
||||
* Route binder. Converts the key in the URL to the specified object (or throw 404).
|
||||
|
@@ -45,7 +45,7 @@ class PiggyBankEvent extends Model
|
||||
'amount' => 'native_string',
|
||||
];
|
||||
|
||||
protected $fillable = ['piggy_bank_id', 'transaction_journal_id', 'date', 'date_tz', 'amount','native_amount'];
|
||||
protected $fillable = ['piggy_bank_id', 'transaction_journal_id', 'date', 'date_tz', 'amount', 'native_amount'];
|
||||
|
||||
protected $hidden = ['amount_encrypted'];
|
||||
|
||||
|
@@ -28,12 +28,10 @@ use Carbon\Carbon;
|
||||
use FireflyIII\Enums\TransactionTypeEnum;
|
||||
use FireflyIII\Helpers\Collector\GroupCollectorInterface;
|
||||
use FireflyIII\Models\TransactionCurrency;
|
||||
use FireflyIII\Support\Facades\Amount;
|
||||
use FireflyIII\Support\Report\Summarizer\TransactionSummarizer;
|
||||
use FireflyIII\User;
|
||||
use Illuminate\Contracts\Auth\Authenticatable;
|
||||
use Illuminate\Support\Collection;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
|
||||
/**
|
||||
* Class OperationsRepository
|
||||
@@ -68,7 +66,7 @@ class OperationsRepository implements OperationsRepositoryInterface
|
||||
return $collector->getExtractedJournals();
|
||||
}
|
||||
|
||||
public function setUser(null | Authenticatable | User $user): void
|
||||
public function setUser(null|Authenticatable|User $user): void
|
||||
{
|
||||
if ($user instanceof User) {
|
||||
$this->user = $user;
|
||||
@@ -132,8 +130,7 @@ class OperationsRepository implements OperationsRepositoryInterface
|
||||
?Collection $accounts = null,
|
||||
?Collection $expense = null,
|
||||
?TransactionCurrency $currency = null
|
||||
): array
|
||||
{
|
||||
): array {
|
||||
$journals = $this->getTransactionsForSum(TransactionTypeEnum::WITHDRAWAL->value, $start, $end, $accounts, $expense, $currency);
|
||||
|
||||
return $this->groupByCurrency($journals, 'negative');
|
||||
@@ -150,8 +147,7 @@ class OperationsRepository implements OperationsRepositoryInterface
|
||||
?Collection $accounts = null,
|
||||
?Collection $opposing = null,
|
||||
?TransactionCurrency $currency = null
|
||||
): array
|
||||
{
|
||||
): array {
|
||||
$start->startOfDay();
|
||||
$end->endOfDay();
|
||||
|
||||
@@ -191,7 +187,8 @@ class OperationsRepository implements OperationsRepositoryInterface
|
||||
/** @var GroupCollectorInterface $collector */
|
||||
$collector = app(GroupCollectorInterface::class);
|
||||
$collector->setUser($this->user)->setRange($start, $end)->setTypes([$type])->withAccountInformation()
|
||||
->setForeignCurrency($currency);
|
||||
->setForeignCurrency($currency)
|
||||
;
|
||||
if (TransactionTypeEnum::WITHDRAWAL->value === $type) {
|
||||
if (null !== $accounts) {
|
||||
$collector->setSourceAccounts($accounts);
|
||||
@@ -221,6 +218,7 @@ class OperationsRepository implements OperationsRepositoryInterface
|
||||
private function groupByCurrency(array $journals, string $direction): array
|
||||
{
|
||||
$summarizer = new TransactionSummarizer($this->user);
|
||||
|
||||
return $summarizer->groupByCurrencyId($journals, $direction);
|
||||
}
|
||||
|
||||
@@ -233,8 +231,7 @@ class OperationsRepository implements OperationsRepositoryInterface
|
||||
?Collection $accounts = null,
|
||||
?Collection $expense = null,
|
||||
?TransactionCurrency $currency = null
|
||||
): array
|
||||
{
|
||||
): array {
|
||||
$journals = $this->getTransactionsForSum(TransactionTypeEnum::WITHDRAWAL->value, $start, $end, $accounts, $expense, $currency);
|
||||
|
||||
return $this->groupByDirection($journals, 'destination', 'negative');
|
||||
@@ -243,6 +240,7 @@ class OperationsRepository implements OperationsRepositoryInterface
|
||||
private function groupByDirection(array $journals, string $direction, string $method): array
|
||||
{
|
||||
$summarizer = new TransactionSummarizer($this->user);
|
||||
|
||||
return $summarizer->groupByDirection($journals, $method, $direction);
|
||||
}
|
||||
|
||||
@@ -255,8 +253,7 @@ class OperationsRepository implements OperationsRepositoryInterface
|
||||
?Collection $accounts = null,
|
||||
?Collection $expense = null,
|
||||
?TransactionCurrency $currency = null
|
||||
): array
|
||||
{
|
||||
): array {
|
||||
$journals = $this->getTransactionsForSum(TransactionTypeEnum::WITHDRAWAL->value, $start, $end, $accounts, $expense, $currency);
|
||||
|
||||
return $this->groupByDirection($journals, 'source', 'negative');
|
||||
@@ -271,8 +268,7 @@ class OperationsRepository implements OperationsRepositoryInterface
|
||||
?Collection $accounts = null,
|
||||
?Collection $revenue = null,
|
||||
?TransactionCurrency $currency = null
|
||||
): array
|
||||
{
|
||||
): array {
|
||||
$journals = $this->getTransactionsForSum(TransactionTypeEnum::DEPOSIT->value, $start, $end, $accounts, $revenue, $currency);
|
||||
|
||||
return $this->groupByCurrency($journals, 'positive');
|
||||
@@ -287,8 +283,7 @@ class OperationsRepository implements OperationsRepositoryInterface
|
||||
?Collection $accounts = null,
|
||||
?Collection $revenue = null,
|
||||
?TransactionCurrency $currency = null
|
||||
): array
|
||||
{
|
||||
): array {
|
||||
$journals = $this->getTransactionsForSum(TransactionTypeEnum::DEPOSIT->value, $start, $end, $accounts, $revenue, $currency);
|
||||
|
||||
return $this->groupByDirection($journals, 'destination', 'positive');
|
||||
@@ -303,8 +298,7 @@ class OperationsRepository implements OperationsRepositoryInterface
|
||||
?Collection $accounts = null,
|
||||
?Collection $revenue = null,
|
||||
?TransactionCurrency $currency = null
|
||||
): array
|
||||
{
|
||||
): array {
|
||||
$journals = $this->getTransactionsForSum(TransactionTypeEnum::DEPOSIT->value, $start, $end, $accounts, $revenue, $currency);
|
||||
|
||||
return $this->groupByDirection($journals, 'source', 'positive');
|
||||
|
@@ -29,12 +29,10 @@ use FireflyIII\Enums\TransactionTypeEnum;
|
||||
use FireflyIII\Helpers\Collector\GroupCollectorInterface;
|
||||
use FireflyIII\Models\TransactionCurrency;
|
||||
use FireflyIII\Models\TransactionType;
|
||||
use FireflyIII\Support\Facades\Amount;
|
||||
use FireflyIII\Support\Report\Summarizer\TransactionSummarizer;
|
||||
use FireflyIII\User;
|
||||
use Illuminate\Contracts\Auth\Authenticatable;
|
||||
use Illuminate\Support\Collection;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
|
||||
/**
|
||||
* Class NoBudgetRepository
|
||||
@@ -106,6 +104,7 @@ class NoBudgetRepository implements NoBudgetRepositoryInterface
|
||||
$collector->withBudgetInformation();
|
||||
$journals = $collector->getExtractedJournals();
|
||||
$summarizer = new TransactionSummarizer($this->user);
|
||||
|
||||
return $summarizer->groupByCurrencyId($journals);
|
||||
}
|
||||
}
|
||||
|
@@ -256,6 +256,7 @@ class OperationsRepository implements OperationsRepositoryInterface
|
||||
Log::debug('STOP looking for transactions in the foreign currency.');
|
||||
}
|
||||
$summarizer = new TransactionSummarizer($this->user);
|
||||
|
||||
return $summarizer->groupByCurrencyId($journals);
|
||||
}
|
||||
}
|
||||
|
@@ -27,12 +27,10 @@ namespace FireflyIII\Repositories\Category;
|
||||
use Carbon\Carbon;
|
||||
use FireflyIII\Helpers\Collector\GroupCollectorInterface;
|
||||
use FireflyIII\Models\TransactionType;
|
||||
use FireflyIII\Support\Facades\Amount;
|
||||
use FireflyIII\Support\Report\Summarizer\TransactionSummarizer;
|
||||
use FireflyIII\User;
|
||||
use Illuminate\Contracts\Auth\Authenticatable;
|
||||
use Illuminate\Support\Collection;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
|
||||
/**
|
||||
* Class NoCategoryRepository
|
||||
@@ -154,6 +152,7 @@ class NoCategoryRepository implements NoCategoryRepositoryInterface
|
||||
}
|
||||
$journals = $collector->getExtractedJournals();
|
||||
$summarizer = new TransactionSummarizer($this->user);
|
||||
|
||||
return $summarizer->groupByCurrencyId($journals);
|
||||
}
|
||||
|
||||
|
@@ -341,6 +341,7 @@ class OperationsRepository implements OperationsRepositoryInterface
|
||||
$collector->withCategoryInformation();
|
||||
$journals = $collector->getExtractedJournals();
|
||||
$summarizer = new TransactionSummarizer($this->user);
|
||||
|
||||
return $summarizer->groupByCurrencyId($journals);
|
||||
}
|
||||
|
||||
|
@@ -166,6 +166,7 @@ class Amount
|
||||
return $this->getDefaultCurrencyByUserGroup($user->userGroup);
|
||||
}
|
||||
}
|
||||
|
||||
return $this->getSystemCurrency();
|
||||
}
|
||||
|
||||
@@ -325,11 +326,11 @@ class Amount
|
||||
}
|
||||
|
||||
// default is amount before currency
|
||||
$format = $posA . $posD . '%v' . $space . $posB . '%s' . $posC . $posE;
|
||||
$format = $posA.$posD.'%v'.$space.$posB.'%s'.$posC.$posE;
|
||||
|
||||
if ($csPrecedes) {
|
||||
// alternative is currency before amount
|
||||
$format = $posA . $posB . '%s' . $posC . $space . $posD . '%v' . $posE;
|
||||
$format = $posA.$posB.'%s'.$posC.$space.$posD.'%v'.$posE;
|
||||
}
|
||||
|
||||
return $format;
|
||||
|
@@ -507,12 +507,12 @@ class Navigation
|
||||
$diff = $start->diffInMonths($end, true);
|
||||
Log::debug(sprintf('preferredCarbonFormat(%s, %s) = %f', $start->format('Y-m-d'), $end->format('Y-m-d'), $diff));
|
||||
if ($diff >= 1.001) {
|
||||
// Log::debug(sprintf('Return Y-m because %s', $diff));
|
||||
// Log::debug(sprintf('Return Y-m because %s', $diff));
|
||||
$format = 'Y-m';
|
||||
}
|
||||
|
||||
if ($diff >= 12.001) {
|
||||
// Log::debug(sprintf('Return Y because %s', $diff));
|
||||
// Log::debug(sprintf('Return Y because %s', $diff));
|
||||
$format = 'Y';
|
||||
}
|
||||
|
||||
|
@@ -1,4 +1,5 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* TransactionSummarizer.php
|
||||
* Copyright (c) 2024 james@firefly-iii.org.
|
||||
@@ -83,7 +84,7 @@ class TransactionSummarizer
|
||||
$currencyDecimalPlaces = $journal['foreign_currency_decimal_places'];
|
||||
}
|
||||
}
|
||||
if(!$this->convertToNative) {
|
||||
if (!$this->convertToNative) {
|
||||
// default to the normal amount, but also
|
||||
}
|
||||
$amount = (string) ($journal[$field] ?? '0');
|
||||
@@ -95,14 +96,16 @@ class TransactionSummarizer
|
||||
'currency_code' => $currencyCode,
|
||||
'currency_decimal_places' => $currencyDecimalPlaces,
|
||||
];
|
||||
$array[$currencyId]['sum'] = bcadd($array[$currencyId]['sum'], app('steam')->$method($amount));
|
||||
$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('End of sumExpenses.', $array);
|
||||
|
||||
return $array;
|
||||
}
|
||||
|
||||
public function groupByDirection(array $journals, string $method, string $direction): array {
|
||||
public function groupByDirection(array $journals, string $method, string $direction): array
|
||||
{
|
||||
|
||||
$array = [];
|
||||
$idKey = sprintf('%s_account_id', $direction);
|
||||
@@ -174,5 +177,4 @@ class TransactionSummarizer
|
||||
|
||||
return $array;
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -58,7 +58,7 @@ class AccountTransformer extends AbstractTransformer
|
||||
|
||||
// get account type:
|
||||
$fullType = $account->accountType->type;
|
||||
$accountType = (string) config(sprintf( 'firefly.shortNamesByFullName.%s', $fullType));
|
||||
$accountType = (string) config(sprintf('firefly.shortNamesByFullName.%s', $fullType));
|
||||
$liabilityType = (string) config(sprintf('firefly.shortLiabilityNameByFullName.%s', $fullType));
|
||||
$liabilityType = '' === $liabilityType ? null : strtolower($liabilityType);
|
||||
$liabilityDirection = $this->repository->getMetaValue($account, 'liability_direction');
|
||||
|
@@ -16,9 +16,9 @@ This project adheres to [Semantic Versioning](http://semver.org/).
|
||||
- [Issue 7945](https://github.com/firefly-iii/firefly-iii/issues/7945) ("Rules" that only trigger manually) reported by @SekoiaTree
|
||||
- [Issue 6760](https://github.com/firefly-iii/firefly-iii/issues/6760) (Add a new trigger for automated rules) reported by @Gsyltc
|
||||
- [Issue 6557](https://github.com/firefly-iii/firefly-iii/issues/6557) (Piggy Banks - Draw Funds from Multiple Accounts) reported by @BugPhobic
|
||||
- #5532
|
||||
- #6314
|
||||
- #9586
|
||||
- [Issue 5532](https://github.com/firefly-iii/firefly-iii/issues/5532) (Asset prices and exchange rates) reported by @svozniuk
|
||||
- [Issue 6314](https://github.com/firefly-iii/firefly-iii/issues/6314) (Currencies and exchange rates) reported by @JC5
|
||||
- [Issue 9586](https://github.com/firefly-iii/firefly-iii/issues/9586) (Non en_US translated string in sign-up mail) reported by @benni347
|
||||
|
||||
### Changed
|
||||
|
||||
|
26
composer.lock
generated
26
composer.lock
generated
@@ -2614,16 +2614,16 @@
|
||||
},
|
||||
{
|
||||
"name": "league/commonmark",
|
||||
"version": "2.6.0",
|
||||
"version": "2.6.1",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/thephpleague/commonmark.git",
|
||||
"reference": "d150f911e0079e90ae3c106734c93137c184f932"
|
||||
"reference": "d990688c91cedfb69753ffc2512727ec646df2ad"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/thephpleague/commonmark/zipball/d150f911e0079e90ae3c106734c93137c184f932",
|
||||
"reference": "d150f911e0079e90ae3c106734c93137c184f932",
|
||||
"url": "https://api.github.com/repos/thephpleague/commonmark/zipball/d990688c91cedfb69753ffc2512727ec646df2ad",
|
||||
"reference": "d990688c91cedfb69753ffc2512727ec646df2ad",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -2717,7 +2717,7 @@
|
||||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"time": "2024-12-07T15:34:16+00:00"
|
||||
"time": "2024-12-29T14:10:59+00:00"
|
||||
},
|
||||
{
|
||||
"name": "league/config",
|
||||
@@ -10193,20 +10193,20 @@
|
||||
},
|
||||
{
|
||||
"name": "barryvdh/laravel-ide-helper",
|
||||
"version": "v3.3.0",
|
||||
"version": "v3.4.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/barryvdh/laravel-ide-helper.git",
|
||||
"reference": "b7675670f75914bf34afdea52a6c2fe3781f7c44"
|
||||
"reference": "2a41415f01bf3c409d200f6cdd940c1e7d86cfd3"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/barryvdh/laravel-ide-helper/zipball/b7675670f75914bf34afdea52a6c2fe3781f7c44",
|
||||
"reference": "b7675670f75914bf34afdea52a6c2fe3781f7c44",
|
||||
"url": "https://api.github.com/repos/barryvdh/laravel-ide-helper/zipball/2a41415f01bf3c409d200f6cdd940c1e7d86cfd3",
|
||||
"reference": "2a41415f01bf3c409d200f6cdd940c1e7d86cfd3",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"barryvdh/reflection-docblock": "^2.1.2",
|
||||
"barryvdh/reflection-docblock": "^2.2",
|
||||
"composer/class-map-generator": "^1.0",
|
||||
"ext-json": "*",
|
||||
"illuminate/console": "^11.15",
|
||||
@@ -10239,7 +10239,7 @@
|
||||
]
|
||||
},
|
||||
"branch-alias": {
|
||||
"dev-master": "3.2-dev"
|
||||
"dev-master": "3.4-dev"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
@@ -10271,7 +10271,7 @@
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/barryvdh/laravel-ide-helper/issues",
|
||||
"source": "https://github.com/barryvdh/laravel-ide-helper/tree/v3.3.0"
|
||||
"source": "https://github.com/barryvdh/laravel-ide-helper/tree/v3.4.0"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
@@ -10283,7 +10283,7 @@
|
||||
"type": "github"
|
||||
}
|
||||
],
|
||||
"time": "2024-12-18T08:24:19+00:00"
|
||||
"time": "2024-12-29T12:10:58+00:00"
|
||||
},
|
||||
{
|
||||
"name": "barryvdh/reflection-docblock",
|
||||
|
@@ -81,7 +81,7 @@ return [
|
||||
'running_balance_column' => env('USE_RUNNING_BALANCE', false),
|
||||
// see cer.php for exchange rates feature flag.
|
||||
],
|
||||
'version' => 'develop/2024-12-28',
|
||||
'version' => 'develop/2024-12-30',
|
||||
'api_version' => '2.1.0', // field is no longer used.
|
||||
'db_version' => 25,
|
||||
|
||||
|
@@ -133,7 +133,7 @@
|
||||
"header_exchange_rates": "Wechselkurse",
|
||||
"exchange_rates_intro": "Firefly III unterst\u00fctzt das Herunterladen und Verwenden von Wechselkursen. Lesen Sie mehr dar\u00fcber in <a href=\u201ehttps:\/\/docs.firefly-iii.org\/LOL_NOT_FINISHED_YET_TODO\u201c>der Dokumentation<\/a>.",
|
||||
"exchange_rates_from_to": "Zwischen {from} und {to} (und umgekehrt)",
|
||||
"exchange_rates_intro_rates": "Firefly III uses the following exchange rates. The inverse is automatically calculated when it is not provided. If no exchange rate exists for the date of the transaction, Firefly III will go back in time to find one. If none are present, the rate \"1\" will be used.",
|
||||
"exchange_rates_intro_rates": "Firefly III verwendet die folgenden Wechselkurse. Der Kehrwert wird automatisch berechnet, wenn er nicht angegeben wurde. Wenn f\u00fcr das Datum der Transaktion kein Wechselkurs vorhanden ist, sucht Firefly III in der Vergangenheit nach einem Kurs. Wenn keine vorhanden sind, wird der Kurs \u201e1\u201c verwendet.",
|
||||
"header_exchange_rates_rates": "Wechselkurse",
|
||||
"header_exchange_rates_table": "Tabelle mit Wechselkursen",
|
||||
"help_rate_form": "An diesem Tag, wie viele {to} werden Sie f\u00fcr {from} bekommen?",
|
||||
|
@@ -36,7 +36,7 @@
|
||||
"is_reconciled_fields_dropped": "Omdat deze transactie al is afgestemd, kan je het bedrag noch de rekeningen wijzigen.",
|
||||
"tags": "Tags",
|
||||
"no_budget": "(geen budget)",
|
||||
"no_bill": "(no subscription)",
|
||||
"no_bill": "(geen abonnement)",
|
||||
"category": "Categorie",
|
||||
"attachments": "Bijlagen",
|
||||
"notes": "Notities",
|
||||
@@ -52,7 +52,7 @@
|
||||
"destination_account_reconciliation": "Je kan de doelrekening van een afstemming niet wijzigen.",
|
||||
"source_account_reconciliation": "Je kan de bronrekening van een afstemming niet wijzigen.",
|
||||
"budget": "Budget",
|
||||
"bill": "Subscription",
|
||||
"bill": "Abonnement",
|
||||
"you_create_withdrawal": "Je maakt een uitgave.",
|
||||
"you_create_transfer": "Je maakt een overschrijving.",
|
||||
"you_create_deposit": "Je maakt inkomsten.",
|
||||
@@ -133,7 +133,7 @@
|
||||
"header_exchange_rates": "Wisselkoersen",
|
||||
"exchange_rates_intro": "Firefly III kan wisselkoersen downloaden en gebruiken. Lees hier meer over in <a href=\"https:\/\/docs.firefly-iii.org\/LOL_NOT_FINISHED_YET_TODO\">de documentatie<\/a>.",
|
||||
"exchange_rates_from_to": "Tussen {from} en {to} (en andersom)",
|
||||
"exchange_rates_intro_rates": "Firefly III uses the following exchange rates. The inverse is automatically calculated when it is not provided. If no exchange rate exists for the date of the transaction, Firefly III will go back in time to find one. If none are present, the rate \"1\" will be used.",
|
||||
"exchange_rates_intro_rates": "Firefly III gebruikt de volgende wisselkoersen. De inverse berekent zichzelf als deze niet is opgegeven. Als er geen wisselkoers bestaat voor de datum van de transactie, gaat Firefly III terug in de tijd om er een te vinden. Als er geen aanwezig is, zal de koers \"1\" gebruikt worden.",
|
||||
"header_exchange_rates_rates": "Wisselkoersen",
|
||||
"header_exchange_rates_table": "Tabel met wisselkoersen",
|
||||
"help_rate_form": "Hoeveel {to} krijg je op deze dag voor \u00e9\u00e9n {from}?",
|
||||
|
@@ -54,6 +54,7 @@ abstract class TestCase extends BaseTestCase
|
||||
protected function createAuthenticatedUser(): User
|
||||
{
|
||||
$group = UserGroup::create(['title' => 'test@email.com']);
|
||||
|
||||
return User::create([
|
||||
'email' => 'test@email.com',
|
||||
'password' => 'password',
|
||||
|
Reference in New Issue
Block a user