mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-12-01 02:21:45 +00:00
Compare commits
16 Commits
develop-20
...
develop-20
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
76899389b8 | ||
|
|
e83fe023d2 | ||
|
|
1dd098a283 | ||
|
|
52164689d4 | ||
|
|
034b14eb0b | ||
|
|
8722d264dc | ||
|
|
3603ef1cc7 | ||
|
|
7abd30f4dd | ||
|
|
3c904c9017 | ||
|
|
d8bdbf2842 | ||
|
|
d08966d141 | ||
|
|
bd71095e40 | ||
|
|
d7967a81e3 | ||
|
|
fa018e80c0 | ||
|
|
eb4b9659cf | ||
|
|
4e0b1bf65d |
2
.github/workflows/depsreview.yml
vendored
2
.github/workflows/depsreview.yml
vendored
@@ -9,7 +9,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: 'Checkout repository'
|
||||
uses: actions/checkout@v5
|
||||
uses: actions/checkout@v6
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: 'Dependency review'
|
||||
|
||||
2
.github/workflows/release.yml
vendored
2
.github/workflows/release.yml
vendored
@@ -29,7 +29,7 @@ jobs:
|
||||
env:
|
||||
version: ${{ github.event_name == 'schedule' && 'develop' || inputs.version }}
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v5
|
||||
uses: actions/checkout@v6
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: Import GPG key
|
||||
|
||||
@@ -74,6 +74,7 @@ class CorrectsDatabase extends Command
|
||||
'correction:group-accounts',
|
||||
'correction:recalculates-liabilities',
|
||||
'correction:preferences',
|
||||
'correction:corrects-inverted-budget-limits',
|
||||
// 'correction:transaction-types', // resource heavy, disabled.
|
||||
'correction:recalculate-pc-amounts',
|
||||
'correction:remove-links-to-deleted-objects',
|
||||
|
||||
@@ -0,0 +1,80 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
/*
|
||||
* CorrectsInversedBudgetLimits.php
|
||||
* Copyright (c) 2025 james@firefly-iii.org
|
||||
*
|
||||
* This file is part of Firefly III (https://github.com/firefly-iii).
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
namespace FireflyIII\Console\Commands\Correction;
|
||||
|
||||
use FireflyIII\Console\Commands\ShowsFriendlyMessages;
|
||||
use FireflyIII\Models\BudgetLimit;
|
||||
use Illuminate\Console\Command;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
|
||||
class CorrectsInvertedBudgetLimits extends Command
|
||||
{
|
||||
use ShowsFriendlyMessages;
|
||||
|
||||
/**
|
||||
* The name and signature of the console command.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $signature = 'correction:corrects-inverted-budget-limits';
|
||||
|
||||
/**
|
||||
* The console command description.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $description = 'Reverse budget limits where the dates are inverted.';
|
||||
|
||||
/**
|
||||
* Execute the console command.
|
||||
*/
|
||||
public function handle(): int
|
||||
{
|
||||
|
||||
$set = BudgetLimit::where('start_date', '>', DB::raw('end_date'))->get();
|
||||
if (0 === $set->count()) {
|
||||
Log::debug('No inverted budget limits found.');
|
||||
|
||||
return Command::SUCCESS;
|
||||
}
|
||||
|
||||
/** @var BudgetLimit $budgetLimit */
|
||||
foreach ($set as $budgetLimit) {
|
||||
$start = $budgetLimit->start_date->copy();
|
||||
$end = $budgetLimit->end_date->copy();
|
||||
$budgetLimit->start_date = $end;
|
||||
$budgetLimit->end_date = $start;
|
||||
$budgetLimit->saveQuietly();
|
||||
}
|
||||
if (1 === $set->count()) {
|
||||
$this->friendlyInfo('Corrected one budget limit to have the right start/end dates.');
|
||||
|
||||
return Command::SUCCESS;
|
||||
}
|
||||
$this->friendlyInfo(sprintf('Corrected %d budget limits to have the right start/end dates.', count($set)));
|
||||
|
||||
return Command::SUCCESS;
|
||||
}
|
||||
}
|
||||
@@ -42,6 +42,7 @@ use Illuminate\Database\Eloquent\Builder;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
|
||||
use function Safe\json_encode;
|
||||
use function Safe\mb_regex_encoding;
|
||||
|
||||
@@ -54,11 +55,11 @@ class ForcesDecimalSize extends Command
|
||||
{
|
||||
use ShowsFriendlyMessages;
|
||||
|
||||
protected $description = 'This command resizes DECIMAL columns in MySQL or PostgreSQL and correct amounts (only MySQL).';
|
||||
protected $signature = 'firefly-iii:force-decimal-size {--force}';
|
||||
protected $description = 'This command resizes DECIMAL columns in MySQL or PostgreSQL and correct amounts (only MySQL).';
|
||||
protected $signature = 'firefly-iii:force-decimal-size {--force}';
|
||||
private string $cast;
|
||||
private array $classes
|
||||
= [
|
||||
= [
|
||||
'accounts' => Account::class,
|
||||
'auto_budgets' => AutoBudget::class,
|
||||
'available_budgets' => AvailableBudget::class,
|
||||
@@ -74,7 +75,7 @@ class ForcesDecimalSize extends Command
|
||||
private string $operator;
|
||||
private string $regularExpression;
|
||||
private array $tables
|
||||
= [
|
||||
= [
|
||||
'accounts' => ['virtual_balance'],
|
||||
'auto_budgets' => ['amount'],
|
||||
'available_budgets' => ['amount'],
|
||||
@@ -238,9 +239,10 @@ class ForcesDecimalSize extends Command
|
||||
$regularExpression = $this->regularExpression;
|
||||
|
||||
/** @var Builder $query */
|
||||
$query = Account::leftJoin('account_meta', 'accounts.id', '=', 'account_meta.account_id')
|
||||
->where('account_meta.name', 'currency_id')
|
||||
->where('account_meta.data', json_encode((string)$currency->id));
|
||||
$query = Account::leftJoin('account_meta', 'accounts.id', '=', 'account_meta.account_id')
|
||||
->where('account_meta.name', 'currency_id')
|
||||
->where('account_meta.data', json_encode((string)$currency->id))
|
||||
;
|
||||
$query->where(static function (Builder $q) use ($fields, $currency, $operator, $cast, $regularExpression): void {
|
||||
foreach ($fields as $field) {
|
||||
$q->orWhere(
|
||||
@@ -250,7 +252,7 @@ class ForcesDecimalSize extends Command
|
||||
);
|
||||
}
|
||||
});
|
||||
$result = $query->get(['accounts.*']);
|
||||
$result = $query->get(['accounts.*']);
|
||||
if (0 === $result->count()) {
|
||||
$this->friendlyPositive(sprintf('All accounts in %s are OK', $currency->code));
|
||||
|
||||
@@ -261,13 +263,13 @@ class ForcesDecimalSize extends Command
|
||||
foreach ($result as $account) {
|
||||
/** @var string $field */
|
||||
foreach ($fields as $field) {
|
||||
$value = $account->{$field};
|
||||
$value = $account->{$field};
|
||||
if (null === $value) {
|
||||
continue;
|
||||
}
|
||||
// fix $field by rounding it down correctly.
|
||||
$pow = 10 ** $currency->decimal_places;
|
||||
$correct = bcdiv((string)round($value * $pow), (string)$pow, 12);
|
||||
$pow = 10 ** $currency->decimal_places;
|
||||
$correct = bcdiv((string)round($value * $pow), (string)$pow, 12);
|
||||
$this->friendlyInfo(sprintf('Account #%d has %s with value "%s", this has been corrected to "%s".', $account->id, $field, $value, $correct));
|
||||
|
||||
/** @var null|Account $updateAccount */
|
||||
@@ -289,7 +291,7 @@ class ForcesDecimalSize extends Command
|
||||
$regularExpression = $this->regularExpression;
|
||||
|
||||
/** @var Builder $query */
|
||||
$query = $class::where('transaction_currency_id', $currency->id)->where(
|
||||
$query = $class::where('transaction_currency_id', $currency->id)->where(
|
||||
static function (Builder $q) use ($fields, $currency, $operator, $cast, $regularExpression): void {
|
||||
/** @var string $field */
|
||||
foreach ($fields as $field) {
|
||||
@@ -302,7 +304,7 @@ class ForcesDecimalSize extends Command
|
||||
}
|
||||
);
|
||||
|
||||
$result = $query->get();
|
||||
$result = $query->get();
|
||||
if (0 === $result->count()) {
|
||||
$this->friendlyPositive(sprintf('All %s in %s are OK', $table, $currency->code));
|
||||
|
||||
@@ -313,7 +315,7 @@ class ForcesDecimalSize extends Command
|
||||
foreach ($result as $item) {
|
||||
/** @var string $field */
|
||||
foreach ($fields as $field) {
|
||||
$value = $item->{$field};
|
||||
$value = $item->{$field};
|
||||
if (null === $value || '' === $value) {
|
||||
continue;
|
||||
}
|
||||
@@ -323,7 +325,7 @@ class ForcesDecimalSize extends Command
|
||||
$this->friendlyWarning(sprintf('%s #%d has %s with value "%s", this has been corrected to "%s".', $table, $item->id, $field, $value, $correct));
|
||||
|
||||
/** @var null|Model $model */
|
||||
$model = $class::find($item->id);
|
||||
$model = $class::find($item->id);
|
||||
$model?->update([$field => $correct]);
|
||||
}
|
||||
}
|
||||
@@ -339,22 +341,23 @@ class ForcesDecimalSize extends Command
|
||||
$regularExpression = $this->regularExpression;
|
||||
|
||||
/** @var Builder $query */
|
||||
$query = PiggyBankEvent::leftJoin('piggy_banks', 'piggy_bank_events.piggy_bank_id', '=', 'piggy_banks.id')
|
||||
->leftJoin('accounts', 'piggy_banks.account_id', '=', 'accounts.id')
|
||||
->leftJoin('account_meta', 'accounts.id', '=', 'account_meta.account_id')
|
||||
->where('account_meta.name', 'currency_id')
|
||||
->where('account_meta.data', json_encode((string)$currency->id))
|
||||
->where(static function (Builder $q) use ($fields, $currency, $cast, $operator, $regularExpression): void {
|
||||
foreach ($fields as $field) {
|
||||
$q->orWhere(
|
||||
DB::raw(sprintf('CAST(piggy_bank_events.%s AS %s)', $field, $cast)),
|
||||
$operator,
|
||||
DB::raw(sprintf($regularExpression, $currency->decimal_places))
|
||||
);
|
||||
}
|
||||
});
|
||||
$query = PiggyBankEvent::leftJoin('piggy_banks', 'piggy_bank_events.piggy_bank_id', '=', 'piggy_banks.id')
|
||||
->leftJoin('accounts', 'piggy_banks.account_id', '=', 'accounts.id')
|
||||
->leftJoin('account_meta', 'accounts.id', '=', 'account_meta.account_id')
|
||||
->where('account_meta.name', 'currency_id')
|
||||
->where('account_meta.data', json_encode((string)$currency->id))
|
||||
->where(static function (Builder $q) use ($fields, $currency, $cast, $operator, $regularExpression): void {
|
||||
foreach ($fields as $field) {
|
||||
$q->orWhere(
|
||||
DB::raw(sprintf('CAST(piggy_bank_events.%s AS %s)', $field, $cast)),
|
||||
$operator,
|
||||
DB::raw(sprintf($regularExpression, $currency->decimal_places))
|
||||
);
|
||||
}
|
||||
})
|
||||
;
|
||||
|
||||
$result = $query->get(['piggy_bank_events.*']);
|
||||
$result = $query->get(['piggy_bank_events.*']);
|
||||
if (0 === $result->count()) {
|
||||
$this->friendlyPositive(sprintf('All piggy bank events in %s are OK', $currency->code));
|
||||
|
||||
@@ -365,7 +368,7 @@ class ForcesDecimalSize extends Command
|
||||
foreach ($result as $item) {
|
||||
/** @var string $field */
|
||||
foreach ($fields as $field) {
|
||||
$value = $item->{$field};
|
||||
$value = $item->{$field};
|
||||
if (null === $value) {
|
||||
continue;
|
||||
}
|
||||
@@ -377,7 +380,7 @@ class ForcesDecimalSize extends Command
|
||||
);
|
||||
|
||||
/** @var null|PiggyBankEvent $event */
|
||||
$event = PiggyBankEvent::find($item->id);
|
||||
$event = PiggyBankEvent::find($item->id);
|
||||
$event?->update([$field => $correct]);
|
||||
}
|
||||
}
|
||||
@@ -394,22 +397,23 @@ class ForcesDecimalSize extends Command
|
||||
|
||||
// select all piggy bank repetitions with this currency and issue.
|
||||
/** @var Builder $query */
|
||||
$query = PiggyBankRepetition::leftJoin('piggy_banks', 'piggy_bank_repetitions.piggy_bank_id', '=', 'piggy_banks.id')
|
||||
->leftJoin('accounts', 'piggy_banks.account_id', '=', 'accounts.id')
|
||||
->leftJoin('account_meta', 'accounts.id', '=', 'account_meta.account_id')
|
||||
->where('account_meta.name', 'currency_id')
|
||||
->where('account_meta.data', json_encode((string)$currency->id))
|
||||
->where(static function (Builder $q) use ($fields, $currency, $operator, $cast, $regularExpression): void {
|
||||
foreach ($fields as $field) {
|
||||
$q->orWhere(
|
||||
DB::raw(sprintf('CAST(piggy_bank_repetitions.%s AS %s)', $field, $cast)),
|
||||
$operator,
|
||||
DB::raw(sprintf($regularExpression, $currency->decimal_places))
|
||||
);
|
||||
}
|
||||
});
|
||||
$query = PiggyBankRepetition::leftJoin('piggy_banks', 'piggy_bank_repetitions.piggy_bank_id', '=', 'piggy_banks.id')
|
||||
->leftJoin('accounts', 'piggy_banks.account_id', '=', 'accounts.id')
|
||||
->leftJoin('account_meta', 'accounts.id', '=', 'account_meta.account_id')
|
||||
->where('account_meta.name', 'currency_id')
|
||||
->where('account_meta.data', json_encode((string)$currency->id))
|
||||
->where(static function (Builder $q) use ($fields, $currency, $operator, $cast, $regularExpression): void {
|
||||
foreach ($fields as $field) {
|
||||
$q->orWhere(
|
||||
DB::raw(sprintf('CAST(piggy_bank_repetitions.%s AS %s)', $field, $cast)),
|
||||
$operator,
|
||||
DB::raw(sprintf($regularExpression, $currency->decimal_places))
|
||||
);
|
||||
}
|
||||
})
|
||||
;
|
||||
|
||||
$result = $query->get(['piggy_bank_repetitions.*']);
|
||||
$result = $query->get(['piggy_bank_repetitions.*']);
|
||||
if (0 === $result->count()) {
|
||||
$this->friendlyPositive(sprintf('All piggy bank repetitions in %s', $currency->code));
|
||||
|
||||
@@ -420,13 +424,13 @@ class ForcesDecimalSize extends Command
|
||||
foreach ($result as $item) {
|
||||
/** @var string $field */
|
||||
foreach ($fields as $field) {
|
||||
$value = $item->{$field};
|
||||
$value = $item->{$field};
|
||||
if (null === $value) {
|
||||
continue;
|
||||
}
|
||||
// fix $field by rounding it down correctly.
|
||||
$pow = 10 ** $currency->decimal_places;
|
||||
$correct = bcdiv((string)round($value * $pow), (string)$pow, 12);
|
||||
$pow = 10 ** $currency->decimal_places;
|
||||
$correct = bcdiv((string)round($value * $pow), (string)$pow, 12);
|
||||
$this->friendlyWarning(
|
||||
sprintf('Piggy bank repetition #%d has %s with value "%s", this has been corrected to "%s".', $item->id, $field, $value, $correct)
|
||||
);
|
||||
@@ -448,21 +452,22 @@ class ForcesDecimalSize extends Command
|
||||
$regularExpression = $this->regularExpression;
|
||||
|
||||
/** @var Builder $query */
|
||||
$query = PiggyBank::leftJoin('accounts', 'piggy_banks.account_id', '=', 'accounts.id')
|
||||
->leftJoin('account_meta', 'accounts.id', '=', 'account_meta.account_id')
|
||||
->where('account_meta.name', 'currency_id')
|
||||
->where('account_meta.data', json_encode((string)$currency->id))
|
||||
->where(static function (Builder $q) use ($fields, $currency, $operator, $cast, $regularExpression): void {
|
||||
foreach ($fields as $field) {
|
||||
$q->orWhere(
|
||||
DB::raw(sprintf('CAST(piggy_banks.%s AS %s)', $field, $cast)),
|
||||
$operator,
|
||||
DB::raw(sprintf($regularExpression, $currency->decimal_places))
|
||||
);
|
||||
}
|
||||
});
|
||||
$query = PiggyBank::leftJoin('accounts', 'piggy_banks.account_id', '=', 'accounts.id')
|
||||
->leftJoin('account_meta', 'accounts.id', '=', 'account_meta.account_id')
|
||||
->where('account_meta.name', 'currency_id')
|
||||
->where('account_meta.data', json_encode((string)$currency->id))
|
||||
->where(static function (Builder $q) use ($fields, $currency, $operator, $cast, $regularExpression): void {
|
||||
foreach ($fields as $field) {
|
||||
$q->orWhere(
|
||||
DB::raw(sprintf('CAST(piggy_banks.%s AS %s)', $field, $cast)),
|
||||
$operator,
|
||||
DB::raw(sprintf($regularExpression, $currency->decimal_places))
|
||||
);
|
||||
}
|
||||
})
|
||||
;
|
||||
|
||||
$result = $query->get(['piggy_banks.*']);
|
||||
$result = $query->get(['piggy_banks.*']);
|
||||
if (0 === $result->count()) {
|
||||
$this->friendlyPositive(sprintf('All piggy banks in %s are OK', $currency->code));
|
||||
|
||||
@@ -473,13 +478,13 @@ class ForcesDecimalSize extends Command
|
||||
foreach ($result as $item) {
|
||||
/** @var string $field */
|
||||
foreach ($fields as $field) {
|
||||
$value = $item->{$field};
|
||||
$value = $item->{$field};
|
||||
if (null === $value) {
|
||||
continue;
|
||||
}
|
||||
// fix $field by rounding it down correctly.
|
||||
$pow = 10 ** $currency->decimal_places;
|
||||
$correct = bcdiv((string)round($value * $pow), (string)$pow, 12);
|
||||
$pow = 10 ** $currency->decimal_places;
|
||||
$correct = bcdiv((string)round($value * $pow), (string)$pow, 12);
|
||||
$this->friendlyWarning(sprintf('Piggy bank #%d has %s with value "%s", this has been corrected to "%s".', $item->id, $field, $value, $correct));
|
||||
|
||||
/** @var null|PiggyBank $piggyBank */
|
||||
@@ -496,7 +501,7 @@ class ForcesDecimalSize extends Command
|
||||
{
|
||||
// select all transactions with this currency and issue.
|
||||
/** @var Builder $query */
|
||||
$query = Transaction::where('transaction_currency_id', $currency->id)->where(
|
||||
$query = Transaction::where('transaction_currency_id', $currency->id)->where(
|
||||
DB::raw(sprintf('CAST(amount as %s)', $this->cast)),
|
||||
$this->operator,
|
||||
DB::raw(sprintf($this->regularExpression, $currency->decimal_places))
|
||||
@@ -509,13 +514,13 @@ class ForcesDecimalSize extends Command
|
||||
|
||||
/** @var Transaction $item */
|
||||
foreach ($result as $item) {
|
||||
$value = $item->amount;
|
||||
$value = $item->amount;
|
||||
if ('' === $value) {
|
||||
continue;
|
||||
}
|
||||
// fix $field by rounding it down correctly.
|
||||
$pow = 10.0 ** $currency->decimal_places;
|
||||
$correct = bcdiv((string)round((float)$value * $pow), (string)$pow, 12);
|
||||
$pow = 10.0 ** $currency->decimal_places;
|
||||
$correct = bcdiv((string)round((float)$value * $pow), (string)$pow, 12);
|
||||
$this->friendlyWarning(sprintf('Transaction #%d has amount with value "%s", this has been corrected to "%s".', $item->id, $value, $correct));
|
||||
|
||||
/** @var null|Transaction $transaction */
|
||||
@@ -525,7 +530,7 @@ class ForcesDecimalSize extends Command
|
||||
|
||||
// select all transactions with this FOREIGN currency and issue.
|
||||
/** @var Builder $query */
|
||||
$query = Transaction::where('foreign_currency_id', $currency->id)->where(
|
||||
$query = Transaction::where('foreign_currency_id', $currency->id)->where(
|
||||
DB::raw(sprintf('CAST(foreign_amount as %s)', $this->cast)),
|
||||
$this->operator,
|
||||
DB::raw(sprintf($this->regularExpression, $currency->decimal_places))
|
||||
@@ -540,13 +545,13 @@ class ForcesDecimalSize extends Command
|
||||
|
||||
/** @var Transaction $item */
|
||||
foreach ($result as $item) {
|
||||
$value = $item->foreign_amount;
|
||||
$value = $item->foreign_amount;
|
||||
if (null === $value) {
|
||||
continue;
|
||||
}
|
||||
// fix $field by rounding it down correctly.
|
||||
$pow = 10.0 ** $currency->decimal_places;
|
||||
$correct = bcdiv((string)round((float)$value * $pow), (string)$pow, 12);
|
||||
$pow = 10.0 ** $currency->decimal_places;
|
||||
$correct = bcdiv((string)round((float)$value * $pow), (string)$pow, 12);
|
||||
$this->friendlyWarning(
|
||||
sprintf('Transaction #%d has foreign amount with value "%s", this has been corrected to "%s".', $item->id, $value, $correct)
|
||||
);
|
||||
|
||||
@@ -23,6 +23,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Helpers\Report;
|
||||
|
||||
use FireflyIII\Support\Facades\Navigation;
|
||||
use Carbon\Carbon;
|
||||
use FireflyIII\Helpers\Collector\GroupCollectorInterface;
|
||||
use FireflyIII\Helpers\Fiscal\FiscalHelperInterface;
|
||||
@@ -81,7 +82,7 @@ class ReportHelper implements ReportHelperInterface
|
||||
|
||||
/** @var Carbon $expectedStart */
|
||||
foreach ($expectedDates as $expectedStart) {
|
||||
$expectedEnd = app('navigation')->endOfX($expectedStart, $bill->repeat_freq, null);
|
||||
$expectedEnd = Navigation::endOfX($expectedStart, $bill->repeat_freq, null);
|
||||
|
||||
// is paid in this period maybe?
|
||||
/** @var GroupCollectorInterface $collector */
|
||||
|
||||
@@ -167,7 +167,7 @@ class IndexController extends Controller
|
||||
/** @var Carbon $end */
|
||||
$end = clone session('end', today(config('app.timezone'))->endOfMonth());
|
||||
|
||||
$now = now();
|
||||
$now = now();
|
||||
if ($now->gt($end) || $now->lt($start)) {
|
||||
$now = $end;
|
||||
}
|
||||
|
||||
@@ -23,6 +23,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Http\Controllers\Account;
|
||||
|
||||
use FireflyIII\Support\Facades\Navigation;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use Carbon\Carbon;
|
||||
use FireflyIII\Enums\AccountTypeEnum;
|
||||
@@ -91,20 +92,20 @@ class ReconcileController extends Controller
|
||||
$currency = $this->accountRepos->getAccountCurrency($account) ?? $this->primaryCurrency;
|
||||
|
||||
// no start or end:
|
||||
$range = app('navigation')->getViewRange(false);
|
||||
$range = Navigation::getViewRange(false);
|
||||
|
||||
// get start and end
|
||||
|
||||
if (!$start instanceof Carbon && !$end instanceof Carbon) {
|
||||
/** @var Carbon $start */
|
||||
$start = clone session('start', app('navigation')->startOfPeriod(new Carbon(), $range));
|
||||
$start = clone session('start', Navigation::startOfPeriod(new Carbon(), $range));
|
||||
|
||||
/** @var Carbon $end */
|
||||
$end = clone session('end', app('navigation')->endOfPeriod(new Carbon(), $range));
|
||||
$end = clone session('end', Navigation::endOfPeriod(new Carbon(), $range));
|
||||
}
|
||||
if (null === $end) {
|
||||
/** @var Carbon $end */
|
||||
$end = app('navigation')->endOfPeriod($start, $range);
|
||||
$end = Navigation::endOfPeriod($start, $range);
|
||||
}
|
||||
|
||||
if ($end->lt($start)) {
|
||||
|
||||
@@ -221,7 +221,7 @@ class ShowController extends Controller
|
||||
// correct
|
||||
Log::debug(sprintf('showAll: Call accountsBalancesOptimized with date/time "%s"', $end->toIso8601String()));
|
||||
|
||||
$now = now();
|
||||
$now = now();
|
||||
if ($now->gt($end) || $now->lt($start)) {
|
||||
$now = $end;
|
||||
}
|
||||
|
||||
@@ -24,6 +24,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Http\Controllers\Bill;
|
||||
|
||||
use FireflyIII\Support\Facades\Navigation;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use FireflyIII\Http\Controllers\Controller;
|
||||
use FireflyIII\Models\Bill;
|
||||
@@ -151,7 +152,7 @@ class IndexController extends Controller
|
||||
private function getSums(array $bills): array
|
||||
{
|
||||
$sums = [];
|
||||
$range = app('navigation')->getViewRange(true);
|
||||
$range = Navigation::getViewRange(true);
|
||||
|
||||
/** @var array $group */
|
||||
foreach ($bills as $groupOrder => $group) {
|
||||
|
||||
@@ -24,6 +24,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Http\Controllers\Bill;
|
||||
|
||||
use FireflyIII\Support\Facades\Navigation;
|
||||
use Carbon\Carbon;
|
||||
use FireflyIII\Helpers\Collector\GroupCollectorInterface;
|
||||
use FireflyIII\Http\Controllers\Controller;
|
||||
@@ -139,8 +140,8 @@ class ShowController extends Controller
|
||||
$manager->parseIncludes(['attachments', 'notes']);
|
||||
|
||||
// add another period to end, could fix 8163
|
||||
$range = app('navigation')->getViewRange(true);
|
||||
$end = app('navigation')->addPeriod($end, $range);
|
||||
$range = Navigation::getViewRange(true);
|
||||
$end = Navigation::addPeriod($end, $range);
|
||||
|
||||
// Make a resource out of the data and
|
||||
$parameters = new ParameterBag();
|
||||
|
||||
@@ -24,6 +24,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Http\Controllers\Budget;
|
||||
|
||||
use FireflyIII\Support\Facades\Navigation;
|
||||
use Carbon\Carbon;
|
||||
use FireflyIII\Exceptions\FireflyException;
|
||||
use FireflyIII\Http\Controllers\Controller;
|
||||
@@ -94,11 +95,11 @@ class IndexController extends Controller
|
||||
Log::debug(sprintf('Start of IndexController::index("%s", "%s")', $start?->format('Y-m-d'), $end?->format('Y-m-d')));
|
||||
|
||||
// collect some basic vars:
|
||||
$range = app('navigation')->getViewRange(true);
|
||||
$range = Navigation::getViewRange(true);
|
||||
$isCustomRange = session('is_custom_range', false);
|
||||
if (false === $isCustomRange) {
|
||||
$start ??= session('start', today(config('app.timezone'))->startOfMonth());
|
||||
$end ??= app('navigation')->endOfPeriod($start, $range);
|
||||
$end ??= Navigation::endOfPeriod($start, $range);
|
||||
}
|
||||
|
||||
// overrule start and end if necessary:
|
||||
@@ -112,7 +113,7 @@ class IndexController extends Controller
|
||||
$spent = '0';
|
||||
|
||||
// new period stuff:
|
||||
$periodTitle = app('navigation')->periodShow($start, $range);
|
||||
$periodTitle = Navigation::periodShow($start, $range);
|
||||
$prevLoop = $this->getPreviousPeriods($start, $range);
|
||||
$nextLoop = $this->getNextPeriods($start, $range);
|
||||
|
||||
|
||||
@@ -23,6 +23,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Http\Controllers\Chart;
|
||||
|
||||
use FireflyIII\Support\Facades\Navigation;
|
||||
use Carbon\Carbon;
|
||||
use FireflyIII\Enums\AccountTypeEnum;
|
||||
use FireflyIII\Enums\TransactionTypeEnum;
|
||||
@@ -514,7 +515,7 @@ class AccountController extends Controller
|
||||
// have to make sure this chart is always based on the balance at the END of the period.
|
||||
// This period depends on the size of the chart
|
||||
$current = clone $start;
|
||||
$current = app('navigation')->endOfX($current, $step, null);
|
||||
$current = Navigation::endOfX($current, $step, null);
|
||||
$format = (string)trans('config.month_and_day_js', [], $locale);
|
||||
$accountCurrency = $this->accountRepository->getAccountCurrency($account);
|
||||
Log::debug('Get and filter balance for entire range start');
|
||||
@@ -574,9 +575,9 @@ class AccountController extends Controller
|
||||
$label = $current->isoFormat($format);
|
||||
$return[$key]['entries'][$label] = $amount;
|
||||
}
|
||||
$current = app('navigation')->addPeriod($current, $step);
|
||||
$current = Navigation::addPeriod($current, $step);
|
||||
// here too, to fix #8041, the data is corrected to the end of the period.
|
||||
$current = app('navigation')->endOfX($current, $step, null);
|
||||
$current = Navigation::endOfX($current, $step, null);
|
||||
}
|
||||
Log::debug('End of chart loop.');
|
||||
// second loop (yes) to create nice array with info! Yay!
|
||||
|
||||
@@ -23,6 +23,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Http\Controllers\Chart;
|
||||
|
||||
use FireflyIII\Support\Facades\Navigation;
|
||||
use Carbon\Carbon;
|
||||
use FireflyIII\Generator\Chart\Basic\GeneratorInterface;
|
||||
use FireflyIII\Http\Controllers\Controller;
|
||||
@@ -81,8 +82,8 @@ class CategoryController extends Controller
|
||||
/** @var CategoryRepositoryInterface $repository */
|
||||
$repository = app(CategoryRepositoryInterface::class);
|
||||
$start = $repository->firstUseDate($category) ?? $this->getDate();
|
||||
$range = app('navigation')->getViewRange(false);
|
||||
$start = app('navigation')->startOfPeriod($start, $range);
|
||||
$range = Navigation::getViewRange(false);
|
||||
$start = Navigation::startOfPeriod($start, $range);
|
||||
$end = $this->getDate();
|
||||
|
||||
/** @var WholePeriodChartGenerator $chartGenerator */
|
||||
@@ -178,8 +179,8 @@ class CategoryController extends Controller
|
||||
$income = $opsRepository->listIncome($start, $end, $accounts, $collection);
|
||||
}
|
||||
$currencies = array_unique(array_merge(array_keys($income), array_keys($expenses)));
|
||||
$periods = app('navigation')->listOfPeriods($start, $end);
|
||||
$format = app('navigation')->preferredCarbonLocalizedFormat($start, $end);
|
||||
$periods = Navigation::listOfPeriods($start, $end);
|
||||
$format = Navigation::preferredCarbonLocalizedFormat($start, $end);
|
||||
$chartData = [];
|
||||
// make empty data array:
|
||||
// double foreach (bad) to make empty array:
|
||||
@@ -260,8 +261,8 @@ class CategoryController extends Controller
|
||||
*/
|
||||
public function specificPeriod(Category $category, Carbon $date): JsonResponse
|
||||
{
|
||||
$range = app('navigation')->getViewRange(false);
|
||||
$start = app('navigation')->startOfPeriod($date, $range);
|
||||
$range = Navigation::getViewRange(false);
|
||||
$start = Navigation::startOfPeriod($date, $range);
|
||||
$end = session()->get('end');
|
||||
if ($end < $start) {
|
||||
[$end, $start] = [$start, $end];
|
||||
|
||||
@@ -23,6 +23,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Http\Controllers\Chart;
|
||||
|
||||
use FireflyIII\Support\Facades\Navigation;
|
||||
use Carbon\Carbon;
|
||||
use FireflyIII\Generator\Chart\Basic\GeneratorInterface;
|
||||
use FireflyIII\Http\Controllers\Controller;
|
||||
@@ -210,7 +211,7 @@ class CategoryReportController extends Controller
|
||||
$chartData = [];
|
||||
$spent = $this->opsRepository->listExpenses($start, $end, $accounts, new Collection()->push($category));
|
||||
$earned = $this->opsRepository->listIncome($start, $end, $accounts, new Collection()->push($category));
|
||||
$format = app('navigation')->preferredCarbonLocalizedFormat($start, $end);
|
||||
$format = Navigation::preferredCarbonLocalizedFormat($start, $end);
|
||||
// loop expenses.
|
||||
foreach ($spent as $currency) {
|
||||
// add things to chart Data for each currency:
|
||||
@@ -276,11 +277,11 @@ class CategoryReportController extends Controller
|
||||
private function makeEntries(Carbon $start, Carbon $end): array
|
||||
{
|
||||
$return = [];
|
||||
$format = app('navigation')->preferredCarbonLocalizedFormat($start, $end);
|
||||
$preferredRange = app('navigation')->preferredRangeFormat($start, $end);
|
||||
$format = Navigation::preferredCarbonLocalizedFormat($start, $end);
|
||||
$preferredRange = Navigation::preferredRangeFormat($start, $end);
|
||||
$currentStart = clone $start;
|
||||
while ($currentStart <= $end) {
|
||||
$currentEnd = app('navigation')->endOfPeriod($currentStart, $preferredRange);
|
||||
$currentEnd = Navigation::endOfPeriod($currentStart, $preferredRange);
|
||||
$key = $currentStart->isoFormat($format);
|
||||
$return[$key] = '0';
|
||||
$currentStart = clone $currentEnd;
|
||||
|
||||
@@ -24,6 +24,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Http\Controllers\Chart;
|
||||
|
||||
use FireflyIII\Support\Facades\Navigation;
|
||||
use Carbon\Carbon;
|
||||
use FireflyIII\Generator\Chart\Basic\GeneratorInterface;
|
||||
use FireflyIII\Http\Controllers\Controller;
|
||||
@@ -154,7 +155,7 @@ class DoubleReportController extends Controller
|
||||
$accounts = $accounts->merge($opposing);
|
||||
$spent = $this->opsRepository->listExpenses($start, $end, $accounts);
|
||||
$earned = $this->opsRepository->listIncome($start, $end, $accounts);
|
||||
$format = app('navigation')->preferredCarbonLocalizedFormat($start, $end);
|
||||
$format = Navigation::preferredCarbonLocalizedFormat($start, $end);
|
||||
|
||||
// loop expenses.
|
||||
foreach ($spent as $currency) {
|
||||
@@ -238,11 +239,11 @@ class DoubleReportController extends Controller
|
||||
private function makeEntries(Carbon $start, Carbon $end): array
|
||||
{
|
||||
$return = [];
|
||||
$format = app('navigation')->preferredCarbonLocalizedFormat($start, $end);
|
||||
$preferredRange = app('navigation')->preferredRangeFormat($start, $end);
|
||||
$format = Navigation::preferredCarbonLocalizedFormat($start, $end);
|
||||
$preferredRange = Navigation::preferredRangeFormat($start, $end);
|
||||
$currentStart = clone $start;
|
||||
while ($currentStart <= $end) {
|
||||
$currentEnd = app('navigation')->endOfPeriod($currentStart, $preferredRange);
|
||||
$currentEnd = Navigation::endOfPeriod($currentStart, $preferredRange);
|
||||
$key = $currentStart->isoFormat($format);
|
||||
$return[$key] = '0';
|
||||
$currentStart = clone $currentEnd;
|
||||
|
||||
@@ -24,6 +24,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Http\Controllers\Chart;
|
||||
|
||||
use FireflyIII\Support\Facades\Navigation;
|
||||
use Carbon\Carbon;
|
||||
use FireflyIII\Generator\Chart\Basic\GeneratorInterface;
|
||||
use FireflyIII\Http\Controllers\Controller;
|
||||
@@ -83,8 +84,8 @@ class ExpenseReportController extends Controller
|
||||
return response()->json($cache->get());
|
||||
}
|
||||
|
||||
$format = app('navigation')->preferredCarbonLocalizedFormat($start, $end);
|
||||
$function = app('navigation')->preferredEndOfPeriod($start, $end);
|
||||
$format = Navigation::preferredCarbonLocalizedFormat($start, $end);
|
||||
$function = Navigation::preferredEndOfPeriod($start, $end);
|
||||
$chartData = [];
|
||||
$currentStart = clone $start;
|
||||
$combined = $this->combineAccounts($expense);
|
||||
|
||||
@@ -23,6 +23,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Http\Controllers\Chart;
|
||||
|
||||
use FireflyIII\Support\Facades\Navigation;
|
||||
use Carbon\Carbon;
|
||||
use FireflyIII\Generator\Chart\Basic\GeneratorInterface;
|
||||
use FireflyIII\Http\Controllers\Controller;
|
||||
@@ -92,7 +93,7 @@ class PiggyBankController extends Controller
|
||||
$currentSum = $filtered->sum('amount');
|
||||
$label = $oldest->isoFormat((string) trans('config.month_and_day_js', [], $locale));
|
||||
$chartData[$label] = $currentSum;
|
||||
$oldest = app('navigation')->addPeriod($oldest, $step);
|
||||
$oldest = Navigation::addPeriod($oldest, $step);
|
||||
}
|
||||
$finalFiltered = $set->filter(
|
||||
static fn (PiggyBankEvent $event) => $event->date->lte($today)
|
||||
|
||||
@@ -23,6 +23,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Http\Controllers\Chart;
|
||||
|
||||
use FireflyIII\Support\Facades\Navigation;
|
||||
use Carbon\Carbon;
|
||||
use FireflyIII\Enums\TransactionTypeEnum;
|
||||
use FireflyIII\Generator\Chart\Basic\GeneratorInterface;
|
||||
@@ -154,9 +155,9 @@ class ReportController extends Controller
|
||||
|
||||
Log::debug('Going to do operations for accounts ', $accounts->pluck('id')->toArray());
|
||||
Log::debug(sprintf('Period: %s to %s', $start->toW3cString(), $end->toW3cString()));
|
||||
$format = app('navigation')->preferredCarbonFormat($start, $end);
|
||||
$titleFormat = app('navigation')->preferredCarbonLocalizedFormat($start, $end);
|
||||
$preferredRange = app('navigation')->preferredRangeFormat($start, $end);
|
||||
$format = Navigation::preferredCarbonFormat($start, $end);
|
||||
$titleFormat = Navigation::preferredCarbonLocalizedFormat($start, $end);
|
||||
$preferredRange = Navigation::preferredRangeFormat($start, $end);
|
||||
$ids = $accounts->pluck('id')->toArray();
|
||||
$data = [];
|
||||
$chartData = [];
|
||||
@@ -242,7 +243,7 @@ class ReportController extends Controller
|
||||
|
||||
// #8374. Sloppy fix for yearly charts. Not really interested in a better fix with v2 layout and all.
|
||||
if ('1Y' === $preferredRange) {
|
||||
$currentEnd = app('navigation')->endOfPeriod($currentEnd, $preferredRange);
|
||||
$currentEnd = Navigation::endOfPeriod($currentEnd, $preferredRange);
|
||||
}
|
||||
Log::debug('Start of sub-loop');
|
||||
while ($currentStart <= $currentEnd) {
|
||||
@@ -260,7 +261,7 @@ class ReportController extends Controller
|
||||
$expense['entries'][$title] = '0';
|
||||
|
||||
}
|
||||
$currentStart = app('navigation')->addPeriod($currentStart, $preferredRange);
|
||||
$currentStart = Navigation::addPeriod($currentStart, $preferredRange);
|
||||
}
|
||||
Log::debug('End of sub-loop');
|
||||
|
||||
|
||||
@@ -23,6 +23,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Http\Controllers\Chart;
|
||||
|
||||
use FireflyIII\Support\Facades\Navigation;
|
||||
use Carbon\Carbon;
|
||||
use FireflyIII\Generator\Chart\Basic\GeneratorInterface;
|
||||
use FireflyIII\Http\Controllers\Controller;
|
||||
@@ -214,7 +215,7 @@ class TagReportController extends Controller
|
||||
$chartData = [];
|
||||
$spent = $this->opsRepository->listExpenses($start, $end, $accounts, new Collection()->push($tag));
|
||||
$earned = $this->opsRepository->listIncome($start, $end, $accounts, new Collection()->push($tag));
|
||||
$format = app('navigation')->preferredCarbonLocalizedFormat($start, $end);
|
||||
$format = Navigation::preferredCarbonLocalizedFormat($start, $end);
|
||||
|
||||
// loop expenses.
|
||||
foreach ($spent as $currency) {
|
||||
@@ -281,11 +282,11 @@ class TagReportController extends Controller
|
||||
private function makeEntries(Carbon $start, Carbon $end): array
|
||||
{
|
||||
$return = [];
|
||||
$format = app('navigation')->preferredCarbonLocalizedFormat($start, $end);
|
||||
$preferredRange = app('navigation')->preferredRangeFormat($start, $end);
|
||||
$format = Navigation::preferredCarbonLocalizedFormat($start, $end);
|
||||
$preferredRange = Navigation::preferredRangeFormat($start, $end);
|
||||
$currentStart = clone $start;
|
||||
while ($currentStart <= $end) {
|
||||
$currentEnd = app('navigation')->endOfPeriod($currentStart, $preferredRange);
|
||||
$currentEnd = Navigation::endOfPeriod($currentStart, $preferredRange);
|
||||
$key = $currentStart->isoFormat($format);
|
||||
$return[$key] = '0';
|
||||
$currentStart = clone $currentEnd;
|
||||
|
||||
@@ -75,6 +75,9 @@ class CreateController extends Controller
|
||||
$subTitleIcon = 'fa-plus';
|
||||
$request->old('_token');
|
||||
$preFilled = $request->old();
|
||||
if (!array_key_exists('transaction_currency_id', $preFilled)) {
|
||||
$preFilled['transaction_currency_id'] = $this->primaryCurrency->id;
|
||||
}
|
||||
|
||||
// put previous url in session if not redirect from store (not "create another").
|
||||
if (true !== session('piggy-banks.create.fromStore')) {
|
||||
|
||||
@@ -23,6 +23,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Http\Controllers;
|
||||
|
||||
use FireflyIII\Support\Facades\Navigation;
|
||||
use Carbon\Carbon;
|
||||
use FireflyIII\Enums\AccountTypeEnum;
|
||||
use FireflyIII\Events\Preferences\UserGroupChangedPrimaryCurrency;
|
||||
@@ -101,7 +102,7 @@ class PreferencesController extends Controller
|
||||
|
||||
/** @var array<int, int> $accountIds */
|
||||
$accountIds = $accounts->pluck('id')->toArray();
|
||||
$viewRange = app('navigation')->getViewRange(false);
|
||||
$viewRange = Navigation::getViewRange(false);
|
||||
$frontpageAccountsPref = Preferences::get('frontpageAccounts', $accountIds);
|
||||
$frontpageAccounts = $frontpageAccountsPref->data;
|
||||
if (!is_array($frontpageAccounts)) {
|
||||
|
||||
@@ -23,6 +23,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Http\Controllers\Report;
|
||||
|
||||
use FireflyIII\Support\Facades\Navigation;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use Carbon\Carbon;
|
||||
use FireflyIII\Exceptions\FireflyException;
|
||||
@@ -485,7 +486,7 @@ class CategoryController extends Controller
|
||||
|
||||
// depending on the carbon format (a reliable way to determine the general date difference)
|
||||
// change the "listOfPeriods" call so the entire period gets included correctly.
|
||||
$format = app('navigation')->preferredCarbonFormat($start, $end);
|
||||
$format = Navigation::preferredCarbonFormat($start, $end);
|
||||
|
||||
if ('Y' === $format) {
|
||||
$start->startOfYear();
|
||||
@@ -494,7 +495,7 @@ class CategoryController extends Controller
|
||||
$start->startOfMonth();
|
||||
}
|
||||
|
||||
$periods = app('navigation')->listOfPeriods($start, $end);
|
||||
$periods = Navigation::listOfPeriods($start, $end);
|
||||
$data = [];
|
||||
$with = $this->opsRepository->listExpenses($start, $end, $accounts);
|
||||
$without = $this->noCatRepository->listExpenses($start, $end, $accounts);
|
||||
@@ -559,7 +560,7 @@ class CategoryController extends Controller
|
||||
|
||||
// depending on the carbon format (a reliable way to determine the general date difference)
|
||||
// change the "listOfPeriods" call so the entire period gets included correctly.
|
||||
$format = app('navigation')->preferredCarbonFormat($start, $end);
|
||||
$format = Navigation::preferredCarbonFormat($start, $end);
|
||||
|
||||
if ('Y' === $format) {
|
||||
$start->startOfYear();
|
||||
@@ -568,7 +569,7 @@ class CategoryController extends Controller
|
||||
$start->startOfMonth();
|
||||
}
|
||||
|
||||
$periods = app('navigation')->listOfPeriods($start, $end);
|
||||
$periods = Navigation::listOfPeriods($start, $end);
|
||||
$data = [];
|
||||
$with = $this->opsRepository->listIncome($start, $end, $accounts);
|
||||
$without = $this->noCatRepository->listIncome($start, $end, $accounts);
|
||||
|
||||
@@ -23,6 +23,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Http\Middleware;
|
||||
|
||||
use FireflyIII\Support\Facades\Navigation;
|
||||
use Carbon\Carbon;
|
||||
use Closure;
|
||||
use FireflyIII\Repositories\Journal\JournalRepositoryInterface;
|
||||
@@ -75,8 +76,8 @@ class Range
|
||||
}
|
||||
|
||||
$today = today(config('app.timezone'));
|
||||
$start = app('navigation')->updateStartDate((string) $viewRange, $today);
|
||||
$end = app('navigation')->updateEndDate((string) $viewRange, $start);
|
||||
$start = Navigation::updateStartDate((string) $viewRange, $today);
|
||||
$end = Navigation::updateEndDate((string) $viewRange, $start);
|
||||
|
||||
app('session')->put('start', $start);
|
||||
app('session')->put('end', $end);
|
||||
|
||||
@@ -24,6 +24,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Jobs;
|
||||
|
||||
use FireflyIII\Support\Facades\Navigation;
|
||||
use Carbon\Carbon;
|
||||
use FireflyIII\Enums\AutoBudgetType;
|
||||
use FireflyIII\Exceptions\FireflyException;
|
||||
@@ -122,8 +123,8 @@ class CreateAutoBudgetLimits implements ShouldQueue
|
||||
);
|
||||
|
||||
// get date range for budget limit, based on range in auto-budget
|
||||
$start = app('navigation')->startOfPeriod($this->date, $autoBudget->period);
|
||||
$end = app('navigation')->endOfPeriod($start, $autoBudget->period);
|
||||
$start = Navigation::startOfPeriod($this->date, $autoBudget->period);
|
||||
$end = Navigation::endOfPeriod($start, $autoBudget->period);
|
||||
|
||||
// find budget limit:
|
||||
$budgetLimit = $this->findBudgetLimit($autoBudget->budget, $start, $end);
|
||||
@@ -237,12 +238,12 @@ class CreateAutoBudgetLimits implements ShouldQueue
|
||||
{
|
||||
Log::debug(sprintf('Will now manage rollover for auto budget #%d', $autoBudget->id));
|
||||
// current period:
|
||||
$start = app('navigation')->startOfPeriod($this->date, $autoBudget->period);
|
||||
$end = app('navigation')->endOfPeriod($start, $autoBudget->period);
|
||||
$start = Navigation::startOfPeriod($this->date, $autoBudget->period);
|
||||
$end = Navigation::endOfPeriod($start, $autoBudget->period);
|
||||
|
||||
// which means previous period:
|
||||
$previousStart = app('navigation')->subtractPeriod($start, $autoBudget->period);
|
||||
$previousEnd = app('navigation')->endOfPeriod($previousStart, $autoBudget->period);
|
||||
$previousStart = Navigation::subtractPeriod($start, $autoBudget->period);
|
||||
$previousEnd = Navigation::endOfPeriod($previousStart, $autoBudget->period);
|
||||
|
||||
Log::debug(
|
||||
sprintf(
|
||||
@@ -297,12 +298,12 @@ class CreateAutoBudgetLimits implements ShouldQueue
|
||||
{
|
||||
Log::debug(sprintf('Will now manage rollover for auto budget #%d', $autoBudget->id));
|
||||
// current period:
|
||||
$start = app('navigation')->startOfPeriod($this->date, $autoBudget->period);
|
||||
$end = app('navigation')->endOfPeriod($start, $autoBudget->period);
|
||||
$start = Navigation::startOfPeriod($this->date, $autoBudget->period);
|
||||
$end = Navigation::endOfPeriod($start, $autoBudget->period);
|
||||
|
||||
// which means previous period:
|
||||
$previousStart = app('navigation')->subtractPeriod($start, $autoBudget->period);
|
||||
$previousEnd = app('navigation')->endOfPeriod($previousStart, $autoBudget->period);
|
||||
$previousStart = Navigation::subtractPeriod($start, $autoBudget->period);
|
||||
$previousEnd = Navigation::endOfPeriod($previousStart, $autoBudget->period);
|
||||
|
||||
Log::debug(
|
||||
sprintf(
|
||||
|
||||
@@ -23,6 +23,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Repositories\Bill;
|
||||
|
||||
use FireflyIII\Support\Facades\Navigation;
|
||||
use Carbon\Carbon;
|
||||
use FireflyIII\Exceptions\FireflyException;
|
||||
use FireflyIII\Factory\BillFactory;
|
||||
@@ -463,11 +464,11 @@ class BillRepository implements BillRepositoryInterface, UserGroupInterface
|
||||
|
||||
while ($start < $date) {
|
||||
Log::debug(sprintf('$start (%s) < $date (%s)', $start->format('Y-m-d H:i:s'), $date->format('Y-m-d H:i:s')));
|
||||
$start = app('navigation')->addPeriod($start, $bill->repeat_freq, $bill->skip);
|
||||
$start = Navigation::addPeriod($start, $bill->repeat_freq, $bill->skip);
|
||||
Log::debug('Start is now '.$start->format('Y-m-d H:i:s'));
|
||||
}
|
||||
|
||||
$end = app('navigation')->addPeriod($start, $bill->repeat_freq, $bill->skip);
|
||||
$end = Navigation::addPeriod($start, $bill->repeat_freq, $bill->skip);
|
||||
$end->endOfDay();
|
||||
|
||||
// see if the bill was paid in this period.
|
||||
@@ -477,7 +478,7 @@ class BillRepository implements BillRepositoryInterface, UserGroupInterface
|
||||
// this period had in fact a bill. The new start is the current end, and we create a new end.
|
||||
Log::debug(sprintf('Journal count is %d, so start becomes %s', $journalCount, $end->format('Y-m-d')));
|
||||
$start = clone $end;
|
||||
$end = app('navigation')->addPeriod($start, $bill->repeat_freq, $bill->skip);
|
||||
$end = Navigation::addPeriod($start, $bill->repeat_freq, $bill->skip);
|
||||
}
|
||||
Log::debug('nextExpectedMatch: Final start is '.$start->format('Y-m-d'));
|
||||
Log::debug('nextExpectedMatch: Matching end is '.$end->format('Y-m-d'));
|
||||
@@ -681,7 +682,7 @@ class BillRepository implements BillRepositoryInterface, UserGroupInterface
|
||||
$start = clone $bill->date;
|
||||
|
||||
while ($start < $date) {
|
||||
$start = app('navigation')->addPeriod($start, $bill->repeat_freq, $bill->skip);
|
||||
$start = Navigation::addPeriod($start, $bill->repeat_freq, $bill->skip);
|
||||
}
|
||||
$cache->store($start);
|
||||
|
||||
|
||||
@@ -23,6 +23,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Repositories\Budget;
|
||||
|
||||
use FireflyIII\Support\Facades\Navigation;
|
||||
use Carbon\Carbon;
|
||||
use FireflyIII\Enums\AutoBudgetType;
|
||||
use FireflyIII\Enums\TransactionTypeEnum;
|
||||
@@ -790,8 +791,8 @@ class BudgetRepository implements BudgetRepositoryInterface, UserGroupInterface
|
||||
|
||||
// create initial budget limit.
|
||||
$today = today(config('app.timezone'));
|
||||
$start = app('navigation')->startOfPeriod($today, $autoBudget->period);
|
||||
$end = app('navigation')->endOfPeriod($start, $autoBudget->period);
|
||||
$start = Navigation::startOfPeriod($today, $autoBudget->period);
|
||||
$end = Navigation::endOfPeriod($start, $autoBudget->period);
|
||||
|
||||
$limitRepos = app(BudgetLimitRepositoryInterface::class);
|
||||
$limitRepos->setUser($this->user);
|
||||
|
||||
@@ -24,6 +24,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Repositories\Budget;
|
||||
|
||||
use FireflyIII\Support\Facades\Navigation;
|
||||
use Carbon\Carbon;
|
||||
use FireflyIII\Enums\TransactionTypeEnum;
|
||||
use FireflyIII\Helpers\Collector\GroupCollectorInterface;
|
||||
@@ -45,7 +46,7 @@ class NoBudgetRepository implements NoBudgetRepositoryInterface, UserGroupInterf
|
||||
#[Deprecated]
|
||||
public function getNoBudgetPeriodReport(Collection $accounts, Carbon $start, Carbon $end): array
|
||||
{
|
||||
$carbonFormat = app('navigation')->preferredCarbonFormat($start, $end);
|
||||
$carbonFormat = Navigation::preferredCarbonFormat($start, $end);
|
||||
|
||||
/** @var GroupCollectorInterface $collector */
|
||||
$collector = app(GroupCollectorInterface::class);
|
||||
|
||||
@@ -24,6 +24,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Repositories\Budget;
|
||||
|
||||
use FireflyIII\Support\Facades\Navigation;
|
||||
use Carbon\Carbon;
|
||||
use Deprecated;
|
||||
use FireflyIII\Enums\TransactionTypeEnum;
|
||||
@@ -82,7 +83,7 @@ class OperationsRepository implements OperationsRepositoryInterface, UserGroupIn
|
||||
#[Deprecated]
|
||||
public function getBudgetPeriodReport(Collection $budgets, Collection $accounts, Carbon $start, Carbon $end): array
|
||||
{
|
||||
$carbonFormat = app('navigation')->preferredCarbonFormat($start, $end);
|
||||
$carbonFormat = Navigation::preferredCarbonFormat($start, $end);
|
||||
$data = [];
|
||||
|
||||
// get all transactions:
|
||||
|
||||
@@ -76,7 +76,6 @@ class JournalRepository implements JournalRepositoryInterface, UserGroupInterfac
|
||||
*/
|
||||
public function firstNull(): ?TransactionJournal
|
||||
{
|
||||
/** @var null|TransactionJournal $entry */
|
||||
return $this->user->transactionJournals()->orderBy('date', 'ASC')->first(['transaction_journals.*']);
|
||||
}
|
||||
|
||||
@@ -113,7 +112,6 @@ class JournalRepository implements JournalRepositoryInterface, UserGroupInterfac
|
||||
|
||||
public function getLast(): ?TransactionJournal
|
||||
{
|
||||
/** @var null|TransactionJournal $entry */
|
||||
return $this->user->transactionJournals()->orderBy('date', 'DESC')->first(['transaction_journals.*']);
|
||||
}
|
||||
|
||||
|
||||
@@ -24,6 +24,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Support\Chart\Category;
|
||||
|
||||
use FireflyIII\Support\Facades\Navigation;
|
||||
use Carbon\Carbon;
|
||||
use FireflyIII\Enums\AccountTypeEnum;
|
||||
use FireflyIII\Models\Category;
|
||||
@@ -59,10 +60,10 @@ class WholePeriodChartGenerator
|
||||
|
||||
while ($current <= $end) {
|
||||
$key = $current->format('Y-m-d');
|
||||
$currentEnd = app('navigation')->endOfPeriod($current, $step);
|
||||
$currentEnd = Navigation::endOfPeriod($current, $step);
|
||||
$spent[$key] = $opsRepository->sumExpenses($current, $currentEnd, $accounts, $collection);
|
||||
$earned[$key] = $opsRepository->sumIncome($current, $currentEnd, $accounts, $collection);
|
||||
$current = app('navigation')->addPeriod($current, $step);
|
||||
$current = Navigation::addPeriod($current, $step);
|
||||
}
|
||||
|
||||
$currencies = $this->extractCurrencies($spent) + $this->extractCurrencies($earned);
|
||||
@@ -91,7 +92,7 @@ class WholePeriodChartGenerator
|
||||
|
||||
while ($current <= $end) {
|
||||
$key = $current->format('Y-m-d');
|
||||
$label = app('navigation')->periodShow($current, $step);
|
||||
$label = Navigation::periodShow($current, $step);
|
||||
|
||||
/** @var array $currency */
|
||||
foreach ($currencies as $currency) {
|
||||
@@ -104,7 +105,7 @@ class WholePeriodChartGenerator
|
||||
$chartData[$spentInfoKey]['entries'][$label] = app('steam')->bcround($spentAmount, $currency['currency_decimal_places']);
|
||||
$chartData[$earnedInfoKey]['entries'][$label] = app('steam')->bcround($earnedAmount, $currency['currency_decimal_places']);
|
||||
}
|
||||
$current = app('navigation')->addPeriod($current, $step);
|
||||
$current = Navigation::addPeriod($current, $step);
|
||||
}
|
||||
|
||||
return $chartData;
|
||||
|
||||
@@ -107,7 +107,7 @@ trait AccountFilter
|
||||
}
|
||||
|
||||
if (0 === count($return)) {
|
||||
$return = $this->types['normal'];
|
||||
return $this->types['normal'];
|
||||
}
|
||||
|
||||
return $return;
|
||||
|
||||
@@ -24,6 +24,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Support\Http\Controllers;
|
||||
|
||||
use FireflyIII\Support\Facades\Navigation;
|
||||
use Carbon\Carbon;
|
||||
|
||||
/**
|
||||
@@ -93,18 +94,18 @@ trait DateCalculation
|
||||
$loop = [];
|
||||
|
||||
/** @var Carbon $current */
|
||||
$current = app('navigation')->startOfPeriod($date, $range);
|
||||
$current = app('navigation')->endOfPeriod($current, $range);
|
||||
$current = Navigation::startOfPeriod($date, $range);
|
||||
$current = Navigation::endOfPeriod($current, $range);
|
||||
$current->addDay();
|
||||
$count = 0;
|
||||
|
||||
while ($count < 12) {
|
||||
$current = app('navigation')->endOfPeriod($current, $range);
|
||||
$currentStart = app('navigation')->startOfPeriod($current, $range);
|
||||
$current = Navigation::endOfPeriod($current, $range);
|
||||
$currentStart = Navigation::startOfPeriod($current, $range);
|
||||
|
||||
$loop[] = [
|
||||
'label' => $current->format('Y-m-d'),
|
||||
'title' => app('navigation')->periodShow($current, $range),
|
||||
'title' => Navigation::periodShow($current, $range),
|
||||
'start' => clone $currentStart,
|
||||
'end' => clone $current,
|
||||
];
|
||||
@@ -125,15 +126,15 @@ trait DateCalculation
|
||||
$loop = [];
|
||||
|
||||
/** @var Carbon $current */
|
||||
$current = app('navigation')->startOfPeriod($date, $range);
|
||||
$current = Navigation::startOfPeriod($date, $range);
|
||||
$count = 0;
|
||||
while ($count < 12) {
|
||||
$current->subDay();
|
||||
$current = app('navigation')->startOfPeriod($current, $range);
|
||||
$currentEnd = app('navigation')->endOfPeriod($current, $range);
|
||||
$current = Navigation::startOfPeriod($current, $range);
|
||||
$currentEnd = Navigation::endOfPeriod($current, $range);
|
||||
$loop[] = [
|
||||
'label' => $current->format('Y-m-d'),
|
||||
'title' => app('navigation')->periodShow($current, $range),
|
||||
'title' => Navigation::periodShow($current, $range),
|
||||
'start' => clone $current,
|
||||
'end' => clone $currentEnd,
|
||||
];
|
||||
|
||||
@@ -24,6 +24,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Support\Http\Controllers;
|
||||
|
||||
use FireflyIII\Support\Facades\Navigation;
|
||||
use Carbon\Carbon;
|
||||
use FireflyIII\Exceptions\FireflyException;
|
||||
use FireflyIII\Support\Facades\FireflyConfig;
|
||||
@@ -82,7 +83,7 @@ trait GetConfigurationData
|
||||
*/
|
||||
protected function getDateRangeConfig(): array // get configuration + get preferences.
|
||||
{
|
||||
$viewRange = app('navigation')->getViewRange(false);
|
||||
$viewRange = Navigation::getViewRange(false);
|
||||
|
||||
Log::debug(sprintf('dateRange: the view range is "%s"', $viewRange));
|
||||
|
||||
@@ -105,32 +106,32 @@ trait GetConfigurationData
|
||||
|
||||
// when current range is a custom range, add the current period as the next range.
|
||||
if ($isCustom) {
|
||||
$index = app('navigation')->periodShow($start, $viewRange);
|
||||
$customPeriodStart = app('navigation')->startOfPeriod($start, $viewRange);
|
||||
$customPeriodEnd = app('navigation')->endOfPeriod($customPeriodStart, $viewRange);
|
||||
$index = Navigation::periodShow($start, $viewRange);
|
||||
$customPeriodStart = Navigation::startOfPeriod($start, $viewRange);
|
||||
$customPeriodEnd = Navigation::endOfPeriod($customPeriodStart, $viewRange);
|
||||
$ranges[$index] = [$customPeriodStart, $customPeriodEnd];
|
||||
}
|
||||
// then add previous range and next range, but skip this for the lastX and YTD stuff.
|
||||
if (!in_array($viewRange, config('firefly.dynamic_date_ranges', []), true)) {
|
||||
$previousDate = app('navigation')->subtractPeriod($start, $viewRange);
|
||||
$index = app('navigation')->periodShow($previousDate, $viewRange);
|
||||
$previousStart = app('navigation')->startOfPeriod($previousDate, $viewRange);
|
||||
$previousEnd = app('navigation')->endOfPeriod($previousStart, $viewRange);
|
||||
$previousDate = Navigation::subtractPeriod($start, $viewRange);
|
||||
$index = Navigation::periodShow($previousDate, $viewRange);
|
||||
$previousStart = Navigation::startOfPeriod($previousDate, $viewRange);
|
||||
$previousEnd = Navigation::endOfPeriod($previousStart, $viewRange);
|
||||
$ranges[$index] = [$previousStart, $previousEnd];
|
||||
|
||||
$nextDate = app('navigation')->addPeriod($start, $viewRange);
|
||||
$index = app('navigation')->periodShow($nextDate, $viewRange);
|
||||
$nextStart = app('navigation')->startOfPeriod($nextDate, $viewRange);
|
||||
$nextEnd = app('navigation')->endOfPeriod($nextStart, $viewRange);
|
||||
$nextDate = Navigation::addPeriod($start, $viewRange);
|
||||
$index = Navigation::periodShow($nextDate, $viewRange);
|
||||
$nextStart = Navigation::startOfPeriod($nextDate, $viewRange);
|
||||
$nextEnd = Navigation::endOfPeriod($nextStart, $viewRange);
|
||||
$ranges[$index] = [$nextStart, $nextEnd];
|
||||
}
|
||||
|
||||
// today:
|
||||
/** @var Carbon $todayStart */
|
||||
$todayStart = app('navigation')->startOfPeriod($today, $viewRange);
|
||||
$todayStart = Navigation::startOfPeriod($today, $viewRange);
|
||||
|
||||
/** @var Carbon $todayEnd */
|
||||
$todayEnd = app('navigation')->endOfPeriod($todayStart, $viewRange);
|
||||
$todayEnd = Navigation::endOfPeriod($todayStart, $viewRange);
|
||||
|
||||
if ($todayStart->ne($start) || $todayEnd->ne($end)) {
|
||||
$ranges[ucfirst((string)trans('firefly.today'))] = [$todayStart, $todayEnd];
|
||||
|
||||
@@ -69,7 +69,6 @@ class RecurringEnrichment implements EnrichmentInterface
|
||||
private string $language = 'en_US';
|
||||
private array $notes = [];
|
||||
private readonly TransactionCurrency $primaryCurrency;
|
||||
private array $recurrenceIds = [];
|
||||
private array $recurrenceByTransaction = [];
|
||||
private array $repetitions = [];
|
||||
private array $sourceAccountIds = [];
|
||||
|
||||
@@ -24,6 +24,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Support\Models;
|
||||
|
||||
use FireflyIII\Support\Facades\Navigation;
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Support\Collection;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
@@ -49,7 +50,7 @@ class BillDateCalculator
|
||||
Log::debug(sprintf('Dates must be between %s and %s.', $earliest->format('Y-m-d'), $latest->format('Y-m-d')));
|
||||
Log::debug(sprintf('Bill started on %s, period is "%s", skip is %d, last paid = "%s".', $billStart->format('Y-m-d'), $period, $skip, $lastPaid?->format('Y-m-d')));
|
||||
|
||||
$daysUntilEOM = app('navigation')->daysUntilEndOfMonth($billStart);
|
||||
$daysUntilEOM = Navigation::daysUntilEndOfMonth($billStart);
|
||||
Log::debug(sprintf('For bill start, days until end of month is %d', $daysUntilEOM));
|
||||
|
||||
$set = new Collection();
|
||||
@@ -94,7 +95,7 @@ class BillDateCalculator
|
||||
// the next expected month because that month has only 28 days (i.e. february).
|
||||
// this applies to leap years as well.
|
||||
if ($daysUntilEOM < 4) {
|
||||
$nextUntilEOM = app('navigation')->daysUntilEndOfMonth($nextExpectedMatch);
|
||||
$nextUntilEOM = Navigation::daysUntilEndOfMonth($nextExpectedMatch);
|
||||
$diffEOM = $daysUntilEOM - $nextUntilEOM;
|
||||
if ($diffEOM > 0) {
|
||||
Log::debug(sprintf('Bill start is %d days from the end of the month. nextExceptedMatch is %d days from the end of the month.', $daysUntilEOM, $nextUntilEOM));
|
||||
@@ -140,7 +141,7 @@ class BillDateCalculator
|
||||
return $billStartDate;
|
||||
}
|
||||
|
||||
$steps = app('navigation')->diffInPeriods($period, $skip, $earliest, $billStartDate);
|
||||
$steps = Navigation::diffInPeriods($period, $skip, $earliest, $billStartDate);
|
||||
if ($steps === $this->diffInMonths) {
|
||||
Log::debug(sprintf('Steps is %d, which is the same as diffInMonths (%d), so we add another 1.', $steps, $this->diffInMonths));
|
||||
++$steps;
|
||||
@@ -150,7 +151,7 @@ class BillDateCalculator
|
||||
if ($steps > 0) {
|
||||
--$steps;
|
||||
Log::debug(sprintf('Steps is %d, because addPeriod already adds 1.', $steps));
|
||||
$result = app('navigation')->addPeriod($billStartDate, $period, $steps);
|
||||
$result = Navigation::addPeriod($billStartDate, $period, $steps);
|
||||
}
|
||||
Log::debug(sprintf('Number of steps is %d, added to %s, result is %s', $steps, $billStartDate->format('Y-m-d'), $result->format('Y-m-d')));
|
||||
|
||||
|
||||
@@ -121,8 +121,8 @@ class Navigation
|
||||
if ($workEnd->gt($start)) {
|
||||
while ($workEnd->gt($start) && $loopCount < 20) {
|
||||
// make range:
|
||||
$workStart = app('navigation')->startOfPeriod($workStart, '1Y');
|
||||
$workEnd = app('navigation')->endOfPeriod($workStart, '1Y');
|
||||
$workStart = Facades\Navigation::startOfPeriod($workStart, '1Y');
|
||||
$workEnd = Facades\Navigation::endOfPeriod($workStart, '1Y');
|
||||
|
||||
// make sure we don't go overboard
|
||||
if ($workEnd->gt($start)) {
|
||||
@@ -206,7 +206,13 @@ class Navigation
|
||||
public function endOfPeriod(Carbon $end, string $repeatFreq): Carbon
|
||||
{
|
||||
$currentEnd = clone $end;
|
||||
|
||||
// Log::debug(sprintf('Now in endOfPeriod("%s", "%s").', $currentEnd->toIso8601String(), $repeatFreq));
|
||||
if ('MTD' === $repeatFreq && $end->isFuture()) {
|
||||
// fall back to a monthly schedule if the requested period is MTD.
|
||||
Log::debug('endOfPeriod() requests "MTD", set it to "1M" instead.');
|
||||
$repeatFreq = '1M';
|
||||
}
|
||||
|
||||
$functionMap = [
|
||||
'1D' => 'endOfDay',
|
||||
@@ -248,12 +254,28 @@ class Navigation
|
||||
Log::debug(sprintf('Diff in days is %d', $diffInDays));
|
||||
$currentEnd->addDays($diffInDays);
|
||||
|
||||
// add sanity check.
|
||||
if ($currentEnd->lt($end)) {
|
||||
throw new FireflyException(sprintf('[a] endOfPeriod(%s, %s) failed, because it resulted in %s.', $end->toW3cString(), $repeatFreq, $currentEnd->toW3cString()));
|
||||
}
|
||||
|
||||
return $currentEnd;
|
||||
}
|
||||
if ('MTD' === $repeatFreq) {
|
||||
$today = today();
|
||||
if ($today->isSameMonth($end)) {
|
||||
return $today->endOfDay()->milli(0);
|
||||
$res = $today->endOfDay()->milli(0);
|
||||
// add sanity check.
|
||||
if ($res->lt($end)) {
|
||||
throw new FireflyException(sprintf('[b] endOfPeriod(%s, %s) failed, because it resulted in %s.', $end->toW3cString(), $repeatFreq, $res->toW3cString()));
|
||||
}
|
||||
|
||||
return $res;
|
||||
}
|
||||
|
||||
// add sanity check.
|
||||
if ($currentEnd->lt($end)) {
|
||||
throw new FireflyException(sprintf('[c] endOfPeriod(%s, %s) failed, because it resulted in %s.', $end->toW3cString(), $repeatFreq, $currentEnd->toW3cString()));
|
||||
}
|
||||
|
||||
return $end->endOfMonth();
|
||||
@@ -270,6 +292,11 @@ class Navigation
|
||||
default => null,
|
||||
};
|
||||
if (null !== $result) {
|
||||
// add sanity check.
|
||||
if ($currentEnd->lt($end)) {
|
||||
throw new FireflyException(sprintf('[d] endOfPeriod(%s, %s) failed, because it resulted in %s.', $end->toW3cString(), $repeatFreq, $currentEnd->toW3cString()));
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
unset($result);
|
||||
@@ -277,6 +304,11 @@ class Navigation
|
||||
if (!array_key_exists($repeatFreq, $functionMap)) {
|
||||
Log::error(sprintf('Cannot do endOfPeriod for $repeat_freq "%s"', $repeatFreq));
|
||||
|
||||
// add sanity check.
|
||||
if ($currentEnd->lt($end)) {
|
||||
throw new FireflyException(sprintf('[e] endOfPeriod(%s, %s) failed, because it resulted in %s.', $end->toW3cString(), $repeatFreq, $currentEnd->toW3cString()));
|
||||
}
|
||||
|
||||
return $end;
|
||||
}
|
||||
$function = $functionMap[$repeatFreq];
|
||||
@@ -288,6 +320,11 @@ class Navigation
|
||||
}
|
||||
$currentEnd->endOfDay()->milli(0);
|
||||
|
||||
// add sanity check.
|
||||
if ($currentEnd->lt($end)) {
|
||||
throw new FireflyException(sprintf('[f] endOfPeriod(%s, %s) failed, because it resulted in %s.', $end->toW3cString(), $repeatFreq, $currentEnd->toW3cString()));
|
||||
}
|
||||
|
||||
return $currentEnd;
|
||||
}
|
||||
$currentEnd->{$function}(); // @phpstan-ignore-line
|
||||
@@ -297,6 +334,11 @@ class Navigation
|
||||
}
|
||||
// Log::debug(sprintf('Final result: %s', $currentEnd->toIso8601String()));
|
||||
|
||||
// add sanity check.
|
||||
if ($currentEnd->lt($end)) {
|
||||
throw new FireflyException(sprintf('[g] endOfPeriod(%s, %s) failed, because it resulted in %s.', $end->toW3cString(), $repeatFreq, $currentEnd->toW3cString()));
|
||||
}
|
||||
|
||||
return $currentEnd;
|
||||
}
|
||||
|
||||
@@ -413,26 +455,26 @@ class Navigation
|
||||
{
|
||||
$date = clone $theDate;
|
||||
$formatMap = [
|
||||
'1D' => (string)trans('config.specific_day_js'),
|
||||
'daily' => (string)trans('config.specific_day_js'),
|
||||
'custom' => (string)trans('config.specific_day_js'),
|
||||
'1W' => (string)trans('config.week_in_year_js'),
|
||||
'week' => (string)trans('config.week_in_year_js'),
|
||||
'weekly' => (string)trans('config.week_in_year_js'),
|
||||
'1M' => (string)trans('config.month_js'),
|
||||
'MTD' => (string)trans('config.month_js'),
|
||||
'month' => (string)trans('config.month_js'),
|
||||
'monthly' => (string)trans('config.month_js'),
|
||||
'1Y' => (string)trans('config.year_js'),
|
||||
'YTD' => (string)trans('config.year_js'),
|
||||
'year' => (string)trans('config.year_js'),
|
||||
'yearly' => (string)trans('config.year_js'),
|
||||
'6M' => (string)trans('config.half_year_js'),
|
||||
'last7' => (string)trans('config.specific_day_js'),
|
||||
'last30' => (string)trans('config.month_js'),
|
||||
'last90' => (string)trans('config.month_js'),
|
||||
'last365' => (string)trans('config.year_js'),
|
||||
'QTD' => (string)trans('config.month_js'),
|
||||
'1D' => (string)trans('config.specific_day_js'),
|
||||
'daily' => (string)trans('config.specific_day_js'),
|
||||
'custom' => (string)trans('config.specific_day_js'),
|
||||
'1W' => (string)trans('config.week_in_year_js'),
|
||||
'week' => (string)trans('config.week_in_year_js'),
|
||||
'weekly' => (string)trans('config.week_in_year_js'),
|
||||
'1M' => (string)trans('config.month_js'),
|
||||
'MTD' => (string)trans('config.month_js'),
|
||||
'month' => (string)trans('config.month_js'),
|
||||
'monthly' => (string)trans('config.month_js'),
|
||||
'1Y' => (string)trans('config.year_js'),
|
||||
'YTD' => (string)trans('config.year_js'),
|
||||
'year' => (string)trans('config.year_js'),
|
||||
'yearly' => (string)trans('config.year_js'),
|
||||
'6M' => (string)trans('config.half_year_js'),
|
||||
'last7' => (string)trans('config.specific_day_js'),
|
||||
'last30' => (string)trans('config.month_js'),
|
||||
'last90' => (string)trans('config.month_js'),
|
||||
'last365' => (string)trans('config.year_js'),
|
||||
'QTD' => (string)trans('config.month_js'),
|
||||
];
|
||||
|
||||
if (array_key_exists($repeatFrequency, $formatMap)) {
|
||||
|
||||
@@ -29,6 +29,7 @@ use FireflyIII\Models\AvailableBudget;
|
||||
use FireflyIII\Models\Budget;
|
||||
use FireflyIII\Models\BudgetLimit;
|
||||
use FireflyIII\Repositories\Budget\BudgetLimitRepositoryInterface;
|
||||
use FireflyIII\Support\Facades\Navigation;
|
||||
use FireflyIII\User;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use Psr\Container\ContainerExceptionInterface;
|
||||
@@ -171,9 +172,16 @@ trait RecalculatesAvailableBudgetsTrait
|
||||
}
|
||||
$viewRange = (string)$viewRange;
|
||||
|
||||
$start = app('navigation')->startOfPeriod($budgetLimit->start_date, $viewRange);
|
||||
$end = app('navigation')->startOfPeriod($budgetLimit->end_date, $viewRange);
|
||||
$end = app('navigation')->endOfPeriod($end, $viewRange);
|
||||
$start = Navigation::startOfPeriod($budgetLimit->start_date, $viewRange);
|
||||
$end = Navigation::startOfPeriod($budgetLimit->end_date, $viewRange);
|
||||
$end = Navigation::endOfPeriod($end, $viewRange);
|
||||
if ($end < $start) {
|
||||
[$start, $end] = [$end, $start];
|
||||
$budgetLimit->start_date = $start;
|
||||
$budgetLimit->end_date = $end;
|
||||
$budgetLimit->saveQuietly();
|
||||
}
|
||||
|
||||
|
||||
// limit period in total is:
|
||||
$limitPeriod = Period::make($start, $end, precision: Precision::DAY(), boundaries: Boundaries::EXCLUDE_NONE());
|
||||
@@ -182,7 +190,7 @@ trait RecalculatesAvailableBudgetsTrait
|
||||
// from the start until the end of the budget limit, need to loop!
|
||||
$current = clone $start;
|
||||
while ($current <= $end) {
|
||||
$currentEnd = app('navigation')->endOfPeriod($current, $viewRange);
|
||||
$currentEnd = Navigation::endOfPeriod($current, $viewRange);
|
||||
|
||||
// create or find AB for this particular period, and set the amount accordingly.
|
||||
/** @var null|AvailableBudget $availableBudget */
|
||||
@@ -192,12 +200,10 @@ trait RecalculatesAvailableBudgetsTrait
|
||||
Log::debug('Found 1 AB, will update.');
|
||||
$this->calculateAmount($availableBudget);
|
||||
}
|
||||
if (null === $availableBudget) {
|
||||
Log::debug('No AB found, will create.');
|
||||
// if not exists:
|
||||
if (null === $availableBudget && $currentEnd->gte($current)) {
|
||||
$currentPeriod = Period::make($current, $currentEnd, precision: Precision::DAY(), boundaries: Boundaries::EXCLUDE_NONE());
|
||||
$daily = $this->getDailyAmount($budgetLimit);
|
||||
$amount = bcmul((string) $daily, (string)$currentPeriod->length(), 12);
|
||||
$amount = bcmul((string)$daily, (string)$currentPeriod->length(), 12);
|
||||
|
||||
// no need to calculate if period is equal.
|
||||
if ($currentPeriod->equals($limitPeriod)) {
|
||||
@@ -227,7 +233,7 @@ trait RecalculatesAvailableBudgetsTrait
|
||||
}
|
||||
|
||||
// prep for next loop
|
||||
$current = app('navigation')->addPeriod($current, $viewRange);
|
||||
$current = Navigation::addPeriod($current, $viewRange);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -55,8 +55,8 @@ class AddTag implements ActionInterface
|
||||
$tagName = $this->action->getValue($journal);
|
||||
$tag = $factory->findOrCreate($tagName);
|
||||
|
||||
$type = $journal['transaction_type_type'];
|
||||
if(TransactionTypeEnum::OPENING_BALANCE->value === $type || TransactionTypeEnum::LIABILITY_CREDIT->value === $type || TransactionTypeEnum::INVALID->value === $type) {
|
||||
$type = $journal['transaction_type_type'];
|
||||
if (TransactionTypeEnum::OPENING_BALANCE->value === $type || TransactionTypeEnum::LIABILITY_CREDIT->value === $type || TransactionTypeEnum::INVALID->value === $type) {
|
||||
// fail silently on invalid transaction types.
|
||||
|
||||
return false;
|
||||
|
||||
118
composer.lock
generated
118
composer.lock
generated
@@ -130,16 +130,16 @@
|
||||
},
|
||||
{
|
||||
"name": "brick/math",
|
||||
"version": "0.14.0",
|
||||
"version": "0.14.1",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/brick/math.git",
|
||||
"reference": "113a8ee2656b882d4c3164fa31aa6e12cbb7aaa2"
|
||||
"reference": "f05858549e5f9d7bb45875a75583240a38a281d0"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/brick/math/zipball/113a8ee2656b882d4c3164fa31aa6e12cbb7aaa2",
|
||||
"reference": "113a8ee2656b882d4c3164fa31aa6e12cbb7aaa2",
|
||||
"url": "https://api.github.com/repos/brick/math/zipball/f05858549e5f9d7bb45875a75583240a38a281d0",
|
||||
"reference": "f05858549e5f9d7bb45875a75583240a38a281d0",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -178,7 +178,7 @@
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/brick/math/issues",
|
||||
"source": "https://github.com/brick/math/tree/0.14.0"
|
||||
"source": "https://github.com/brick/math/tree/0.14.1"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
@@ -186,7 +186,7 @@
|
||||
"type": "github"
|
||||
}
|
||||
],
|
||||
"time": "2025-08-29T12:40:03+00:00"
|
||||
"time": "2025-11-24T14:40:29+00:00"
|
||||
},
|
||||
{
|
||||
"name": "carbonphp/carbon-doctrine-types",
|
||||
@@ -1938,16 +1938,16 @@
|
||||
},
|
||||
{
|
||||
"name": "laravel/framework",
|
||||
"version": "v12.39.0",
|
||||
"version": "v12.40.1",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/laravel/framework.git",
|
||||
"reference": "1a6176129ef28eaf42b6b4a6250025120c3d8dac"
|
||||
"reference": "2e986acbf9acf62cba13400bc23c4d639bf188b9"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/laravel/framework/zipball/1a6176129ef28eaf42b6b4a6250025120c3d8dac",
|
||||
"reference": "1a6176129ef28eaf42b6b4a6250025120c3d8dac",
|
||||
"url": "https://api.github.com/repos/laravel/framework/zipball/2e986acbf9acf62cba13400bc23c4d639bf188b9",
|
||||
"reference": "2e986acbf9acf62cba13400bc23c4d639bf188b9",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -2059,7 +2059,7 @@
|
||||
"league/flysystem-sftp-v3": "^3.25.1",
|
||||
"mockery/mockery": "^1.6.10",
|
||||
"opis/json-schema": "^2.4.1",
|
||||
"orchestra/testbench-core": "^10.7.0",
|
||||
"orchestra/testbench-core": "^10.8.0",
|
||||
"pda/pheanstalk": "^5.0.6|^7.0.0",
|
||||
"php-http/discovery": "^1.15",
|
||||
"phpstan/phpstan": "^2.0",
|
||||
@@ -2153,7 +2153,7 @@
|
||||
"issues": "https://github.com/laravel/framework/issues",
|
||||
"source": "https://github.com/laravel/framework"
|
||||
},
|
||||
"time": "2025-11-18T15:16:10+00:00"
|
||||
"time": "2025-11-25T16:16:33+00:00"
|
||||
},
|
||||
{
|
||||
"name": "laravel/passport",
|
||||
@@ -2233,16 +2233,16 @@
|
||||
},
|
||||
{
|
||||
"name": "laravel/prompts",
|
||||
"version": "v0.3.7",
|
||||
"version": "v0.3.8",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/laravel/prompts.git",
|
||||
"reference": "a1891d362714bc40c8d23b0b1d7090f022ea27cc"
|
||||
"reference": "096748cdfb81988f60090bbb839ce3205ace0d35"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/laravel/prompts/zipball/a1891d362714bc40c8d23b0b1d7090f022ea27cc",
|
||||
"reference": "a1891d362714bc40c8d23b0b1d7090f022ea27cc",
|
||||
"url": "https://api.github.com/repos/laravel/prompts/zipball/096748cdfb81988f60090bbb839ce3205ace0d35",
|
||||
"reference": "096748cdfb81988f60090bbb839ce3205ace0d35",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -2258,7 +2258,7 @@
|
||||
"require-dev": {
|
||||
"illuminate/collections": "^10.0|^11.0|^12.0",
|
||||
"mockery/mockery": "^1.5",
|
||||
"pestphp/pest": "^2.3|^3.4",
|
||||
"pestphp/pest": "^2.3|^3.4|^4.0",
|
||||
"phpstan/phpstan": "^1.12.28",
|
||||
"phpstan/phpstan-mockery": "^1.1.3"
|
||||
},
|
||||
@@ -2286,22 +2286,22 @@
|
||||
"description": "Add beautiful and user-friendly forms to your command-line applications.",
|
||||
"support": {
|
||||
"issues": "https://github.com/laravel/prompts/issues",
|
||||
"source": "https://github.com/laravel/prompts/tree/v0.3.7"
|
||||
"source": "https://github.com/laravel/prompts/tree/v0.3.8"
|
||||
},
|
||||
"time": "2025-09-19T13:47:56+00:00"
|
||||
"time": "2025-11-21T20:52:52+00:00"
|
||||
},
|
||||
{
|
||||
"name": "laravel/sanctum",
|
||||
"version": "v4.2.0",
|
||||
"version": "v4.2.1",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/laravel/sanctum.git",
|
||||
"reference": "fd6df4f79f48a72992e8d29a9c0ee25422a0d677"
|
||||
"reference": "f5fb373be39a246c74a060f2cf2ae2c2145b3664"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/laravel/sanctum/zipball/fd6df4f79f48a72992e8d29a9c0ee25422a0d677",
|
||||
"reference": "fd6df4f79f48a72992e8d29a9c0ee25422a0d677",
|
||||
"url": "https://api.github.com/repos/laravel/sanctum/zipball/f5fb373be39a246c74a060f2cf2ae2c2145b3664",
|
||||
"reference": "f5fb373be39a246c74a060f2cf2ae2c2145b3664",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -2315,9 +2315,8 @@
|
||||
},
|
||||
"require-dev": {
|
||||
"mockery/mockery": "^1.6",
|
||||
"orchestra/testbench": "^9.0|^10.0",
|
||||
"phpstan/phpstan": "^1.10",
|
||||
"phpunit/phpunit": "^11.3"
|
||||
"orchestra/testbench": "^9.15|^10.8",
|
||||
"phpstan/phpstan": "^1.10"
|
||||
},
|
||||
"type": "library",
|
||||
"extra": {
|
||||
@@ -2352,20 +2351,20 @@
|
||||
"issues": "https://github.com/laravel/sanctum/issues",
|
||||
"source": "https://github.com/laravel/sanctum"
|
||||
},
|
||||
"time": "2025-07-09T19:45:24+00:00"
|
||||
"time": "2025-11-21T13:59:03+00:00"
|
||||
},
|
||||
{
|
||||
"name": "laravel/serializable-closure",
|
||||
"version": "v2.0.6",
|
||||
"version": "v2.0.7",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/laravel/serializable-closure.git",
|
||||
"reference": "038ce42edee619599a1debb7e81d7b3759492819"
|
||||
"reference": "cb291e4c998ac50637c7eeb58189c14f5de5b9dd"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/laravel/serializable-closure/zipball/038ce42edee619599a1debb7e81d7b3759492819",
|
||||
"reference": "038ce42edee619599a1debb7e81d7b3759492819",
|
||||
"url": "https://api.github.com/repos/laravel/serializable-closure/zipball/cb291e4c998ac50637c7eeb58189c14f5de5b9dd",
|
||||
"reference": "cb291e4c998ac50637c7eeb58189c14f5de5b9dd",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -2374,7 +2373,7 @@
|
||||
"require-dev": {
|
||||
"illuminate/support": "^10.0|^11.0|^12.0",
|
||||
"nesbot/carbon": "^2.67|^3.0",
|
||||
"pestphp/pest": "^2.36|^3.0",
|
||||
"pestphp/pest": "^2.36|^3.0|^4.0",
|
||||
"phpstan/phpstan": "^2.0",
|
||||
"symfony/var-dumper": "^6.2.0|^7.0.0"
|
||||
},
|
||||
@@ -2413,20 +2412,20 @@
|
||||
"issues": "https://github.com/laravel/serializable-closure/issues",
|
||||
"source": "https://github.com/laravel/serializable-closure"
|
||||
},
|
||||
"time": "2025-10-09T13:42:30+00:00"
|
||||
"time": "2025-11-21T20:52:36+00:00"
|
||||
},
|
||||
{
|
||||
"name": "laravel/slack-notification-channel",
|
||||
"version": "v3.6.0",
|
||||
"version": "v3.7.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/laravel/slack-notification-channel.git",
|
||||
"reference": "642677a57490eebccb7e9fb666f5a5379c6e3459"
|
||||
"reference": "414aec57b487bfbac7f90fc30f50a2f0a2df4caa"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/laravel/slack-notification-channel/zipball/642677a57490eebccb7e9fb666f5a5379c6e3459",
|
||||
"reference": "642677a57490eebccb7e9fb666f5a5379c6e3459",
|
||||
"url": "https://api.github.com/repos/laravel/slack-notification-channel/zipball/414aec57b487bfbac7f90fc30f50a2f0a2df4caa",
|
||||
"reference": "414aec57b487bfbac7f90fc30f50a2f0a2df4caa",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -2476,9 +2475,9 @@
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/laravel/slack-notification-channel/issues",
|
||||
"source": "https://github.com/laravel/slack-notification-channel/tree/v3.6.0"
|
||||
"source": "https://github.com/laravel/slack-notification-channel/tree/v3.7.0"
|
||||
},
|
||||
"time": "2025-06-26T16:51:38+00:00"
|
||||
"time": "2025-11-20T17:26:07+00:00"
|
||||
},
|
||||
{
|
||||
"name": "laravel/ui",
|
||||
@@ -3544,22 +3543,22 @@
|
||||
},
|
||||
{
|
||||
"name": "mailersend/laravel-driver",
|
||||
"version": "v2.9.1",
|
||||
"version": "v2.12.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/mailersend/mailersend-laravel-driver.git",
|
||||
"reference": "87fd5ab76808bbaac9221be0d306baef13e98725"
|
||||
"reference": "15e1ec41e29e65d3ca226929c65804190aaa93eb"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/mailersend/mailersend-laravel-driver/zipball/87fd5ab76808bbaac9221be0d306baef13e98725",
|
||||
"reference": "87fd5ab76808bbaac9221be0d306baef13e98725",
|
||||
"url": "https://api.github.com/repos/mailersend/mailersend-laravel-driver/zipball/15e1ec41e29e65d3ca226929c65804190aaa93eb",
|
||||
"reference": "15e1ec41e29e65d3ca226929c65804190aaa93eb",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"ext-json": "*",
|
||||
"illuminate/support": "^9.0 || ^10.0 || ^11.0 || ^12.0",
|
||||
"mailersend/mailersend": "^0.31.0",
|
||||
"mailersend/mailersend": "^0.35.0",
|
||||
"nyholm/psr7": "^1.5",
|
||||
"php": ">=8.0",
|
||||
"php-http/guzzle7-adapter": "^1.0",
|
||||
@@ -3607,29 +3606,28 @@
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/mailersend/mailersend-laravel-driver/issues",
|
||||
"source": "https://github.com/mailersend/mailersend-laravel-driver/tree/v2.9.1"
|
||||
"source": "https://github.com/mailersend/mailersend-laravel-driver/tree/v2.12.0"
|
||||
},
|
||||
"time": "2025-04-09T09:33:07+00:00"
|
||||
"time": "2025-10-28T14:59:16+00:00"
|
||||
},
|
||||
{
|
||||
"name": "mailersend/mailersend",
|
||||
"version": "v0.31.0",
|
||||
"version": "v0.35.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/mailersend/mailersend-php.git",
|
||||
"reference": "513ff83ee768526055ad52987cde401ea7218c67"
|
||||
"reference": "f1696cf9e727e9503fbc5882d2a111bd966ad276"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/mailersend/mailersend-php/zipball/513ff83ee768526055ad52987cde401ea7218c67",
|
||||
"reference": "513ff83ee768526055ad52987cde401ea7218c67",
|
||||
"url": "https://api.github.com/repos/mailersend/mailersend-php/zipball/f1696cf9e727e9503fbc5882d2a111bd966ad276",
|
||||
"reference": "f1696cf9e727e9503fbc5882d2a111bd966ad276",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"beberlei/assert": "^3.2",
|
||||
"ext-json": "*",
|
||||
"illuminate/collections": "^8.0 || ^9.0 || ^10.0 || ^11.0 || ^12.0",
|
||||
"php": "^7.4|^8.0",
|
||||
"php": "^7.4 || ^8.0 <8.5",
|
||||
"php-http/client-common": "^2.2",
|
||||
"php-http/discovery": "^1.9",
|
||||
"php-http/httplug": "^2.1",
|
||||
@@ -3674,9 +3672,9 @@
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/mailersend/mailersend-php/issues",
|
||||
"source": "https://github.com/mailersend/mailersend-php/tree/v0.31.0"
|
||||
"source": "https://github.com/mailersend/mailersend-php/tree/v0.35.0"
|
||||
},
|
||||
"time": "2025-04-03T12:16:11+00:00"
|
||||
"time": "2025-10-28T13:11:43+00:00"
|
||||
},
|
||||
{
|
||||
"name": "monolog/monolog",
|
||||
@@ -5181,16 +5179,16 @@
|
||||
},
|
||||
{
|
||||
"name": "predis/predis",
|
||||
"version": "v3.2.0",
|
||||
"version": "v3.3.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/predis/predis.git",
|
||||
"reference": "9e9deec4dfd3ebf65d32eb368f498c646ba2ecd8"
|
||||
"reference": "153097374b39a2f737fe700ebcd725642526cdec"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/predis/predis/zipball/9e9deec4dfd3ebf65d32eb368f498c646ba2ecd8",
|
||||
"reference": "9e9deec4dfd3ebf65d32eb368f498c646ba2ecd8",
|
||||
"url": "https://api.github.com/repos/predis/predis/zipball/153097374b39a2f737fe700ebcd725642526cdec",
|
||||
"reference": "153097374b39a2f737fe700ebcd725642526cdec",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -5232,7 +5230,7 @@
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/predis/predis/issues",
|
||||
"source": "https://github.com/predis/predis/tree/v3.2.0"
|
||||
"source": "https://github.com/predis/predis/tree/v3.3.0"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
@@ -5240,7 +5238,7 @@
|
||||
"type": "github"
|
||||
}
|
||||
],
|
||||
"time": "2025-08-06T06:41:24+00:00"
|
||||
"time": "2025-11-24T17:48:50+00:00"
|
||||
},
|
||||
{
|
||||
"name": "psr/cache",
|
||||
|
||||
@@ -78,8 +78,8 @@ return [
|
||||
'running_balance_column' => env('USE_RUNNING_BALANCE', false),
|
||||
// see cer.php for exchange rates feature flag.
|
||||
],
|
||||
'version' => 'develop/2025-11-24',
|
||||
'build_time' => 1763955176,
|
||||
'version' => 'develop/2025-11-26',
|
||||
'build_time' => 1764180641,
|
||||
'api_version' => '2.1.0', // field is no longer used.
|
||||
'db_version' => 28, // field is no longer used.
|
||||
|
||||
|
||||
66
package-lock.json
generated
66
package-lock.json
generated
@@ -3291,42 +3291,42 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@vue/compiler-core": {
|
||||
"version": "3.5.24",
|
||||
"resolved": "https://registry.npmjs.org/@vue/compiler-core/-/compiler-core-3.5.24.tgz",
|
||||
"integrity": "sha512-eDl5H57AOpNakGNAkFDH+y7kTqrQpJkZFXhWZQGyx/5Wh7B1uQYvcWkvZi11BDhscPgj8N7XV3oRwiPnx1Vrig==",
|
||||
"version": "3.5.25",
|
||||
"resolved": "https://registry.npmjs.org/@vue/compiler-core/-/compiler-core-3.5.25.tgz",
|
||||
"integrity": "sha512-vay5/oQJdsNHmliWoZfHPoVZZRmnSWhug0BYT34njkYTPqClh3DNWLkZNJBVSjsNMrg0CCrBfoKkjZQPM/QVUw==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@babel/parser": "^7.28.5",
|
||||
"@vue/shared": "3.5.24",
|
||||
"@vue/shared": "3.5.25",
|
||||
"entities": "^4.5.0",
|
||||
"estree-walker": "^2.0.2",
|
||||
"source-map-js": "^1.2.1"
|
||||
}
|
||||
},
|
||||
"node_modules/@vue/compiler-dom": {
|
||||
"version": "3.5.24",
|
||||
"resolved": "https://registry.npmjs.org/@vue/compiler-dom/-/compiler-dom-3.5.24.tgz",
|
||||
"integrity": "sha512-1QHGAvs53gXkWdd3ZMGYuvQFXHW4ksKWPG8HP8/2BscrbZ0brw183q2oNWjMrSWImYLHxHrx1ItBQr50I/q2zw==",
|
||||
"version": "3.5.25",
|
||||
"resolved": "https://registry.npmjs.org/@vue/compiler-dom/-/compiler-dom-3.5.25.tgz",
|
||||
"integrity": "sha512-4We0OAcMZsKgYoGlMjzYvaoErltdFI2/25wqanuTu+S4gismOTRTBPi4IASOjxWdzIwrYSjnqONfKvuqkXzE2Q==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@vue/compiler-core": "3.5.24",
|
||||
"@vue/shared": "3.5.24"
|
||||
"@vue/compiler-core": "3.5.25",
|
||||
"@vue/shared": "3.5.25"
|
||||
}
|
||||
},
|
||||
"node_modules/@vue/compiler-sfc": {
|
||||
"version": "3.5.24",
|
||||
"resolved": "https://registry.npmjs.org/@vue/compiler-sfc/-/compiler-sfc-3.5.24.tgz",
|
||||
"integrity": "sha512-8EG5YPRgmTB+YxYBM3VXy8zHD9SWHUJLIGPhDovo3Z8VOgvP+O7UP5vl0J4BBPWYD9vxtBabzW1EuEZ+Cqs14g==",
|
||||
"version": "3.5.25",
|
||||
"resolved": "https://registry.npmjs.org/@vue/compiler-sfc/-/compiler-sfc-3.5.25.tgz",
|
||||
"integrity": "sha512-PUgKp2rn8fFsI++lF2sO7gwO2d9Yj57Utr5yEsDf3GNaQcowCLKL7sf+LvVFvtJDXUp/03+dC6f2+LCv5aK1ag==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@babel/parser": "^7.28.5",
|
||||
"@vue/compiler-core": "3.5.24",
|
||||
"@vue/compiler-dom": "3.5.24",
|
||||
"@vue/compiler-ssr": "3.5.24",
|
||||
"@vue/shared": "3.5.24",
|
||||
"@vue/compiler-core": "3.5.25",
|
||||
"@vue/compiler-dom": "3.5.25",
|
||||
"@vue/compiler-ssr": "3.5.25",
|
||||
"@vue/shared": "3.5.25",
|
||||
"estree-walker": "^2.0.2",
|
||||
"magic-string": "^0.30.21",
|
||||
"postcss": "^8.5.6",
|
||||
@@ -3334,14 +3334,14 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@vue/compiler-ssr": {
|
||||
"version": "3.5.24",
|
||||
"resolved": "https://registry.npmjs.org/@vue/compiler-ssr/-/compiler-ssr-3.5.24.tgz",
|
||||
"integrity": "sha512-trOvMWNBMQ/odMRHW7Ae1CdfYx+7MuiQu62Jtu36gMLXcaoqKvAyh+P73sYG9ll+6jLB6QPovqoKGGZROzkFFg==",
|
||||
"version": "3.5.25",
|
||||
"resolved": "https://registry.npmjs.org/@vue/compiler-ssr/-/compiler-ssr-3.5.25.tgz",
|
||||
"integrity": "sha512-ritPSKLBcParnsKYi+GNtbdbrIE1mtuFEJ4U1sWeuOMlIziK5GtOL85t5RhsNy4uWIXPgk+OUdpnXiTdzn8o3A==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@vue/compiler-dom": "3.5.24",
|
||||
"@vue/shared": "3.5.24"
|
||||
"@vue/compiler-dom": "3.5.25",
|
||||
"@vue/shared": "3.5.25"
|
||||
}
|
||||
},
|
||||
"node_modules/@vue/component-compiler-utils": {
|
||||
@@ -3423,9 +3423,9 @@
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/@vue/shared": {
|
||||
"version": "3.5.24",
|
||||
"resolved": "https://registry.npmjs.org/@vue/shared/-/shared-3.5.24.tgz",
|
||||
"integrity": "sha512-9cwHL2EsJBdi8NY22pngYYWzkTDhld6fAD6jlaeloNGciNSJL6bLpbxVgXl96X00Jtc6YWQv96YA/0sxex/k1A==",
|
||||
"version": "3.5.25",
|
||||
"resolved": "https://registry.npmjs.org/@vue/shared/-/shared-3.5.25.tgz",
|
||||
"integrity": "sha512-AbOPdQQnAnzs58H2FrrDxYj/TJfmeS2jdfEEhgiKINy+bnOANmVizIEgq1r+C5zsbs6l1CCQxtcj71rwNQ4jWg==",
|
||||
"dev": true,
|
||||
"license": "MIT"
|
||||
},
|
||||
@@ -4521,9 +4521,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/caniuse-lite": {
|
||||
"version": "1.0.30001756",
|
||||
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001756.tgz",
|
||||
"integrity": "sha512-4HnCNKbMLkLdhJz3TToeVWHSnfJvPaq6vu/eRP0Ahub/07n484XHhBF5AJoSGHdVrS8tKFauUQz8Bp9P7LVx7A==",
|
||||
"version": "1.0.30001757",
|
||||
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001757.tgz",
|
||||
"integrity": "sha512-r0nnL/I28Zi/yjk1el6ilj27tKcdjLsNqAOZr0yVjWPrSQyHgKI2INaEWw21bAQSv2LXRt1XuCS/GomNpWOxsQ==",
|
||||
"dev": true,
|
||||
"funding": [
|
||||
{
|
||||
@@ -5736,9 +5736,9 @@
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/electron-to-chromium": {
|
||||
"version": "1.5.259",
|
||||
"resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.259.tgz",
|
||||
"integrity": "sha512-I+oLXgpEJzD6Cwuwt1gYjxsDmu/S/Kd41mmLA3O+/uH2pFRO/DvOjUyGozL8j3KeLV6WyZ7ssPwELMsXCcsJAQ==",
|
||||
"version": "1.5.260",
|
||||
"resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.260.tgz",
|
||||
"integrity": "sha512-ov8rBoOBhVawpzdre+Cmz4FB+y66Eqrk6Gwqd8NGxuhv99GQ8XqMAr351KEkOt7gukXWDg6gJWEMKgL2RLMPtA==",
|
||||
"dev": true,
|
||||
"license": "ISC"
|
||||
},
|
||||
@@ -8400,9 +8400,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/node-forge": {
|
||||
"version": "1.3.1",
|
||||
"resolved": "https://registry.npmjs.org/node-forge/-/node-forge-1.3.1.tgz",
|
||||
"integrity": "sha512-dPEtOeMvF9VMcYV/1Wb8CPoVAXtp6MKMlcbAt4ddqmGqUJ6fQZFXkNZNkNlfevtNkGtaSoXf/vNNNSvgrdXwtA==",
|
||||
"version": "1.3.2",
|
||||
"resolved": "https://registry.npmjs.org/node-forge/-/node-forge-1.3.2.tgz",
|
||||
"integrity": "sha512-6xKiQ+cph9KImrRh0VsjH2d8/GXA4FIMlgU4B757iI1ApvcyA9VlouP0yZJha01V+huImO+kKMU7ih+2+E14fw==",
|
||||
"dev": true,
|
||||
"license": "(BSD-3-Clause OR GPL-2.0)",
|
||||
"engines": {
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
<div class="box-body">
|
||||
{{ ExpandedForm.text('name') }}
|
||||
{{ ExpandedForm.amountNoCurrency('target_amount') }}
|
||||
{{ CurrencyForm.currencyList('transaction_currency_id', null, {helpText:'piggy_default_currency'|_}) }}
|
||||
{{ CurrencyForm.currencyList('transaction_currency_id', preFilled.transaction_currency_id, {helpText:'piggy_default_currency'|_}) }}
|
||||
{{ AccountForm.assetLiabilityMultiAccountList('accounts', preFilled.accounts, {label: 'saveOnAccounts'|_, helpText: 'piggy_account_currency_match'|_ }) }}
|
||||
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user