mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-12 15:35:15 +00:00
Auto commit for release 'develop' on 2024-06-16
This commit is contained in:
27
.ci/php-cs-fixer/composer.lock
generated
27
.ci/php-cs-fixer/composer.lock
generated
@@ -398,16 +398,16 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "friendsofphp/php-cs-fixer",
|
"name": "friendsofphp/php-cs-fixer",
|
||||||
"version": "v3.59.1",
|
"version": "v3.59.3",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer.git",
|
"url": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer.git",
|
||||||
"reference": "756fa7852c2e961cba4ea39e3e510e1c020f2123"
|
"reference": "30ba9ecc2b0e5205e578fe29973c15653d9bfd29"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/zipball/756fa7852c2e961cba4ea39e3e510e1c020f2123",
|
"url": "https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/zipball/30ba9ecc2b0e5205e578fe29973c15653d9bfd29",
|
||||||
"reference": "756fa7852c2e961cba4ea39e3e510e1c020f2123",
|
"reference": "30ba9ecc2b0e5205e578fe29973c15653d9bfd29",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
@@ -437,16 +437,16 @@
|
|||||||
"symfony/stopwatch": "^5.4 || ^6.0 || ^7.0"
|
"symfony/stopwatch": "^5.4 || ^6.0 || ^7.0"
|
||||||
},
|
},
|
||||||
"require-dev": {
|
"require-dev": {
|
||||||
"facile-it/paraunit": "^1.3 || ^2.0",
|
"facile-it/paraunit": "^1.3 || ^2.3",
|
||||||
"infection/infection": "^0.27.11",
|
"infection/infection": "^0.29.5",
|
||||||
"justinrainbow/json-schema": "^5.2",
|
"justinrainbow/json-schema": "^5.2",
|
||||||
"keradus/cli-executor": "^2.1",
|
"keradus/cli-executor": "^2.1",
|
||||||
"mikey179/vfsstream": "^1.6.11",
|
"mikey179/vfsstream": "^1.6.11",
|
||||||
"php-coveralls/php-coveralls": "^2.7",
|
"php-coveralls/php-coveralls": "^2.7",
|
||||||
"php-cs-fixer/accessible-object": "^1.1",
|
"php-cs-fixer/accessible-object": "^1.1",
|
||||||
"php-cs-fixer/phpunit-constraint-isidenticalstring": "^1.4",
|
"php-cs-fixer/phpunit-constraint-isidenticalstring": "^1.5",
|
||||||
"php-cs-fixer/phpunit-constraint-xmlmatchesxsd": "^1.4",
|
"php-cs-fixer/phpunit-constraint-xmlmatchesxsd": "^1.5",
|
||||||
"phpunit/phpunit": "^9.6 || ^10.5.5 || ^11.0.2",
|
"phpunit/phpunit": "^9.6.19 || ^10.5.21 || ^11.2",
|
||||||
"symfony/var-dumper": "^5.4 || ^6.0 || ^7.0",
|
"symfony/var-dumper": "^5.4 || ^6.0 || ^7.0",
|
||||||
"symfony/yaml": "^5.4 || ^6.0 || ^7.0"
|
"symfony/yaml": "^5.4 || ^6.0 || ^7.0"
|
||||||
},
|
},
|
||||||
@@ -461,7 +461,10 @@
|
|||||||
"autoload": {
|
"autoload": {
|
||||||
"psr-4": {
|
"psr-4": {
|
||||||
"PhpCsFixer\\": "src/"
|
"PhpCsFixer\\": "src/"
|
||||||
}
|
},
|
||||||
|
"exclude-from-classmap": [
|
||||||
|
"src/Fixer/Internal/*"
|
||||||
|
]
|
||||||
},
|
},
|
||||||
"notification-url": "https://packagist.org/downloads/",
|
"notification-url": "https://packagist.org/downloads/",
|
||||||
"license": [
|
"license": [
|
||||||
@@ -486,7 +489,7 @@
|
|||||||
],
|
],
|
||||||
"support": {
|
"support": {
|
||||||
"issues": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues",
|
"issues": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues",
|
||||||
"source": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/tree/v3.59.1"
|
"source": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/tree/v3.59.3"
|
||||||
},
|
},
|
||||||
"funding": [
|
"funding": [
|
||||||
{
|
{
|
||||||
@@ -494,7 +497,7 @@
|
|||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"time": "2024-06-15T12:19:07+00:00"
|
"time": "2024-06-16T14:17:03+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "psr/container",
|
"name": "psr/container",
|
||||||
|
@@ -28,7 +28,8 @@ use Illuminate\Foundation\Http\Middleware\VerifyCsrfToken as Middleware;
|
|||||||
/**
|
/**
|
||||||
* Class VerifyCsrfToken.
|
* Class VerifyCsrfToken.
|
||||||
*/
|
*/
|
||||||
class VerifyCsrfToken extends Middleware {
|
class VerifyCsrfToken extends Middleware
|
||||||
|
{
|
||||||
protected $except = [
|
protected $except = [
|
||||||
'oauth/token',
|
'oauth/token',
|
||||||
];
|
];
|
||||||
|
@@ -60,9 +60,9 @@ class AccountBalanceCalculator
|
|||||||
|
|
||||||
private function getAccountBalanceByAccount(int $account, int $currency): AccountBalance
|
private function getAccountBalanceByAccount(int $account, int $currency): AccountBalance
|
||||||
{
|
{
|
||||||
$query = AccountBalance::where('title', 'balance')->where('account_id', $account)->where('transaction_currency_id', $currency);
|
$query = AccountBalance::where('title', 'balance')->where('account_id', $account)->where('transaction_currency_id', $currency);
|
||||||
|
|
||||||
$entry = $query->first();
|
$entry = $query->first();
|
||||||
if (null !== $entry) {
|
if (null !== $entry) {
|
||||||
// Log::debug(sprintf('Found account balance "balance" for account #%d and currency #%d: %s', $account, $currency, $entry->balance));
|
// Log::debug(sprintf('Found account balance "balance" for account #%d and currency #%d: %s', $account, $currency, $entry->balance));
|
||||||
|
|
||||||
@@ -81,9 +81,9 @@ class AccountBalanceCalculator
|
|||||||
|
|
||||||
private function getAccountBalanceByJournal(string $title, int $account, int $journal, int $currency): AccountBalance
|
private function getAccountBalanceByJournal(string $title, int $account, int $journal, int $currency): AccountBalance
|
||||||
{
|
{
|
||||||
$query = AccountBalance::where('title', $title)->where('account_id', $account)->where('transaction_journal_id', $journal)->where('transaction_currency_id', $currency);
|
$query = AccountBalance::where('title', $title)->where('account_id', $account)->where('transaction_journal_id', $journal)->where('transaction_currency_id', $currency);
|
||||||
|
|
||||||
$entry = $query->first();
|
$entry = $query->first();
|
||||||
if (null !== $entry) {
|
if (null !== $entry) {
|
||||||
return $entry;
|
return $entry;
|
||||||
}
|
}
|
||||||
@@ -100,7 +100,7 @@ class AccountBalanceCalculator
|
|||||||
|
|
||||||
private function recalculateLatest(?Account $account): void
|
private function recalculateLatest(?Account $account): void
|
||||||
{
|
{
|
||||||
$query = Transaction::groupBy(['transactions.account_id', 'transactions.transaction_currency_id', 'transactions.foreign_currency_id']);
|
$query = Transaction::groupBy(['transactions.account_id', 'transactions.transaction_currency_id', 'transactions.foreign_currency_id']);
|
||||||
|
|
||||||
if (null !== $account) {
|
if (null !== $account) {
|
||||||
$query->where('transactions.account_id', $account->id);
|
$query->where('transactions.account_id', $account->id);
|
||||||
@@ -121,8 +121,8 @@ class AccountBalanceCalculator
|
|||||||
$sumForeignAmount = '' === $sumForeignAmount ? '0' : $sumForeignAmount;
|
$sumForeignAmount = '' === $sumForeignAmount ? '0' : $sumForeignAmount;
|
||||||
|
|
||||||
// first create for normal currency:
|
// first create for normal currency:
|
||||||
$entry = $this->getAccountBalanceByAccount($account, $transactionCurrency);
|
$entry = $this->getAccountBalanceByAccount($account, $transactionCurrency);
|
||||||
$entry->balance = bcadd((string) $entry->balance, $sumAmount);
|
$entry->balance = bcadd((string) $entry->balance, $sumAmount);
|
||||||
$entry->save();
|
$entry->save();
|
||||||
|
|
||||||
// then do foreign amount, if present:
|
// then do foreign amount, if present:
|
||||||
@@ -160,7 +160,7 @@ class AccountBalanceCalculator
|
|||||||
*/
|
*/
|
||||||
private function recalculateJournals(?Account $account, ?TransactionJournal $transactionJournal): void
|
private function recalculateJournals(?Account $account, ?TransactionJournal $transactionJournal): void
|
||||||
{
|
{
|
||||||
$query = Transaction::groupBy(['transactions.account_id', 'transaction_journals.id', 'transactions.transaction_currency_id', 'transactions.foreign_currency_id']);
|
$query = Transaction::groupBy(['transactions.account_id', 'transaction_journals.id', 'transactions.transaction_currency_id', 'transactions.foreign_currency_id']);
|
||||||
$query->leftJoin('transaction_journals', 'transaction_journals.id', '=', 'transactions.transaction_journal_id');
|
$query->leftJoin('transaction_journals', 'transaction_journals.id', '=', 'transactions.transaction_journal_id');
|
||||||
$query->orderBy('transaction_journals.date', 'asc');
|
$query->orderBy('transaction_journals.date', 'asc');
|
||||||
$amounts = [];
|
$amounts = [];
|
||||||
@@ -171,28 +171,28 @@ class AccountBalanceCalculator
|
|||||||
$query->where('transaction_journals.date', '>=', $transactionJournal->date);
|
$query->where('transaction_journals.date', '>=', $transactionJournal->date);
|
||||||
$amounts = $this->getStartAmounts($account, $transactionJournal);
|
$amounts = $this->getStartAmounts($account, $transactionJournal);
|
||||||
}
|
}
|
||||||
$result = $query->get(['transactions.account_id', 'transaction_journals.id', 'transactions.transaction_currency_id', 'transactions.foreign_currency_id', \DB::raw('SUM(transactions.amount) as sum_amount'), \DB::raw('SUM(transactions.foreign_amount) as sum_foreign_amount')]);
|
$result = $query->get(['transactions.account_id', 'transaction_journals.id', 'transactions.transaction_currency_id', 'transactions.foreign_currency_id', \DB::raw('SUM(transactions.amount) as sum_amount'), \DB::raw('SUM(transactions.foreign_amount) as sum_foreign_amount')]);
|
||||||
|
|
||||||
/** @var \stdClass $row */
|
/** @var \stdClass $row */
|
||||||
foreach ($result as $row) {
|
foreach ($result as $row) {
|
||||||
$account = (int) $row->account_id;
|
$account = (int) $row->account_id;
|
||||||
$transactionCurrency = (int) $row->transaction_currency_id;
|
$transactionCurrency = (int) $row->transaction_currency_id;
|
||||||
$foreignCurrency = (int) $row->foreign_currency_id;
|
$foreignCurrency = (int) $row->foreign_currency_id;
|
||||||
$sumAmount = (string) $row->sum_amount;
|
$sumAmount = (string) $row->sum_amount;
|
||||||
$sumForeignAmount = (string) $row->sum_foreign_amount;
|
$sumForeignAmount = (string) $row->sum_foreign_amount;
|
||||||
$journalId = (int) $row->id;
|
$journalId = (int) $row->id;
|
||||||
|
|
||||||
// check for empty strings
|
// check for empty strings
|
||||||
$sumAmount = '' === $sumAmount ? '0' : $sumAmount;
|
$sumAmount = '' === $sumAmount ? '0' : $sumAmount;
|
||||||
$sumForeignAmount = '' === $sumForeignAmount ? '0' : $sumForeignAmount;
|
$sumForeignAmount = '' === $sumForeignAmount ? '0' : $sumForeignAmount;
|
||||||
|
|
||||||
// new amounts:
|
// new amounts:
|
||||||
$amounts[$account][$transactionCurrency] = bcadd($amounts[$account][$transactionCurrency] ?? '0', $sumAmount);
|
$amounts[$account][$transactionCurrency] = bcadd($amounts[$account][$transactionCurrency] ?? '0', $sumAmount);
|
||||||
$amounts[$account][$foreignCurrency] = bcadd($amounts[$account][$foreignCurrency] ?? '0', $sumForeignAmount);
|
$amounts[$account][$foreignCurrency] = bcadd($amounts[$account][$foreignCurrency] ?? '0', $sumForeignAmount);
|
||||||
|
|
||||||
// first create for normal currency:
|
// first create for normal currency:
|
||||||
$entry = self::getAccountBalanceByJournal('balance_after_journal', $account, $journalId, $transactionCurrency);
|
$entry = self::getAccountBalanceByJournal('balance_after_journal', $account, $journalId, $transactionCurrency);
|
||||||
$entry->balance = $amounts[$account][$transactionCurrency];
|
$entry->balance = $amounts[$account][$transactionCurrency];
|
||||||
$entry->save();
|
$entry->save();
|
||||||
|
|
||||||
// then do foreign amount, if present:
|
// then do foreign amount, if present:
|
||||||
|
@@ -117,7 +117,7 @@ return [
|
|||||||
'expression_engine' => false,
|
'expression_engine' => false,
|
||||||
// see cer.php for exchange rates feature flag.
|
// see cer.php for exchange rates feature flag.
|
||||||
],
|
],
|
||||||
'version' => 'develop/2024-06-15',
|
'version' => 'develop/2024-06-16',
|
||||||
'api_version' => '2.1.0',
|
'api_version' => '2.1.0',
|
||||||
'db_version' => 24,
|
'db_version' => 24,
|
||||||
|
|
||||||
|
18
package-lock.json
generated
18
package-lock.json
generated
@@ -4028,9 +4028,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/caniuse-lite": {
|
"node_modules/caniuse-lite": {
|
||||||
"version": "1.0.30001634",
|
"version": "1.0.30001635",
|
||||||
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001634.tgz",
|
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001635.tgz",
|
||||||
"integrity": "sha512-fbBYXQ9q3+yp1q1gBk86tOFs4pyn/yxFm5ZNP18OXJDfA3txImOY9PhfxVggZ4vRHDqoU8NrKU81eN0OtzOgRA==",
|
"integrity": "sha512-34NOwyGFZxFoIOFNoLPP08eHzaCN+3wJFKx4Vph0XpidU1tRxB0p3Q2etIbOj0W8TYeuXkYsMCcyjV1+phBzxQ==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"funding": [
|
"funding": [
|
||||||
{
|
{
|
||||||
@@ -6974,9 +6974,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/launch-editor": {
|
"node_modules/launch-editor": {
|
||||||
"version": "2.6.1",
|
"version": "2.7.0",
|
||||||
"resolved": "https://registry.npmjs.org/launch-editor/-/launch-editor-2.6.1.tgz",
|
"resolved": "https://registry.npmjs.org/launch-editor/-/launch-editor-2.7.0.tgz",
|
||||||
"integrity": "sha512-eB/uXmFVpY4zezmGp5XtU21kwo7GBbKB+EQ+UZeWtGb9yAM5xt/Evk+lYH3eRNAtId+ej4u7TYPFZ07w4s7rRw==",
|
"integrity": "sha512-KAc66u6LxWL8MifQ94oG3YGKYWDwz/Gi0T15lN//GaQoZe08vQGFJxrXkPAeu50UXgvJPPaRKVGuP1TRUm/aHQ==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"picocolors": "^1.0.0",
|
"picocolors": "^1.0.0",
|
||||||
@@ -10819,9 +10819,9 @@
|
|||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"node_modules/ws": {
|
"node_modules/ws": {
|
||||||
"version": "8.17.0",
|
"version": "8.17.1",
|
||||||
"resolved": "https://registry.npmjs.org/ws/-/ws-8.17.0.tgz",
|
"resolved": "https://registry.npmjs.org/ws/-/ws-8.17.1.tgz",
|
||||||
"integrity": "sha512-uJq6108EgZMAl20KagGkzCKfMEjxmKvZHG7Tlq0Z6nOky7YF7aq4mOx6xK8TJ/i1LeK4Qus7INktacctDgY8Ow==",
|
"integrity": "sha512-6XQFvXTkbfUOZOKKILFG1PDK2NDQs4azKQl26T0YS5CxqWLgXajbPZ+h4gZekJyRqFU8pvnbAbbs/3TgRPy+GQ==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=10.0.0"
|
"node": ">=10.0.0"
|
||||||
|
Reference in New Issue
Block a user