mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-16 09:22:33 +00:00
Auto commit for release 'develop' on 2024-09-28
This commit is contained in:
@@ -82,6 +82,7 @@ class AccountBalanceCalculator
|
|||||||
{
|
{
|
||||||
if (null === $notBefore) {
|
if (null === $notBefore) {
|
||||||
Log::debug('getLatestBalance: no notBefore date, returning 0');
|
Log::debug('getLatestBalance: no notBefore date, returning 0');
|
||||||
|
|
||||||
return '0';
|
return '0';
|
||||||
}
|
}
|
||||||
Log::debug(sprintf('getLatestBalance: notBefore date is "%s", calculating', $notBefore->format('Y-m-d')));
|
Log::debug(sprintf('getLatestBalance: notBefore date is "%s", calculating', $notBefore->format('Y-m-d')));
|
||||||
@@ -95,13 +96,15 @@ class AccountBalanceCalculator
|
|||||||
->orderBy('transaction_journals.id', 'DESC')
|
->orderBy('transaction_journals.id', 'DESC')
|
||||||
->orderBy('transaction_journals.description', 'DESC')
|
->orderBy('transaction_journals.description', 'DESC')
|
||||||
->orderBy('transactions.amount', 'DESC')
|
->orderBy('transactions.amount', 'DESC')
|
||||||
->where('transactions.account_id', $accountId);
|
->where('transactions.account_id', $accountId)
|
||||||
|
;
|
||||||
$notBefore->startOfDay();
|
$notBefore->startOfDay();
|
||||||
$query->where('transaction_journals.date', '<', $notBefore);
|
$query->where('transaction_journals.date', '<', $notBefore);
|
||||||
|
|
||||||
$first = $query->first(['transactions.id', 'transactions.balance_dirty', 'transactions.transaction_currency_id', 'transaction_journals.date', 'transactions.account_id', 'transactions.amount', 'transactions.balance_after']);
|
$first = $query->first(['transactions.id', 'transactions.balance_dirty', 'transactions.transaction_currency_id', 'transaction_journals.date', 'transactions.account_id', 'transactions.amount', 'transactions.balance_after']);
|
||||||
$balance = $first->balance_after ?? '0';
|
$balance = $first->balance_after ?? '0';
|
||||||
Log::debug(sprintf('getLatestBalance: found balance: %s in transaction #%d', $balance, $first->id ?? 0));
|
Log::debug(sprintf('getLatestBalance: found balance: %s in transaction #%d', $balance, $first->id ?? 0));
|
||||||
|
|
||||||
return $balance;
|
return $balance;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -131,6 +134,7 @@ class AccountBalanceCalculator
|
|||||||
Log::debug('start of optimizedCalculation');
|
Log::debug('start of optimizedCalculation');
|
||||||
if (false === config('firefly.feature_flags.running_balance_column')) {
|
if (false === config('firefly.feature_flags.running_balance_column')) {
|
||||||
Log::debug('optimizedCalculation is disabled, return.');
|
Log::debug('optimizedCalculation is disabled, return.');
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -148,7 +152,8 @@ class AccountBalanceCalculator
|
|||||||
->orderBy('transaction_journals.order', 'desc')
|
->orderBy('transaction_journals.order', 'desc')
|
||||||
->orderBy('transaction_journals.id', 'asc')
|
->orderBy('transaction_journals.id', 'asc')
|
||||||
->orderBy('transaction_journals.description', 'asc')
|
->orderBy('transaction_journals.description', 'asc')
|
||||||
->orderBy('transactions.amount', 'asc');
|
->orderBy('transactions.amount', 'asc')
|
||||||
|
;
|
||||||
if ($accounts->count() > 0) {
|
if ($accounts->count() > 0) {
|
||||||
$query->whereIn('transactions.account_id', $accounts->pluck('id')->toArray());
|
$query->whereIn('transactions.account_id', $accounts->pluck('id')->toArray());
|
||||||
}
|
}
|
||||||
|
@@ -74,14 +74,14 @@ class General extends AbstractExtension
|
|||||||
|
|
||||||
$strings = [];
|
$strings = [];
|
||||||
foreach ($info as $currencyId => $balance) {
|
foreach ($info as $currencyId => $balance) {
|
||||||
if(0 === $currencyId) {
|
if (0 === $currencyId) {
|
||||||
// not good code but OK
|
// not good code but OK
|
||||||
/** @var AccountRepositoryInterface $accountRepos */
|
/** @var AccountRepositoryInterface $accountRepos */
|
||||||
$accountRepos = app(AccountRepositoryInterface::class);
|
$accountRepos = app(AccountRepositoryInterface::class);
|
||||||
$currency = $accountRepos->getAccountCurrency($account) ?? app('amount')->getDefaultCurrency();
|
$currency = $accountRepos->getAccountCurrency($account) ?? app('amount')->getDefaultCurrency();
|
||||||
$strings[] = app('amount')->formatAnything($currency, $balance, false);
|
$strings[] = app('amount')->formatAnything($currency, $balance, false);
|
||||||
}
|
}
|
||||||
if(0 !== $currencyId) {
|
if (0 !== $currencyId) {
|
||||||
$strings[] = app('amount')->formatByCurrencyId($currencyId, $balance, false);
|
$strings[] = app('amount')->formatByCurrencyId($currencyId, $balance, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -102,15 +102,15 @@ class General extends AbstractExtension
|
|||||||
static function (int $size): string {
|
static function (int $size): string {
|
||||||
// less than one GB, more than one MB
|
// less than one GB, more than one MB
|
||||||
if ($size < (1024 * 1024 * 2014) && $size >= (1024 * 1024)) {
|
if ($size < (1024 * 1024 * 2014) && $size >= (1024 * 1024)) {
|
||||||
return round($size / (1024 * 1024), 2) . ' MB';
|
return round($size / (1024 * 1024), 2).' MB';
|
||||||
}
|
}
|
||||||
|
|
||||||
// less than one MB
|
// less than one MB
|
||||||
if ($size < (1024 * 1024)) {
|
if ($size < (1024 * 1024)) {
|
||||||
return round($size / 1024, 2) . ' KB';
|
return round($size / 1024, 2).' KB';
|
||||||
}
|
}
|
||||||
|
|
||||||
return $size . ' bytes';
|
return $size.' bytes';
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@@ -7,8 +7,8 @@ This project adheres to [Semantic Versioning](http://semver.org/).
|
|||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
|
|
||||||
- #9275
|
- [Issue 9275](https://github.com/firefly-iii/firefly-iii/issues/9275) (Long wait when editing a transaction) reported by @JC5
|
||||||
- #9278
|
- [Issue 9278](https://github.com/firefly-iii/firefly-iii/issues/9278) (Update to v6.1.20 changed Balance of Account) reported by @JeuJeus
|
||||||
|
|
||||||
## 6.1.20 - 2024-09-29
|
## 6.1.20 - 2024-09-29
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user