mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-16 09:22:33 +00:00
Compare commits
43 Commits
v6.4.0
...
develop-20
Author | SHA1 | Date | |
---|---|---|---|
|
84dbeeb0ce | ||
|
d868dc0945 | ||
|
beecf9c229 | ||
|
e39ba46398 | ||
|
e6b6a3cee5 | ||
|
b5483f6ad3 | ||
|
a751218d53 | ||
|
2af5e6eeef | ||
|
013c43f9f2 | ||
|
7e08a1f33c | ||
|
e592b56d7a | ||
|
a2479f71fe | ||
|
7d3b993b98 | ||
|
90623101a3 | ||
|
e2eca79b25 | ||
|
8c0ee8f024 | ||
|
69cae3ae55 | ||
|
8a06298385 | ||
|
acc3c294d8 | ||
|
dbf7dba421 | ||
|
65813f290d | ||
|
3491fbb99d | ||
|
cb6b3d5f85 | ||
|
956d4e09c3 | ||
|
6a7c35e7bc | ||
|
090aecb5f5 | ||
|
b653d63d3d | ||
|
258dbf4a98 | ||
|
53335077ff | ||
|
ecfb3e2f95 | ||
|
f512e6724e | ||
|
de9efb0727 | ||
|
9075fa8ac8 | ||
|
768bd892c8 | ||
|
9d9483e20f | ||
|
935453796e | ||
|
c2d3f5da16 | ||
|
9e6f9d16e4 | ||
|
fad016f92f | ||
|
30df6684cb | ||
|
4aa911420a | ||
|
19555a7046 | ||
|
e5c409a8fc |
@@ -67,7 +67,9 @@ class StoreController extends Controller
|
||||
*/
|
||||
public function store(StoreRequest $request): JsonResponse
|
||||
{
|
||||
$budget = $this->repository->store($request->getAll());
|
||||
$data = $request->getAll();
|
||||
$data['fire_webhooks'] ??= true;
|
||||
$budget = $this->repository->store($data);
|
||||
$budget->refresh();
|
||||
$manager = $this->getManager();
|
||||
|
||||
|
@@ -57,15 +57,10 @@ class UpdateController extends Controller
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* This endpoint is documented at:
|
||||
* https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/budgets/updateBudget
|
||||
*
|
||||
* Update a budget.
|
||||
*/
|
||||
public function update(UpdateRequest $request, Budget $budget): JsonResponse
|
||||
{
|
||||
$data = $request->getAll();
|
||||
$data['fire_webhooks'] ??= true;
|
||||
$budget = $this->repository->update($budget, $data);
|
||||
$manager = $this->getManager();
|
||||
|
||||
|
@@ -70,6 +70,7 @@ class StoreController extends Controller
|
||||
$data = $request->getAll();
|
||||
$data['start_date'] = $data['start'];
|
||||
$data['end_date'] = $data['end'];
|
||||
$data['fire_webhooks'] ??= true;
|
||||
$data['budget_id'] = $budget->id;
|
||||
|
||||
$budgetLimit = $this->blRepository->store($data);
|
||||
|
@@ -77,6 +77,7 @@ class UpdateController extends Controller
|
||||
throw new FireflyException('20028: The budget limit does not belong to the budget.');
|
||||
}
|
||||
$data = $request->getAll();
|
||||
$data['fire_webhooks'] ??= true;
|
||||
$data['budget_id'] = $budget->id;
|
||||
$budgetLimit = $this->blRepository->update($budgetLimit, $data);
|
||||
$manager = $this->getManager();
|
||||
|
@@ -48,17 +48,20 @@ class StoreRequest extends FormRequest
|
||||
public function getAll(): array
|
||||
{
|
||||
$fields = [
|
||||
'name' => ['name', 'convertString'],
|
||||
'active' => ['active', 'boolean'],
|
||||
'order' => ['active', 'convertInteger'],
|
||||
'notes' => ['notes', 'convertString'],
|
||||
'name' => ['name', 'convertString'],
|
||||
'active' => ['active', 'boolean'],
|
||||
'order' => ['active', 'convertInteger'],
|
||||
'notes' => ['notes', 'convertString'],
|
||||
|
||||
// auto budget currency:
|
||||
'currency_id' => ['auto_budget_currency_id', 'convertInteger'],
|
||||
'currency_code' => ['auto_budget_currency_code', 'convertString'],
|
||||
'auto_budget_type' => ['auto_budget_type', 'convertString'],
|
||||
'auto_budget_amount' => ['auto_budget_amount', 'convertString'],
|
||||
'auto_budget_period' => ['auto_budget_period', 'convertString'],
|
||||
'currency_id' => ['auto_budget_currency_id', 'convertInteger'],
|
||||
'currency_code' => ['auto_budget_currency_code', 'convertString'],
|
||||
'auto_budget_type' => ['auto_budget_type', 'convertString'],
|
||||
'auto_budget_amount' => ['auto_budget_amount', 'convertString'],
|
||||
'auto_budget_period' => ['auto_budget_period', 'convertString'],
|
||||
|
||||
// webhooks
|
||||
'fire_webhooks' => ['fire_webhooks', 'boolean'],
|
||||
];
|
||||
|
||||
return $this->getAllData($fields);
|
||||
@@ -70,15 +73,18 @@ class StoreRequest extends FormRequest
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'name' => 'required|min:1|max:255|uniqueObjectForUser:budgets,name',
|
||||
'active' => [new IsBoolean()],
|
||||
'currency_id' => 'exists:transaction_currencies,id',
|
||||
'currency_code' => 'exists:transaction_currencies,code',
|
||||
'notes' => 'nullable|min:1|max:32768',
|
||||
'name' => 'required|min:1|max:255|uniqueObjectForUser:budgets,name',
|
||||
'active' => [new IsBoolean()],
|
||||
'currency_id' => 'exists:transaction_currencies,id',
|
||||
'currency_code' => 'exists:transaction_currencies,code',
|
||||
'notes' => 'nullable|min:1|max:32768',
|
||||
// auto budget info
|
||||
'auto_budget_type' => 'in:reset,rollover,adjusted,none',
|
||||
'auto_budget_amount' => ['required_if:auto_budget_type,reset', 'required_if:auto_budget_type,rollover', 'required_if:auto_budget_type,adjusted', new IsValidPositiveAmount()],
|
||||
'auto_budget_period' => 'in:daily,weekly,monthly,quarterly,half_year,yearly|required_if:auto_budget_type,reset|required_if:auto_budget_type,rollover|required_if:auto_budget_type,adjusted',
|
||||
'auto_budget_type' => 'in:reset,rollover,adjusted,none',
|
||||
'auto_budget_amount' => ['required_if:auto_budget_type,reset', 'required_if:auto_budget_type,rollover', 'required_if:auto_budget_type,adjusted', new IsValidPositiveAmount()],
|
||||
'auto_budget_period' => 'in:daily,weekly,monthly,quarterly,half_year,yearly|required_if:auto_budget_type,reset|required_if:auto_budget_type,rollover|required_if:auto_budget_type,adjusted',
|
||||
|
||||
// webhooks
|
||||
'fire_webhooks' => [new IsBoolean()],
|
||||
];
|
||||
}
|
||||
|
||||
|
@@ -50,15 +50,18 @@ class UpdateRequest extends FormRequest
|
||||
{
|
||||
// this is the way:
|
||||
$fields = [
|
||||
'name' => ['name', 'convertString'],
|
||||
'active' => ['active', 'boolean'],
|
||||
'order' => ['order', 'convertInteger'],
|
||||
'notes' => ['notes', 'convertString'],
|
||||
'currency_id' => ['auto_budget_currency_id', 'convertInteger'],
|
||||
'currency_code' => ['auto_budget_currency_code', 'convertString'],
|
||||
'auto_budget_type' => ['auto_budget_type', 'convertString'],
|
||||
'auto_budget_amount' => ['auto_budget_amount', 'convertString'],
|
||||
'auto_budget_period' => ['auto_budget_period', 'convertString'],
|
||||
'name' => ['name', 'convertString'],
|
||||
'active' => ['active', 'boolean'],
|
||||
'order' => ['order', 'convertInteger'],
|
||||
'notes' => ['notes', 'convertString'],
|
||||
'currency_id' => ['auto_budget_currency_id', 'convertInteger'],
|
||||
'currency_code' => ['auto_budget_currency_code', 'convertString'],
|
||||
'auto_budget_type' => ['auto_budget_type', 'convertString'],
|
||||
'auto_budget_amount' => ['auto_budget_amount', 'convertString'],
|
||||
'auto_budget_period' => ['auto_budget_period', 'convertString'],
|
||||
|
||||
// webhooks
|
||||
'fire_webhooks' => ['fire_webhooks', 'boolean'],
|
||||
];
|
||||
$allData = $this->getAllData($fields);
|
||||
if (array_key_exists('auto_budget_type', $allData)) {
|
||||
@@ -83,14 +86,17 @@ class UpdateRequest extends FormRequest
|
||||
$budget = $this->route()->parameter('budget');
|
||||
|
||||
return [
|
||||
'name' => sprintf('min:1|max:100|uniqueObjectForUser:budgets,name,%d', $budget->id),
|
||||
'active' => [new IsBoolean()],
|
||||
'notes' => 'nullable|min:1|max:32768',
|
||||
'auto_budget_type' => 'in:reset,rollover,adjusted,none',
|
||||
'auto_budget_currency_id' => 'exists:transaction_currencies,id',
|
||||
'auto_budget_currency_code' => 'exists:transaction_currencies,code',
|
||||
'auto_budget_amount' => ['nullable', new IsValidPositiveAmount()],
|
||||
'auto_budget_period' => 'in:daily,weekly,monthly,quarterly,half_year,yearly',
|
||||
'name' => sprintf('min:1|max:100|uniqueObjectForUser:budgets,name,%d', $budget->id),
|
||||
'active' => [new IsBoolean()],
|
||||
'notes' => 'nullable|min:1|max:32768',
|
||||
'auto_budget_type' => 'in:reset,rollover,adjusted,none',
|
||||
'auto_budget_currency_id' => 'exists:transaction_currencies,id',
|
||||
'auto_budget_currency_code' => 'exists:transaction_currencies,code',
|
||||
'auto_budget_amount' => ['nullable', new IsValidPositiveAmount()],
|
||||
'auto_budget_period' => 'in:daily,weekly,monthly,quarterly,half_year,yearly',
|
||||
|
||||
// webhooks
|
||||
'fire_webhooks' => [new IsBoolean()],
|
||||
];
|
||||
}
|
||||
|
||||
|
@@ -24,10 +24,16 @@ declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Api\V1\Requests\Models\BudgetLimit;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use FireflyIII\Factory\TransactionCurrencyFactory;
|
||||
use FireflyIII\Rules\IsBoolean;
|
||||
use FireflyIII\Rules\IsValidPositiveAmount;
|
||||
use FireflyIII\Support\Facades\Amount;
|
||||
use FireflyIII\Support\Request\ChecksLogin;
|
||||
use FireflyIII\Support\Request\ConvertsDataTypes;
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use Illuminate\Validation\Validator;
|
||||
|
||||
/**
|
||||
* Class StoreRequest
|
||||
@@ -49,6 +55,9 @@ class StoreRequest extends FormRequest
|
||||
'currency_id' => $this->convertInteger('currency_id'),
|
||||
'currency_code' => $this->convertString('currency_code'),
|
||||
'notes' => $this->stringWithNewlines('notes'),
|
||||
|
||||
// for webhooks:
|
||||
'fire_webhooks' => $this->boolean('fire_webhooks', true),
|
||||
];
|
||||
}
|
||||
|
||||
@@ -58,12 +67,59 @@ class StoreRequest extends FormRequest
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'start' => 'required|before:end|date',
|
||||
'end' => 'required|after:start|date',
|
||||
'amount' => ['required', new IsValidPositiveAmount()],
|
||||
'currency_id' => 'numeric|exists:transaction_currencies,id',
|
||||
'currency_code' => 'min:3|max:51|exists:transaction_currencies,code',
|
||||
'notes' => 'nullable|min:0|max:32768',
|
||||
'start' => 'required|before:end|date',
|
||||
'end' => 'required|after:start|date',
|
||||
'amount' => ['required', new IsValidPositiveAmount()],
|
||||
'currency_id' => 'numeric|exists:transaction_currencies,id',
|
||||
'currency_code' => 'min:3|max:51|exists:transaction_currencies,code',
|
||||
'notes' => 'nullable|min:0|max:32768',
|
||||
|
||||
// webhooks
|
||||
'fire_webhooks' => [new IsBoolean()],
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Configure the validator instance.
|
||||
*/
|
||||
public function withValidator(Validator $validator): void
|
||||
{
|
||||
$budget = $this->route()->parameter('budget');
|
||||
$validator->after(
|
||||
static function (Validator $validator) use ($budget): void {
|
||||
if (0 !== count($validator->failed())) {
|
||||
return;
|
||||
}
|
||||
$data = $validator->getData();
|
||||
|
||||
// if no currency has been provided, use the user's default currency:
|
||||
/** @var TransactionCurrencyFactory $factory */
|
||||
$factory = app(TransactionCurrencyFactory::class);
|
||||
$currency = $factory->find($data['currency_id'] ?? null, $data['currency_code'] ?? null);
|
||||
if (null === $currency) {
|
||||
$currency = Amount::getPrimaryCurrency();
|
||||
}
|
||||
$currency->enabled = true;
|
||||
$currency->save();
|
||||
|
||||
// validator already concluded start and end are valid dates:
|
||||
$start = Carbon::parse($data['start'], config('app.timezone'));
|
||||
$end = Carbon::parse($data['end'], config('app.timezone'));
|
||||
|
||||
// find limit with same date range and currency.
|
||||
$limit = $budget->budgetlimits()
|
||||
->where('budget_limits.start_date', $start->format('Y-m-d'))
|
||||
->where('budget_limits.end_date', $end->format('Y-m-d'))
|
||||
->where('budget_limits.transaction_currency_id', $currency->id)
|
||||
->first(['budget_limits.*'])
|
||||
;
|
||||
if (null !== $limit) {
|
||||
$validator->errors()->add('start', trans('validation.limit_exists'));
|
||||
}
|
||||
}
|
||||
);
|
||||
if ($validator->fails()) {
|
||||
Log::channel('audit')->error(sprintf('Validation errors in %s', self::class), $validator->errors()->toArray());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -24,6 +24,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Api\V1\Requests\Models\BudgetLimit;
|
||||
|
||||
use FireflyIII\Rules\IsBoolean;
|
||||
use Illuminate\Validation\Validator;
|
||||
use Carbon\Carbon;
|
||||
use FireflyIII\Rules\IsValidPositiveAmount;
|
||||
@@ -46,12 +47,15 @@ class UpdateRequest extends FormRequest
|
||||
public function getAll(): array
|
||||
{
|
||||
$fields = [
|
||||
'start' => ['start', 'date'],
|
||||
'end' => ['end', 'date'],
|
||||
'amount' => ['amount', 'convertString'],
|
||||
'currency_id' => ['currency_id', 'convertInteger'],
|
||||
'currency_code' => ['currency_code', 'convertString'],
|
||||
'notes' => ['notes', 'stringWithNewlines'],
|
||||
'start' => ['start', 'date'],
|
||||
'end' => ['end', 'date'],
|
||||
'amount' => ['amount', 'convertString'],
|
||||
'currency_id' => ['currency_id', 'convertInteger'],
|
||||
'currency_code' => ['currency_code', 'convertString'],
|
||||
'notes' => ['notes', 'stringWithNewlines'],
|
||||
|
||||
// webhooks
|
||||
'fire_webhooks' => ['fire_webhooks', 'boolean'],
|
||||
];
|
||||
if (false === $this->has('notes')) {
|
||||
// ignore notes, not submitted.
|
||||
@@ -67,12 +71,15 @@ class UpdateRequest extends FormRequest
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'start' => 'date|after:1970-01-02|before:2038-01-17',
|
||||
'end' => 'date|after:1970-01-02|before:2038-01-17',
|
||||
'amount' => ['nullable', new IsValidPositiveAmount()],
|
||||
'currency_id' => 'numeric|exists:transaction_currencies,id',
|
||||
'currency_code' => 'min:3|max:51|exists:transaction_currencies,code',
|
||||
'notes' => 'nullable|min:0|max:32768',
|
||||
'start' => 'date|after:1970-01-02|before:2038-01-17',
|
||||
'end' => 'date|after:1970-01-02|before:2038-01-17',
|
||||
'amount' => ['nullable', new IsValidPositiveAmount()],
|
||||
'currency_id' => 'numeric|exists:transaction_currencies,id',
|
||||
'currency_code' => 'min:3|max:51|exists:transaction_currencies,code',
|
||||
'notes' => 'nullable|min:0|max:32768',
|
||||
|
||||
// webhooks
|
||||
'fire_webhooks' => [new IsBoolean()],
|
||||
];
|
||||
}
|
||||
|
||||
|
@@ -183,6 +183,7 @@ class StoreRequest extends FormRequest
|
||||
// basic fields for group:
|
||||
'group_title' => 'min:1|max:1000|nullable',
|
||||
'error_if_duplicate_hash' => [new IsBoolean()],
|
||||
'fire_webhooks' => [new IsBoolean()],
|
||||
'apply_rules' => [new IsBoolean()],
|
||||
|
||||
// location rules
|
||||
|
@@ -29,12 +29,15 @@ use FireflyIII\Enums\AccountTypeEnum;
|
||||
use FireflyIII\Enums\TransactionTypeEnum;
|
||||
use FireflyIII\Exceptions\FireflyException;
|
||||
use FireflyIII\Factory\AccountFactory;
|
||||
use FireflyIII\Models\Account;
|
||||
use FireflyIII\Models\Transaction;
|
||||
use FireflyIII\Models\TransactionJournal;
|
||||
use FireflyIII\Models\TransactionType;
|
||||
use FireflyIII\Repositories\Account\AccountRepositoryInterface;
|
||||
use Illuminate\Console\Command;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
use Illuminate\Database\Query\JoinClause;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
|
||||
class CorrectsAccountTypes extends Command
|
||||
{
|
||||
@@ -45,6 +48,7 @@ class CorrectsAccountTypes extends Command
|
||||
private int $count;
|
||||
private array $expected;
|
||||
private AccountFactory $factory;
|
||||
private AccountRepositoryInterface $repository;
|
||||
|
||||
/**
|
||||
* Execute the console command.
|
||||
@@ -110,7 +114,7 @@ class CorrectsAccountTypes extends Command
|
||||
if ($resultSet->count() > 0) {
|
||||
$this->friendlyLine(sprintf('Found %d journals that need to be fixed.', $resultSet->count()));
|
||||
foreach ($resultSet as $entry) {
|
||||
app('log')->debug(sprintf('Now fixing journal #%d', $entry->id));
|
||||
Log::debug(sprintf('Now fixing journal #%d', $entry->id));
|
||||
|
||||
/** @var null|TransactionJournal $journal */
|
||||
$journal = TransactionJournal::find($entry->id);
|
||||
@@ -120,7 +124,7 @@ class CorrectsAccountTypes extends Command
|
||||
}
|
||||
}
|
||||
if (0 !== $this->count) {
|
||||
app('log')->debug(sprintf('%d journals had to be fixed.', $this->count));
|
||||
Log::debug(sprintf('%d journals had to be fixed.', $this->count));
|
||||
$this->friendlyInfo(sprintf('Acted on %d transaction(s)', $this->count));
|
||||
}
|
||||
|
||||
@@ -134,10 +138,10 @@ class CorrectsAccountTypes extends Command
|
||||
|
||||
private function inspectJournal(TransactionJournal $journal): void
|
||||
{
|
||||
app('log')->debug(sprintf('Now inspecting journal #%d', $journal->id));
|
||||
Log::debug(sprintf('Now inspecting journal #%d', $journal->id));
|
||||
$transactions = $journal->transactions()->count();
|
||||
if (2 !== $transactions) {
|
||||
app('log')->debug(sprintf('Journal has %d transactions, so can\'t fix.', $transactions));
|
||||
Log::debug(sprintf('Journal has %d transactions, so can\'t fix.', $transactions));
|
||||
$this->friendlyError(sprintf('Cannot inspect transaction journal #%d because it has %d transaction(s) instead of 2.', $journal->id, $transactions));
|
||||
|
||||
return;
|
||||
@@ -151,20 +155,20 @@ class CorrectsAccountTypes extends Command
|
||||
$destAccountType = $destAccount->accountType->type;
|
||||
|
||||
if (!array_key_exists($type, $this->expected)) {
|
||||
app('log')->info(sprintf('No source/destination info for transaction type %s.', $type));
|
||||
Log::info(sprintf('No source/destination info for transaction type %s.', $type));
|
||||
$this->friendlyError(sprintf('No source/destination info for transaction type %s.', $type));
|
||||
|
||||
return;
|
||||
}
|
||||
if (!array_key_exists($sourceAccountType, $this->expected[$type])) {
|
||||
app('log')->debug(sprintf('[a] Going to fix journal #%d', $journal->id));
|
||||
Log::debug(sprintf('[a] Going to fix journal #%d', $journal->id));
|
||||
$this->fixJournal($journal, $type, $sourceTransaction, $destTransaction);
|
||||
|
||||
return;
|
||||
}
|
||||
$expectedTypes = $this->expected[$type][$sourceAccountType];
|
||||
if (!in_array($destAccountType, $expectedTypes, true)) {
|
||||
app('log')->debug(sprintf('[b] Going to fix journal #%d', $journal->id));
|
||||
Log::debug(sprintf('[b] Going to fix journal #%d', $journal->id));
|
||||
$this->fixJournal($journal, $type, $sourceTransaction, $destTransaction);
|
||||
}
|
||||
}
|
||||
@@ -181,13 +185,15 @@ class CorrectsAccountTypes extends Command
|
||||
|
||||
private function fixJournal(TransactionJournal $journal, string $transactionType, Transaction $source, Transaction $dest): void
|
||||
{
|
||||
app('log')->debug(sprintf('Going to fix journal #%d', $journal->id));
|
||||
Log::debug(sprintf('Going to fix journal #%d', $journal->id));
|
||||
$this->repository = app(AccountRepositoryInterface::class);
|
||||
$this->repository->setUser($journal->user);
|
||||
++$this->count;
|
||||
// variables:
|
||||
$sourceType = $source->account->accountType->type;
|
||||
$destinationType = $dest->account->accountType->type;
|
||||
$combination = sprintf('%s%s%s', $transactionType, $source->account->accountType->type, $dest->account->accountType->type);
|
||||
app('log')->debug(sprintf('Combination is "%s"', $combination));
|
||||
$sourceType = $source->account->accountType->type;
|
||||
$destinationType = $dest->account->accountType->type;
|
||||
$combination = sprintf('%s%s%s', $transactionType, $source->account->accountType->type, $dest->account->accountType->type);
|
||||
Log::debug(sprintf('Combination is "%s"', $combination));
|
||||
|
||||
if ($this->shouldBeTransfer($transactionType, $sourceType, $destinationType)) {
|
||||
$this->makeTransfer($journal);
|
||||
@@ -211,37 +217,45 @@ class CorrectsAccountTypes extends Command
|
||||
}
|
||||
|
||||
// transaction has no valid source.
|
||||
$validSources = array_keys($this->expected[$transactionType]);
|
||||
$canCreateSource = $this->canCreateSource($validSources);
|
||||
$hasValidSource = $this->hasValidAccountType($validSources, $sourceType);
|
||||
$validSources = array_keys($this->expected[$transactionType]);
|
||||
$canCreateSource = $this->canCreateSource($validSources);
|
||||
$hasValidSource = $this->hasValidAccountType($validSources, $sourceType);
|
||||
if (!$hasValidSource && $canCreateSource) {
|
||||
$this->giveNewRevenue($journal, $source);
|
||||
|
||||
return;
|
||||
}
|
||||
if (!$canCreateSource && !$hasValidSource) {
|
||||
app('log')->debug('This transaction type has no source we can create. Just give error.');
|
||||
Log::debug('This transaction type has no source we can create. Just give error.');
|
||||
$message = sprintf('The source account of %s #%d cannot be of type "%s". Firefly III cannot fix this. You may have to remove the transaction yourself.', $transactionType, $journal->id, $source->account->accountType->type);
|
||||
$this->friendlyError($message);
|
||||
app('log')->debug($message);
|
||||
Log::debug($message);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
/** @var array $validDestinations */
|
||||
$validDestinations = $this->expected[$transactionType][$sourceType] ?? [];
|
||||
$canCreateDestination = $this->canCreateDestination($validDestinations);
|
||||
$hasValidDestination = $this->hasValidAccountType($validDestinations, $destinationType);
|
||||
$validDestinations = $this->expected[$transactionType][$sourceType] ?? [];
|
||||
$canCreateDestination = $this->canCreateDestination($validDestinations);
|
||||
$hasValidDestination = $this->hasValidAccountType($validDestinations, $destinationType);
|
||||
$alternativeDestination = $this->repository->findByName($dest->account->name, $validDestinations);
|
||||
if (!$hasValidDestination && $canCreateDestination) {
|
||||
$this->giveNewExpense($journal, $dest);
|
||||
|
||||
return;
|
||||
}
|
||||
if (!$canCreateDestination && !$hasValidDestination) {
|
||||
app('log')->debug('This transaction type has no destination we can create. Just give error.');
|
||||
if (!$canCreateDestination && !$hasValidDestination && null === $alternativeDestination) {
|
||||
Log::debug('This transaction type has no destination we can create. Just give error.');
|
||||
$message = sprintf('The destination account of %s #%d cannot be of type "%s". Firefly III cannot fix this. You may have to remove the transaction yourself.', $transactionType, $journal->id, $dest->account->accountType->type);
|
||||
$this->friendlyError($message);
|
||||
app('log')->debug($message);
|
||||
Log::debug($message);
|
||||
}
|
||||
if (!$canCreateDestination && !$hasValidDestination && null !== $alternativeDestination) {
|
||||
Log::debug('This transaction type has no destination we can create, but found alternative with the same name.');
|
||||
$message = sprintf('The destination account of %s #%d cannot be of type "%s". Firefly III found an alternative account. Please make sure this transaction is correct.', $transactionType, $journal->transaction_group_id, $dest->account->accountType->type);
|
||||
$this->friendlyInfo($message);
|
||||
Log::debug($message);
|
||||
$this->giveNewDestinationAccount($journal, $alternativeDestination);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -263,7 +277,7 @@ class CorrectsAccountTypes extends Command
|
||||
$journal->save();
|
||||
$message = sprintf('Converted transaction #%d from a transfer to a withdrawal.', $journal->id);
|
||||
$this->friendlyInfo($message);
|
||||
app('log')->debug($message);
|
||||
Log::debug($message);
|
||||
// check it again:
|
||||
$this->inspectJournal($journal);
|
||||
}
|
||||
@@ -281,7 +295,7 @@ class CorrectsAccountTypes extends Command
|
||||
$journal->save();
|
||||
$message = sprintf('Converted transaction #%d from a transfer to a deposit.', $journal->id);
|
||||
$this->friendlyInfo($message);
|
||||
app('log')->debug($message);
|
||||
Log::debug($message);
|
||||
// check it again:
|
||||
$this->inspectJournal($journal);
|
||||
}
|
||||
@@ -308,7 +322,7 @@ class CorrectsAccountTypes extends Command
|
||||
$result->name
|
||||
);
|
||||
$this->friendlyWarning($message);
|
||||
app('log')->debug($message);
|
||||
Log::debug($message);
|
||||
$this->inspectJournal($journal);
|
||||
}
|
||||
|
||||
@@ -335,7 +349,7 @@ class CorrectsAccountTypes extends Command
|
||||
$result->name
|
||||
);
|
||||
$this->friendlyWarning($message);
|
||||
app('log')->debug($message);
|
||||
Log::debug($message);
|
||||
$this->inspectJournal($journal);
|
||||
}
|
||||
|
||||
@@ -354,14 +368,14 @@ class CorrectsAccountTypes extends Command
|
||||
|
||||
private function giveNewRevenue(TransactionJournal $journal, Transaction $source): void
|
||||
{
|
||||
app('log')->debug(sprintf('An account of type "%s" could be a valid source.', AccountTypeEnum::REVENUE->value));
|
||||
Log::debug(sprintf('An account of type "%s" could be a valid source.', AccountTypeEnum::REVENUE->value));
|
||||
$this->factory->setUser($journal->user);
|
||||
$name = $source->account->name;
|
||||
$newSource = $this->factory->findOrCreate($name, AccountTypeEnum::REVENUE->value);
|
||||
$source->account()->associate($newSource);
|
||||
$source->save();
|
||||
$this->friendlyPositive(sprintf('Firefly III gave transaction #%d a new source %s: #%d ("%s").', $journal->transaction_group_id, AccountTypeEnum::REVENUE->value, $newSource->id, $newSource->name));
|
||||
app('log')->debug(sprintf('Associated account #%d with transaction #%d', $newSource->id, $source->id));
|
||||
Log::debug(sprintf('Associated account #%d with transaction #%d', $newSource->id, $source->id));
|
||||
$this->inspectJournal($journal);
|
||||
}
|
||||
|
||||
@@ -372,14 +386,33 @@ class CorrectsAccountTypes extends Command
|
||||
|
||||
private function giveNewExpense(TransactionJournal $journal, Transaction $destination): void
|
||||
{
|
||||
app('log')->debug(sprintf('An account of type "%s" could be a valid destination.', AccountTypeEnum::EXPENSE->value));
|
||||
Log::debug(sprintf('An account of type "%s" could be a valid destination.', AccountTypeEnum::EXPENSE->value));
|
||||
$this->factory->setUser($journal->user);
|
||||
$name = $destination->account->name;
|
||||
$newDestination = $this->factory->findOrCreate($name, AccountTypeEnum::EXPENSE->value);
|
||||
$destination->account()->associate($newDestination);
|
||||
$destination->save();
|
||||
$this->friendlyPositive(sprintf('Firefly III gave transaction #%d a new destination %s: #%d ("%s").', $journal->transaction_group_id, AccountTypeEnum::EXPENSE->value, $newDestination->id, $newDestination->name));
|
||||
app('log')->debug(sprintf('Associated account #%d with transaction #%d', $newDestination->id, $destination->id));
|
||||
Log::debug(sprintf('Associated account #%d with transaction #%d', $newDestination->id, $destination->id));
|
||||
$this->inspectJournal($journal);
|
||||
}
|
||||
|
||||
private function giveNewDestinationAccount(TransactionJournal $journal, Account $newDestination): void
|
||||
{
|
||||
$destTransaction = $this->getDestinationTransaction($journal);
|
||||
$oldDest = $destTransaction->account;
|
||||
$destTransaction->account_id = $newDestination->id;
|
||||
$destTransaction->save();
|
||||
$message = sprintf(
|
||||
'Transaction journal #%d, destination account changed from #%d ("%s") to #%d ("%s").',
|
||||
$journal->id,
|
||||
$oldDest->id,
|
||||
$oldDest->name,
|
||||
$newDestination->id,
|
||||
$newDestination->name
|
||||
);
|
||||
$this->friendlyInfo($message);
|
||||
$journal->refresh();
|
||||
Log::debug($message);
|
||||
}
|
||||
}
|
||||
|
@@ -75,7 +75,8 @@ class CorrectsDatabase extends Command
|
||||
'correction:recalculates-liabilities',
|
||||
'correction:preferences',
|
||||
// 'correction:transaction-types', // resource heavy, disabled.
|
||||
'correction:recalculate-pc-amounts', // not necessary, disabled.
|
||||
'correction:recalculate-pc-amounts',
|
||||
'correction:remove-links-to-deleted-objects',
|
||||
'firefly-iii:report-integrity',
|
||||
];
|
||||
foreach ($commands as $command) {
|
||||
|
118
app/Console/Commands/Correction/RemovesLinksToDeletedObjects.php
Normal file
118
app/Console/Commands/Correction/RemovesLinksToDeletedObjects.php
Normal file
@@ -0,0 +1,118 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
/*
|
||||
* RemovesLinksToDeletedObjects.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\Budget;
|
||||
use FireflyIII\Models\Category;
|
||||
use FireflyIII\Models\Tag;
|
||||
use FireflyIII\Models\TransactionJournal;
|
||||
use Illuminate\Console\Command;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
|
||||
class RemovesLinksToDeletedObjects extends Command
|
||||
{
|
||||
use ShowsFriendlyMessages;
|
||||
|
||||
/**
|
||||
* The name and signature of the console command.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $signature = 'correction:remove-links-to-deleted-objects';
|
||||
|
||||
/**
|
||||
* The console command description.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $description = 'Removes deleted entries from intermediate tables.';
|
||||
|
||||
/**
|
||||
* Execute the console command.
|
||||
*/
|
||||
public function handle(): void
|
||||
{
|
||||
$deletedTags = Tag::withTrashed()->whereNotNull('deleted_at')->get('tags.id')->pluck('id')->toArray();
|
||||
$deletedJournals = TransactionJournal::withTrashed()->whereNotNull('deleted_at')->get('transaction_journals.id')->pluck('id')->toArray();
|
||||
$deletedBudgets = Budget::withTrashed()->whereNotNull('deleted_at')->get('budgets.id')->pluck('id')->toArray();
|
||||
$deletedCategories = Category::withTrashed()->whereNotNull('deleted_at')->get('categories.id')->pluck('id')->toArray();
|
||||
|
||||
if (count($deletedTags) > 0) {
|
||||
$this->cleanupTags($deletedTags);
|
||||
}
|
||||
if (count($deletedJournals) > 0) {
|
||||
$this->cleanupJournals($deletedJournals);
|
||||
}
|
||||
if (count($deletedBudgets) > 0) {
|
||||
$this->cleanupBudgets($deletedBudgets);
|
||||
}
|
||||
if (count($deletedCategories) > 0) {
|
||||
$this->cleanupCategories($deletedCategories);
|
||||
}
|
||||
$this->friendlyNeutral('Validated links to deleted objects.');
|
||||
|
||||
|
||||
}
|
||||
|
||||
private function cleanupTags(array $tags): void
|
||||
{
|
||||
$count = DB::table('tag_transaction_journal')->whereIn('tag_id', $tags)->delete();
|
||||
if ($count > 0) {
|
||||
$this->friendlyInfo(sprintf('Removed %d old relationship(s) categories transactions and tags.', $count));
|
||||
}
|
||||
}
|
||||
|
||||
private function cleanupJournals(array $journals): void
|
||||
{
|
||||
$count = DB::table('tag_transaction_journal')->whereIn('transaction_journal_id', $journals)->delete();
|
||||
if ($count > 0) {
|
||||
$this->friendlyInfo(sprintf('Removed %d old relationship(s) between tags and transactions.', $count));
|
||||
}
|
||||
$count = DB::table('budget_transaction_journal')->whereIn('transaction_journal_id', $journals)->delete();
|
||||
if ($count > 0) {
|
||||
$this->friendlyInfo(sprintf('Removed %d old relationship(s) between budgets and transactions.', $count));
|
||||
}
|
||||
$count = DB::table('category_transaction_journal')->whereIn('transaction_journal_id', $journals)->delete();
|
||||
if ($count > 0) {
|
||||
$this->friendlyInfo(sprintf('Removed %d old relationship(s) categories and transactions.', $count));
|
||||
}
|
||||
}
|
||||
|
||||
private function cleanupBudgets(array $budgets): void
|
||||
{
|
||||
$count = DB::table('budget_transaction_journal')->whereIn('budget_id', $budgets)->delete();
|
||||
if ($count > 0) {
|
||||
$this->friendlyInfo(sprintf('Removed %d old relationship(s) between budgets and transactions.', $count));
|
||||
}
|
||||
}
|
||||
|
||||
private function cleanupCategories(array $categories): void
|
||||
{
|
||||
$count = DB::table('category_transaction_journal')->whereIn('category_id', $categories)->delete();
|
||||
if ($count > 0) {
|
||||
$this->friendlyInfo(sprintf('Removed %d old relationship(s) categories categories and transactions.', $count));
|
||||
}
|
||||
}
|
||||
}
|
@@ -222,7 +222,7 @@ class TransactionJournalFactory
|
||||
Log::debug('Source info:', $sourceInfo);
|
||||
Log::debug('Destination info:', $destInfo);
|
||||
$sourceAccount = $this->getAccount($type->type, 'source', $sourceInfo);
|
||||
$destinationAccount = $this->getAccount($type->type, 'destination', $destInfo);
|
||||
$destinationAccount = $this->getAccount($type->type, 'destination', $destInfo, $sourceAccount);
|
||||
Log::debug('Done with getAccount(2x)');
|
||||
|
||||
|
||||
|
@@ -31,6 +31,7 @@ use FireflyIII\Models\BudgetLimit;
|
||||
use FireflyIII\Support\Facades\Amount;
|
||||
use FireflyIII\Support\Http\Api\ExchangeRateConverter;
|
||||
use FireflyIII\Support\Observers\RecalculatesAvailableBudgetsTrait;
|
||||
use FireflyIII\Support\Singleton\PreferencesSingleton;
|
||||
use Illuminate\Support\Collection;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
|
||||
@@ -44,17 +45,24 @@ class BudgetLimitObserver
|
||||
$this->updatePrimaryCurrencyAmount($budgetLimit);
|
||||
$this->updateAvailableBudget($budgetLimit);
|
||||
|
||||
$user = $budgetLimit->budget->user;
|
||||
|
||||
/** @var MessageGeneratorInterface $engine */
|
||||
$engine = app(MessageGeneratorInterface::class);
|
||||
$engine->setUser($user);
|
||||
$engine->setObjects(new Collection()->push($budgetLimit));
|
||||
$engine->setTrigger(WebhookTrigger::STORE_UPDATE_BUDGET_LIMIT);
|
||||
$engine->generateMessages();
|
||||
// this is a lame trick to communicate with the observer.
|
||||
$singleton = PreferencesSingleton::getInstance();
|
||||
|
||||
Log::debug(sprintf('send event RequestedSendWebhookMessages from %s', __METHOD__));
|
||||
event(new RequestedSendWebhookMessages());
|
||||
if (true === $singleton->getPreference('fire_webhooks_bl_store')) {
|
||||
|
||||
$user = $budgetLimit->budget->user;
|
||||
|
||||
/** @var MessageGeneratorInterface $engine */
|
||||
$engine = app(MessageGeneratorInterface::class);
|
||||
$engine->setUser($user);
|
||||
$engine->setObjects(new Collection()->push($budgetLimit));
|
||||
$engine->setTrigger(WebhookTrigger::STORE_UPDATE_BUDGET_LIMIT);
|
||||
$engine->generateMessages();
|
||||
|
||||
Log::debug(sprintf('send event RequestedSendWebhookMessages from %s', __METHOD__));
|
||||
event(new RequestedSendWebhookMessages());
|
||||
}
|
||||
}
|
||||
|
||||
private function updatePrimaryCurrencyAmount(BudgetLimit $budgetLimit): void
|
||||
@@ -82,16 +90,21 @@ class BudgetLimitObserver
|
||||
$this->updatePrimaryCurrencyAmount($budgetLimit);
|
||||
$this->updateAvailableBudget($budgetLimit);
|
||||
|
||||
$user = $budgetLimit->budget->user;
|
||||
// this is a lame trick to communicate with the observer.
|
||||
$singleton = PreferencesSingleton::getInstance();
|
||||
|
||||
/** @var MessageGeneratorInterface $engine */
|
||||
$engine = app(MessageGeneratorInterface::class);
|
||||
$engine->setUser($user);
|
||||
$engine->setObjects(new Collection()->push($budgetLimit));
|
||||
$engine->setTrigger(WebhookTrigger::STORE_UPDATE_BUDGET_LIMIT);
|
||||
$engine->generateMessages();
|
||||
if (true === $singleton->getPreference('fire_webhooks_bl_update')) {
|
||||
$user = $budgetLimit->budget->user;
|
||||
|
||||
Log::debug(sprintf('send event RequestedSendWebhookMessages from %s', __METHOD__));
|
||||
event(new RequestedSendWebhookMessages());
|
||||
/** @var MessageGeneratorInterface $engine */
|
||||
$engine = app(MessageGeneratorInterface::class);
|
||||
$engine->setUser($user);
|
||||
$engine->setObjects(new Collection()->push($budgetLimit));
|
||||
$engine->setTrigger(WebhookTrigger::STORE_UPDATE_BUDGET_LIMIT);
|
||||
$engine->generateMessages();
|
||||
|
||||
Log::debug(sprintf('send event RequestedSendWebhookMessages from %s', __METHOD__));
|
||||
event(new RequestedSendWebhookMessages());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -31,6 +31,7 @@ use FireflyIII\Models\Budget;
|
||||
use FireflyIII\Models\BudgetLimit;
|
||||
use FireflyIII\Repositories\Attachment\AttachmentRepositoryInterface;
|
||||
use FireflyIII\Support\Observers\RecalculatesAvailableBudgetsTrait;
|
||||
use FireflyIII\Support\Singleton\PreferencesSingleton;
|
||||
use Illuminate\Support\Collection;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
|
||||
@@ -45,32 +46,43 @@ class BudgetObserver
|
||||
{
|
||||
Log::debug(sprintf('Observe "created" of budget #%d ("%s").', $budget->id, $budget->name));
|
||||
|
||||
// fire event.
|
||||
$user = $budget->user;
|
||||
// this is a lame trick to communicate with the observer.
|
||||
$singleton = PreferencesSingleton::getInstance();
|
||||
|
||||
/** @var MessageGeneratorInterface $engine */
|
||||
$engine = app(MessageGeneratorInterface::class);
|
||||
$engine->setUser($user);
|
||||
$engine->setObjects(new Collection()->push($budget));
|
||||
$engine->setTrigger(WebhookTrigger::STORE_BUDGET);
|
||||
$engine->generateMessages();
|
||||
Log::debug(sprintf('send event RequestedSendWebhookMessages from %s', __METHOD__));
|
||||
event(new RequestedSendWebhookMessages());
|
||||
if (true === $singleton->getPreference('fire_webhooks_budget_create')) {
|
||||
// fire event.
|
||||
$user = $budget->user;
|
||||
|
||||
/** @var MessageGeneratorInterface $engine */
|
||||
$engine = app(MessageGeneratorInterface::class);
|
||||
$engine->setUser($user);
|
||||
$engine->setObjects(new Collection()->push($budget));
|
||||
$engine->setTrigger(WebhookTrigger::STORE_BUDGET);
|
||||
$engine->generateMessages();
|
||||
Log::debug(sprintf('send event RequestedSendWebhookMessages from %s', __METHOD__));
|
||||
event(new RequestedSendWebhookMessages());
|
||||
}
|
||||
}
|
||||
|
||||
public function updated(Budget $budget): void
|
||||
{
|
||||
Log::debug(sprintf('Observe "updated" of budget #%d ("%s").', $budget->id, $budget->name));
|
||||
$user = $budget->user;
|
||||
|
||||
/** @var MessageGeneratorInterface $engine */
|
||||
$engine = app(MessageGeneratorInterface::class);
|
||||
$engine->setUser($user);
|
||||
$engine->setObjects(new Collection()->push($budget));
|
||||
$engine->setTrigger(WebhookTrigger::UPDATE_BUDGET);
|
||||
$engine->generateMessages();
|
||||
Log::debug(sprintf('send event RequestedSendWebhookMessages from %s', __METHOD__));
|
||||
event(new RequestedSendWebhookMessages());
|
||||
// this is a lame trick to communicate with the observer.
|
||||
$singleton = PreferencesSingleton::getInstance();
|
||||
|
||||
if (true === $singleton->getPreference('fire_webhooks_budget_update')) {
|
||||
$user = $budget->user;
|
||||
|
||||
/** @var MessageGeneratorInterface $engine */
|
||||
$engine = app(MessageGeneratorInterface::class);
|
||||
$engine->setUser($user);
|
||||
$engine->setObjects(new Collection()->push($budget));
|
||||
$engine->setTrigger(WebhookTrigger::UPDATE_BUDGET);
|
||||
$engine->generateMessages();
|
||||
Log::debug(sprintf('send event RequestedSendWebhookMessages from %s', __METHOD__));
|
||||
event(new RequestedSendWebhookMessages());
|
||||
}
|
||||
}
|
||||
|
||||
public function deleting(Budget $budget): void
|
||||
|
@@ -122,6 +122,11 @@ class NotificationController extends Controller
|
||||
|
||||
public function testNotification(Request $request): RedirectResponse
|
||||
{
|
||||
if (true === auth()->user()->hasRole('demo')) {
|
||||
session()->flash('error', (string) trans('firefly.not_available_demo_user'));
|
||||
|
||||
return redirect(route('settings.notification.index'));
|
||||
}
|
||||
|
||||
$all = $request->all();
|
||||
$channel = $all['test_submit'] ?? '';
|
||||
|
@@ -26,6 +26,7 @@ namespace FireflyIII\Http\Controllers;
|
||||
use FireflyIII\Events\RequestedSendWebhookMessages;
|
||||
use FireflyIII\Models\TransactionCurrency;
|
||||
use FireflyIII\Support\Facades\Amount;
|
||||
use FireflyIII\Support\Facades\Preferences;
|
||||
use FireflyIII\Support\Facades\Steam;
|
||||
use FireflyIII\Support\Http\Controllers\RequestInformation;
|
||||
use FireflyIII\Support\Http\Controllers\UserNavigation;
|
||||
@@ -133,7 +134,7 @@ abstract class Controller extends BaseController
|
||||
$this->primaryCurrency = Amount::getPrimaryCurrency();
|
||||
$language = Steam::getLanguage();
|
||||
$locale = Steam::getLocale();
|
||||
$darkMode = app('preferences')->get('darkMode', 'browser')->data;
|
||||
$darkMode = Preferences::get('darkMode', 'browser')->data;
|
||||
$this->convertToPrimary = Amount::convertToPrimary();
|
||||
$page = $this->getPageName();
|
||||
$shownDemo = $this->hasSeenDemo();
|
||||
|
@@ -146,25 +146,7 @@ class ShowController extends Controller
|
||||
$attachments = $this->repository->getAttachments($transactionGroup);
|
||||
$links = $this->repository->getLinks($transactionGroup);
|
||||
|
||||
return view(
|
||||
'transactions.show',
|
||||
compact(
|
||||
'transactionGroup',
|
||||
'amounts',
|
||||
'first',
|
||||
'type',
|
||||
'logEntries',
|
||||
'groupLogEntries',
|
||||
'subTitle',
|
||||
'splits',
|
||||
'selectedGroup',
|
||||
'groupArray',
|
||||
'events',
|
||||
'attachments',
|
||||
'links',
|
||||
'accounts',
|
||||
)
|
||||
);
|
||||
return view('transactions.show', compact('transactionGroup', 'amounts', 'first', 'type', 'logEntries', 'groupLogEntries', 'subTitle', 'splits', 'selectedGroup', 'groupArray', 'events', 'attachments', 'links', 'accounts'));
|
||||
}
|
||||
|
||||
private function getAmounts(array $group): array
|
||||
|
@@ -23,11 +23,13 @@ declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Attributes\Scope;
|
||||
use FireflyIII\Enums\AccountTypeEnum;
|
||||
use FireflyIII\Handlers\Observer\AccountObserver;
|
||||
use FireflyIII\Support\Models\ReturnsIntegerIdTrait;
|
||||
use FireflyIII\Support\Models\ReturnsIntegerUserIdTrait;
|
||||
use FireflyIII\User;
|
||||
use Illuminate\Database\Eloquent\Attributes\ObservedBy;
|
||||
use Illuminate\Database\Eloquent\Attributes\Scope;
|
||||
use Illuminate\Database\Eloquent\Builder as EloquentBuilder;
|
||||
use Illuminate\Database\Eloquent\Casts\Attribute;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
@@ -40,6 +42,7 @@ use Illuminate\Database\Eloquent\Relations\MorphToMany;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
|
||||
|
||||
#[ObservedBy([AccountObserver::class])]
|
||||
class Account extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
@@ -60,7 +63,7 @@ class Account extends Model
|
||||
public static function routeBinder(string $value): self
|
||||
{
|
||||
if (auth()->check()) {
|
||||
$accountId = (int) $value;
|
||||
$accountId = (int)$value;
|
||||
|
||||
/** @var User $user */
|
||||
$user = auth()->user();
|
||||
@@ -95,39 +98,6 @@ class Account extends Model
|
||||
return $this->morphMany(Attachment::class, 'attachable');
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the account number.
|
||||
*/
|
||||
protected function accountNumber(): Attribute
|
||||
{
|
||||
return Attribute::make(get: function () {
|
||||
/** @var null|AccountMeta $metaValue */
|
||||
$metaValue = $this->accountMeta()
|
||||
->where('name', 'account_number')
|
||||
->first()
|
||||
;
|
||||
|
||||
return null !== $metaValue ? $metaValue->data : '';
|
||||
});
|
||||
}
|
||||
|
||||
public function accountMeta(): HasMany
|
||||
{
|
||||
return $this->hasMany(AccountMeta::class);
|
||||
}
|
||||
|
||||
protected function editName(): Attribute
|
||||
{
|
||||
return Attribute::make(get: function () {
|
||||
$name = $this->name;
|
||||
if (AccountTypeEnum::CASH->value === $this->accountType->type) {
|
||||
return '';
|
||||
}
|
||||
|
||||
return $name;
|
||||
});
|
||||
}
|
||||
|
||||
public function locations(): MorphMany
|
||||
{
|
||||
return $this->morphMany(Location::class, 'locatable');
|
||||
@@ -154,19 +124,9 @@ class Account extends Model
|
||||
return $this->belongsToMany(PiggyBank::class);
|
||||
}
|
||||
|
||||
#[Scope]
|
||||
protected function accountTypeIn(EloquentBuilder $query, array $types): void
|
||||
{
|
||||
if (false === $this->joinedAccountTypes) {
|
||||
$query->leftJoin('account_types', 'account_types.id', '=', 'accounts.account_type_id');
|
||||
$this->joinedAccountTypes = true;
|
||||
}
|
||||
$query->whereIn('account_types.type', $types);
|
||||
}
|
||||
|
||||
public function setVirtualBalanceAttribute(mixed $value): void
|
||||
{
|
||||
$value = (string) $value;
|
||||
$value = (string)$value;
|
||||
if ('' === $value) {
|
||||
$value = null;
|
||||
}
|
||||
@@ -186,42 +146,49 @@ class Account extends Model
|
||||
protected function accountId(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: static fn ($value) => (int) $value,
|
||||
get: static fn ($value) => (int)$value,
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the account number.
|
||||
*/
|
||||
protected function accountNumber(): Attribute
|
||||
{
|
||||
return Attribute::make(get: function () {
|
||||
/** @var null|AccountMeta $metaValue */
|
||||
$metaValue = $this->accountMeta()
|
||||
->where('name', 'account_number')
|
||||
->first()
|
||||
;
|
||||
|
||||
return null !== $metaValue ? $metaValue->data : '';
|
||||
});
|
||||
}
|
||||
|
||||
public function accountMeta(): HasMany
|
||||
{
|
||||
return $this->hasMany(AccountMeta::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the user ID
|
||||
*/
|
||||
protected function accountTypeId(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: static fn ($value) => (int) $value,
|
||||
get: static fn ($value) => (int)$value,
|
||||
);
|
||||
}
|
||||
|
||||
protected function iban(): Attribute
|
||||
#[Scope]
|
||||
protected function accountTypeIn(EloquentBuilder $query, array $types): void
|
||||
{
|
||||
return Attribute::make(
|
||||
get: static fn ($value) => null === $value ? null : trim(str_replace(' ', '', (string) $value)),
|
||||
);
|
||||
}
|
||||
|
||||
protected function order(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: static fn ($value) => (int) $value,
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the virtual balance
|
||||
*/
|
||||
protected function virtualBalance(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: static fn ($value) => (string) $value,
|
||||
);
|
||||
if (false === $this->joinedAccountTypes) {
|
||||
$query->leftJoin('account_types', 'account_types.id', '=', 'accounts.account_type_id');
|
||||
$this->joinedAccountTypes = true;
|
||||
}
|
||||
$query->whereIn('account_types.type', $types);
|
||||
}
|
||||
|
||||
protected function casts(): array
|
||||
@@ -238,4 +205,40 @@ class Account extends Model
|
||||
'native_virtual_balance' => 'string',
|
||||
];
|
||||
}
|
||||
|
||||
protected function editName(): Attribute
|
||||
{
|
||||
return Attribute::make(get: function () {
|
||||
$name = $this->name;
|
||||
if (AccountTypeEnum::CASH->value === $this->accountType->type) {
|
||||
return '';
|
||||
}
|
||||
|
||||
return $name;
|
||||
});
|
||||
}
|
||||
|
||||
protected function iban(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: static fn ($value) => null === $value ? null : trim(str_replace(' ', '', (string)$value)),
|
||||
);
|
||||
}
|
||||
|
||||
protected function order(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: static fn ($value) => (int)$value,
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the virtual balance
|
||||
*/
|
||||
protected function virtualBalance(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: static fn ($value) => (string)$value,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@@ -23,8 +23,8 @@ declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Casts\Attribute;
|
||||
use FireflyIII\Support\Models\ReturnsIntegerIdTrait;
|
||||
use Illuminate\Database\Eloquent\Casts\Attribute;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
|
||||
@@ -43,11 +43,6 @@ class AccountMeta extends Model
|
||||
return $this->belongsTo(Account::class);
|
||||
}
|
||||
|
||||
protected function data(): Attribute
|
||||
{
|
||||
return Attribute::make(get: fn (mixed $value) => (string) json_decode((string) $value, true), set: fn (mixed $value) => ['data' => json_encode($value)]);
|
||||
}
|
||||
|
||||
protected function casts(): array
|
||||
{
|
||||
return [
|
||||
@@ -55,4 +50,9 @@ class AccountMeta extends Model
|
||||
'updated_at' => 'datetime',
|
||||
];
|
||||
}
|
||||
|
||||
protected function data(): Attribute
|
||||
{
|
||||
return Attribute::make(get: fn (mixed $value) => (string)json_decode((string)$value, true), set: fn (mixed $value) => ['data' => json_encode($value)]);
|
||||
}
|
||||
}
|
||||
|
@@ -32,46 +32,60 @@ class AccountType extends Model
|
||||
{
|
||||
use ReturnsIntegerIdTrait;
|
||||
|
||||
#[Deprecated] /** @deprecated */
|
||||
#[Deprecated]
|
||||
/** @deprecated */
|
||||
public const string ASSET = 'Asset account';
|
||||
|
||||
#[Deprecated] /** @deprecated */
|
||||
#[Deprecated]
|
||||
/** @deprecated */
|
||||
public const string BENEFICIARY = 'Beneficiary account';
|
||||
|
||||
#[Deprecated] /** @deprecated */
|
||||
#[Deprecated]
|
||||
/** @deprecated */
|
||||
public const string CASH = 'Cash account';
|
||||
|
||||
#[Deprecated] /** @deprecated */
|
||||
#[Deprecated]
|
||||
/** @deprecated */
|
||||
public const string CREDITCARD = 'Credit card';
|
||||
|
||||
#[Deprecated] /** @deprecated */
|
||||
#[Deprecated]
|
||||
/** @deprecated */
|
||||
public const string DEBT = 'Debt';
|
||||
|
||||
#[Deprecated] /** @deprecated */
|
||||
#[Deprecated]
|
||||
/** @deprecated */
|
||||
public const string DEFAULT = 'Default account';
|
||||
|
||||
#[Deprecated] /** @deprecated */
|
||||
#[Deprecated]
|
||||
/** @deprecated */
|
||||
public const string EXPENSE = 'Expense account';
|
||||
|
||||
#[Deprecated] /** @deprecated */
|
||||
#[Deprecated]
|
||||
/** @deprecated */
|
||||
public const string IMPORT = 'Import account';
|
||||
|
||||
#[Deprecated] /** @deprecated */
|
||||
#[Deprecated]
|
||||
/** @deprecated */
|
||||
public const string INITIAL_BALANCE = 'Initial balance account';
|
||||
|
||||
#[Deprecated] /** @deprecated */
|
||||
#[Deprecated]
|
||||
/** @deprecated */
|
||||
public const string LIABILITY_CREDIT = 'Liability credit account';
|
||||
|
||||
#[Deprecated] /** @deprecated */
|
||||
#[Deprecated]
|
||||
/** @deprecated */
|
||||
public const string LOAN = 'Loan';
|
||||
|
||||
#[Deprecated] /** @deprecated */
|
||||
#[Deprecated]
|
||||
/** @deprecated */
|
||||
public const string MORTGAGE = 'Mortgage';
|
||||
|
||||
#[Deprecated] /** @deprecated */
|
||||
#[Deprecated]
|
||||
/** @deprecated */
|
||||
public const string RECONCILIATION = 'Reconciliation account';
|
||||
|
||||
#[Deprecated] /** @deprecated */
|
||||
#[Deprecated]
|
||||
/** @deprecated */
|
||||
public const string REVENUE = 'Revenue account';
|
||||
|
||||
protected $casts
|
||||
|
@@ -23,9 +23,11 @@ declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Models;
|
||||
|
||||
use FireflyIII\Handlers\Observer\AttachmentObserver;
|
||||
use FireflyIII\Support\Models\ReturnsIntegerIdTrait;
|
||||
use FireflyIII\Support\Models\ReturnsIntegerUserIdTrait;
|
||||
use FireflyIII\User;
|
||||
use Illuminate\Database\Eloquent\Attributes\ObservedBy;
|
||||
use Illuminate\Database\Eloquent\Casts\Attribute;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
@@ -34,6 +36,7 @@ use Illuminate\Database\Eloquent\Relations\MorphTo;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
|
||||
|
||||
#[ObservedBy([AttachmentObserver::class])]
|
||||
class Attachment extends Model
|
||||
{
|
||||
use ReturnsIntegerIdTrait;
|
||||
@@ -50,7 +53,7 @@ class Attachment extends Model
|
||||
public static function routeBinder(string $value): self
|
||||
{
|
||||
if (auth()->check()) {
|
||||
$attachmentId = (int) $value;
|
||||
$attachmentId = (int)$value;
|
||||
|
||||
/** @var User $user */
|
||||
$user = auth()->user();
|
||||
@@ -83,7 +86,7 @@ class Attachment extends Model
|
||||
*/
|
||||
public function fileName(): string
|
||||
{
|
||||
return sprintf('at-%s.data', (string) $this->id);
|
||||
return sprintf('at-%s.data', (string)$this->id);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -97,7 +100,7 @@ class Attachment extends Model
|
||||
protected function attachableId(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: static fn ($value) => (int) $value,
|
||||
get: static fn ($value) => (int)$value,
|
||||
);
|
||||
}
|
||||
|
||||
|
@@ -48,14 +48,7 @@ class AuditLogEntry extends Model
|
||||
protected function auditableId(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: static fn ($value) => (int) $value,
|
||||
);
|
||||
}
|
||||
|
||||
protected function changerId(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: static fn ($value) => (int) $value,
|
||||
get: static fn ($value) => (int)$value,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -69,4 +62,11 @@ class AuditLogEntry extends Model
|
||||
'deleted_at' => 'datetime',
|
||||
];
|
||||
}
|
||||
|
||||
protected function changerId(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: static fn ($value) => (int)$value,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@@ -25,24 +25,30 @@ declare(strict_types=1);
|
||||
namespace FireflyIII\Models;
|
||||
|
||||
use Deprecated;
|
||||
use FireflyIII\Handlers\Observer\AutoBudgetObserver;
|
||||
use FireflyIII\Support\Models\ReturnsIntegerIdTrait;
|
||||
use Illuminate\Database\Eloquent\Attributes\ObservedBy;
|
||||
use Illuminate\Database\Eloquent\Casts\Attribute;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
|
||||
#[ObservedBy([AutoBudgetObserver::class])]
|
||||
class AutoBudget extends Model
|
||||
{
|
||||
use ReturnsIntegerIdTrait;
|
||||
use SoftDeletes;
|
||||
|
||||
#[Deprecated] /** @deprecated */
|
||||
#[Deprecated]
|
||||
/** @deprecated */
|
||||
public const int AUTO_BUDGET_ADJUSTED = 3;
|
||||
|
||||
#[Deprecated] /** @deprecated */
|
||||
#[Deprecated]
|
||||
/** @deprecated */
|
||||
public const int AUTO_BUDGET_RESET = 1;
|
||||
|
||||
#[Deprecated] /** @deprecated */
|
||||
#[Deprecated]
|
||||
/** @deprecated */
|
||||
public const int AUTO_BUDGET_ROLLOVER = 2;
|
||||
protected $casts
|
||||
= [
|
||||
@@ -64,14 +70,14 @@ class AutoBudget extends Model
|
||||
protected function amount(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: static fn ($value) => (string) $value,
|
||||
get: static fn ($value) => (string)$value,
|
||||
);
|
||||
}
|
||||
|
||||
protected function budgetId(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: static fn ($value) => (int) $value,
|
||||
get: static fn ($value) => (int)$value,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -85,7 +91,7 @@ class AutoBudget extends Model
|
||||
protected function transactionCurrencyId(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: static fn ($value) => (int) $value,
|
||||
get: static fn ($value) => (int)$value,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@@ -24,15 +24,18 @@ declare(strict_types=1);
|
||||
namespace FireflyIII\Models;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use FireflyIII\Handlers\Observer\AvailableBudgetObserver;
|
||||
use FireflyIII\Support\Models\ReturnsIntegerIdTrait;
|
||||
use FireflyIII\Support\Models\ReturnsIntegerUserIdTrait;
|
||||
use FireflyIII\User;
|
||||
use Illuminate\Database\Eloquent\Attributes\ObservedBy;
|
||||
use Illuminate\Database\Eloquent\Casts\Attribute;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
|
||||
|
||||
#[ObservedBy([AvailableBudgetObserver::class])]
|
||||
class AvailableBudget extends Model
|
||||
{
|
||||
use ReturnsIntegerIdTrait;
|
||||
@@ -49,7 +52,7 @@ class AvailableBudget extends Model
|
||||
public static function routeBinder(string $value): self
|
||||
{
|
||||
if (auth()->check()) {
|
||||
$availableBudgetId = (int) $value;
|
||||
$availableBudgetId = (int)$value;
|
||||
|
||||
/** @var User $user */
|
||||
$user = auth()->user();
|
||||
@@ -77,10 +80,26 @@ class AvailableBudget extends Model
|
||||
protected function amount(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: static fn ($value) => (string) $value,
|
||||
get: static fn ($value) => (string)$value,
|
||||
);
|
||||
}
|
||||
|
||||
protected function casts(): array
|
||||
{
|
||||
return [
|
||||
'created_at' => 'datetime',
|
||||
'updated_at' => 'datetime',
|
||||
'deleted_at' => 'datetime',
|
||||
'start_date' => 'date',
|
||||
'end_date' => 'date',
|
||||
'transaction_currency_id' => 'int',
|
||||
'amount' => 'string',
|
||||
'native_amount' => 'string',
|
||||
'user_id' => 'integer',
|
||||
'user_group_id' => 'integer',
|
||||
];
|
||||
}
|
||||
|
||||
protected function endDate(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
@@ -100,23 +119,7 @@ class AvailableBudget extends Model
|
||||
protected function transactionCurrencyId(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: static fn ($value) => (int) $value,
|
||||
get: static fn ($value) => (int)$value,
|
||||
);
|
||||
}
|
||||
|
||||
protected function casts(): array
|
||||
{
|
||||
return [
|
||||
'created_at' => 'datetime',
|
||||
'updated_at' => 'datetime',
|
||||
'deleted_at' => 'datetime',
|
||||
'start_date' => 'date',
|
||||
'end_date' => 'date',
|
||||
'transaction_currency_id' => 'int',
|
||||
'amount' => 'string',
|
||||
'native_amount' => 'string',
|
||||
'user_id' => 'integer',
|
||||
'user_group_id' => 'integer',
|
||||
];
|
||||
}
|
||||
}
|
||||
|
@@ -24,9 +24,11 @@ declare(strict_types=1);
|
||||
namespace FireflyIII\Models;
|
||||
|
||||
use FireflyIII\Casts\SeparateTimezoneCaster;
|
||||
use FireflyIII\Handlers\Observer\BillObserver;
|
||||
use FireflyIII\Support\Models\ReturnsIntegerIdTrait;
|
||||
use FireflyIII\Support\Models\ReturnsIntegerUserIdTrait;
|
||||
use FireflyIII\User;
|
||||
use Illuminate\Database\Eloquent\Attributes\ObservedBy;
|
||||
use Illuminate\Database\Eloquent\Casts\Attribute;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
@@ -36,6 +38,7 @@ use Illuminate\Database\Eloquent\Relations\MorphToMany;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
|
||||
|
||||
#[ObservedBy([BillObserver::class])]
|
||||
class Bill extends Model
|
||||
{
|
||||
use ReturnsIntegerIdTrait;
|
||||
@@ -75,7 +78,7 @@ class Bill extends Model
|
||||
public static function routeBinder(string $value): self
|
||||
{
|
||||
if (auth()->check()) {
|
||||
$billId = (int) $value;
|
||||
$billId = (int)$value;
|
||||
|
||||
/** @var User $user */
|
||||
$user = auth()->user();
|
||||
@@ -121,7 +124,7 @@ class Bill extends Model
|
||||
*/
|
||||
public function setAmountMaxAttribute($value): void
|
||||
{
|
||||
$this->attributes['amount_max'] = (string) $value;
|
||||
$this->attributes['amount_max'] = (string)$value;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -129,7 +132,7 @@ class Bill extends Model
|
||||
*/
|
||||
public function setAmountMinAttribute($value): void
|
||||
{
|
||||
$this->attributes['amount_min'] = (string) $value;
|
||||
$this->attributes['amount_min'] = (string)$value;
|
||||
}
|
||||
|
||||
public function transactionCurrency(): BelongsTo
|
||||
@@ -148,7 +151,7 @@ class Bill extends Model
|
||||
protected function amountMax(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: static fn ($value) => (string) $value,
|
||||
get: static fn ($value) => (string)$value,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -158,31 +161,7 @@ class Bill extends Model
|
||||
protected function amountMin(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: static fn ($value) => (string) $value,
|
||||
);
|
||||
}
|
||||
|
||||
protected function order(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: static fn ($value) => (int) $value,
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the skip
|
||||
*/
|
||||
protected function skip(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: static fn ($value) => (int) $value,
|
||||
);
|
||||
}
|
||||
|
||||
protected function transactionCurrencyId(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: static fn ($value) => (int) $value,
|
||||
get: static fn ($value) => (string)$value,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -206,4 +185,28 @@ class Bill extends Model
|
||||
'native_amount_max' => 'string',
|
||||
];
|
||||
}
|
||||
|
||||
protected function order(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: static fn ($value) => (int)$value,
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the skip
|
||||
*/
|
||||
protected function skip(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: static fn ($value) => (int)$value,
|
||||
);
|
||||
}
|
||||
|
||||
protected function transactionCurrencyId(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: static fn ($value) => (int)$value,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@@ -23,9 +23,11 @@ declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Models;
|
||||
|
||||
use FireflyIII\Handlers\Observer\BudgetObserver;
|
||||
use FireflyIII\Support\Models\ReturnsIntegerIdTrait;
|
||||
use FireflyIII\Support\Models\ReturnsIntegerUserIdTrait;
|
||||
use FireflyIII\User;
|
||||
use Illuminate\Database\Eloquent\Attributes\ObservedBy;
|
||||
use Illuminate\Database\Eloquent\Casts\Attribute;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
@@ -35,6 +37,7 @@ use Illuminate\Database\Eloquent\Relations\MorphMany;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
|
||||
|
||||
#[ObservedBy([BudgetObserver::class])]
|
||||
class Budget extends Model
|
||||
{
|
||||
use ReturnsIntegerIdTrait;
|
||||
@@ -53,7 +56,7 @@ class Budget extends Model
|
||||
public static function routeBinder(string $value): self
|
||||
{
|
||||
if (auth()->check()) {
|
||||
$budgetId = (int) $value;
|
||||
$budgetId = (int)$value;
|
||||
|
||||
/** @var User $user */
|
||||
$user = auth()->user();
|
||||
@@ -106,13 +109,6 @@ class Budget extends Model
|
||||
return $this->belongsToMany(Transaction::class, 'budget_transaction', 'budget_id');
|
||||
}
|
||||
|
||||
protected function order(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: static fn ($value) => (int) $value,
|
||||
);
|
||||
}
|
||||
|
||||
protected function casts(): array
|
||||
{
|
||||
return [
|
||||
@@ -125,4 +121,11 @@ class Budget extends Model
|
||||
'user_group_id' => 'integer',
|
||||
];
|
||||
}
|
||||
|
||||
protected function order(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: static fn ($value) => (int)$value,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@@ -24,13 +24,16 @@ declare(strict_types=1);
|
||||
namespace FireflyIII\Models;
|
||||
|
||||
use FireflyIII\Casts\SeparateTimezoneCaster;
|
||||
use FireflyIII\Handlers\Observer\BudgetLimitObserver;
|
||||
use FireflyIII\Support\Models\ReturnsIntegerIdTrait;
|
||||
use Illuminate\Database\Eloquent\Attributes\ObservedBy;
|
||||
use Illuminate\Database\Eloquent\Casts\Attribute;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use Illuminate\Database\Eloquent\Relations\MorphMany;
|
||||
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
|
||||
|
||||
#[ObservedBy([BudgetLimitObserver::class])]
|
||||
class BudgetLimit extends Model
|
||||
{
|
||||
use ReturnsIntegerIdTrait;
|
||||
@@ -45,7 +48,7 @@ class BudgetLimit extends Model
|
||||
public static function routeBinder(string $value): self
|
||||
{
|
||||
if (auth()->check()) {
|
||||
$budgetLimitId = (int) $value;
|
||||
$budgetLimitId = (int)$value;
|
||||
$budgetLimit = self::where('budget_limits.id', $budgetLimitId)
|
||||
->leftJoin('budgets', 'budgets.id', '=', 'budget_limits.budget_id')
|
||||
->where('budgets.user_id', auth()->user()->id)
|
||||
@@ -83,21 +86,14 @@ class BudgetLimit extends Model
|
||||
protected function amount(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: static fn ($value) => (string) $value,
|
||||
get: static fn ($value) => (string)$value,
|
||||
);
|
||||
}
|
||||
|
||||
protected function budgetId(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: static fn ($value) => (int) $value,
|
||||
);
|
||||
}
|
||||
|
||||
protected function transactionCurrencyId(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: static fn ($value) => (int) $value,
|
||||
get: static fn ($value) => (int)$value,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -113,4 +109,11 @@ class BudgetLimit extends Model
|
||||
'native_amount' => 'string',
|
||||
];
|
||||
}
|
||||
|
||||
protected function transactionCurrencyId(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: static fn ($value) => (int)$value,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@@ -24,9 +24,11 @@ declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Models;
|
||||
|
||||
use FireflyIII\Handlers\Observer\CategoryObserver;
|
||||
use FireflyIII\Support\Models\ReturnsIntegerIdTrait;
|
||||
use FireflyIII\Support\Models\ReturnsIntegerUserIdTrait;
|
||||
use FireflyIII\User;
|
||||
use Illuminate\Database\Eloquent\Attributes\ObservedBy;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
|
||||
@@ -34,6 +36,7 @@ use Illuminate\Database\Eloquent\Relations\MorphMany;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
|
||||
|
||||
#[ObservedBy([CategoryObserver::class])]
|
||||
class Category extends Model
|
||||
{
|
||||
use ReturnsIntegerIdTrait;
|
||||
@@ -52,7 +55,7 @@ class Category extends Model
|
||||
public static function routeBinder(string $value): self
|
||||
{
|
||||
if (auth()->check()) {
|
||||
$categoryId = (int) $value;
|
||||
$categoryId = (int)$value;
|
||||
|
||||
/** @var User $user */
|
||||
$user = auth()->user();
|
||||
|
@@ -23,8 +23,8 @@ declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Casts\Attribute;
|
||||
use FireflyIII\Support\Models\ReturnsIntegerIdTrait;
|
||||
use Illuminate\Database\Eloquent\Casts\Attribute;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
|
||||
@@ -38,14 +38,6 @@ class Configuration extends Model
|
||||
|
||||
protected $table = 'configuration';
|
||||
|
||||
/**
|
||||
* TODO can be replaced with native laravel code.
|
||||
*/
|
||||
protected function data(): Attribute
|
||||
{
|
||||
return Attribute::make(get: fn ($value) => json_decode((string) $value), set: fn ($value) => ['data' => json_encode($value)]);
|
||||
}
|
||||
|
||||
protected function casts(): array
|
||||
{
|
||||
return [
|
||||
@@ -54,4 +46,12 @@ class Configuration extends Model
|
||||
'deleted_at' => 'datetime',
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* TODO can be replaced with native laravel code.
|
||||
*/
|
||||
protected function data(): Attribute
|
||||
{
|
||||
return Attribute::make(get: fn ($value) => json_decode((string)$value), set: fn ($value) => ['data' => json_encode($value)]);
|
||||
}
|
||||
}
|
||||
|
@@ -37,7 +37,8 @@ class CurrencyExchangeRate extends Model
|
||||
use ReturnsIntegerIdTrait;
|
||||
use ReturnsIntegerUserIdTrait;
|
||||
use SoftDeletes;
|
||||
protected $fillable = ['user_id', 'from_currency_id', 'to_currency_id', 'date', 'date_tz', 'rate'];
|
||||
|
||||
protected $fillable = ['user_id', 'user_group_id', 'from_currency_id', 'to_currency_id', 'date', 'date_tz', 'rate'];
|
||||
|
||||
public function fromCurrency(): BelongsTo
|
||||
{
|
||||
@@ -54,34 +55,6 @@ class CurrencyExchangeRate extends Model
|
||||
return $this->belongsTo(User::class);
|
||||
}
|
||||
|
||||
protected function fromCurrencyId(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: static fn ($value) => (int) $value,
|
||||
);
|
||||
}
|
||||
|
||||
protected function rate(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: static fn ($value) => (string) $value,
|
||||
);
|
||||
}
|
||||
|
||||
protected function toCurrencyId(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: static fn ($value) => (int) $value,
|
||||
);
|
||||
}
|
||||
|
||||
protected function userRate(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: static fn ($value) => (string) $value,
|
||||
);
|
||||
}
|
||||
|
||||
protected function casts(): array
|
||||
{
|
||||
return [
|
||||
@@ -96,4 +69,32 @@ class CurrencyExchangeRate extends Model
|
||||
'user_rate' => 'string',
|
||||
];
|
||||
}
|
||||
|
||||
protected function fromCurrencyId(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: static fn ($value) => (int)$value,
|
||||
);
|
||||
}
|
||||
|
||||
protected function rate(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: static fn ($value) => (string)$value,
|
||||
);
|
||||
}
|
||||
|
||||
protected function toCurrencyId(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: static fn ($value) => (int)$value,
|
||||
);
|
||||
}
|
||||
|
||||
protected function userRate(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: static fn ($value) => (string)$value,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@@ -53,13 +53,6 @@ class GroupMembership extends Model
|
||||
return $this->belongsTo(UserRole::class);
|
||||
}
|
||||
|
||||
protected function userRoleId(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: static fn ($value) => (int) $value,
|
||||
);
|
||||
}
|
||||
|
||||
protected function casts(): array
|
||||
{
|
||||
return [
|
||||
@@ -69,4 +62,11 @@ class GroupMembership extends Model
|
||||
'user_group_id' => 'integer',
|
||||
];
|
||||
}
|
||||
|
||||
protected function userRoleId(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: static fn ($value) => (int)$value,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@@ -36,6 +36,7 @@ class InvitedUser extends Model
|
||||
{
|
||||
use ReturnsIntegerIdTrait;
|
||||
use ReturnsIntegerUserIdTrait;
|
||||
|
||||
protected $fillable = ['user_group_id', 'user_id', 'email', 'invite_code', 'expires', 'expires_tz', 'redeemed'];
|
||||
|
||||
/**
|
||||
@@ -44,7 +45,7 @@ class InvitedUser extends Model
|
||||
public static function routeBinder(string $value): self
|
||||
{
|
||||
if (auth()->check()) {
|
||||
$attemptId = (int) $value;
|
||||
$attemptId = (int)$value;
|
||||
|
||||
/** @var null|InvitedUser $attempt */
|
||||
$attempt = self::find($attemptId);
|
||||
|
@@ -44,7 +44,7 @@ class LinkType extends Model
|
||||
public static function routeBinder(string $value): self
|
||||
{
|
||||
if (auth()->check()) {
|
||||
$linkTypeId = (int) $value;
|
||||
$linkTypeId = (int)$value;
|
||||
$linkType = self::find($linkTypeId);
|
||||
if (null !== $linkType) {
|
||||
return $linkType;
|
||||
|
@@ -66,13 +66,6 @@ class Location extends Model
|
||||
return $this->morphMany(TransactionJournal::class, 'locatable');
|
||||
}
|
||||
|
||||
protected function locatableId(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: static fn ($value) => (int) $value,
|
||||
);
|
||||
}
|
||||
|
||||
protected function casts(): array
|
||||
{
|
||||
return [
|
||||
@@ -84,4 +77,11 @@ class Location extends Model
|
||||
'longitude' => 'float',
|
||||
];
|
||||
}
|
||||
|
||||
protected function locatableId(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: static fn ($value) => (int)$value,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@@ -44,13 +44,6 @@ class Note extends Model
|
||||
return $this->morphTo();
|
||||
}
|
||||
|
||||
protected function noteableId(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: static fn ($value) => (int) $value,
|
||||
);
|
||||
}
|
||||
|
||||
protected function casts(): array
|
||||
{
|
||||
return [
|
||||
@@ -59,4 +52,11 @@ class Note extends Model
|
||||
'deleted_at' => 'datetime',
|
||||
];
|
||||
}
|
||||
|
||||
protected function noteableId(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: static fn ($value) => (int)$value,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@@ -37,6 +37,7 @@ class ObjectGroup extends Model
|
||||
{
|
||||
use ReturnsIntegerIdTrait;
|
||||
use ReturnsIntegerUserIdTrait;
|
||||
|
||||
protected $fillable = ['title', 'order', 'user_id', 'user_group_id'];
|
||||
|
||||
/**
|
||||
@@ -47,7 +48,7 @@ class ObjectGroup extends Model
|
||||
public static function routeBinder(string $value): self
|
||||
{
|
||||
if (auth()->check()) {
|
||||
$objectGroupId = (int) $value;
|
||||
$objectGroupId = (int)$value;
|
||||
|
||||
/** @var null|ObjectGroup $objectGroup */
|
||||
$objectGroup = self::where('object_groups.id', $objectGroupId)
|
||||
@@ -90,13 +91,6 @@ class ObjectGroup extends Model
|
||||
return $this->morphedByMany(PiggyBank::class, 'object_groupable');
|
||||
}
|
||||
|
||||
protected function order(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: static fn ($value) => (int) $value,
|
||||
);
|
||||
}
|
||||
|
||||
protected function casts(): array
|
||||
{
|
||||
return [
|
||||
@@ -107,4 +101,11 @@ class ObjectGroup extends Model
|
||||
'deleted_at' => 'datetime',
|
||||
];
|
||||
}
|
||||
|
||||
protected function order(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: static fn ($value) => (int)$value,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@@ -23,7 +23,9 @@ declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Models;
|
||||
|
||||
use FireflyIII\Handlers\Observer\PiggyBankObserver;
|
||||
use FireflyIII\Support\Models\ReturnsIntegerIdTrait;
|
||||
use Illuminate\Database\Eloquent\Attributes\ObservedBy;
|
||||
use Illuminate\Database\Eloquent\Casts\Attribute;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
@@ -34,6 +36,7 @@ use Illuminate\Database\Eloquent\Relations\MorphToMany;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
|
||||
|
||||
#[ObservedBy([PiggyBankObserver::class])]
|
||||
class PiggyBank extends Model
|
||||
{
|
||||
use ReturnsIntegerIdTrait;
|
||||
@@ -49,7 +52,7 @@ class PiggyBank extends Model
|
||||
public static function routeBinder(string $value): self
|
||||
{
|
||||
if (auth()->check()) {
|
||||
$piggyBankId = (int) $value;
|
||||
$piggyBankId = (int)$value;
|
||||
$piggyBank = self::where('piggy_banks.id', $piggyBankId)
|
||||
->leftJoin('account_piggy_bank', 'account_piggy_bank.piggy_bank_id', '=', 'piggy_banks.id')
|
||||
->leftJoin('accounts', 'accounts.id', '=', 'account_piggy_bank.account_id')
|
||||
@@ -109,7 +112,7 @@ class PiggyBank extends Model
|
||||
*/
|
||||
public function setTargetAmountAttribute($value): void
|
||||
{
|
||||
$this->attributes['target_amount'] = (string) $value;
|
||||
$this->attributes['target_amount'] = (string)$value;
|
||||
}
|
||||
|
||||
public function transactionCurrency(): BelongsTo
|
||||
@@ -120,24 +123,7 @@ class PiggyBank extends Model
|
||||
protected function accountId(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: static fn ($value) => (int) $value,
|
||||
);
|
||||
}
|
||||
|
||||
protected function order(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: static fn ($value) => (int) $value,
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the max amount
|
||||
*/
|
||||
protected function targetAmount(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: static fn ($value) => (string) $value,
|
||||
get: static fn ($value) => (int)$value,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -156,4 +142,21 @@ class PiggyBank extends Model
|
||||
'native_target_amount' => 'string',
|
||||
];
|
||||
}
|
||||
|
||||
protected function order(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: static fn ($value) => (int)$value,
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the max amount
|
||||
*/
|
||||
protected function targetAmount(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: static fn ($value) => (string)$value,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@@ -24,11 +24,14 @@ declare(strict_types=1);
|
||||
namespace FireflyIII\Models;
|
||||
|
||||
use FireflyIII\Casts\SeparateTimezoneCaster;
|
||||
use FireflyIII\Handlers\Observer\PiggyBankEventObserver;
|
||||
use FireflyIII\Support\Models\ReturnsIntegerIdTrait;
|
||||
use Illuminate\Database\Eloquent\Attributes\ObservedBy;
|
||||
use Illuminate\Database\Eloquent\Casts\Attribute;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
|
||||
#[ObservedBy([PiggyBankEventObserver::class])]
|
||||
class PiggyBankEvent extends Model
|
||||
{
|
||||
use ReturnsIntegerIdTrait;
|
||||
@@ -47,7 +50,7 @@ class PiggyBankEvent extends Model
|
||||
*/
|
||||
public function setAmountAttribute($value): void
|
||||
{
|
||||
$this->attributes['amount'] = (string) $value;
|
||||
$this->attributes['amount'] = (string)$value;
|
||||
}
|
||||
|
||||
public function transactionJournal(): BelongsTo
|
||||
@@ -61,14 +64,7 @@ class PiggyBankEvent extends Model
|
||||
protected function amount(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: static fn ($value) => (string) $value,
|
||||
);
|
||||
}
|
||||
|
||||
protected function piggyBankId(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: static fn ($value) => (int) $value,
|
||||
get: static fn ($value) => (string)$value,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -82,4 +78,11 @@ class PiggyBankEvent extends Model
|
||||
'native_amount' => 'string',
|
||||
];
|
||||
}
|
||||
|
||||
protected function piggyBankId(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: static fn ($value) => (int)$value,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@@ -23,10 +23,10 @@ declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Attributes\Scope;
|
||||
use Carbon\Carbon;
|
||||
use FireflyIII\Casts\SeparateTimezoneCaster;
|
||||
use FireflyIII\Support\Models\ReturnsIntegerIdTrait;
|
||||
use Illuminate\Database\Eloquent\Attributes\Scope;
|
||||
use Illuminate\Database\Eloquent\Builder as EloquentBuilder;
|
||||
use Illuminate\Database\Eloquent\Casts\Attribute;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
@@ -43,12 +43,48 @@ class PiggyBankRepetition extends Model
|
||||
return $this->belongsTo(PiggyBank::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param mixed $value
|
||||
*/
|
||||
public function setCurrentAmountAttribute($value): void
|
||||
{
|
||||
$this->attributes['current_amount'] = (string)$value;
|
||||
}
|
||||
|
||||
protected function casts(): array
|
||||
{
|
||||
return [
|
||||
'created_at' => 'datetime',
|
||||
'updated_at' => 'datetime',
|
||||
'start_date' => SeparateTimezoneCaster::class,
|
||||
'target_date' => SeparateTimezoneCaster::class,
|
||||
'virtual_balance' => 'string',
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the amount
|
||||
*/
|
||||
protected function currentAmount(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: static fn ($value) => (string)$value,
|
||||
);
|
||||
}
|
||||
|
||||
#[Scope]
|
||||
protected function onDates(EloquentBuilder $query, Carbon $start, Carbon $target): EloquentBuilder
|
||||
{
|
||||
return $query->where('start_date', $start->format('Y-m-d'))->where('target_date', $target->format('Y-m-d'));
|
||||
}
|
||||
|
||||
protected function piggyBankId(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: static fn ($value) => (int)$value,
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return EloquentBuilder
|
||||
*/
|
||||
@@ -69,40 +105,4 @@ class PiggyBankRepetition extends Model
|
||||
)
|
||||
;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param mixed $value
|
||||
*/
|
||||
public function setCurrentAmountAttribute($value): void
|
||||
{
|
||||
$this->attributes['current_amount'] = (string) $value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the amount
|
||||
*/
|
||||
protected function currentAmount(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: static fn ($value) => (string) $value,
|
||||
);
|
||||
}
|
||||
|
||||
protected function piggyBankId(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: static fn ($value) => (int) $value,
|
||||
);
|
||||
}
|
||||
|
||||
protected function casts(): array
|
||||
{
|
||||
return [
|
||||
'created_at' => 'datetime',
|
||||
'updated_at' => 'datetime',
|
||||
'start_date' => SeparateTimezoneCaster::class,
|
||||
'target_date' => SeparateTimezoneCaster::class,
|
||||
'virtual_balance' => 'string',
|
||||
];
|
||||
}
|
||||
}
|
||||
|
@@ -50,7 +50,7 @@ class Preference extends Model
|
||||
|
||||
// some preferences do not have an administration ID.
|
||||
// some need it, to make sure the correct one is selected.
|
||||
$userGroupId = (int) $user->user_group_id;
|
||||
$userGroupId = (int)$user->user_group_id;
|
||||
$userGroupId = 0 === $userGroupId ? null : $userGroupId;
|
||||
|
||||
/** @var null|Preference $preference */
|
||||
@@ -67,7 +67,7 @@ class Preference extends Model
|
||||
|
||||
// try again with ID, but this time don't care about the preferred user_group_id
|
||||
if (null === $preference) {
|
||||
$preference = $user->preferences()->where('id', (int) $value)->first();
|
||||
$preference = $user->preferences()->where('id', (int)$value)->first();
|
||||
}
|
||||
if (null !== $preference) {
|
||||
/** @var Preference $preference */
|
||||
@@ -78,7 +78,7 @@ class Preference extends Model
|
||||
$preference = new self();
|
||||
$preference->name = $value;
|
||||
$preference->data = $default[$value];
|
||||
$preference->user_id = (int) $user->id;
|
||||
$preference->user_id = (int)$user->id;
|
||||
$preference->user_group_id = in_array($value, $items, true) ? $userGroupId : null;
|
||||
$preference->save();
|
||||
|
||||
|
@@ -25,9 +25,11 @@ declare(strict_types=1);
|
||||
namespace FireflyIII\Models;
|
||||
|
||||
use FireflyIII\Casts\SeparateTimezoneCaster;
|
||||
use FireflyIII\Handlers\Observer\RecurrenceObserver;
|
||||
use FireflyIII\Support\Models\ReturnsIntegerIdTrait;
|
||||
use FireflyIII\Support\Models\ReturnsIntegerUserIdTrait;
|
||||
use FireflyIII\User;
|
||||
use Illuminate\Database\Eloquent\Attributes\ObservedBy;
|
||||
use Illuminate\Database\Eloquent\Casts\Attribute;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
@@ -36,6 +38,7 @@ use Illuminate\Database\Eloquent\Relations\MorphMany;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
|
||||
|
||||
#[ObservedBy([RecurrenceObserver::class])]
|
||||
class Recurrence extends Model
|
||||
{
|
||||
use ReturnsIntegerIdTrait;
|
||||
@@ -55,7 +58,7 @@ class Recurrence extends Model
|
||||
public static function routeBinder(string $value): self
|
||||
{
|
||||
if (auth()->check()) {
|
||||
$recurrenceId = (int) $value;
|
||||
$recurrenceId = (int)$value;
|
||||
|
||||
/** @var User $user */
|
||||
$user = auth()->user();
|
||||
@@ -113,13 +116,6 @@ class Recurrence extends Model
|
||||
return $this->belongsTo(TransactionType::class);
|
||||
}
|
||||
|
||||
protected function transactionTypeId(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: static fn ($value) => (int) $value,
|
||||
);
|
||||
}
|
||||
|
||||
protected function casts(): array
|
||||
{
|
||||
return [
|
||||
@@ -139,4 +135,11 @@ class Recurrence extends Model
|
||||
'user_group_id' => 'integer',
|
||||
];
|
||||
}
|
||||
|
||||
protected function transactionTypeId(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: static fn ($value) => (int)$value,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@@ -44,13 +44,6 @@ class RecurrenceMeta extends Model
|
||||
return $this->belongsTo(Recurrence::class);
|
||||
}
|
||||
|
||||
protected function recurrenceId(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: static fn ($value) => (int) $value,
|
||||
);
|
||||
}
|
||||
|
||||
protected function casts(): array
|
||||
{
|
||||
return [
|
||||
@@ -61,4 +54,11 @@ class RecurrenceMeta extends Model
|
||||
'value' => 'string',
|
||||
];
|
||||
}
|
||||
|
||||
protected function recurrenceId(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: static fn ($value) => (int)$value,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@@ -36,16 +36,20 @@ class RecurrenceRepetition extends Model
|
||||
use ReturnsIntegerIdTrait;
|
||||
use SoftDeletes;
|
||||
|
||||
#[Deprecated] /** @deprecated */
|
||||
#[Deprecated]
|
||||
/** @deprecated */
|
||||
public const int WEEKEND_DO_NOTHING = 1;
|
||||
|
||||
#[Deprecated] /** @deprecated */
|
||||
#[Deprecated]
|
||||
/** @deprecated */
|
||||
public const int WEEKEND_SKIP_CREATION = 2;
|
||||
|
||||
#[Deprecated] /** @deprecated */
|
||||
#[Deprecated]
|
||||
/** @deprecated */
|
||||
public const int WEEKEND_TO_FRIDAY = 3;
|
||||
|
||||
#[Deprecated] /** @deprecated */
|
||||
#[Deprecated]
|
||||
/** @deprecated */
|
||||
public const int WEEKEND_TO_MONDAY = 4;
|
||||
|
||||
protected $casts
|
||||
@@ -78,21 +82,21 @@ class RecurrenceRepetition extends Model
|
||||
protected function recurrenceId(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: static fn ($value) => (int) $value,
|
||||
get: static fn ($value) => (int)$value,
|
||||
);
|
||||
}
|
||||
|
||||
protected function repetitionSkip(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: static fn ($value) => (int) $value,
|
||||
get: static fn ($value) => (int)$value,
|
||||
);
|
||||
}
|
||||
|
||||
protected function weekend(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: static fn ($value) => (int) $value,
|
||||
get: static fn ($value) => (int)$value,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@@ -24,13 +24,16 @@ declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Models;
|
||||
|
||||
use FireflyIII\Handlers\Observer\RecurrenceTransactionObserver;
|
||||
use FireflyIII\Support\Models\ReturnsIntegerIdTrait;
|
||||
use Illuminate\Database\Eloquent\Attributes\ObservedBy;
|
||||
use Illuminate\Database\Eloquent\Casts\Attribute;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
|
||||
#[ObservedBy([RecurrenceTransactionObserver::class])]
|
||||
class RecurrenceTransaction extends Model
|
||||
{
|
||||
use ReturnsIntegerIdTrait;
|
||||
@@ -88,49 +91,7 @@ class RecurrenceTransaction extends Model
|
||||
protected function amount(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: static fn ($value) => (string) $value,
|
||||
);
|
||||
}
|
||||
|
||||
protected function destinationId(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: static fn ($value) => (int) $value,
|
||||
);
|
||||
}
|
||||
|
||||
protected function foreignAmount(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: static fn ($value) => (string) $value,
|
||||
);
|
||||
}
|
||||
|
||||
protected function recurrenceId(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: static fn ($value) => (int) $value,
|
||||
);
|
||||
}
|
||||
|
||||
protected function sourceId(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: static fn ($value) => (int) $value,
|
||||
);
|
||||
}
|
||||
|
||||
protected function transactionCurrencyId(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: static fn ($value) => (int) $value,
|
||||
);
|
||||
}
|
||||
|
||||
protected function userId(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: static fn ($value) => (int) $value,
|
||||
get: static fn ($value) => (string)$value,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -145,4 +106,46 @@ class RecurrenceTransaction extends Model
|
||||
'description' => 'string',
|
||||
];
|
||||
}
|
||||
|
||||
protected function destinationId(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: static fn ($value) => (int)$value,
|
||||
);
|
||||
}
|
||||
|
||||
protected function foreignAmount(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: static fn ($value) => (string)$value,
|
||||
);
|
||||
}
|
||||
|
||||
protected function recurrenceId(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: static fn ($value) => (int)$value,
|
||||
);
|
||||
}
|
||||
|
||||
protected function sourceId(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: static fn ($value) => (int)$value,
|
||||
);
|
||||
}
|
||||
|
||||
protected function transactionCurrencyId(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: static fn ($value) => (int)$value,
|
||||
);
|
||||
}
|
||||
|
||||
protected function userId(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: static fn ($value) => (int)$value,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@@ -44,13 +44,6 @@ class RecurrenceTransactionMeta extends Model
|
||||
return $this->belongsTo(RecurrenceTransaction::class, 'rt_id');
|
||||
}
|
||||
|
||||
protected function rtId(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: static fn ($value) => (int) $value,
|
||||
);
|
||||
}
|
||||
|
||||
protected function casts(): array
|
||||
{
|
||||
return [
|
||||
@@ -61,4 +54,11 @@ class RecurrenceTransactionMeta extends Model
|
||||
'value' => 'string',
|
||||
];
|
||||
}
|
||||
|
||||
protected function rtId(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: static fn ($value) => (int)$value,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@@ -23,9 +23,11 @@ declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Models;
|
||||
|
||||
use FireflyIII\Handlers\Observer\RuleObserver;
|
||||
use FireflyIII\Support\Models\ReturnsIntegerIdTrait;
|
||||
use FireflyIII\Support\Models\ReturnsIntegerUserIdTrait;
|
||||
use FireflyIII\User;
|
||||
use Illuminate\Database\Eloquent\Attributes\ObservedBy;
|
||||
use Illuminate\Database\Eloquent\Casts\Attribute;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
@@ -33,6 +35,7 @@ use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
|
||||
|
||||
#[ObservedBy([RuleObserver::class])]
|
||||
class Rule extends Model
|
||||
{
|
||||
use ReturnsIntegerIdTrait;
|
||||
@@ -49,7 +52,7 @@ class Rule extends Model
|
||||
public static function routeBinder(string $value): self
|
||||
{
|
||||
if (auth()->check()) {
|
||||
$ruleId = (int) $value;
|
||||
$ruleId = (int)$value;
|
||||
|
||||
/** @var User $user */
|
||||
$user = auth()->user();
|
||||
@@ -84,30 +87,11 @@ class Rule extends Model
|
||||
return $this->hasMany(RuleTrigger::class);
|
||||
}
|
||||
|
||||
protected function description(): Attribute
|
||||
{
|
||||
return Attribute::make(set: fn ($value) => ['description' => e($value)]);
|
||||
}
|
||||
|
||||
public function userGroup(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(UserGroup::class);
|
||||
}
|
||||
|
||||
protected function order(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: static fn ($value) => (int) $value,
|
||||
);
|
||||
}
|
||||
|
||||
protected function ruleGroupId(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: static fn ($value) => (int) $value,
|
||||
);
|
||||
}
|
||||
|
||||
protected function casts(): array
|
||||
{
|
||||
return [
|
||||
@@ -123,4 +107,23 @@ class Rule extends Model
|
||||
'user_group_id' => 'integer',
|
||||
];
|
||||
}
|
||||
|
||||
protected function description(): Attribute
|
||||
{
|
||||
return Attribute::make(set: fn ($value) => ['description' => e($value)]);
|
||||
}
|
||||
|
||||
protected function order(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: static fn ($value) => (int)$value,
|
||||
);
|
||||
}
|
||||
|
||||
protected function ruleGroupId(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: static fn ($value) => (int)$value,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@@ -42,7 +42,7 @@ class RuleAction extends Model
|
||||
if (false === config('firefly.feature_flags.expression_engine')) {
|
||||
Log::debug('Expression engine is disabled, returning action value as string.');
|
||||
|
||||
return (string) $this->action_value;
|
||||
return (string)$this->action_value;
|
||||
}
|
||||
if (true === config('firefly.feature_flags.expression_engine') && str_starts_with($this->action_value, '\=')) {
|
||||
// return literal string.
|
||||
@@ -54,7 +54,7 @@ class RuleAction extends Model
|
||||
$result = $expr->evaluate($journal);
|
||||
} catch (SyntaxError $e) {
|
||||
Log::error(sprintf('Expression engine failed to evaluate expression "%s" with error "%s".', $this->action_value, $e->getMessage()));
|
||||
$result = (string) $this->action_value;
|
||||
$result = (string)$this->action_value;
|
||||
}
|
||||
Log::debug(sprintf('Expression engine is enabled, result of expression "%s" is "%s".', $this->action_value, $result));
|
||||
|
||||
@@ -66,20 +66,6 @@ class RuleAction extends Model
|
||||
return $this->belongsTo(Rule::class);
|
||||
}
|
||||
|
||||
protected function order(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: static fn ($value) => (int) $value,
|
||||
);
|
||||
}
|
||||
|
||||
protected function ruleId(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: static fn ($value) => (int) $value,
|
||||
);
|
||||
}
|
||||
|
||||
protected function casts(): array
|
||||
{
|
||||
return [
|
||||
@@ -90,4 +76,18 @@ class RuleAction extends Model
|
||||
'stop_processing' => 'boolean',
|
||||
];
|
||||
}
|
||||
|
||||
protected function order(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: static fn ($value) => (int)$value,
|
||||
);
|
||||
}
|
||||
|
||||
protected function ruleId(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: static fn ($value) => (int)$value,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@@ -23,9 +23,11 @@ declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Models;
|
||||
|
||||
use FireflyIII\Handlers\Observer\RuleGroupObserver;
|
||||
use FireflyIII\Support\Models\ReturnsIntegerIdTrait;
|
||||
use FireflyIII\Support\Models\ReturnsIntegerUserIdTrait;
|
||||
use FireflyIII\User;
|
||||
use Illuminate\Database\Eloquent\Attributes\ObservedBy;
|
||||
use Illuminate\Database\Eloquent\Casts\Attribute;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
@@ -33,6 +35,7 @@ use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
|
||||
|
||||
#[ObservedBy([RuleGroupObserver::class])]
|
||||
class RuleGroup extends Model
|
||||
{
|
||||
use ReturnsIntegerIdTrait;
|
||||
@@ -49,7 +52,7 @@ class RuleGroup extends Model
|
||||
public static function routeBinder(string $value): self
|
||||
{
|
||||
if (auth()->check()) {
|
||||
$ruleGroupId = (int) $value;
|
||||
$ruleGroupId = (int)$value;
|
||||
|
||||
/** @var User $user */
|
||||
$user = auth()->user();
|
||||
@@ -74,13 +77,6 @@ class RuleGroup extends Model
|
||||
return $this->hasMany(Rule::class);
|
||||
}
|
||||
|
||||
protected function order(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: static fn ($value) => (int) $value,
|
||||
);
|
||||
}
|
||||
|
||||
protected function casts(): array
|
||||
{
|
||||
return [
|
||||
@@ -94,4 +90,11 @@ class RuleGroup extends Model
|
||||
'user_group_id' => 'integer',
|
||||
];
|
||||
}
|
||||
|
||||
protected function order(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: static fn ($value) => (int)$value,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@@ -39,20 +39,6 @@ class RuleTrigger extends Model
|
||||
return $this->belongsTo(Rule::class);
|
||||
}
|
||||
|
||||
protected function order(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: static fn ($value) => (int) $value,
|
||||
);
|
||||
}
|
||||
|
||||
protected function ruleId(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: static fn ($value) => (int) $value,
|
||||
);
|
||||
}
|
||||
|
||||
protected function casts(): array
|
||||
{
|
||||
return [
|
||||
@@ -63,4 +49,18 @@ class RuleTrigger extends Model
|
||||
'stop_processing' => 'boolean',
|
||||
];
|
||||
}
|
||||
|
||||
protected function order(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: static fn ($value) => (int)$value,
|
||||
);
|
||||
}
|
||||
|
||||
protected function ruleId(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: static fn ($value) => (int)$value,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@@ -24,9 +24,11 @@ declare(strict_types=1);
|
||||
namespace FireflyIII\Models;
|
||||
|
||||
use FireflyIII\Casts\SeparateTimezoneCaster;
|
||||
use FireflyIII\Handlers\Observer\TagObserver;
|
||||
use FireflyIII\Support\Models\ReturnsIntegerIdTrait;
|
||||
use FireflyIII\Support\Models\ReturnsIntegerUserIdTrait;
|
||||
use FireflyIII\User;
|
||||
use Illuminate\Database\Eloquent\Attributes\ObservedBy;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
|
||||
@@ -34,6 +36,7 @@ use Illuminate\Database\Eloquent\Relations\MorphMany;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
|
||||
|
||||
#[ObservedBy([TagObserver::class])]
|
||||
class Tag extends Model
|
||||
{
|
||||
use ReturnsIntegerIdTrait;
|
||||
@@ -42,7 +45,7 @@ class Tag extends Model
|
||||
|
||||
protected $fillable = ['user_id', 'user_group_id', 'tag', 'date', 'date_tz', 'description', 'tag_mode'];
|
||||
|
||||
protected $hidden = ['zoomLevel', 'latitude', 'longitude'];
|
||||
protected $hidden = ['zoomLevel', 'zoom_level', 'latitude', 'longitude'];
|
||||
|
||||
/**
|
||||
* Route binder. Converts the key in the URL to the specified object (or throw 404).
|
||||
@@ -52,7 +55,7 @@ class Tag extends Model
|
||||
public static function routeBinder(string $value): self
|
||||
{
|
||||
if (auth()->check()) {
|
||||
$tagId = (int) $value;
|
||||
$tagId = (int)$value;
|
||||
|
||||
/** @var User $user */
|
||||
$user = auth()->user();
|
||||
|
@@ -23,9 +23,11 @@ declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Attributes\Scope;
|
||||
use Carbon\Carbon;
|
||||
use FireflyIII\Handlers\Observer\TransactionObserver;
|
||||
use FireflyIII\Support\Models\ReturnsIntegerIdTrait;
|
||||
use Illuminate\Database\Eloquent\Attributes\ObservedBy;
|
||||
use Illuminate\Database\Eloquent\Attributes\Scope;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
use Illuminate\Database\Eloquent\Casts\Attribute;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
@@ -34,6 +36,7 @@ use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
|
||||
#[ObservedBy([TransactionObserver::class])]
|
||||
class Transaction extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
@@ -89,6 +92,31 @@ class Transaction extends Model
|
||||
return $this->belongsTo(TransactionCurrency::class, 'foreign_currency_id');
|
||||
}
|
||||
|
||||
/**
|
||||
* @param mixed $value
|
||||
*/
|
||||
public function setAmountAttribute($value): void
|
||||
{
|
||||
$this->attributes['amount'] = (string)$value;
|
||||
}
|
||||
|
||||
public function transactionCurrency(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(TransactionCurrency::class);
|
||||
}
|
||||
|
||||
public function transactionJournal(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(TransactionJournal::class);
|
||||
}
|
||||
|
||||
protected function accountId(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: static fn ($value) => (int)$value,
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Check for transactions AFTER a specified date.
|
||||
*/
|
||||
@@ -117,6 +145,23 @@ class Transaction extends Model
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the amount
|
||||
*/
|
||||
protected function amount(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: static fn ($value) => (string)$value,
|
||||
);
|
||||
}
|
||||
|
||||
protected function balanceDirty(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: static fn ($value) => 1 === (int)$value,
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Check for transactions BEFORE the specified date.
|
||||
*/
|
||||
@@ -129,78 +174,6 @@ class Transaction extends Model
|
||||
$query->where('transaction_journals.date', '<=', $date->format('Y-m-d 23:59:59'));
|
||||
}
|
||||
|
||||
#[Scope]
|
||||
protected function transactionTypes(Builder $query, array $types): void
|
||||
{
|
||||
if (!self::isJoined($query, 'transaction_journals')) {
|
||||
$query->leftJoin('transaction_journals', 'transaction_journals.id', '=', 'transactions.transaction_journal_id');
|
||||
}
|
||||
|
||||
if (!self::isJoined($query, 'transaction_types')) {
|
||||
$query->leftJoin('transaction_types', 'transaction_types.id', '=', 'transaction_journals.transaction_type_id');
|
||||
}
|
||||
$query->whereIn('transaction_types.type', $types);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param mixed $value
|
||||
*/
|
||||
public function setAmountAttribute($value): void
|
||||
{
|
||||
$this->attributes['amount'] = (string) $value;
|
||||
}
|
||||
|
||||
public function transactionCurrency(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(TransactionCurrency::class);
|
||||
}
|
||||
|
||||
public function transactionJournal(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(TransactionJournal::class);
|
||||
}
|
||||
|
||||
protected function accountId(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: static fn ($value) => (int) $value,
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the amount
|
||||
*/
|
||||
protected function amount(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: static fn ($value) => (string) $value,
|
||||
);
|
||||
}
|
||||
|
||||
protected function balanceDirty(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: static fn ($value) => 1 === (int) $value,
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the foreign amount
|
||||
*/
|
||||
protected function foreignAmount(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: static fn ($value) => (string) $value,
|
||||
);
|
||||
}
|
||||
|
||||
protected function transactionJournalId(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: static fn ($value) => (int) $value,
|
||||
);
|
||||
}
|
||||
|
||||
protected function casts(): array
|
||||
{
|
||||
return [
|
||||
@@ -221,4 +194,34 @@ class Transaction extends Model
|
||||
'native_foreign_amount' => 'string',
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the foreign amount
|
||||
*/
|
||||
protected function foreignAmount(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: static fn ($value) => (string)$value,
|
||||
);
|
||||
}
|
||||
|
||||
protected function transactionJournalId(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: static fn ($value) => (int)$value,
|
||||
);
|
||||
}
|
||||
|
||||
#[Scope]
|
||||
protected function transactionTypes(Builder $query, array $types): void
|
||||
{
|
||||
if (!self::isJoined($query, 'transaction_journals')) {
|
||||
$query->leftJoin('transaction_journals', 'transaction_journals.id', '=', 'transactions.transaction_journal_id');
|
||||
}
|
||||
|
||||
if (!self::isJoined($query, 'transaction_types')) {
|
||||
$query->leftJoin('transaction_types', 'transaction_types.id', '=', 'transaction_journals.transaction_type_id');
|
||||
}
|
||||
$query->whereIn('transaction_types.type', $types);
|
||||
}
|
||||
}
|
||||
|
@@ -50,7 +50,7 @@ class TransactionCurrency extends Model
|
||||
public static function routeBinder(string $value): self
|
||||
{
|
||||
if (auth()->check()) {
|
||||
$currencyId = (int) $value;
|
||||
$currencyId = (int)$value;
|
||||
$currency = self::find($currencyId);
|
||||
if (null !== $currency) {
|
||||
$currency->refreshForUser(auth()->user());
|
||||
@@ -101,13 +101,6 @@ class TransactionCurrency extends Model
|
||||
return $this->belongsToMany(User::class)->withTimestamps()->withPivot('user_default');
|
||||
}
|
||||
|
||||
protected function decimalPlaces(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: static fn ($value) => (int) $value,
|
||||
);
|
||||
}
|
||||
|
||||
protected function casts(): array
|
||||
{
|
||||
return [
|
||||
@@ -118,4 +111,11 @@ class TransactionCurrency extends Model
|
||||
'enabled' => 'bool',
|
||||
];
|
||||
}
|
||||
|
||||
protected function decimalPlaces(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: static fn ($value) => (int)$value,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@@ -23,15 +23,18 @@ declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Models;
|
||||
|
||||
use FireflyIII\Handlers\Observer\TransactionGroupObserver;
|
||||
use FireflyIII\Support\Models\ReturnsIntegerIdTrait;
|
||||
use FireflyIII\Support\Models\ReturnsIntegerUserIdTrait;
|
||||
use FireflyIII\User;
|
||||
use Illuminate\Database\Eloquent\Attributes\ObservedBy;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
|
||||
|
||||
#[ObservedBy([TransactionGroupObserver::class])]
|
||||
class TransactionGroup extends Model
|
||||
{
|
||||
use ReturnsIntegerIdTrait;
|
||||
@@ -49,7 +52,7 @@ class TransactionGroup extends Model
|
||||
{
|
||||
app('log')->debug(sprintf('Now in %s("%s")', __METHOD__, $value));
|
||||
if (auth()->check()) {
|
||||
$groupId = (int) $value;
|
||||
$groupId = (int)$value;
|
||||
|
||||
/** @var User $user */
|
||||
$user = auth()->user();
|
||||
|
@@ -23,13 +23,15 @@ declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Attributes\Scope;
|
||||
use Carbon\Carbon;
|
||||
use FireflyIII\Casts\SeparateTimezoneCaster;
|
||||
use FireflyIII\Enums\TransactionTypeEnum;
|
||||
use FireflyIII\Handlers\Observer\TransactionJournalObserver;
|
||||
use FireflyIII\Support\Models\ReturnsIntegerIdTrait;
|
||||
use FireflyIII\Support\Models\ReturnsIntegerUserIdTrait;
|
||||
use FireflyIII\User;
|
||||
use Illuminate\Database\Eloquent\Attributes\ObservedBy;
|
||||
use Illuminate\Database\Eloquent\Attributes\Scope;
|
||||
use Illuminate\Database\Eloquent\Builder as EloquentBuilder;
|
||||
use Illuminate\Database\Eloquent\Casts\Attribute;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
@@ -46,6 +48,7 @@ use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
|
||||
* @method EloquentBuilder|static after()
|
||||
* @method static EloquentBuilder|static query()
|
||||
*/
|
||||
#[ObservedBy([TransactionJournalObserver::class])]
|
||||
class TransactionJournal extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
@@ -78,7 +81,7 @@ class TransactionJournal extends Model
|
||||
public static function routeBinder(string $value): self
|
||||
{
|
||||
if (auth()->check()) {
|
||||
$journalId = (int) $value;
|
||||
$journalId = (int)$value;
|
||||
|
||||
/** @var User $user */
|
||||
$user = auth()->user();
|
||||
@@ -165,32 +168,6 @@ class TransactionJournal extends Model
|
||||
return $query->where('transaction_journals.date', '<=', $date->format('Y-m-d H:i:s'));
|
||||
}
|
||||
|
||||
#[Scope]
|
||||
protected function transactionTypes(EloquentBuilder $query, array $types): void
|
||||
{
|
||||
if (!self::isJoined($query, 'transaction_types')) {
|
||||
$query->leftJoin('transaction_types', 'transaction_types.id', '=', 'transaction_journals.transaction_type_id');
|
||||
}
|
||||
if (0 !== count($types)) {
|
||||
$query->whereIn('transaction_types.type', $types);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if tables are joined.
|
||||
*/
|
||||
public static function isJoined(EloquentBuilder $query, string $table): bool
|
||||
{
|
||||
$joins = $query->getQuery()->joins;
|
||||
foreach ($joins as $join) {
|
||||
if ($join->table === $table) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public function sourceJournalLinks(): HasMany
|
||||
{
|
||||
return $this->hasMany(TransactionJournalLink::class, 'source_id');
|
||||
@@ -231,20 +208,6 @@ class TransactionJournal extends Model
|
||||
return $this->belongsTo(UserGroup::class);
|
||||
}
|
||||
|
||||
protected function order(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: static fn ($value) => (int) $value,
|
||||
);
|
||||
}
|
||||
|
||||
protected function transactionTypeId(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: static fn ($value) => (int) $value,
|
||||
);
|
||||
}
|
||||
|
||||
protected function casts(): array
|
||||
{
|
||||
return [
|
||||
@@ -263,4 +226,44 @@ class TransactionJournal extends Model
|
||||
'user_group_id' => 'integer',
|
||||
];
|
||||
}
|
||||
|
||||
protected function order(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: static fn ($value) => (int)$value,
|
||||
);
|
||||
}
|
||||
|
||||
protected function transactionTypeId(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: static fn ($value) => (int)$value,
|
||||
);
|
||||
}
|
||||
|
||||
#[Scope]
|
||||
protected function transactionTypes(EloquentBuilder $query, array $types): void
|
||||
{
|
||||
if (!self::isJoined($query, 'transaction_types')) {
|
||||
$query->leftJoin('transaction_types', 'transaction_types.id', '=', 'transaction_journals.transaction_type_id');
|
||||
}
|
||||
if (0 !== count($types)) {
|
||||
$query->whereIn('transaction_types.type', $types);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if tables are joined.
|
||||
*/
|
||||
public static function isJoined(EloquentBuilder $query, string $table): bool
|
||||
{
|
||||
$joins = $query->getQuery()->joins;
|
||||
foreach ($joins as $join) {
|
||||
if ($join->table === $table) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@@ -44,7 +44,7 @@ class TransactionJournalLink extends Model
|
||||
public static function routeBinder(string $value): self
|
||||
{
|
||||
if (auth()->check()) {
|
||||
$linkId = (int) $value;
|
||||
$linkId = (int)$value;
|
||||
$link = self::where('journal_links.id', $linkId)
|
||||
->leftJoin('transaction_journals as t_a', 't_a.id', '=', 'source_id')
|
||||
->leftJoin('transaction_journals as t_b', 't_b.id', '=', 'destination_id')
|
||||
@@ -83,27 +83,6 @@ class TransactionJournalLink extends Model
|
||||
return $this->belongsTo(TransactionJournal::class, 'source_id');
|
||||
}
|
||||
|
||||
protected function destinationId(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: static fn ($value) => (int) $value,
|
||||
);
|
||||
}
|
||||
|
||||
protected function linkTypeId(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: static fn ($value) => (int) $value,
|
||||
);
|
||||
}
|
||||
|
||||
protected function sourceId(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: static fn ($value) => (int) $value,
|
||||
);
|
||||
}
|
||||
|
||||
protected function casts(): array
|
||||
{
|
||||
return [
|
||||
@@ -111,4 +90,25 @@ class TransactionJournalLink extends Model
|
||||
'updated_at' => 'datetime',
|
||||
];
|
||||
}
|
||||
|
||||
protected function destinationId(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: static fn ($value) => (int)$value,
|
||||
);
|
||||
}
|
||||
|
||||
protected function linkTypeId(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: static fn ($value) => (int)$value,
|
||||
);
|
||||
}
|
||||
|
||||
protected function sourceId(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: static fn ($value) => (int)$value,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@@ -41,27 +41,11 @@ class TransactionJournalMeta extends Model
|
||||
|
||||
protected $table = 'journal_meta';
|
||||
|
||||
protected function data(): Attribute
|
||||
{
|
||||
return Attribute::make(get: fn ($value) => json_decode((string) $value, false), set: function ($value) {
|
||||
$data = json_encode($value);
|
||||
|
||||
return ['data' => $data, 'hash' => hash('sha256', $data)];
|
||||
});
|
||||
}
|
||||
|
||||
public function transactionJournal(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(TransactionJournal::class);
|
||||
}
|
||||
|
||||
protected function transactionJournalId(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: static fn ($value) => (int) $value,
|
||||
);
|
||||
}
|
||||
|
||||
protected function casts(): array
|
||||
{
|
||||
return [
|
||||
@@ -70,4 +54,20 @@ class TransactionJournalMeta extends Model
|
||||
'deleted_at' => 'datetime',
|
||||
];
|
||||
}
|
||||
|
||||
protected function data(): Attribute
|
||||
{
|
||||
return Attribute::make(get: fn ($value) => json_decode((string)$value, false), set: function ($value) {
|
||||
$data = json_encode($value);
|
||||
|
||||
return ['data' => $data, 'hash' => hash('sha256', $data)];
|
||||
});
|
||||
}
|
||||
|
||||
protected function transactionJournalId(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: static fn ($value) => (int)$value,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@@ -36,25 +36,32 @@ class TransactionType extends Model
|
||||
use ReturnsIntegerIdTrait;
|
||||
use SoftDeletes;
|
||||
|
||||
#[Deprecated] /** @deprecated */
|
||||
#[Deprecated]
|
||||
/** @deprecated */
|
||||
public const string DEPOSIT = 'Deposit';
|
||||
|
||||
#[Deprecated] /** @deprecated */
|
||||
#[Deprecated]
|
||||
/** @deprecated */
|
||||
public const string INVALID = 'Invalid';
|
||||
|
||||
#[Deprecated] /** @deprecated */
|
||||
#[Deprecated]
|
||||
/** @deprecated */
|
||||
public const string LIABILITY_CREDIT = 'Liability credit';
|
||||
|
||||
#[Deprecated] /** @deprecated */
|
||||
#[Deprecated]
|
||||
/** @deprecated */
|
||||
public const string OPENING_BALANCE = 'Opening balance';
|
||||
|
||||
#[Deprecated] /** @deprecated */
|
||||
#[Deprecated]
|
||||
/** @deprecated */
|
||||
public const string RECONCILIATION = 'Reconciliation';
|
||||
|
||||
#[Deprecated] /** @deprecated */
|
||||
#[Deprecated]
|
||||
/** @deprecated */
|
||||
public const string TRANSFER = 'Transfer';
|
||||
|
||||
#[Deprecated] /** @deprecated */
|
||||
#[Deprecated]
|
||||
/** @deprecated */
|
||||
public const string WITHDRAWAL = 'Withdrawal';
|
||||
|
||||
protected $casts
|
||||
|
@@ -47,7 +47,7 @@ class UserGroup extends Model
|
||||
public static function routeBinder(string $value): self
|
||||
{
|
||||
if (auth()->check()) {
|
||||
$userGroupId = (int) $value;
|
||||
$userGroupId = (int)$value;
|
||||
|
||||
/** @var User $user */
|
||||
$user = auth()->user();
|
||||
|
@@ -27,9 +27,11 @@ namespace FireflyIII\Models;
|
||||
use FireflyIII\Enums\WebhookDelivery as WebhookDeliveryEnum;
|
||||
use FireflyIII\Enums\WebhookResponse as WebhookResponseEnum;
|
||||
use FireflyIII\Enums\WebhookTrigger as WebhookTriggerEnum;
|
||||
use FireflyIII\Handlers\Observer\WebhookObserver;
|
||||
use FireflyIII\Support\Models\ReturnsIntegerIdTrait;
|
||||
use FireflyIII\Support\Models\ReturnsIntegerUserIdTrait;
|
||||
use FireflyIII\User;
|
||||
use Illuminate\Database\Eloquent\Attributes\ObservedBy;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
|
||||
@@ -37,6 +39,7 @@ use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
|
||||
|
||||
#[ObservedBy([WebhookObserver::class])]
|
||||
class Webhook extends Model
|
||||
{
|
||||
use ReturnsIntegerIdTrait;
|
||||
@@ -151,16 +154,16 @@ class Webhook extends Model
|
||||
return $this->belongsTo(User::class);
|
||||
}
|
||||
|
||||
public function webhookMessages(): HasMany
|
||||
{
|
||||
return $this->hasMany(WebhookMessage::class);
|
||||
}
|
||||
|
||||
public function webhookDeliveries(): BelongsToMany
|
||||
{
|
||||
return $this->belongsToMany(WebhookDelivery::class);
|
||||
}
|
||||
|
||||
public function webhookMessages(): HasMany
|
||||
{
|
||||
return $this->hasMany(WebhookMessage::class);
|
||||
}
|
||||
|
||||
public function webhookResponses(): BelongsToMany
|
||||
{
|
||||
return $this->belongsToMany(WebhookResponse::class);
|
||||
|
@@ -45,7 +45,7 @@ class WebhookAttempt extends Model
|
||||
public static function routeBinder(string $value): self
|
||||
{
|
||||
if (auth()->check()) {
|
||||
$attemptId = (int) $value;
|
||||
$attemptId = (int)$value;
|
||||
|
||||
/** @var User $user */
|
||||
$user = auth()->user();
|
||||
@@ -68,7 +68,7 @@ class WebhookAttempt extends Model
|
||||
protected function webhookMessageId(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: static fn ($value) => (int) $value,
|
||||
get: static fn ($value) => (int)$value,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@@ -41,7 +41,7 @@ class WebhookDelivery extends Model
|
||||
protected function key(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: static fn ($value) => (int) $value,
|
||||
get: static fn ($value) => (int)$value,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@@ -24,14 +24,17 @@ declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Models;
|
||||
|
||||
use FireflyIII\Handlers\Observer\WebhookMessageObserver;
|
||||
use FireflyIII\Support\Models\ReturnsIntegerIdTrait;
|
||||
use FireflyIII\User;
|
||||
use Illuminate\Database\Eloquent\Attributes\ObservedBy;
|
||||
use Illuminate\Database\Eloquent\Casts\Attribute;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
|
||||
|
||||
#[ObservedBy([WebhookMessageObserver::class])]
|
||||
class WebhookMessage extends Model
|
||||
{
|
||||
use ReturnsIntegerIdTrait;
|
||||
@@ -44,7 +47,7 @@ class WebhookMessage extends Model
|
||||
public static function routeBinder(string $value): self
|
||||
{
|
||||
if (auth()->check()) {
|
||||
$messageId = (int) $value;
|
||||
$messageId = (int)$value;
|
||||
|
||||
/** @var User $user */
|
||||
$user = auth()->user();
|
||||
@@ -69,23 +72,6 @@ class WebhookMessage extends Model
|
||||
return $this->hasMany(WebhookAttempt::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the amount
|
||||
*/
|
||||
protected function sent(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: static fn ($value) => (bool) $value,
|
||||
);
|
||||
}
|
||||
|
||||
protected function webhookId(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: static fn ($value) => (int) $value,
|
||||
);
|
||||
}
|
||||
|
||||
protected function casts(): array
|
||||
{
|
||||
return [
|
||||
@@ -96,4 +82,21 @@ class WebhookMessage extends Model
|
||||
'logs' => 'json',
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the amount
|
||||
*/
|
||||
protected function sent(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: static fn ($value) => (bool)$value,
|
||||
);
|
||||
}
|
||||
|
||||
protected function webhookId(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: static fn ($value) => (int)$value,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@@ -41,7 +41,7 @@ class WebhookResponse extends Model
|
||||
protected function key(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: static fn ($value) => (int) $value,
|
||||
get: static fn ($value) => (int)$value,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@@ -41,7 +41,7 @@ class WebhookTrigger extends Model
|
||||
protected function key(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: static fn ($value) => (int) $value,
|
||||
get: static fn ($value) => (int)$value,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@@ -57,46 +57,6 @@ use FireflyIII\Events\TriggeredAuditLog;
|
||||
use FireflyIII\Events\UpdatedAccount;
|
||||
use FireflyIII\Events\UpdatedTransactionGroup;
|
||||
use FireflyIII\Events\UserChangedEmail;
|
||||
use FireflyIII\Handlers\Observer\AccountObserver;
|
||||
use FireflyIII\Handlers\Observer\AttachmentObserver;
|
||||
use FireflyIII\Handlers\Observer\AutoBudgetObserver;
|
||||
use FireflyIII\Handlers\Observer\AvailableBudgetObserver;
|
||||
use FireflyIII\Handlers\Observer\BillObserver;
|
||||
use FireflyIII\Handlers\Observer\BudgetLimitObserver;
|
||||
use FireflyIII\Handlers\Observer\BudgetObserver;
|
||||
use FireflyIII\Handlers\Observer\CategoryObserver;
|
||||
use FireflyIII\Handlers\Observer\PiggyBankEventObserver;
|
||||
use FireflyIII\Handlers\Observer\PiggyBankObserver;
|
||||
use FireflyIII\Handlers\Observer\RecurrenceObserver;
|
||||
use FireflyIII\Handlers\Observer\RecurrenceTransactionObserver;
|
||||
use FireflyIII\Handlers\Observer\RuleGroupObserver;
|
||||
use FireflyIII\Handlers\Observer\RuleObserver;
|
||||
use FireflyIII\Handlers\Observer\TagObserver;
|
||||
use FireflyIII\Handlers\Observer\TransactionGroupObserver;
|
||||
use FireflyIII\Handlers\Observer\TransactionJournalObserver;
|
||||
use FireflyIII\Handlers\Observer\TransactionObserver;
|
||||
use FireflyIII\Handlers\Observer\WebhookMessageObserver;
|
||||
use FireflyIII\Handlers\Observer\WebhookObserver;
|
||||
use FireflyIII\Models\Account;
|
||||
use FireflyIII\Models\Attachment;
|
||||
use FireflyIII\Models\AutoBudget;
|
||||
use FireflyIII\Models\AvailableBudget;
|
||||
use FireflyIII\Models\Bill;
|
||||
use FireflyIII\Models\Budget;
|
||||
use FireflyIII\Models\BudgetLimit;
|
||||
use FireflyIII\Models\Category;
|
||||
use FireflyIII\Models\PiggyBank;
|
||||
use FireflyIII\Models\PiggyBankEvent;
|
||||
use FireflyIII\Models\Recurrence;
|
||||
use FireflyIII\Models\RecurrenceTransaction;
|
||||
use FireflyIII\Models\Rule;
|
||||
use FireflyIII\Models\RuleGroup;
|
||||
use FireflyIII\Models\Tag;
|
||||
use FireflyIII\Models\Transaction;
|
||||
use FireflyIII\Models\TransactionGroup;
|
||||
use FireflyIII\Models\TransactionJournal;
|
||||
use FireflyIII\Models\Webhook;
|
||||
use FireflyIII\Models\WebhookMessage;
|
||||
use Illuminate\Auth\Events\Login;
|
||||
use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvider;
|
||||
use Laravel\Passport\Events\AccessTokenCreated;
|
||||
@@ -256,32 +216,5 @@ class EventServiceProvider extends ServiceProvider
|
||||
* Register any events for your application.
|
||||
*/
|
||||
#[Override]
|
||||
public function boot(): void
|
||||
{
|
||||
$this->registerObservers();
|
||||
}
|
||||
|
||||
private function registerObservers(): void
|
||||
{
|
||||
Attachment::observe(new AttachmentObserver());
|
||||
Account::observe(new AccountObserver());
|
||||
AutoBudget::observe(new AutoBudgetObserver());
|
||||
AvailableBudget::observe(new AvailableBudgetObserver());
|
||||
Bill::observe(new BillObserver());
|
||||
Budget::observe(new BudgetObserver());
|
||||
BudgetLimit::observe(new BudgetLimitObserver());
|
||||
Category::observe(new CategoryObserver());
|
||||
PiggyBank::observe(new PiggyBankObserver());
|
||||
PiggyBankEvent::observe(new PiggyBankEventObserver());
|
||||
Recurrence::observe(new RecurrenceObserver());
|
||||
RecurrenceTransaction::observe(new RecurrenceTransactionObserver());
|
||||
Rule::observe(new RuleObserver());
|
||||
RuleGroup::observe(new RuleGroupObserver());
|
||||
Tag::observe(new TagObserver());
|
||||
Transaction::observe(new TransactionObserver());
|
||||
TransactionJournal::observe(new TransactionJournalObserver());
|
||||
TransactionGroup::observe(new TransactionGroupObserver());
|
||||
Webhook::observe(new WebhookObserver());
|
||||
WebhookMessage::observe(new WebhookMessageObserver());
|
||||
}
|
||||
public function boot(): void {}
|
||||
}
|
||||
|
@@ -45,6 +45,7 @@ use FireflyIII\Support\Repositories\UserGroup\UserGroupTrait;
|
||||
use Illuminate\Database\Eloquent\Builder as EloquentBuilder;
|
||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
use Illuminate\Support\Collection;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
use Override;
|
||||
|
||||
@@ -150,18 +151,18 @@ class AccountRepository implements AccountRepositoryInterface, UserGroupInterfac
|
||||
$query->leftJoin('account_types', 'accounts.account_type_id', '=', 'account_types.id');
|
||||
$query->whereIn('account_types.type', $types);
|
||||
}
|
||||
app('log')->debug(sprintf('Searching for account named "%s" (of user #%d) of the following type(s)', $name, $this->user->id), ['types' => $types]);
|
||||
Log::debug(sprintf('Searching for account named "%s" (of user #%d) of the following type(s)', $name, $this->user->id), ['types' => $types]);
|
||||
|
||||
$query->where('accounts.name', $name);
|
||||
|
||||
/** @var null|Account $account */
|
||||
$account = $query->first(['accounts.*']);
|
||||
if (null === $account) {
|
||||
app('log')->debug(sprintf('There is no account with name "%s" of types', $name), $types);
|
||||
Log::debug(sprintf('There is no account with name "%s" of types', $name), $types);
|
||||
|
||||
return null;
|
||||
}
|
||||
app('log')->debug(sprintf('Found #%d (%s) with type id %d', $account->id, $account->name, $account->account_type_id));
|
||||
Log::debug(sprintf('Found #%d (%s) with type id %d', $account->id, $account->name, $account->account_type_id));
|
||||
|
||||
return $account;
|
||||
}
|
||||
@@ -465,14 +466,14 @@ class AccountRepository implements AccountRepositoryInterface, UserGroupInterfac
|
||||
];
|
||||
if (array_key_exists(ucfirst($type), $sets)) {
|
||||
$order = (int) $this->getAccountsByType($sets[ucfirst($type)])->max('order');
|
||||
app('log')->debug(sprintf('Return max order of "%s" set: %d', $type, $order));
|
||||
Log::debug(sprintf('Return max order of "%s" set: %d', $type, $order));
|
||||
|
||||
return $order;
|
||||
}
|
||||
$specials = [AccountTypeEnum::CASH->value, AccountTypeEnum::INITIAL_BALANCE->value, AccountTypeEnum::IMPORT->value, AccountTypeEnum::RECONCILIATION->value];
|
||||
|
||||
$order = (int) $this->getAccountsByType($specials)->max('order');
|
||||
app('log')->debug(sprintf('Return max order of "%s" set (specials!): %d', $type, $order));
|
||||
Log::debug(sprintf('Return max order of "%s" set (specials!): %d', $type, $order));
|
||||
|
||||
return $order;
|
||||
}
|
||||
@@ -599,7 +600,7 @@ class AccountRepository implements AccountRepositoryInterface, UserGroupInterfac
|
||||
continue;
|
||||
}
|
||||
if ($index !== (int) $account->order) {
|
||||
app('log')->debug(sprintf('Account #%d ("%s"): order should %d be but is %d.', $account->id, $account->name, $index, $account->order));
|
||||
Log::debug(sprintf('Account #%d ("%s"): order should %d be but is %d.', $account->id, $account->name, $index, $account->order));
|
||||
$account->order = $index;
|
||||
$account->save();
|
||||
}
|
||||
|
@@ -31,8 +31,10 @@ use FireflyIII\Models\Budget;
|
||||
use FireflyIII\Models\BudgetLimit;
|
||||
use FireflyIII\Models\Note;
|
||||
use FireflyIII\Models\TransactionCurrency;
|
||||
use FireflyIII\Support\Facades\Amount;
|
||||
use FireflyIII\Support\Repositories\UserGroup\UserGroupInterface;
|
||||
use FireflyIII\Support\Repositories\UserGroup\UserGroupTrait;
|
||||
use FireflyIII\Support\Singleton\PreferencesSingleton;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
use Illuminate\Support\Collection;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
@@ -271,7 +273,7 @@ class BudgetLimitRepository implements BudgetLimitRepositoryInterface, UserGroup
|
||||
$factory = app(TransactionCurrencyFactory::class);
|
||||
$currency = $factory->find($data['currency_id'] ?? null, $data['currency_code'] ?? null);
|
||||
if (null === $currency) {
|
||||
$currency = app('amount')->getPrimaryCurrencyByUserGroup($this->user->userGroup);
|
||||
$currency = Amount::getPrimaryCurrencyByUserGroup($this->user->userGroup);
|
||||
}
|
||||
$currency->enabled = true;
|
||||
$currency->save();
|
||||
@@ -293,7 +295,11 @@ class BudgetLimitRepository implements BudgetLimitRepositoryInterface, UserGroup
|
||||
if (null !== $limit) {
|
||||
throw new FireflyException('200027: Budget limit already exists.');
|
||||
}
|
||||
app('log')->debug('No existing budget limit, create a new one');
|
||||
Log::debug('No existing budget limit, create a new one');
|
||||
|
||||
// this is a lame trick to communicate with the observer.
|
||||
$singleton = PreferencesSingleton::getInstance();
|
||||
$singleton->setPreference('fire_webhooks_bl_store', $data['fire_webhooks'] ?? true);
|
||||
|
||||
// or create one and return it.
|
||||
$limit = new BudgetLimit();
|
||||
@@ -309,7 +315,7 @@ class BudgetLimitRepository implements BudgetLimitRepositoryInterface, UserGroup
|
||||
$this->setNoteText($limit, $noteText);
|
||||
}
|
||||
|
||||
app('log')->debug(sprintf('Created new budget limit with ID #%d and amount %s', $limit->id, $data['amount']));
|
||||
Log::debug(sprintf('Created new budget limit with ID #%d and amount %s', $limit->id, $data['amount']));
|
||||
|
||||
return $limit;
|
||||
}
|
||||
@@ -369,11 +375,15 @@ class BudgetLimitRepository implements BudgetLimitRepositoryInterface, UserGroup
|
||||
}
|
||||
// catch unexpected null:
|
||||
if (null === $currency) {
|
||||
$currency = $budgetLimit->transactionCurrency ?? app('amount')->getPrimaryCurrencyByUserGroup($this->user->userGroup);
|
||||
$currency = $budgetLimit->transactionCurrency ?? Amount::getPrimaryCurrencyByUserGroup($this->user->userGroup);
|
||||
}
|
||||
$currency->enabled = true;
|
||||
$currency->save();
|
||||
|
||||
// this is a lame trick to communicate with the observer.
|
||||
$singleton = PreferencesSingleton::getInstance();
|
||||
$singleton->setPreference('fire_webhooks_bl_update', $data['fire_webhooks'] ?? true);
|
||||
|
||||
$budgetLimit->transaction_currency_id = $currency->id;
|
||||
$budgetLimit->save();
|
||||
|
||||
@@ -385,63 +395,63 @@ class BudgetLimitRepository implements BudgetLimitRepositoryInterface, UserGroup
|
||||
return $budgetLimit;
|
||||
}
|
||||
|
||||
public function updateLimitAmount(Budget $budget, Carbon $start, Carbon $end, string $amount): ?BudgetLimit
|
||||
{
|
||||
// count the limits:
|
||||
$limits = $budget->budgetlimits()
|
||||
->where('budget_limits.start_date', $start->format('Y-m-d 00:00:00'))
|
||||
->where('budget_limits.end_date', $end->format('Y-m-d 00:00:00'))
|
||||
->count('budget_limits.*')
|
||||
;
|
||||
app('log')->debug(sprintf('Found %d budget limits.', $limits));
|
||||
|
||||
// there might be a budget limit for these dates:
|
||||
/** @var null|BudgetLimit $limit */
|
||||
$limit = $budget->budgetlimits()
|
||||
->where('budget_limits.start_date', $start->format('Y-m-d 00:00:00'))
|
||||
->where('budget_limits.end_date', $end->format('Y-m-d 00:00:00'))
|
||||
->first(['budget_limits.*'])
|
||||
;
|
||||
|
||||
// if more than 1 limit found, delete the others:
|
||||
if ($limits > 1 && null !== $limit) {
|
||||
app('log')->debug(sprintf('Found more than 1, delete all except #%d', $limit->id));
|
||||
$budget->budgetlimits()
|
||||
->where('budget_limits.start_date', $start->format('Y-m-d 00:00:00'))
|
||||
->where('budget_limits.end_date', $end->format('Y-m-d 00:00:00'))
|
||||
->where('budget_limits.id', '!=', $limit->id)->delete()
|
||||
;
|
||||
}
|
||||
|
||||
// delete if amount is zero.
|
||||
// Returns 0 if the two operands are equal,
|
||||
// 1 if the left_operand is larger than the right_operand, -1 otherwise.
|
||||
if (null !== $limit && bccomp($amount, '0') <= 0) {
|
||||
app('log')->debug(sprintf('%s is zero, delete budget limit #%d', $amount, $limit->id));
|
||||
$limit->delete();
|
||||
|
||||
return null;
|
||||
}
|
||||
// update if exists:
|
||||
if (null !== $limit) {
|
||||
app('log')->debug(sprintf('Existing budget limit is #%d, update this to amount %s', $limit->id, $amount));
|
||||
$limit->amount = $amount;
|
||||
$limit->save();
|
||||
|
||||
return $limit;
|
||||
}
|
||||
app('log')->debug('No existing budget limit, create a new one');
|
||||
// or create one and return it.
|
||||
$limit = new BudgetLimit();
|
||||
$limit->budget()->associate($budget);
|
||||
$limit->start_date = $start->startOfDay();
|
||||
$limit->start_date_tz = $start->format('e');
|
||||
$limit->end_date = $end->startOfDay();
|
||||
$limit->end_date_tz = $end->format('e');
|
||||
$limit->amount = $amount;
|
||||
$limit->save();
|
||||
app('log')->debug(sprintf('Created new budget limit with ID #%d and amount %s', $limit->id, $amount));
|
||||
|
||||
return $limit;
|
||||
}
|
||||
// public function updateLimitAmount(Budget $budget, Carbon $start, Carbon $end, string $amount): ?BudgetLimit
|
||||
// {
|
||||
// // count the limits:
|
||||
// $limits = $budget->budgetlimits()
|
||||
// ->where('budget_limits.start_date', $start->format('Y-m-d 00:00:00'))
|
||||
// ->where('budget_limits.end_date', $end->format('Y-m-d 00:00:00'))
|
||||
// ->count('budget_limits.*')
|
||||
// ;
|
||||
// Log::debug(sprintf('Found %d budget limits.', $limits));
|
||||
//
|
||||
// // there might be a budget limit for these dates:
|
||||
// /** @var null|BudgetLimit $limit */
|
||||
// $limit = $budget->budgetlimits()
|
||||
// ->where('budget_limits.start_date', $start->format('Y-m-d 00:00:00'))
|
||||
// ->where('budget_limits.end_date', $end->format('Y-m-d 00:00:00'))
|
||||
// ->first(['budget_limits.*'])
|
||||
// ;
|
||||
//
|
||||
// // if more than 1 limit found, delete the others:
|
||||
// if ($limits > 1 && null !== $limit) {
|
||||
// Log::debug(sprintf('Found more than 1, delete all except #%d', $limit->id));
|
||||
// $budget->budgetlimits()
|
||||
// ->where('budget_limits.start_date', $start->format('Y-m-d 00:00:00'))
|
||||
// ->where('budget_limits.end_date', $end->format('Y-m-d 00:00:00'))
|
||||
// ->where('budget_limits.id', '!=', $limit->id)->delete()
|
||||
// ;
|
||||
// }
|
||||
//
|
||||
// // delete if amount is zero.
|
||||
// // Returns 0 if the two operands are equal,
|
||||
// // 1 if the left_operand is larger than the right_operand, -1 otherwise.
|
||||
// if (null !== $limit && bccomp($amount, '0') <= 0) {
|
||||
// Log::debug(sprintf('%s is zero, delete budget limit #%d', $amount, $limit->id));
|
||||
// $limit->delete();
|
||||
//
|
||||
// return null;
|
||||
// }
|
||||
// // update if exists:
|
||||
// if (null !== $limit) {
|
||||
// Log::debug(sprintf('Existing budget limit is #%d, update this to amount %s', $limit->id, $amount));
|
||||
// $limit->amount = $amount;
|
||||
// $limit->save();
|
||||
//
|
||||
// return $limit;
|
||||
// }
|
||||
// Log::debug('No existing budget limit, create a new one');
|
||||
// // or create one and return it.
|
||||
// $limit = new BudgetLimit();
|
||||
// $limit->budget()->associate($budget);
|
||||
// $limit->start_date = $start->startOfDay();
|
||||
// $limit->start_date_tz = $start->format('e');
|
||||
// $limit->end_date = $end->startOfDay();
|
||||
// $limit->end_date_tz = $end->format('e');
|
||||
// $limit->amount = $amount;
|
||||
// $limit->save();
|
||||
// Log::debug(sprintf('Created new budget limit with ID #%d and amount %s', $limit->id, $amount));
|
||||
//
|
||||
// return $limit;
|
||||
// }
|
||||
}
|
||||
|
@@ -81,5 +81,5 @@ interface BudgetLimitRepositoryInterface
|
||||
|
||||
public function update(BudgetLimit $budgetLimit, array $data): BudgetLimit;
|
||||
|
||||
public function updateLimitAmount(Budget $budget, Carbon $start, Carbon $end, string $amount): ?BudgetLimit;
|
||||
// public function updateLimitAmount(Budget $budget, Carbon $start, Carbon $end, string $amount): ?BudgetLimit;
|
||||
}
|
||||
|
@@ -44,6 +44,7 @@ use FireflyIII\Support\Facades\Steam;
|
||||
use FireflyIII\Support\Http\Api\ExchangeRateConverter;
|
||||
use FireflyIII\Support\Repositories\UserGroup\UserGroupInterface;
|
||||
use FireflyIII\Support\Repositories\UserGroup\UserGroupTrait;
|
||||
use FireflyIII\Support\Singleton\PreferencesSingleton;
|
||||
use Illuminate\Database\QueryException;
|
||||
use Illuminate\Support\Collection;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
@@ -85,7 +86,7 @@ class BudgetRepository implements BudgetRepositoryInterface, UserGroupInterface
|
||||
|
||||
public function budgetedInPeriod(Carbon $start, Carbon $end): array
|
||||
{
|
||||
app('log')->debug(sprintf('Now in budgetedInPeriod("%s", "%s")', $start->format('Y-m-d'), $end->format('Y-m-d')));
|
||||
Log::debug(sprintf('Now in budgetedInPeriod("%s", "%s")', $start->format('Y-m-d'), $end->format('Y-m-d')));
|
||||
$return = [];
|
||||
|
||||
/** @var BudgetLimitRepository $limitRepository */
|
||||
@@ -97,12 +98,12 @@ class BudgetRepository implements BudgetRepositoryInterface, UserGroupInterface
|
||||
|
||||
/** @var Budget $budget */
|
||||
foreach ($budgets as $budget) {
|
||||
app('log')->debug(sprintf('Budget #%d: "%s"', $budget->id, $budget->name));
|
||||
Log::debug(sprintf('Budget #%d: "%s"', $budget->id, $budget->name));
|
||||
$limits = $limitRepository->getBudgetLimits($budget, $start, $end);
|
||||
|
||||
/** @var BudgetLimit $limit */
|
||||
foreach ($limits as $limit) {
|
||||
app('log')->debug(sprintf('Budget limit #%d', $limit->id));
|
||||
Log::debug(sprintf('Budget limit #%d', $limit->id));
|
||||
$currency = $limit->transactionCurrency;
|
||||
$rate = $converter->getCurrencyRate($currency, $primaryCurrency, $end);
|
||||
$currencyCode = $currency->code;
|
||||
@@ -124,7 +125,7 @@ class BudgetRepository implements BudgetRepositoryInterface, UserGroupInterface
|
||||
if ($limit->start_date->isSameDay($start) && $limit->end_date->isSameDay($end)) {
|
||||
$return[$currencyCode]['sum'] = bcadd($return[$currencyCode]['sum'], (string) $limit->amount);
|
||||
$return[$currencyCode]['pc_sum'] = bcmul($rate, $return[$currencyCode]['sum']);
|
||||
app('log')->debug(sprintf('Add full amount [1]: %s', $limit->amount));
|
||||
Log::debug(sprintf('Add full amount [1]: %s', $limit->amount));
|
||||
|
||||
continue;
|
||||
}
|
||||
@@ -132,7 +133,7 @@ class BudgetRepository implements BudgetRepositoryInterface, UserGroupInterface
|
||||
if ($start->lte($limit->start_date) && $end->gte($limit->end_date)) {
|
||||
$return[$currencyCode]['sum'] = bcadd($return[$currencyCode]['sum'], (string) $limit->amount);
|
||||
$return[$currencyCode]['pc_sum'] = bcmul($rate, $return[$currencyCode]['sum']);
|
||||
app('log')->debug(sprintf('Add full amount [2]: %s', $limit->amount));
|
||||
Log::debug(sprintf('Add full amount [2]: %s', $limit->amount));
|
||||
|
||||
continue;
|
||||
}
|
||||
@@ -141,7 +142,7 @@ class BudgetRepository implements BudgetRepositoryInterface, UserGroupInterface
|
||||
$amount = bcmul(bcdiv((string) $limit->amount, (string) $total), (string) $days);
|
||||
$return[$currencyCode]['sum'] = bcadd($return[$currencyCode]['sum'], $amount);
|
||||
$return[$currencyCode]['pc_sum'] = bcmul($rate, $return[$currencyCode]['sum']);
|
||||
app('log')->debug(
|
||||
Log::debug(
|
||||
sprintf(
|
||||
'Amount per day: %s (%s over %d days). Total amount for %d days: %s',
|
||||
bcdiv((string) $limit->amount, (string) $total),
|
||||
@@ -202,19 +203,19 @@ class BudgetRepository implements BudgetRepositoryInterface, UserGroupInterface
|
||||
|
||||
public function budgetedInPeriodForBudget(Budget $budget, Carbon $start, Carbon $end): array
|
||||
{
|
||||
app('log')->debug(sprintf('Now in budgetedInPeriod(#%d, "%s", "%s")', $budget->id, $start->format('Y-m-d'), $end->format('Y-m-d')));
|
||||
Log::debug(sprintf('Now in budgetedInPeriod(#%d, "%s", "%s")', $budget->id, $start->format('Y-m-d'), $end->format('Y-m-d')));
|
||||
$return = [];
|
||||
|
||||
/** @var BudgetLimitRepository $limitRepository */
|
||||
$limitRepository = app(BudgetLimitRepository::class);
|
||||
$limitRepository->setUser($this->user);
|
||||
|
||||
app('log')->debug(sprintf('Budget #%d: "%s"', $budget->id, $budget->name));
|
||||
Log::debug(sprintf('Budget #%d: "%s"', $budget->id, $budget->name));
|
||||
$limits = $limitRepository->getBudgetLimits($budget, $start, $end);
|
||||
|
||||
/** @var BudgetLimit $limit */
|
||||
foreach ($limits as $limit) {
|
||||
app('log')->debug(sprintf('Budget limit #%d', $limit->id));
|
||||
Log::debug(sprintf('Budget limit #%d', $limit->id));
|
||||
$currency = $limit->transactionCurrency;
|
||||
$return[$currency->id] ??= [
|
||||
'id' => (string) $currency->id,
|
||||
@@ -227,14 +228,14 @@ class BudgetRepository implements BudgetRepositoryInterface, UserGroupInterface
|
||||
// same period
|
||||
if ($limit->start_date->isSameDay($start) && $limit->end_date->isSameDay($end)) {
|
||||
$return[$currency->id]['sum'] = bcadd($return[$currency->id]['sum'], (string) $limit->amount);
|
||||
app('log')->debug(sprintf('Add full amount [1]: %s', $limit->amount));
|
||||
Log::debug(sprintf('Add full amount [1]: %s', $limit->amount));
|
||||
|
||||
continue;
|
||||
}
|
||||
// limit is inside of date range
|
||||
if ($start->lte($limit->start_date) && $end->gte($limit->end_date)) {
|
||||
$return[$currency->id]['sum'] = bcadd($return[$currency->id]['sum'], (string) $limit->amount);
|
||||
app('log')->debug(sprintf('Add full amount [2]: %s', $limit->amount));
|
||||
Log::debug(sprintf('Add full amount [2]: %s', $limit->amount));
|
||||
|
||||
continue;
|
||||
}
|
||||
@@ -242,7 +243,7 @@ class BudgetRepository implements BudgetRepositoryInterface, UserGroupInterface
|
||||
$days = $this->daysInOverlap($limit, $start, $end);
|
||||
$amount = bcmul(bcdiv((string) $limit->amount, (string) $total), (string) $days);
|
||||
$return[$currency->id]['sum'] = bcadd($return[$currency->id]['sum'], $amount);
|
||||
app('log')->debug(
|
||||
Log::debug(
|
||||
sprintf(
|
||||
'Amount per day: %s (%s over %d days). Total amount for %d days: %s',
|
||||
bcdiv((string) $limit->amount, (string) $total),
|
||||
@@ -282,7 +283,11 @@ class BudgetRepository implements BudgetRepositoryInterface, UserGroupInterface
|
||||
*/
|
||||
public function update(Budget $budget, array $data): Budget
|
||||
{
|
||||
app('log')->debug('Now in update()');
|
||||
Log::debug('Now in update()');
|
||||
|
||||
// this is a lame trick to communicate with the observer.
|
||||
$singleton = PreferencesSingleton::getInstance();
|
||||
$singleton->setPreference('fire_webhooks_budget_update', $data['fire_webhooks'] ?? true);
|
||||
|
||||
$oldName = $budget->name;
|
||||
if (array_key_exists('name', $data)) {
|
||||
@@ -330,13 +335,13 @@ class BudgetRepository implements BudgetRepositoryInterface, UserGroupInterface
|
||||
->where('rule_actions.action_value', $oldName)
|
||||
->get(['rule_actions.*'])
|
||||
;
|
||||
app('log')->debug(sprintf('Found %d actions to update.', $actions->count()));
|
||||
Log::debug(sprintf('Found %d actions to update.', $actions->count()));
|
||||
|
||||
/** @var RuleAction $action */
|
||||
foreach ($actions as $action) {
|
||||
$action->action_value = $newName;
|
||||
$action->save();
|
||||
app('log')->debug(sprintf('Updated action %d: %s', $action->id, $action->action_value));
|
||||
Log::debug(sprintf('Updated action %d: %s', $action->id, $action->action_value));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -349,13 +354,13 @@ class BudgetRepository implements BudgetRepositoryInterface, UserGroupInterface
|
||||
->where('rule_triggers.trigger_value', $oldName)
|
||||
->get(['rule_triggers.*'])
|
||||
;
|
||||
app('log')->debug(sprintf('Found %d triggers to update.', $triggers->count()));
|
||||
Log::debug(sprintf('Found %d triggers to update.', $triggers->count()));
|
||||
|
||||
/** @var RuleTrigger $trigger */
|
||||
foreach ($triggers as $trigger) {
|
||||
$trigger->trigger_value = $newName;
|
||||
$trigger->save();
|
||||
app('log')->debug(sprintf('Updated trigger %d: %s', $trigger->id, $trigger->trigger_value));
|
||||
Log::debug(sprintf('Updated trigger %d: %s', $trigger->id, $trigger->trigger_value));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -486,17 +491,17 @@ class BudgetRepository implements BudgetRepositoryInterface, UserGroupInterface
|
||||
|
||||
public function findBudget(?int $budgetId, ?string $budgetName): ?Budget
|
||||
{
|
||||
app('log')->debug('Now in findBudget()');
|
||||
app('log')->debug(sprintf('Searching for budget with ID #%d...', $budgetId));
|
||||
Log::debug('Now in findBudget()');
|
||||
Log::debug(sprintf('Searching for budget with ID #%d...', $budgetId));
|
||||
$result = $this->find((int) $budgetId);
|
||||
if (!$result instanceof Budget && null !== $budgetName && '' !== $budgetName) {
|
||||
app('log')->debug(sprintf('Searching for budget with name %s...', $budgetName));
|
||||
Log::debug(sprintf('Searching for budget with name %s...', $budgetName));
|
||||
$result = $this->findByName($budgetName);
|
||||
}
|
||||
if ($result instanceof Budget) {
|
||||
app('log')->debug(sprintf('Found budget #%d: %s', $result->id, $result->name));
|
||||
Log::debug(sprintf('Found budget #%d: %s', $result->id, $result->name));
|
||||
}
|
||||
app('log')->debug(sprintf('Found result is null? %s', var_export(!$result instanceof Budget, true)));
|
||||
Log::debug(sprintf('Found result is null? %s', var_export(!$result instanceof Budget, true)));
|
||||
|
||||
return $result;
|
||||
}
|
||||
@@ -593,7 +598,7 @@ class BudgetRepository implements BudgetRepositoryInterface, UserGroupInterface
|
||||
|
||||
public function spentInPeriod(Carbon $start, Carbon $end): array
|
||||
{
|
||||
app('log')->debug(sprintf('Now in %s', __METHOD__));
|
||||
Log::debug(sprintf('Now in %s', __METHOD__));
|
||||
$start->startOfDay();
|
||||
$end->endOfDay();
|
||||
|
||||
@@ -655,7 +660,7 @@ class BudgetRepository implements BudgetRepositoryInterface, UserGroupInterface
|
||||
|
||||
public function spentInPeriodForBudget(Budget $budget, Carbon $start, Carbon $end): array
|
||||
{
|
||||
app('log')->debug(sprintf('Now in %s', __METHOD__));
|
||||
Log::debug(sprintf('Now in %s', __METHOD__));
|
||||
$start->startOfDay();
|
||||
$end->endOfDay();
|
||||
|
||||
@@ -724,6 +729,10 @@ class BudgetRepository implements BudgetRepositoryInterface, UserGroupInterface
|
||||
{
|
||||
$order = $this->getMaxOrder();
|
||||
|
||||
// this is a lame trick to communicate with the observer.
|
||||
$singleton = PreferencesSingleton::getInstance();
|
||||
$singleton->setPreference('fire_webhooks_budget_create', $data['fire_webhooks'] ?? true);
|
||||
|
||||
try {
|
||||
$newBudget = Budget::create(
|
||||
[
|
||||
@@ -735,8 +744,8 @@ class BudgetRepository implements BudgetRepositoryInterface, UserGroupInterface
|
||||
]
|
||||
);
|
||||
} catch (QueryException $e) {
|
||||
app('log')->error($e->getMessage());
|
||||
app('log')->error($e->getTraceAsString());
|
||||
Log::error($e->getMessage());
|
||||
Log::error($e->getTraceAsString());
|
||||
|
||||
throw new FireflyException('400002: Could not store budget.', 0, $e);
|
||||
}
|
||||
|
@@ -314,7 +314,7 @@ class OperationsRepository implements OperationsRepositoryInterface, UserGroupIn
|
||||
#[Override]
|
||||
public function collectExpenses(Carbon $start, Carbon $end, ?Collection $accounts = null, ?Collection $budgets = null, ?TransactionCurrency $currency = null): array
|
||||
{
|
||||
Log::debug(sprintf('Start of %s(date, date, array, array, "%s").', __METHOD__, $currency?->code));
|
||||
Log::debug(sprintf('Start of %s(%s, %s, array, array, "%s").', __METHOD__, $start->toW3cString(), $end->toW3cString(), $currency?->code));
|
||||
// this collector excludes all transfers TO liabilities (which are also withdrawals)
|
||||
// because those expenses only become expenses once they move from the liability to the friend.
|
||||
// 2024-12-24 disable the exclusion for now.
|
||||
|
@@ -370,8 +370,11 @@ class TransactionGroupRepository implements TransactionGroupRepositoryInterface,
|
||||
|
||||
public function getTagObjects(int $journalId): Collection
|
||||
{
|
||||
/** @var TransactionJournal $journal */
|
||||
/** @var null|TransactionJournal $journal */
|
||||
$journal = $this->user->transactionJournals()->find($journalId);
|
||||
if (null === $journal) {
|
||||
return new Collection();
|
||||
}
|
||||
|
||||
return $journal->tags()->whereNull('deleted_at')->get();
|
||||
}
|
||||
|
@@ -54,7 +54,7 @@ trait JournalServiceTrait
|
||||
/**
|
||||
* @throws FireflyException
|
||||
*/
|
||||
protected function getAccount(string $transactionType, string $direction, array $data): ?Account
|
||||
protected function getAccount(string $transactionType, string $direction, array $data, ?Account $opposite = null): ?Account
|
||||
{
|
||||
// some debug logging:
|
||||
Log::debug(sprintf('Now in getAccount(%s)', $direction), $data);
|
||||
@@ -69,12 +69,12 @@ trait JournalServiceTrait
|
||||
$message = 'Transaction = %s, %s account should be in: %s. Direction is %s.';
|
||||
Log::debug(sprintf($message, $transactionType, $direction, implode(', ', $expectedTypes[$transactionType] ?? ['UNKNOWN']), $direction));
|
||||
|
||||
$result = $this->findAccountById($data, $expectedTypes[$transactionType]);
|
||||
$result = $this->findAccountByIban($result, $data, $expectedTypes[$transactionType]);
|
||||
$result = $this->findAccountById($data, $expectedTypes[$transactionType], $opposite);
|
||||
$result = $this->findAccountByIban($result, $data, $expectedTypes[$transactionType], $opposite);
|
||||
$ibanResult = $result;
|
||||
$result = $this->findAccountByNumber($result, $data, $expectedTypes[$transactionType]);
|
||||
$result = $this->findAccountByNumber($result, $data, $expectedTypes[$transactionType], $opposite);
|
||||
$numberResult = $result;
|
||||
$result = $this->findAccountByName($result, $data, $expectedTypes[$transactionType]);
|
||||
$result = $this->findAccountByName($result, $data, $expectedTypes[$transactionType], $opposite);
|
||||
$nameResult = $result;
|
||||
|
||||
// if $result (find by name) is NULL, but IBAN is set, any result of the search by NAME can't overrule
|
||||
@@ -82,7 +82,7 @@ trait JournalServiceTrait
|
||||
if (null !== $nameResult && null === $numberResult && null === $ibanResult && '' !== (string) $data['iban'] && '' !== (string) $nameResult->iban) {
|
||||
$data['name'] = sprintf('%s (%s)', $data['name'], $data['iban']);
|
||||
Log::debug(sprintf('Search again using the new name, "%s".', $data['name']));
|
||||
$result = $this->findAccountByName(null, $data, $expectedTypes[$transactionType]);
|
||||
$result = $this->findAccountByName(null, $data, $expectedTypes[$transactionType], $opposite);
|
||||
}
|
||||
|
||||
// the account that Firefly III creates must be "creatable", aka select the one we can create from the list just in case
|
||||
@@ -115,15 +115,19 @@ trait JournalServiceTrait
|
||||
return $result;
|
||||
}
|
||||
|
||||
private function findAccountById(array $data, array $types): ?Account
|
||||
private function findAccountById(array $data, array $types, ?Account $opposite = null): ?Account
|
||||
{
|
||||
// first attempt, find by ID.
|
||||
if (null !== $data['id']) {
|
||||
$search = $this->accountRepository->find((int) $data['id']);
|
||||
if (null !== $search && in_array($search->accountType->type, $types, true)) {
|
||||
Log::debug(
|
||||
sprintf('Found "account_id" object: #%d, "%s" of type %s (1)', $search->id, $search->name, $search->accountType->type)
|
||||
);
|
||||
Log::debug(sprintf('Found "account_id" object: #%d, "%s" of type %s (1)', $search->id, $search->name, $search->accountType->type));
|
||||
|
||||
if ($opposite?->id === $search->id) {
|
||||
Log::debug(sprintf('Account #%d is the same as opposite account #%d, returning NULL.', $search->id, $opposite->id));
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
return $search;
|
||||
}
|
||||
@@ -140,7 +144,7 @@ trait JournalServiceTrait
|
||||
return null;
|
||||
}
|
||||
|
||||
private function findAccountByIban(?Account $account, array $data, array $types): ?Account
|
||||
private function findAccountByIban(?Account $account, array $data, array $types, ?Account $opposite = null): ?Account
|
||||
{
|
||||
if ($account instanceof Account) {
|
||||
Log::debug(sprintf('Already have account #%d ("%s"), return that.', $account->id, $account->name));
|
||||
@@ -153,21 +157,27 @@ trait JournalServiceTrait
|
||||
return null;
|
||||
}
|
||||
// find by preferred type.
|
||||
$source = $this->accountRepository->findByIbanNull($data['iban'], [$types[0]]);
|
||||
$result = $this->accountRepository->findByIbanNull($data['iban'], [$types[0]]);
|
||||
// or any expected type.
|
||||
$source ??= $this->accountRepository->findByIbanNull($data['iban'], $types);
|
||||
$result ??= $this->accountRepository->findByIbanNull($data['iban'], $types);
|
||||
|
||||
if (null !== $source) {
|
||||
Log::debug(sprintf('Found "account_iban" object: #%d, %s', $source->id, $source->name));
|
||||
if (null !== $result) {
|
||||
Log::debug(sprintf('Found "account_iban" object: #%d, %s', $result->id, $result->name));
|
||||
|
||||
return $source;
|
||||
if ($opposite?->id === $result->id) {
|
||||
Log::debug(sprintf('Account #%d is the same as opposite account #%d, returning NULL.', $result->id, $opposite->id));
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
Log::debug(sprintf('Found no account with IBAN "%s" of expected types', $data['iban']), $types);
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
private function findAccountByNumber(?Account $account, array $data, array $types): ?Account
|
||||
private function findAccountByNumber(?Account $account, array $data, array $types, ?Account $opposite = null): ?Account
|
||||
{
|
||||
if ($account instanceof Account) {
|
||||
Log::debug(sprintf('Already have account #%d ("%s"), return that.', $account->id, $account->name));
|
||||
@@ -180,15 +190,21 @@ trait JournalServiceTrait
|
||||
return null;
|
||||
}
|
||||
// find by preferred type.
|
||||
$source = $this->accountRepository->findByAccountNumber((string) $data['number'], [$types[0]]);
|
||||
$result = $this->accountRepository->findByAccountNumber((string) $data['number'], [$types[0]]);
|
||||
|
||||
// or any expected type.
|
||||
$source ??= $this->accountRepository->findByAccountNumber((string) $data['number'], $types);
|
||||
$result ??= $this->accountRepository->findByAccountNumber((string) $data['number'], $types);
|
||||
|
||||
if (null !== $source) {
|
||||
Log::debug(sprintf('Found account: #%d, %s', $source->id, $source->name));
|
||||
if (null !== $result) {
|
||||
Log::debug(sprintf('Found account: #%d, %s', $result->id, $result->name));
|
||||
|
||||
return $source;
|
||||
if ($opposite?->id === $result->id) {
|
||||
Log::debug(sprintf('Account #%d is the same as opposite account #%d, returning NULL.', $result->id, $opposite->id));
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
Log::debug(sprintf('Found no account with account number "%s" of expected types', $data['number']), $types);
|
||||
@@ -196,7 +212,7 @@ trait JournalServiceTrait
|
||||
return null;
|
||||
}
|
||||
|
||||
private function findAccountByName(?Account $account, array $data, array $types): ?Account
|
||||
private function findAccountByName(?Account $account, array $data, array $types, ?Account $opposite = null): ?Account
|
||||
{
|
||||
if ($account instanceof Account) {
|
||||
Log::debug(sprintf('Already have account #%d ("%s"), return that.', $account->id, $account->name));
|
||||
@@ -210,15 +226,21 @@ trait JournalServiceTrait
|
||||
}
|
||||
|
||||
// find by preferred type.
|
||||
$source = $this->accountRepository->findByName($data['name'], [$types[0]]);
|
||||
$result = $this->accountRepository->findByName($data['name'], [$types[0]]);
|
||||
|
||||
// or any expected type.
|
||||
$source ??= $this->accountRepository->findByName($data['name'], $types);
|
||||
$result ??= $this->accountRepository->findByName($data['name'], $types);
|
||||
|
||||
if (null !== $source) {
|
||||
Log::debug(sprintf('Found "account_name" object: #%d, %s', $source->id, $source->name));
|
||||
if (null !== $result) {
|
||||
Log::debug(sprintf('Found "account_name" object: #%d, %s', $result->id, $result->name));
|
||||
|
||||
return $source;
|
||||
if ($opposite?->id === $result->id) {
|
||||
Log::debug(sprintf('Account #%d is the same as opposite account #%d, returning NULL.', $result->id, $opposite->id));
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
Log::debug(sprintf('Found no account with account name "%s" of expected types', $data['name']), $types);
|
||||
|
||||
|
@@ -128,7 +128,7 @@ class Amount
|
||||
}
|
||||
$currency = TransactionCurrency::find($currencyId);
|
||||
if (null === $currency) {
|
||||
$message = sprintf('Could not find a transaction currency with ID #%d', $currencyId);
|
||||
$message = sprintf('Could not find a transaction currency with ID #%d in %s', $currencyId, __METHOD__);
|
||||
Log::error($message);
|
||||
|
||||
throw new FireflyException($message);
|
||||
@@ -150,7 +150,7 @@ class Amount
|
||||
}
|
||||
$currency = TransactionCurrency::whereCode($code)->first();
|
||||
if (null === $currency) {
|
||||
$message = sprintf('Could not find a transaction currency with code "%s"', $code);
|
||||
$message = sprintf('Could not find a transaction currency with code "%s" in %s', $code, __METHOD__);
|
||||
Log::error($message);
|
||||
|
||||
throw new FireflyException($message);
|
||||
|
@@ -40,8 +40,8 @@ class AutoBudgetCronjob extends AbstractCronjob
|
||||
/** @var Configuration $config */
|
||||
$config = FireflyConfig::get('last_ab_job', 0);
|
||||
$lastTime = (int) $config->data;
|
||||
$diff = Carbon::now()->getTimestamp() - $lastTime;
|
||||
$diffForHumans = today(config('app.timezone'))->diffForHumans(Carbon::createFromTimestamp($lastTime), null, true);
|
||||
$diff = now(config('app.timezone'))->getTimestamp() - $lastTime;
|
||||
$diffForHumans = now(config('app.timezone'))->diffForHumans(Carbon::createFromTimestamp($lastTime), null, true);
|
||||
if (0 === $lastTime) {
|
||||
Log::info('Auto budget cron-job has never fired before.');
|
||||
}
|
||||
|
@@ -46,8 +46,8 @@ class BillWarningCronjob extends AbstractCronjob
|
||||
/** @var Configuration $config */
|
||||
$config = FireflyConfig::get('last_bw_job', 0);
|
||||
$lastTime = (int) $config->data;
|
||||
$diff = Carbon::now()->getTimestamp() - $lastTime;
|
||||
$diffForHumans = today(config('app.timezone'))->diffForHumans(Carbon::createFromTimestamp($lastTime), null, true);
|
||||
$diff = now(config('app.timezone'))->getTimestamp() - $lastTime;
|
||||
$diffForHumans = now(config('app.timezone'))->diffForHumans(Carbon::createFromTimestamp($lastTime), null, true);
|
||||
|
||||
if (0 === $lastTime) {
|
||||
Log::info('The bill notification cron-job has never fired before.');
|
||||
|
@@ -40,8 +40,8 @@ class ExchangeRatesCronjob extends AbstractCronjob
|
||||
/** @var Configuration $config */
|
||||
$config = FireflyConfig::get('last_cer_job', 0);
|
||||
$lastTime = (int) $config->data;
|
||||
$diff = Carbon::now()->getTimestamp() - $lastTime;
|
||||
$diffForHumans = today(config('app.timezone'))->diffForHumans(Carbon::createFromTimestamp($lastTime), null, true);
|
||||
$diff = now(config('app.timezone'))->getTimestamp() - $lastTime;
|
||||
$diffForHumans = now(config('app.timezone'))->diffForHumans(Carbon::createFromTimestamp($lastTime), null, true);
|
||||
if (0 === $lastTime) {
|
||||
Log::info('Exchange rates cron-job has never fired before.');
|
||||
}
|
||||
|
@@ -46,8 +46,8 @@ class RecurringCronjob extends AbstractCronjob
|
||||
/** @var Configuration $config */
|
||||
$config = FireflyConfig::get('last_rt_job', 0);
|
||||
$lastTime = (int) $config->data;
|
||||
$diff = Carbon::now()->getTimestamp() - $lastTime;
|
||||
$diffForHumans = today(config('app.timezone'))->diffForHumans(Carbon::createFromTimestamp($lastTime), null, true);
|
||||
$diff = now(config('app.timezone'))->getTimestamp() - $lastTime;
|
||||
$diffForHumans = now(config('app.timezone'))->diffForHumans(Carbon::createFromTimestamp($lastTime), null, true);
|
||||
|
||||
if (0 === $lastTime) {
|
||||
Log::info('Recurring transactions cron-job has never fired before.');
|
||||
|
@@ -46,8 +46,8 @@ class WebhookCronjob extends AbstractCronjob
|
||||
/** @var Configuration $config */
|
||||
$config = FireflyConfig::get('last_webhook_job', 0);
|
||||
$lastTime = (int) $config->data;
|
||||
$diff = Carbon::now()->getTimestamp() - $lastTime;
|
||||
$diffForHumans = today(config('app.timezone'))->diffForHumans(Carbon::createFromTimestamp($lastTime), null, true);
|
||||
$diff = now(config('app.timezone'))->getTimestamp() - $lastTime;
|
||||
$diffForHumans = now(config('app.timezone'))->diffForHumans(Carbon::createFromTimestamp($lastTime), null, true);
|
||||
|
||||
if (0 === $lastTime) {
|
||||
Log::info('The webhook cron-job has never fired before.');
|
||||
|
@@ -40,18 +40,18 @@ use Illuminate\Support\Facades\Log;
|
||||
|
||||
class BudgetLimitEnrichment implements EnrichmentInterface
|
||||
{
|
||||
private User $user;
|
||||
private UserGroup $userGroup; // @phpstan-ignore-line
|
||||
private Collection $collection;
|
||||
private array $ids = [];
|
||||
private array $notes = [];
|
||||
private Carbon $start;
|
||||
private Carbon $end;
|
||||
private array $expenses = [];
|
||||
private array $pcExpenses = [];
|
||||
private array $currencyIds = [];
|
||||
private array $currencies = [];
|
||||
private bool $convertToPrimary = true;
|
||||
private User $user;
|
||||
private UserGroup $userGroup; // @phpstan-ignore-line
|
||||
private Collection $collection;
|
||||
private array $ids = [];
|
||||
private array $notes = [];
|
||||
private Carbon $start;
|
||||
private Carbon $end;
|
||||
private array $expenses = [];
|
||||
private array $pcExpenses = [];
|
||||
private array $currencyIds = [];
|
||||
private array $currencies = [];
|
||||
private bool $convertToPrimary = true;
|
||||
private readonly TransactionCurrency $primaryCurrency;
|
||||
|
||||
public function __construct()
|
||||
@@ -154,9 +154,10 @@ class BudgetLimitEnrichment implements EnrichmentInterface
|
||||
|
||||
/** @var BudgetLimit $budgetLimit */
|
||||
foreach ($this->collection as $budgetLimit) {
|
||||
Log::debug(sprintf('Filtering expenses for budget limit #%d (budget #%d)', $budgetLimit->id, $budgetLimit->budget_id));
|
||||
$id = (int)$budgetLimit->id;
|
||||
$filteredExpenses = $this->filterToBudget($expenses, $budgetLimit->budget_id);
|
||||
$filteredExpenses = $repository->sumCollectedExpenses($expenses, $budgetLimit->start_date, $budgetLimit->end_date, $budgetLimit->transactionCurrency, false);
|
||||
$filteredExpenses = $repository->sumCollectedExpenses($filteredExpenses, $budgetLimit->start_date, $budgetLimit->end_date, $budgetLimit->transactionCurrency, false);
|
||||
$this->expenses[$id] = array_values($filteredExpenses);
|
||||
|
||||
if (true === $this->convertToPrimary && $budgetLimit->transactionCurrency->id !== $this->primaryCurrency->id) {
|
||||
@@ -195,6 +196,9 @@ class BudgetLimitEnrichment implements EnrichmentInterface
|
||||
|
||||
private function filterToBudget(array $expenses, int $budget): array
|
||||
{
|
||||
return array_filter($expenses, fn (array $item) => (int)$item['budget_id'] === $budget);
|
||||
$result = array_filter($expenses, fn (array $item) => (int)$item['budget_id'] === $budget);
|
||||
Log::debug(sprintf('filterToBudget for budget #%d, from %d to %d items', $budget, count($expenses), count($result)));
|
||||
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
|
@@ -130,7 +130,7 @@ class PiggyBankEnrichment implements EnrichmentInterface
|
||||
}
|
||||
$this->amounts[$id][$accountId]['current_amount'] = bcadd($this->amounts[$id][$accountId]['current_amount'], (string) $item->current_amount);
|
||||
if (null !== $this->amounts[$id][$accountId]['pc_current_amount'] && null !== $item->native_current_amount) {
|
||||
$this->amounts[$id][$accountId]['pc_current_amount'] = bcadd($this->amounts[$id][$accountId]['pc_current_amount'], $item->native_current_amount);
|
||||
$this->amounts[$id][$accountId]['pc_current_amount'] = bcadd($this->amounts[$id][$accountId]['pc_current_amount'], (string) $item->native_current_amount);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -258,6 +258,12 @@ trait ConvertsDataTypes
|
||||
if ('yes' === $value) {
|
||||
return true;
|
||||
}
|
||||
if ('on' === $value) {
|
||||
return true;
|
||||
}
|
||||
if ('y' === $value) {
|
||||
return true;
|
||||
}
|
||||
if ('1' === $value) {
|
||||
return true;
|
||||
}
|
||||
|
@@ -114,20 +114,20 @@ class AmountFormat extends AbstractExtension
|
||||
{
|
||||
return new TwigFunction(
|
||||
'formatAmountBySymbol',
|
||||
static function (string $amount, ?string $symbol, ?int $decimalPlaces = null, ?bool $coloured = null): string {
|
||||
static function (string $amount, ?string $symbol = null, ?int $decimalPlaces = null, ?bool $coloured = null): string {
|
||||
|
||||
if (null === $symbol) {
|
||||
$message = sprintf('formatAmountBySymbol("%s", %s, %d, %s) was called without a symbol. Please browse to /flush to clear your cache.', $amount, var_export($symbol, true), $decimalPlaces, var_export($coloured, true));
|
||||
$message = sprintf('formatAmountBySymbol("%s", %s, %d, %s) was called without a symbol. Please browse to /flush to clear your cache.', $amount, var_export($symbol, true), $decimalPlaces, var_export($coloured, true));
|
||||
Log::error($message);
|
||||
|
||||
throw new FireflyException($message);
|
||||
$currency = Amount::getPrimaryCurrency();
|
||||
}
|
||||
if (null !== $symbol) {
|
||||
$decimalPlaces ??= 2;
|
||||
$coloured ??= true;
|
||||
$currency = new TransactionCurrency();
|
||||
$currency->symbol = $symbol;
|
||||
$currency->decimal_places = $decimalPlaces;
|
||||
}
|
||||
|
||||
$decimalPlaces ??= 2;
|
||||
$coloured ??= true;
|
||||
$currency = new TransactionCurrency();
|
||||
$currency->symbol = $symbol;
|
||||
$currency->decimal_places = $decimalPlaces;
|
||||
|
||||
return Amount::formatAnything($currency, $amount, $coloured);
|
||||
},
|
||||
|
@@ -508,9 +508,11 @@ class SearchRuleEngine implements RuleEngineInterface
|
||||
{
|
||||
Log::debug(sprintf('Going to fire group #%d with %d rule(s)', $group->id, $group->rules->count()));
|
||||
|
||||
$rules = $group->rules()->orderBy('order', 'ASC')->get();
|
||||
|
||||
/** @var Rule $rule */
|
||||
foreach ($group->rules as $rule) {
|
||||
Log::debug(sprintf('Going to fire rule #%d from group #%d', $rule->id, $group->id));
|
||||
foreach ($rules as $rule) {
|
||||
Log::debug(sprintf('Going to fire rule #%d with order #%d from group #%d', $rule->id, $rule->order, $group->id));
|
||||
$result = $this->fireRule($rule);
|
||||
if (true === $result && true === $rule->stop_processing) {
|
||||
Log::debug(sprintf('The rule was triggered and rule->stop_processing = true, so group #%d will stop processing further rules.', $group->id));
|
||||
|
@@ -27,6 +27,7 @@ namespace FireflyIII\Validation\Account;
|
||||
use FireflyIII\Enums\AccountTypeEnum;
|
||||
use FireflyIII\Models\Account;
|
||||
use FireflyIII\Models\AccountType;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
|
||||
/**
|
||||
* Trait DepositValidation
|
||||
@@ -40,7 +41,7 @@ trait DepositValidation
|
||||
$accountName = array_key_exists('name', $array) ? $array['name'] : null;
|
||||
$accountIban = array_key_exists('iban', $array) ? $array['iban'] : null;
|
||||
|
||||
app('log')->debug('Now in validateDepositDestination', $array);
|
||||
Log::debug('Now in validateDepositDestination', $array);
|
||||
|
||||
// source can be any of the following types.
|
||||
$validTypes = $this->combinations[$this->transactionType][$this->source->accountType->type] ?? [];
|
||||
@@ -48,12 +49,12 @@ trait DepositValidation
|
||||
// if both values are NULL we return false,
|
||||
// because the destination of a deposit can't be created.
|
||||
$this->destError = (string) trans('validation.deposit_dest_need_data');
|
||||
app('log')->error('Both values are NULL, cant create deposit destination.');
|
||||
Log::error('Both values are NULL, cant create deposit destination.');
|
||||
$result = false;
|
||||
}
|
||||
// if the account can be created anyway we don't need to search.
|
||||
if (null === $result && true === $this->canCreateTypes($validTypes)) {
|
||||
app('log')->debug('Can create some of these types, so return true.');
|
||||
Log::debug('Can create some of these types, so return true.');
|
||||
$result = true;
|
||||
}
|
||||
|
||||
@@ -61,17 +62,17 @@ trait DepositValidation
|
||||
// otherwise try to find the account:
|
||||
$search = $this->findExistingAccount($validTypes, $array);
|
||||
if (null === $search) {
|
||||
app('log')->debug('findExistingAccount() returned NULL, so the result is false.');
|
||||
Log::debug('findExistingAccount() returned NULL, so the result is false.');
|
||||
$this->destError = (string) trans('validation.deposit_dest_bad_data', ['id' => $accountId, 'name' => $accountName]);
|
||||
$result = false;
|
||||
}
|
||||
if (null !== $search) {
|
||||
app('log')->debug(sprintf('findExistingAccount() returned #%d ("%s"), so the result is true.', $search->id, $search->name));
|
||||
Log::debug(sprintf('findExistingAccount() returned #%d ("%s"), so the result is true.', $search->id, $search->name));
|
||||
$this->setDestination($search);
|
||||
$result = true;
|
||||
}
|
||||
}
|
||||
app('log')->debug(sprintf('validateDepositDestination will return %s', var_export($result, true)));
|
||||
Log::debug(sprintf('validateDepositDestination will return %s', var_export($result, true)));
|
||||
|
||||
return $result;
|
||||
}
|
||||
@@ -92,7 +93,7 @@ trait DepositValidation
|
||||
$accountName = array_key_exists('name', $array) ? $array['name'] : null;
|
||||
$accountIban = array_key_exists('iban', $array) ? $array['iban'] : null;
|
||||
$accountNumber = array_key_exists('number', $array) ? $array['number'] : null;
|
||||
app('log')->debug('Now in validateDepositSource', $array);
|
||||
Log::debug('Now in validateDepositSource', $array);
|
||||
|
||||
// null = we found nothing at all or didn't even search
|
||||
// false = invalid results
|
||||
@@ -114,7 +115,7 @@ trait DepositValidation
|
||||
|
||||
// if there is an iban, it can only be in use by a valid source type, or we will fail.
|
||||
if (null !== $accountIban && '' !== $accountIban) {
|
||||
app('log')->debug('Check if there is not already another account with this IBAN');
|
||||
Log::debug('Check if there is not already another account with this IBAN');
|
||||
$existing = $this->findExistingAccount($validTypes, ['iban' => $accountIban], true);
|
||||
if (null !== $existing) {
|
||||
$this->sourceError = (string) trans('validation.deposit_src_iban_exists');
|
||||
@@ -128,11 +129,14 @@ trait DepositValidation
|
||||
if (null !== $accountId) {
|
||||
$search = $this->accountRepository->find($accountId);
|
||||
if (null !== $search && !in_array($search->accountType->type, $validTypes, true)) {
|
||||
app('log')->debug(sprintf('User submitted an ID (#%d), which is a "%s", so this is not a valid source.', $accountId, $search->accountType->type));
|
||||
app('log')->debug(sprintf('Firefly III accepts ID #%d as valid account data.', $accountId));
|
||||
Log::debug(sprintf('User submitted an ID (#%d), which is a "%s", so this is not a valid source.', $accountId, $search->accountType->type));
|
||||
Log::debug(sprintf('Firefly III does not accept ID #%d as valid account data.', $accountId));
|
||||
// #10921 Set result false
|
||||
$this->sourceError = (string) trans('validation.withdrawal_source_bad_data', ['id' => $accountId, 'name' => $accountName]);
|
||||
$result = false;
|
||||
}
|
||||
if (null !== $search && in_array($search->accountType->type, $validTypes, true)) {
|
||||
app('log')->debug('ID result is not null and seems valid, save as source account.');
|
||||
Log::debug('ID result is not null and seems valid, save as source account.');
|
||||
$this->setSource($search);
|
||||
$result = true;
|
||||
}
|
||||
@@ -142,11 +146,11 @@ trait DepositValidation
|
||||
if (null !== $accountIban) {
|
||||
$search = $this->accountRepository->findByIbanNull($accountIban, $validTypes);
|
||||
if (null !== $search && !in_array($search->accountType->type, $validTypes, true)) {
|
||||
app('log')->debug(sprintf('User submitted IBAN ("%s"), which is a "%s", so this is not a valid source.', $accountIban, $search->accountType->type));
|
||||
Log::debug(sprintf('User submitted IBAN ("%s"), which is a "%s", so this is not a valid source.', $accountIban, $search->accountType->type));
|
||||
$result = false;
|
||||
}
|
||||
if (null !== $search && in_array($search->accountType->type, $validTypes, true)) {
|
||||
app('log')->debug('IBAN result is not null and seems valid, save as source account.');
|
||||
Log::debug('IBAN result is not null and seems valid, save as source account.');
|
||||
$this->setSource($search);
|
||||
$result = true;
|
||||
}
|
||||
@@ -156,13 +160,13 @@ trait DepositValidation
|
||||
if (null !== $accountNumber && '' !== $accountNumber) {
|
||||
$search = $this->accountRepository->findByAccountNumber($accountNumber, $validTypes);
|
||||
if (null !== $search && !in_array($search->accountType->type, $validTypes, true)) {
|
||||
app('log')->debug(
|
||||
Log::debug(
|
||||
sprintf('User submitted number ("%s"), which is a "%s", so this is not a valid source.', $accountNumber, $search->accountType->type)
|
||||
);
|
||||
$result = false;
|
||||
}
|
||||
if (null !== $search && in_array($search->accountType->type, $validTypes, true)) {
|
||||
app('log')->debug('Number result is not null and seems valid, save as source account.');
|
||||
Log::debug('Number result is not null and seems valid, save as source account.');
|
||||
$this->setSource($search);
|
||||
$result = true;
|
||||
}
|
||||
|
@@ -27,6 +27,7 @@ namespace FireflyIII\Validation\Account;
|
||||
use FireflyIII\Enums\AccountTypeEnum;
|
||||
use FireflyIII\Models\Account;
|
||||
use FireflyIII\Models\AccountType;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
|
||||
/**
|
||||
* Trait OBValidation
|
||||
@@ -38,7 +39,7 @@ trait OBValidation
|
||||
$result = null;
|
||||
$accountId = array_key_exists('id', $array) ? $array['id'] : null;
|
||||
$accountName = array_key_exists('name', $array) ? $array['name'] : null;
|
||||
app('log')->debug('Now in validateOBDestination', $array);
|
||||
Log::debug('Now in validateOBDestination', $array);
|
||||
|
||||
// source can be any of the following types.
|
||||
$validTypes = $this->combinations[$this->transactionType][$this->source?->accountType->type] ?? [];
|
||||
@@ -46,12 +47,12 @@ trait OBValidation
|
||||
// if both values are NULL we return false,
|
||||
// because the destination of a deposit can't be created.
|
||||
$this->destError = (string) trans('validation.ob_dest_need_data');
|
||||
app('log')->error('Both values are NULL, cant create OB destination.');
|
||||
Log::error('Both values are NULL, cant create OB destination.');
|
||||
$result = false;
|
||||
}
|
||||
// if the account can be created anyway we don't need to search.
|
||||
if (null === $result && true === $this->canCreateTypes($validTypes)) {
|
||||
app('log')->debug('Can create some of these types, so return true.');
|
||||
Log::debug('Can create some of these types, so return true.');
|
||||
$result = true;
|
||||
}
|
||||
|
||||
@@ -59,17 +60,17 @@ trait OBValidation
|
||||
// otherwise try to find the account:
|
||||
$search = $this->findExistingAccount($validTypes, $array);
|
||||
if (null === $search) {
|
||||
app('log')->debug('findExistingAccount() returned NULL, so the result is false.', $validTypes);
|
||||
Log::debug('findExistingAccount() returned NULL, so the result is false.', $validTypes);
|
||||
$this->destError = (string) trans('validation.ob_dest_bad_data', ['id' => $accountId, 'name' => $accountName]);
|
||||
$result = false;
|
||||
}
|
||||
if (null !== $search) {
|
||||
app('log')->debug(sprintf('findExistingAccount() returned #%d ("%s"), so the result is true.', $search->id, $search->name));
|
||||
Log::debug(sprintf('findExistingAccount() returned #%d ("%s"), so the result is true.', $search->id, $search->name));
|
||||
$this->setDestination($search);
|
||||
$result = true;
|
||||
}
|
||||
}
|
||||
app('log')->debug(sprintf('validateOBDestination(%d, "%s") will return %s', $accountId, $accountName, var_export($result, true)));
|
||||
Log::debug(sprintf('validateOBDestination(%d, "%s") will return %s', $accountId, $accountName, var_export($result, true)));
|
||||
|
||||
return $result;
|
||||
}
|
||||
@@ -84,7 +85,7 @@ trait OBValidation
|
||||
{
|
||||
$accountId = array_key_exists('id', $array) ? $array['id'] : null;
|
||||
$accountName = array_key_exists('name', $array) ? $array['name'] : null;
|
||||
app('log')->debug('Now in validateOBSource', $array);
|
||||
Log::debug('Now in validateOBSource', $array);
|
||||
$result = null;
|
||||
// source can be any of the following types.
|
||||
$validTypes = array_keys($this->combinations[$this->transactionType]);
|
||||
@@ -100,19 +101,19 @@ trait OBValidation
|
||||
// if the user submits an ID only but that ID is not of the correct type,
|
||||
// return false.
|
||||
if (null !== $accountId && null === $accountName) {
|
||||
app('log')->debug('Source ID is not null, but name is null.');
|
||||
Log::debug('Source ID is not null, but name is null.');
|
||||
$search = $this->accountRepository->find($accountId);
|
||||
|
||||
// the source resulted in an account, but it's not of a valid type.
|
||||
if (null !== $search && !in_array($search->accountType->type, $validTypes, true)) {
|
||||
$message = sprintf('User submitted only an ID (#%d), which is a "%s", so this is not a valid source.', $accountId, $search->accountType->type);
|
||||
app('log')->debug($message);
|
||||
Log::debug($message);
|
||||
$this->sourceError = $message;
|
||||
$result = false;
|
||||
}
|
||||
// the source resulted in an account, AND it's of a valid type.
|
||||
if (null !== $search && in_array($search->accountType->type, $validTypes, true)) {
|
||||
app('log')->debug(sprintf('Found account of correct type: #%d, "%s"', $search->id, $search->name));
|
||||
Log::debug(sprintf('Found account of correct type: #%d, "%s"', $search->id, $search->name));
|
||||
$this->setSource($search);
|
||||
$result = true;
|
||||
}
|
||||
@@ -120,7 +121,7 @@ trait OBValidation
|
||||
|
||||
// if the account can be created anyway we don't need to search.
|
||||
if (null === $result && true === $this->canCreateTypes($validTypes)) {
|
||||
app('log')->debug('Result is still null.');
|
||||
Log::debug('Result is still null.');
|
||||
$result = true;
|
||||
|
||||
// set the source to be a (dummy) initial balance account.
|
||||
|
@@ -26,6 +26,7 @@ namespace FireflyIII\Validation\Account;
|
||||
|
||||
use FireflyIII\Enums\AccountTypeEnum;
|
||||
use FireflyIII\Models\Account;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
|
||||
/**
|
||||
* Trait WithdrawalValidation
|
||||
@@ -37,14 +38,14 @@ trait WithdrawalValidation
|
||||
$accountId = array_key_exists('id', $array) ? $array['id'] : null;
|
||||
$accountName = array_key_exists('name', $array) ? $array['name'] : null;
|
||||
$accountIban = array_key_exists('iban', $array) ? $array['iban'] : null;
|
||||
app('log')->debug('Now in validateGenericSource', $array);
|
||||
Log::debug('Now in validateGenericSource', $array);
|
||||
// source can be any of the following types.
|
||||
$validTypes = [AccountTypeEnum::ASSET->value, AccountTypeEnum::REVENUE->value, AccountTypeEnum::LOAN->value, AccountTypeEnum::DEBT->value, AccountTypeEnum::MORTGAGE->value];
|
||||
if (null === $accountId && null === $accountName && null === $accountIban && false === $this->canCreateTypes($validTypes)) {
|
||||
// if both values are NULL we return TRUE
|
||||
// because we assume the user doesn't want to submit / change anything.
|
||||
$this->sourceError = (string) trans('validation.withdrawal_source_need_data');
|
||||
app('log')->warning('[a] Not a valid source. Need more data.');
|
||||
Log::warning('[a] Not a valid source. Need more data.');
|
||||
|
||||
return false;
|
||||
}
|
||||
@@ -53,12 +54,12 @@ trait WithdrawalValidation
|
||||
$search = $this->findExistingAccount($validTypes, $array);
|
||||
if (null === $search) {
|
||||
$this->sourceError = (string) trans('validation.withdrawal_source_bad_data', ['id' => $accountId, 'name' => $accountName]);
|
||||
app('log')->warning('Not a valid source. Cant find it.', $validTypes);
|
||||
Log::warning('Not a valid source. Cant find it.', $validTypes);
|
||||
|
||||
return false;
|
||||
}
|
||||
$this->setSource($search);
|
||||
app('log')->debug('Valid source account!');
|
||||
Log::debug('Valid source account!');
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -73,10 +74,10 @@ trait WithdrawalValidation
|
||||
$accountName = array_key_exists('name', $array) ? $array['name'] : null;
|
||||
$accountIban = array_key_exists('iban', $array) ? $array['iban'] : null;
|
||||
$accountNumber = array_key_exists('number', $array) ? $array['number'] : null;
|
||||
app('log')->debug('Now in validateWithdrawalDestination()', $array);
|
||||
Log::debug('Now in validateWithdrawalDestination()', $array);
|
||||
// source can be any of the following types.
|
||||
$validTypes = $this->combinations[$this->transactionType][$this->source->accountType->type] ?? [];
|
||||
app('log')->debug('Source type can be: ', $validTypes);
|
||||
Log::debug('Source type can be: ', $validTypes);
|
||||
if (null === $accountId && null === $accountName && null === $accountIban && null === $accountNumber && false === $this->canCreateTypes($validTypes)) {
|
||||
// if both values are NULL return false,
|
||||
// because the destination of a withdrawal can never be created automatically.
|
||||
@@ -86,7 +87,7 @@ trait WithdrawalValidation
|
||||
}
|
||||
|
||||
// if there's an ID it must be of the "validTypes".
|
||||
if (null !== $accountId && 0 !== $accountId) {
|
||||
if (null !== $accountId && 0 !== $accountId && $accountId !== $this->source->id) {
|
||||
$found = $this->accountRepository->find($accountId);
|
||||
if (null !== $found) {
|
||||
$type = $found->accountType->type;
|
||||
@@ -104,7 +105,7 @@ trait WithdrawalValidation
|
||||
// if there is an iban, it can only be in use by a valid destination type, or we will fail.
|
||||
// the inverse of $validTypes is
|
||||
if (null !== $accountIban && '' !== $accountIban) {
|
||||
app('log')->debug('Check if there is not already an account with this IBAN');
|
||||
Log::debug('Check if there is not already an account with this IBAN');
|
||||
// the inverse flag reverses the search, searching for everything that is NOT a valid type.
|
||||
$existing = $this->findExistingAccount($validTypes, ['iban' => $accountIban], true);
|
||||
if (null !== $existing) {
|
||||
@@ -125,14 +126,14 @@ trait WithdrawalValidation
|
||||
$accountIban = array_key_exists('iban', $array) ? $array['iban'] : null;
|
||||
$accountNumber = array_key_exists('number', $array) ? $array['number'] : null;
|
||||
|
||||
app('log')->debug('Now in validateWithdrawalSource', $array);
|
||||
Log::debug('Now in validateWithdrawalSource', $array);
|
||||
// source can be any of the following types.
|
||||
$validTypes = array_keys($this->combinations[$this->transactionType]);
|
||||
if (null === $accountId && null === $accountName && null === $accountNumber && null === $accountIban && false === $this->canCreateTypes($validTypes)) {
|
||||
// if both values are NULL we return false,
|
||||
// because the source of a withdrawal can't be created.
|
||||
$this->sourceError = (string) trans('validation.withdrawal_source_need_data');
|
||||
app('log')->warning('[b] Not a valid source. Need more data.');
|
||||
Log::warning('[b] Not a valid source. Need more data.');
|
||||
|
||||
return false;
|
||||
}
|
||||
@@ -141,12 +142,12 @@ trait WithdrawalValidation
|
||||
$search = $this->findExistingAccount($validTypes, $array);
|
||||
if (null === $search) {
|
||||
$this->sourceError = (string) trans('validation.withdrawal_source_bad_data', ['id' => $accountId, 'name' => $accountName]);
|
||||
app('log')->warning('Not a valid source. Cant find it.', $validTypes);
|
||||
Log::warning('Not a valid source. Cant find it.', $validTypes);
|
||||
|
||||
return false;
|
||||
}
|
||||
$this->setSource($search);
|
||||
app('log')->debug('Valid source account!');
|
||||
Log::debug('Valid source account!');
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@@ -36,6 +36,7 @@ use FireflyIII\Validation\Account\OBValidation;
|
||||
use FireflyIII\Validation\Account\ReconciliationValidation;
|
||||
use FireflyIII\Validation\Account\TransferValidation;
|
||||
use FireflyIII\Validation\Account\WithdrawalValidation;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
|
||||
/**
|
||||
* Class AccountValidator
|
||||
@@ -80,10 +81,10 @@ class AccountValidator
|
||||
public function setSource(?Account $account): void
|
||||
{
|
||||
if (!$account instanceof Account) {
|
||||
app('log')->debug('AccountValidator source is set to NULL');
|
||||
Log::debug('AccountValidator source is set to NULL');
|
||||
}
|
||||
if ($account instanceof Account) {
|
||||
app('log')->debug(sprintf('AccountValidator source is set to #%d: "%s" (%s)', $account->id, $account->name, $account->accountType?->type));
|
||||
Log::debug(sprintf('AccountValidator source is set to #%d: "%s" (%s)', $account->id, $account->name, $account->accountType?->type));
|
||||
}
|
||||
$this->source = $account;
|
||||
}
|
||||
@@ -91,17 +92,17 @@ class AccountValidator
|
||||
public function setDestination(?Account $account): void
|
||||
{
|
||||
if (!$account instanceof Account) {
|
||||
app('log')->debug('AccountValidator destination is set to NULL');
|
||||
Log::debug('AccountValidator destination is set to NULL');
|
||||
}
|
||||
if ($account instanceof Account) {
|
||||
app('log')->debug(sprintf('AccountValidator destination is set to #%d: "%s" (%s)', $account->id, $account->name, $account->accountType->type));
|
||||
Log::debug(sprintf('AccountValidator destination is set to #%d: "%s" (%s)', $account->id, $account->name, $account->accountType->type));
|
||||
}
|
||||
$this->destination = $account;
|
||||
}
|
||||
|
||||
public function setTransactionType(string $transactionType): void
|
||||
{
|
||||
app('log')->debug(sprintf('Transaction type for validator is now "%s".', ucfirst($transactionType)));
|
||||
Log::debug(sprintf('Transaction type for validator is now "%s".', ucfirst($transactionType)));
|
||||
$this->transactionType = ucfirst($transactionType);
|
||||
}
|
||||
|
||||
@@ -117,9 +118,9 @@ class AccountValidator
|
||||
|
||||
public function validateDestination(array $array): bool
|
||||
{
|
||||
app('log')->debug('Now in AccountValidator::validateDestination()', $array);
|
||||
Log::debug('Now in AccountValidator::validateDestination()', $array);
|
||||
if (!$this->source instanceof Account) {
|
||||
app('log')->error('Source is NULL, always FALSE.');
|
||||
Log::error('Source is NULL, always FALSE.');
|
||||
$this->destError = 'No source account validation has taken place yet. Please do this first or overrule the object.';
|
||||
|
||||
return false;
|
||||
@@ -128,7 +129,7 @@ class AccountValidator
|
||||
switch ($this->transactionType) {
|
||||
default:
|
||||
$this->destError = sprintf('AccountValidator::validateDestination cannot handle "%s", so it will always return false.', $this->transactionType);
|
||||
app('log')->error(sprintf('AccountValidator::validateDestination cannot handle "%s", so it will always return false.', $this->transactionType));
|
||||
Log::error(sprintf('AccountValidator::validateDestination cannot handle "%s", so it will always return false.', $this->transactionType));
|
||||
|
||||
$result = false;
|
||||
|
||||
@@ -170,11 +171,11 @@ class AccountValidator
|
||||
|
||||
public function validateSource(array $array): bool
|
||||
{
|
||||
app('log')->debug('Now in AccountValidator::validateSource()', $array);
|
||||
Log::debug('Now in AccountValidator::validateSource()', $array);
|
||||
|
||||
switch ($this->transactionType) {
|
||||
default:
|
||||
app('log')->error(sprintf('AccountValidator::validateSource cannot handle "%s", so it will do a generic check.', $this->transactionType));
|
||||
Log::error(sprintf('AccountValidator::validateSource cannot handle "%s", so it will do a generic check.', $this->transactionType));
|
||||
$result = $this->validateGenericSource($array);
|
||||
|
||||
break;
|
||||
@@ -205,7 +206,7 @@ class AccountValidator
|
||||
break;
|
||||
|
||||
case TransactionTypeEnum::RECONCILIATION->value:
|
||||
app('log')->debug('Calling validateReconciliationSource');
|
||||
Log::debug('Calling validateReconciliationSource');
|
||||
$result = $this->validateReconciliationSource($array);
|
||||
|
||||
break;
|
||||
@@ -216,17 +217,17 @@ class AccountValidator
|
||||
|
||||
protected function canCreateTypes(array $accountTypes): bool
|
||||
{
|
||||
app('log')->debug('Can we create any of these types?', $accountTypes);
|
||||
Log::debug('Can we create any of these types?', $accountTypes);
|
||||
|
||||
/** @var string $accountType */
|
||||
foreach ($accountTypes as $accountType) {
|
||||
if ($this->canCreateType($accountType)) {
|
||||
app('log')->debug(sprintf('YES, we can create a %s', $accountType));
|
||||
Log::debug(sprintf('YES, we can create a %s', $accountType));
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
app('log')->debug('NO, we cant create any of those.');
|
||||
Log::debug('NO, we cant create any of those.');
|
||||
|
||||
return false;
|
||||
}
|
||||
@@ -250,8 +251,8 @@ class AccountValidator
|
||||
*/
|
||||
protected function findExistingAccount(array $validTypes, array $data, bool $inverse = false): ?Account
|
||||
{
|
||||
app('log')->debug('Now in findExistingAccount', [$validTypes, $data]);
|
||||
app('log')->debug('The search will be reversed!');
|
||||
Log::debug('Now in findExistingAccount', [$validTypes, $data]);
|
||||
Log::debug('The search will be reversed!');
|
||||
$accountId = array_key_exists('id', $data) ? $data['id'] : null;
|
||||
$accountIban = array_key_exists('iban', $data) ? $data['iban'] : null;
|
||||
$accountNumber = array_key_exists('number', $data) ? $data['number'] : null;
|
||||
@@ -264,7 +265,7 @@ class AccountValidator
|
||||
$check = in_array($accountType, $validTypes, true);
|
||||
$check = $inverse ? !$check : $check; // reverse the validation check if necessary.
|
||||
if (($first instanceof Account) && $check) {
|
||||
app('log')->debug(sprintf('ID: Found %s account #%d ("%s", IBAN "%s")', $first->accountType->type, $first->id, $first->name, $first->iban ?? 'no iban'));
|
||||
Log::debug(sprintf('ID: Found %s account #%d ("%s", IBAN "%s")', $first->accountType->type, $first->id, $first->name, $first->iban ?? 'no iban'));
|
||||
|
||||
return $first;
|
||||
}
|
||||
@@ -277,7 +278,7 @@ class AccountValidator
|
||||
$check = in_array($accountType, $validTypes, true);
|
||||
$check = $inverse ? !$check : $check; // reverse the validation check if necessary.
|
||||
if (($first instanceof Account) && $check) {
|
||||
app('log')->debug(sprintf('Iban: Found %s account #%d ("%s", IBAN "%s")', $first->accountType->type, $first->id, $first->name, $first->iban ?? 'no iban'));
|
||||
Log::debug(sprintf('Iban: Found %s account #%d ("%s", IBAN "%s")', $first->accountType->type, $first->id, $first->name, $first->iban ?? 'no iban'));
|
||||
|
||||
return $first;
|
||||
}
|
||||
@@ -290,7 +291,7 @@ class AccountValidator
|
||||
$check = in_array($accountType, $validTypes, true);
|
||||
$check = $inverse ? !$check : $check; // reverse the validation check if necessary.
|
||||
if (($first instanceof Account) && $check) {
|
||||
app('log')->debug(sprintf('Number: Found %s account #%d ("%s", IBAN "%s")', $first->accountType->type, $first->id, $first->name, $first->iban ?? 'no iban'));
|
||||
Log::debug(sprintf('Number: Found %s account #%d ("%s", IBAN "%s")', $first->accountType->type, $first->id, $first->name, $first->iban ?? 'no iban'));
|
||||
|
||||
return $first;
|
||||
}
|
||||
@@ -300,12 +301,12 @@ class AccountValidator
|
||||
if ('' !== (string) $accountName) {
|
||||
$first = $this->accountRepository->findByName($accountName, $validTypes);
|
||||
if ($first instanceof Account) {
|
||||
app('log')->debug(sprintf('Name: Found %s account #%d ("%s", IBAN "%s")', $first->accountType->type, $first->id, $first->name, $first->iban ?? 'no iban'));
|
||||
Log::debug(sprintf('Name: Found %s account #%d ("%s", IBAN "%s")', $first->accountType->type, $first->id, $first->name, $first->iban ?? 'no iban'));
|
||||
|
||||
return $first;
|
||||
}
|
||||
}
|
||||
app('log')->debug('Found nothing in findExistingAccount()');
|
||||
Log::debug('Found nothing in findExistingAccount()');
|
||||
|
||||
return null;
|
||||
}
|
||||
|
17
changelog.md
17
changelog.md
@@ -3,7 +3,22 @@
|
||||
All notable changes to this project will be documented in this file.
|
||||
This project adheres to [Semantic Versioning](http://semver.org/).
|
||||
|
||||
## 6.4.0 - 2025-09-19
|
||||
## 6.4.1 - 2025-09-15
|
||||
|
||||
### Fixed
|
||||
|
||||
- Fixed a missing filter from [issue 10803](https://github.com/firefly-iii/firefly-iii/issues/10803).
|
||||
- #10891
|
||||
- #10920
|
||||
- #10921
|
||||
- #10833
|
||||
|
||||
### API
|
||||
|
||||
- #10908
|
||||
|
||||
|
||||
## 6.4.0 - 2025-09-14
|
||||
|
||||
### Added
|
||||
|
||||
|
176
composer.lock
generated
176
composer.lock
generated
@@ -324,16 +324,16 @@
|
||||
},
|
||||
{
|
||||
"name": "dasprid/enum",
|
||||
"version": "1.0.6",
|
||||
"version": "1.0.7",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/DASPRiD/Enum.git",
|
||||
"reference": "8dfd07c6d2cf31c8da90c53b83c026c7696dda90"
|
||||
"reference": "b5874fa9ed0043116c72162ec7f4fb50e02e7cce"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/DASPRiD/Enum/zipball/8dfd07c6d2cf31c8da90c53b83c026c7696dda90",
|
||||
"reference": "8dfd07c6d2cf31c8da90c53b83c026c7696dda90",
|
||||
"url": "https://api.github.com/repos/DASPRiD/Enum/zipball/b5874fa9ed0043116c72162ec7f4fb50e02e7cce",
|
||||
"reference": "b5874fa9ed0043116c72162ec7f4fb50e02e7cce",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -368,9 +368,9 @@
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/DASPRiD/Enum/issues",
|
||||
"source": "https://github.com/DASPRiD/Enum/tree/1.0.6"
|
||||
"source": "https://github.com/DASPRiD/Enum/tree/1.0.7"
|
||||
},
|
||||
"time": "2024-08-09T14:30:48+00:00"
|
||||
"time": "2025-09-16T12:23:56+00:00"
|
||||
},
|
||||
{
|
||||
"name": "defuse/php-encryption",
|
||||
@@ -1878,16 +1878,16 @@
|
||||
},
|
||||
{
|
||||
"name": "laravel/framework",
|
||||
"version": "v12.28.1",
|
||||
"version": "v12.30.1",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/laravel/framework.git",
|
||||
"reference": "868c1f2d3dba4df6d21e3a8d818479f094cfd942"
|
||||
"reference": "7f61e8679f9142f282a0184ac7ef9e3834bfd023"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/laravel/framework/zipball/868c1f2d3dba4df6d21e3a8d818479f094cfd942",
|
||||
"reference": "868c1f2d3dba4df6d21e3a8d818479f094cfd942",
|
||||
"url": "https://api.github.com/repos/laravel/framework/zipball/7f61e8679f9142f282a0184ac7ef9e3834bfd023",
|
||||
"reference": "7f61e8679f9142f282a0184ac7ef9e3834bfd023",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -1915,6 +1915,7 @@
|
||||
"monolog/monolog": "^3.0",
|
||||
"nesbot/carbon": "^3.8.4",
|
||||
"nunomaduro/termwind": "^2.0",
|
||||
"phiki/phiki": "^2.0.0",
|
||||
"php": "^8.2",
|
||||
"psr/container": "^1.1.1|^2.0.1",
|
||||
"psr/log": "^1.0|^2.0|^3.0",
|
||||
@@ -2024,7 +2025,7 @@
|
||||
"ext-pdo": "Required to use all database features.",
|
||||
"ext-posix": "Required to use all features of the queue worker.",
|
||||
"ext-redis": "Required to use the Redis cache and queue drivers (^4.0|^5.0|^6.0).",
|
||||
"fakerphp/faker": "Required to use the eloquent factory builder (^1.9.1).",
|
||||
"fakerphp/faker": "Required to generate fake data using the fake() helper (^1.23).",
|
||||
"filp/whoops": "Required for friendly error pages in development (^2.14.3).",
|
||||
"laravel/tinker": "Required to use the tinker console command (^2.0).",
|
||||
"league/flysystem-aws-s3-v3": "Required to use the Flysystem S3 driver (^3.25.1).",
|
||||
@@ -2093,7 +2094,7 @@
|
||||
"issues": "https://github.com/laravel/framework/issues",
|
||||
"source": "https://github.com/laravel/framework"
|
||||
},
|
||||
"time": "2025-09-04T14:58:12+00:00"
|
||||
"time": "2025-09-18T21:07:07+00:00"
|
||||
},
|
||||
{
|
||||
"name": "laravel/passport",
|
||||
@@ -4349,6 +4350,77 @@
|
||||
},
|
||||
"time": "2020-10-15T08:29:30+00:00"
|
||||
},
|
||||
{
|
||||
"name": "phiki/phiki",
|
||||
"version": "v2.0.3",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/phikiphp/phiki.git",
|
||||
"reference": "fe51fe6dc31856cd776fd1b04ee74053a4271644"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/phikiphp/phiki/zipball/fe51fe6dc31856cd776fd1b04ee74053a4271644",
|
||||
"reference": "fe51fe6dc31856cd776fd1b04ee74053a4271644",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"ext-mbstring": "*",
|
||||
"league/commonmark": "^2.5.3",
|
||||
"php": "^8.2",
|
||||
"psr/simple-cache": "^3.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"illuminate/support": "^11.45",
|
||||
"laravel/pint": "^1.18.1",
|
||||
"orchestra/testbench": "^9.15",
|
||||
"pestphp/pest": "^3.5.1",
|
||||
"phpstan/extension-installer": "^1.4.3",
|
||||
"phpstan/phpstan": "^2.0",
|
||||
"symfony/var-dumper": "^7.1.6"
|
||||
},
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"laravel": {
|
||||
"providers": [
|
||||
"Phiki\\Adapters\\Laravel\\PhikiServiceProvider"
|
||||
]
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Phiki\\": "src/"
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Ryan Chandler",
|
||||
"email": "support@ryangjchandler.co.uk",
|
||||
"homepage": "https://ryangjchandler.co.uk",
|
||||
"role": "Developer"
|
||||
}
|
||||
],
|
||||
"description": "Syntax highlighting using TextMate grammars in PHP.",
|
||||
"support": {
|
||||
"issues": "https://github.com/phikiphp/phiki/issues",
|
||||
"source": "https://github.com/phikiphp/phiki/tree/v2.0.3"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
"url": "https://github.com/sponsors/ryangjchandler",
|
||||
"type": "github"
|
||||
},
|
||||
{
|
||||
"url": "https://buymeacoffee.com/ryangjchandler",
|
||||
"type": "other"
|
||||
}
|
||||
],
|
||||
"time": "2025-09-19T11:50:41+00:00"
|
||||
},
|
||||
{
|
||||
"name": "php-http/client-common",
|
||||
"version": "2.7.2",
|
||||
@@ -4973,21 +5045,21 @@
|
||||
},
|
||||
{
|
||||
"name": "pragmarx/google2fa-qrcode",
|
||||
"version": "v3.0.0",
|
||||
"version": "v3.0.1",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/antonioribeiro/google2fa-qrcode.git",
|
||||
"reference": "ce4d8a729b6c93741c607cfb2217acfffb5bf76b"
|
||||
"reference": "c23ebcc3a50de0d1566016a6dd1486e183bb78e1"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/antonioribeiro/google2fa-qrcode/zipball/ce4d8a729b6c93741c607cfb2217acfffb5bf76b",
|
||||
"reference": "ce4d8a729b6c93741c607cfb2217acfffb5bf76b",
|
||||
"url": "https://api.github.com/repos/antonioribeiro/google2fa-qrcode/zipball/c23ebcc3a50de0d1566016a6dd1486e183bb78e1",
|
||||
"reference": "c23ebcc3a50de0d1566016a6dd1486e183bb78e1",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=7.1",
|
||||
"pragmarx/google2fa": ">=4.0"
|
||||
"pragmarx/google2fa": "^4.0|^5.0|^6.0|^7.0|^8.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"bacon/bacon-qr-code": "^2.0",
|
||||
@@ -5034,9 +5106,9 @@
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/antonioribeiro/google2fa-qrcode/issues",
|
||||
"source": "https://github.com/antonioribeiro/google2fa-qrcode/tree/v3.0.0"
|
||||
"source": "https://github.com/antonioribeiro/google2fa-qrcode/tree/v3.0.1"
|
||||
},
|
||||
"time": "2021-08-15T12:53:48+00:00"
|
||||
"time": "2025-09-19T23:02:26+00:00"
|
||||
},
|
||||
{
|
||||
"name": "pragmarx/random",
|
||||
@@ -10738,16 +10810,16 @@
|
||||
},
|
||||
{
|
||||
"name": "larastan/larastan",
|
||||
"version": "v3.7.1",
|
||||
"version": "v3.7.2",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/larastan/larastan.git",
|
||||
"reference": "2e653fd19585a825e283b42f38378b21ae481cc7"
|
||||
"reference": "a761859a7487bd7d0cb8b662a7538a234d5bb5ae"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/larastan/larastan/zipball/2e653fd19585a825e283b42f38378b21ae481cc7",
|
||||
"reference": "2e653fd19585a825e283b42f38378b21ae481cc7",
|
||||
"url": "https://api.github.com/repos/larastan/larastan/zipball/a761859a7487bd7d0cb8b662a7538a234d5bb5ae",
|
||||
"reference": "a761859a7487bd7d0cb8b662a7538a234d5bb5ae",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -10761,7 +10833,7 @@
|
||||
"illuminate/pipeline": "^11.44.2 || ^12.4.1",
|
||||
"illuminate/support": "^11.44.2 || ^12.4.1",
|
||||
"php": "^8.2",
|
||||
"phpstan/phpstan": "^2.1.23"
|
||||
"phpstan/phpstan": "^2.1.28"
|
||||
},
|
||||
"require-dev": {
|
||||
"doctrine/coding-standard": "^13",
|
||||
@@ -10815,7 +10887,7 @@
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/larastan/larastan/issues",
|
||||
"source": "https://github.com/larastan/larastan/tree/v3.7.1"
|
||||
"source": "https://github.com/larastan/larastan/tree/v3.7.2"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
@@ -10823,7 +10895,7 @@
|
||||
"type": "github"
|
||||
}
|
||||
],
|
||||
"time": "2025-09-10T19:42:11+00:00"
|
||||
"time": "2025-09-19T09:03:05+00:00"
|
||||
},
|
||||
{
|
||||
"name": "laravel-json-api/testing",
|
||||
@@ -11332,16 +11404,16 @@
|
||||
},
|
||||
{
|
||||
"name": "phpstan/phpstan",
|
||||
"version": "2.1.25",
|
||||
"version": "2.1.28",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/phpstan/phpstan.git",
|
||||
"reference": "4087d28bd252895874e174d65e26b2c202ed893a"
|
||||
"reference": "578fa296a166605d97b94091f724f1257185d278"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/phpstan/phpstan/zipball/4087d28bd252895874e174d65e26b2c202ed893a",
|
||||
"reference": "4087d28bd252895874e174d65e26b2c202ed893a",
|
||||
"url": "https://api.github.com/repos/phpstan/phpstan/zipball/578fa296a166605d97b94091f724f1257185d278",
|
||||
"reference": "578fa296a166605d97b94091f724f1257185d278",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -11386,7 +11458,7 @@
|
||||
"type": "github"
|
||||
}
|
||||
],
|
||||
"time": "2025-09-12T14:26:42+00:00"
|
||||
"time": "2025-09-19T08:58:49+00:00"
|
||||
},
|
||||
{
|
||||
"name": "phpstan/phpstan-deprecation-rules",
|
||||
@@ -11485,16 +11557,16 @@
|
||||
},
|
||||
{
|
||||
"name": "phpunit/php-code-coverage",
|
||||
"version": "12.3.7",
|
||||
"version": "12.3.8",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/sebastianbergmann/php-code-coverage.git",
|
||||
"reference": "bbede0f5593dad37af3be6a6f8e6ae1885e8a0a9"
|
||||
"reference": "99e692c6a84708211f7536ba322bbbaef57ac7fc"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/bbede0f5593dad37af3be6a6f8e6ae1885e8a0a9",
|
||||
"reference": "bbede0f5593dad37af3be6a6f8e6ae1885e8a0a9",
|
||||
"url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/99e692c6a84708211f7536ba322bbbaef57ac7fc",
|
||||
"reference": "99e692c6a84708211f7536ba322bbbaef57ac7fc",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -11550,7 +11622,7 @@
|
||||
"support": {
|
||||
"issues": "https://github.com/sebastianbergmann/php-code-coverage/issues",
|
||||
"security": "https://github.com/sebastianbergmann/php-code-coverage/security/policy",
|
||||
"source": "https://github.com/sebastianbergmann/php-code-coverage/tree/12.3.7"
|
||||
"source": "https://github.com/sebastianbergmann/php-code-coverage/tree/12.3.8"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
@@ -11570,7 +11642,7 @@
|
||||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"time": "2025-09-10T09:59:06+00:00"
|
||||
"time": "2025-09-17T11:31:43+00:00"
|
||||
},
|
||||
{
|
||||
"name": "phpunit/php-file-iterator",
|
||||
@@ -11819,16 +11891,16 @@
|
||||
},
|
||||
{
|
||||
"name": "phpunit/phpunit",
|
||||
"version": "12.3.10",
|
||||
"version": "12.3.12",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/sebastianbergmann/phpunit.git",
|
||||
"reference": "0d401d0df2e3c1703be425ecdc2d04f5c095938d"
|
||||
"reference": "729861f66944204f5b446ee1cb156f02f2a439a6"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/0d401d0df2e3c1703be425ecdc2d04f5c095938d",
|
||||
"reference": "0d401d0df2e3c1703be425ecdc2d04f5c095938d",
|
||||
"url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/729861f66944204f5b446ee1cb156f02f2a439a6",
|
||||
"reference": "729861f66944204f5b446ee1cb156f02f2a439a6",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -11842,12 +11914,12 @@
|
||||
"phar-io/manifest": "^2.0.4",
|
||||
"phar-io/version": "^3.2.1",
|
||||
"php": ">=8.3",
|
||||
"phpunit/php-code-coverage": "^12.3.7",
|
||||
"phpunit/php-code-coverage": "^12.3.8",
|
||||
"phpunit/php-file-iterator": "^6.0.0",
|
||||
"phpunit/php-invoker": "^6.0.0",
|
||||
"phpunit/php-text-template": "^5.0.0",
|
||||
"phpunit/php-timer": "^8.0.0",
|
||||
"sebastian/cli-parser": "^4.0.0",
|
||||
"sebastian/cli-parser": "^4.2.0",
|
||||
"sebastian/comparator": "^7.1.3",
|
||||
"sebastian/diff": "^7.0.0",
|
||||
"sebastian/environment": "^8.0.3",
|
||||
@@ -11896,7 +11968,7 @@
|
||||
"support": {
|
||||
"issues": "https://github.com/sebastianbergmann/phpunit/issues",
|
||||
"security": "https://github.com/sebastianbergmann/phpunit/security/policy",
|
||||
"source": "https://github.com/sebastianbergmann/phpunit/tree/12.3.10"
|
||||
"source": "https://github.com/sebastianbergmann/phpunit/tree/12.3.12"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
@@ -11920,7 +11992,7 @@
|
||||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"time": "2025-09-11T10:35:19+00:00"
|
||||
"time": "2025-09-21T12:23:01+00:00"
|
||||
},
|
||||
{
|
||||
"name": "rector/rector",
|
||||
@@ -11984,16 +12056,16 @@
|
||||
},
|
||||
{
|
||||
"name": "sebastian/cli-parser",
|
||||
"version": "4.1.0",
|
||||
"version": "4.2.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/sebastianbergmann/cli-parser.git",
|
||||
"reference": "8fd93be538992d556aaa45c74570129448a42084"
|
||||
"reference": "90f41072d220e5c40df6e8635f5dafba2d9d4d04"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/sebastianbergmann/cli-parser/zipball/8fd93be538992d556aaa45c74570129448a42084",
|
||||
"reference": "8fd93be538992d556aaa45c74570129448a42084",
|
||||
"url": "https://api.github.com/repos/sebastianbergmann/cli-parser/zipball/90f41072d220e5c40df6e8635f5dafba2d9d4d04",
|
||||
"reference": "90f41072d220e5c40df6e8635f5dafba2d9d4d04",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -12005,7 +12077,7 @@
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-main": "4.1-dev"
|
||||
"dev-main": "4.2-dev"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
@@ -12029,7 +12101,7 @@
|
||||
"support": {
|
||||
"issues": "https://github.com/sebastianbergmann/cli-parser/issues",
|
||||
"security": "https://github.com/sebastianbergmann/cli-parser/security/policy",
|
||||
"source": "https://github.com/sebastianbergmann/cli-parser/tree/4.1.0"
|
||||
"source": "https://github.com/sebastianbergmann/cli-parser/tree/4.2.0"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
@@ -12049,7 +12121,7 @@
|
||||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"time": "2025-09-13T14:16:18+00:00"
|
||||
"time": "2025-09-14T09:36:45+00:00"
|
||||
},
|
||||
{
|
||||
"name": "sebastian/comparator",
|
||||
|
@@ -78,10 +78,10 @@ return [
|
||||
'running_balance_column' => env('USE_RUNNING_BALANCE', false),
|
||||
// see cer.php for exchange rates feature flag.
|
||||
],
|
||||
'version' => '6.4.0',
|
||||
'build_time' => 1757781366,
|
||||
'version' => 'develop/2025-09-22',
|
||||
'build_time' => 1758511276,
|
||||
'api_version' => '2.1.0', // field is no longer used.
|
||||
'db_version' => 26,
|
||||
'db_version' => 27,
|
||||
|
||||
// generic settings
|
||||
'maxUploadSize' => 1073741824, // 1 GB
|
||||
|
@@ -140,7 +140,7 @@ return new class () extends Migration {
|
||||
$table->dropColumn('transaction_currency_id');
|
||||
|
||||
// 2. make column non-nullable.
|
||||
$table->unsignedInteger('account_id')->change();
|
||||
$table->unsignedInteger('account_id')->nullable()->change();
|
||||
|
||||
// 5. add new index
|
||||
$table->foreign('account_id')->references('id')->on('accounts')->onDelete('cascade');
|
||||
|
481
package-lock.json
generated
481
package-lock.json
generated
@@ -1693,9 +1693,9 @@
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/@esbuild/aix-ppc64": {
|
||||
"version": "0.25.9",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.25.9.tgz",
|
||||
"integrity": "sha512-OaGtL73Jck6pBKjNIe24BnFE6agGl+6KxDtTfHhy1HmhthfKouEcOhqpSL64K4/0WCtbKFLOdzD/44cJ4k9opA==",
|
||||
"version": "0.25.10",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.25.10.tgz",
|
||||
"integrity": "sha512-0NFWnA+7l41irNuaSVlLfgNT12caWJVLzp5eAVhZ0z1qpxbockccEt3s+149rE64VUI3Ml2zt8Nv5JVc4QXTsw==",
|
||||
"cpu": [
|
||||
"ppc64"
|
||||
],
|
||||
@@ -1710,9 +1710,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/android-arm": {
|
||||
"version": "0.25.9",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.25.9.tgz",
|
||||
"integrity": "sha512-5WNI1DaMtxQ7t7B6xa572XMXpHAaI/9Hnhk8lcxF4zVN4xstUgTlvuGDorBguKEnZO70qwEcLpfifMLoxiPqHQ==",
|
||||
"version": "0.25.10",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.25.10.tgz",
|
||||
"integrity": "sha512-dQAxF1dW1C3zpeCDc5KqIYuZ1tgAdRXNoZP7vkBIRtKZPYe2xVr/d3SkirklCHudW1B45tGiUlz2pUWDfbDD4w==",
|
||||
"cpu": [
|
||||
"arm"
|
||||
],
|
||||
@@ -1727,9 +1727,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/android-arm64": {
|
||||
"version": "0.25.9",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.25.9.tgz",
|
||||
"integrity": "sha512-IDrddSmpSv51ftWslJMvl3Q2ZT98fUSL2/rlUXuVqRXHCs5EUF1/f+jbjF5+NG9UffUDMCiTyh8iec7u8RlTLg==",
|
||||
"version": "0.25.10",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.25.10.tgz",
|
||||
"integrity": "sha512-LSQa7eDahypv/VO6WKohZGPSJDq5OVOo3UoFR1E4t4Gj1W7zEQMUhI+lo81H+DtB+kP+tDgBp+M4oNCwp6kffg==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
@@ -1744,9 +1744,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/android-x64": {
|
||||
"version": "0.25.9",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.25.9.tgz",
|
||||
"integrity": "sha512-I853iMZ1hWZdNllhVZKm34f4wErd4lMyeV7BLzEExGEIZYsOzqDWDf+y082izYUE8gtJnYHdeDpN/6tUdwvfiw==",
|
||||
"version": "0.25.10",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.25.10.tgz",
|
||||
"integrity": "sha512-MiC9CWdPrfhibcXwr39p9ha1x0lZJ9KaVfvzA0Wxwz9ETX4v5CHfF09bx935nHlhi+MxhA63dKRRQLiVgSUtEg==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
@@ -1761,9 +1761,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/darwin-arm64": {
|
||||
"version": "0.25.9",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.25.9.tgz",
|
||||
"integrity": "sha512-XIpIDMAjOELi/9PB30vEbVMs3GV1v2zkkPnuyRRURbhqjyzIINwj+nbQATh4H9GxUgH1kFsEyQMxwiLFKUS6Rg==",
|
||||
"version": "0.25.10",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.25.10.tgz",
|
||||
"integrity": "sha512-JC74bdXcQEpW9KkV326WpZZjLguSZ3DfS8wrrvPMHgQOIEIG/sPXEN/V8IssoJhbefLRcRqw6RQH2NnpdprtMA==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
@@ -1778,9 +1778,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/darwin-x64": {
|
||||
"version": "0.25.9",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.25.9.tgz",
|
||||
"integrity": "sha512-jhHfBzjYTA1IQu8VyrjCX4ApJDnH+ez+IYVEoJHeqJm9VhG9Dh2BYaJritkYK3vMaXrf7Ogr/0MQ8/MeIefsPQ==",
|
||||
"version": "0.25.10",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.25.10.tgz",
|
||||
"integrity": "sha512-tguWg1olF6DGqzws97pKZ8G2L7Ig1vjDmGTwcTuYHbuU6TTjJe5FXbgs5C1BBzHbJ2bo1m3WkQDbWO2PvamRcg==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
@@ -1795,9 +1795,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/freebsd-arm64": {
|
||||
"version": "0.25.9",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.25.9.tgz",
|
||||
"integrity": "sha512-z93DmbnY6fX9+KdD4Ue/H6sYs+bhFQJNCPZsi4XWJoYblUqT06MQUdBCpcSfuiN72AbqeBFu5LVQTjfXDE2A6Q==",
|
||||
"version": "0.25.10",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.25.10.tgz",
|
||||
"integrity": "sha512-3ZioSQSg1HT2N05YxeJWYR+Libe3bREVSdWhEEgExWaDtyFbbXWb49QgPvFH8u03vUPX10JhJPcz7s9t9+boWg==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
@@ -1812,9 +1812,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/freebsd-x64": {
|
||||
"version": "0.25.9",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.25.9.tgz",
|
||||
"integrity": "sha512-mrKX6H/vOyo5v71YfXWJxLVxgy1kyt1MQaD8wZJgJfG4gq4DpQGpgTB74e5yBeQdyMTbgxp0YtNj7NuHN0PoZg==",
|
||||
"version": "0.25.10",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.25.10.tgz",
|
||||
"integrity": "sha512-LLgJfHJk014Aa4anGDbh8bmI5Lk+QidDmGzuC2D+vP7mv/GeSN+H39zOf7pN5N8p059FcOfs2bVlrRr4SK9WxA==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
@@ -1829,9 +1829,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/linux-arm": {
|
||||
"version": "0.25.9",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.25.9.tgz",
|
||||
"integrity": "sha512-HBU2Xv78SMgaydBmdor38lg8YDnFKSARg1Q6AT0/y2ezUAKiZvc211RDFHlEZRFNRVhcMamiToo7bDx3VEOYQw==",
|
||||
"version": "0.25.10",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.25.10.tgz",
|
||||
"integrity": "sha512-oR31GtBTFYCqEBALI9r6WxoU/ZofZl962pouZRTEYECvNF/dtXKku8YXcJkhgK/beU+zedXfIzHijSRapJY3vg==",
|
||||
"cpu": [
|
||||
"arm"
|
||||
],
|
||||
@@ -1846,9 +1846,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/linux-arm64": {
|
||||
"version": "0.25.9",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.25.9.tgz",
|
||||
"integrity": "sha512-BlB7bIcLT3G26urh5Dmse7fiLmLXnRlopw4s8DalgZ8ef79Jj4aUcYbk90g8iCa2467HX8SAIidbL7gsqXHdRw==",
|
||||
"version": "0.25.10",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.25.10.tgz",
|
||||
"integrity": "sha512-5luJWN6YKBsawd5f9i4+c+geYiVEw20FVW5x0v1kEMWNq8UctFjDiMATBxLvmmHA4bf7F6hTRaJgtghFr9iziQ==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
@@ -1863,9 +1863,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/linux-ia32": {
|
||||
"version": "0.25.9",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.25.9.tgz",
|
||||
"integrity": "sha512-e7S3MOJPZGp2QW6AK6+Ly81rC7oOSerQ+P8L0ta4FhVi+/j/v2yZzx5CqqDaWjtPFfYz21Vi1S0auHrap3Ma3A==",
|
||||
"version": "0.25.10",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.25.10.tgz",
|
||||
"integrity": "sha512-NrSCx2Kim3EnnWgS4Txn0QGt0Xipoumb6z6sUtl5bOEZIVKhzfyp/Lyw4C1DIYvzeW/5mWYPBFJU3a/8Yr75DQ==",
|
||||
"cpu": [
|
||||
"ia32"
|
||||
],
|
||||
@@ -1880,9 +1880,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/linux-loong64": {
|
||||
"version": "0.25.9",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.25.9.tgz",
|
||||
"integrity": "sha512-Sbe10Bnn0oUAB2AalYztvGcK+o6YFFA/9829PhOCUS9vkJElXGdphz0A3DbMdP8gmKkqPmPcMJmJOrI3VYB1JQ==",
|
||||
"version": "0.25.10",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.25.10.tgz",
|
||||
"integrity": "sha512-xoSphrd4AZda8+rUDDfD9J6FUMjrkTz8itpTITM4/xgerAZZcFW7Dv+sun7333IfKxGG8gAq+3NbfEMJfiY+Eg==",
|
||||
"cpu": [
|
||||
"loong64"
|
||||
],
|
||||
@@ -1897,9 +1897,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/linux-mips64el": {
|
||||
"version": "0.25.9",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.25.9.tgz",
|
||||
"integrity": "sha512-YcM5br0mVyZw2jcQeLIkhWtKPeVfAerES5PvOzaDxVtIyZ2NUBZKNLjC5z3/fUlDgT6w89VsxP2qzNipOaaDyA==",
|
||||
"version": "0.25.10",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.25.10.tgz",
|
||||
"integrity": "sha512-ab6eiuCwoMmYDyTnyptoKkVS3k8fy/1Uvq7Dj5czXI6DF2GqD2ToInBI0SHOp5/X1BdZ26RKc5+qjQNGRBelRA==",
|
||||
"cpu": [
|
||||
"mips64el"
|
||||
],
|
||||
@@ -1914,9 +1914,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/linux-ppc64": {
|
||||
"version": "0.25.9",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.25.9.tgz",
|
||||
"integrity": "sha512-++0HQvasdo20JytyDpFvQtNrEsAgNG2CY1CLMwGXfFTKGBGQT3bOeLSYE2l1fYdvML5KUuwn9Z8L1EWe2tzs1w==",
|
||||
"version": "0.25.10",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.25.10.tgz",
|
||||
"integrity": "sha512-NLinzzOgZQsGpsTkEbdJTCanwA5/wozN9dSgEl12haXJBzMTpssebuXR42bthOF3z7zXFWH1AmvWunUCkBE4EA==",
|
||||
"cpu": [
|
||||
"ppc64"
|
||||
],
|
||||
@@ -1931,9 +1931,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/linux-riscv64": {
|
||||
"version": "0.25.9",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.25.9.tgz",
|
||||
"integrity": "sha512-uNIBa279Y3fkjV+2cUjx36xkx7eSjb8IvnL01eXUKXez/CBHNRw5ekCGMPM0BcmqBxBcdgUWuUXmVWwm4CH9kg==",
|
||||
"version": "0.25.10",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.25.10.tgz",
|
||||
"integrity": "sha512-FE557XdZDrtX8NMIeA8LBJX3dC2M8VGXwfrQWU7LB5SLOajfJIxmSdyL/gU1m64Zs9CBKvm4UAuBp5aJ8OgnrA==",
|
||||
"cpu": [
|
||||
"riscv64"
|
||||
],
|
||||
@@ -1948,9 +1948,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/linux-s390x": {
|
||||
"version": "0.25.9",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.25.9.tgz",
|
||||
"integrity": "sha512-Mfiphvp3MjC/lctb+7D287Xw1DGzqJPb/J2aHHcHxflUo+8tmN/6d4k6I2yFR7BVo5/g7x2Monq4+Yew0EHRIA==",
|
||||
"version": "0.25.10",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.25.10.tgz",
|
||||
"integrity": "sha512-3BBSbgzuB9ajLoVZk0mGu+EHlBwkusRmeNYdqmznmMc9zGASFjSsxgkNsqmXugpPk00gJ0JNKh/97nxmjctdew==",
|
||||
"cpu": [
|
||||
"s390x"
|
||||
],
|
||||
@@ -1965,9 +1965,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/linux-x64": {
|
||||
"version": "0.25.9",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.25.9.tgz",
|
||||
"integrity": "sha512-iSwByxzRe48YVkmpbgoxVzn76BXjlYFXC7NvLYq+b+kDjyyk30J0JY47DIn8z1MO3K0oSl9fZoRmZPQI4Hklzg==",
|
||||
"version": "0.25.10",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.25.10.tgz",
|
||||
"integrity": "sha512-QSX81KhFoZGwenVyPoberggdW1nrQZSvfVDAIUXr3WqLRZGZqWk/P4T8p2SP+de2Sr5HPcvjhcJzEiulKgnxtA==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
@@ -1982,9 +1982,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/netbsd-arm64": {
|
||||
"version": "0.25.9",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/netbsd-arm64/-/netbsd-arm64-0.25.9.tgz",
|
||||
"integrity": "sha512-9jNJl6FqaUG+COdQMjSCGW4QiMHH88xWbvZ+kRVblZsWrkXlABuGdFJ1E9L7HK+T0Yqd4akKNa/lO0+jDxQD4Q==",
|
||||
"version": "0.25.10",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/netbsd-arm64/-/netbsd-arm64-0.25.10.tgz",
|
||||
"integrity": "sha512-AKQM3gfYfSW8XRk8DdMCzaLUFB15dTrZfnX8WXQoOUpUBQ+NaAFCP1kPS/ykbbGYz7rxn0WS48/81l9hFl3u4A==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
@@ -1999,9 +1999,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/netbsd-x64": {
|
||||
"version": "0.25.9",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.25.9.tgz",
|
||||
"integrity": "sha512-RLLdkflmqRG8KanPGOU7Rpg829ZHu8nFy5Pqdi9U01VYtG9Y0zOG6Vr2z4/S+/3zIyOxiK6cCeYNWOFR9QP87g==",
|
||||
"version": "0.25.10",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.25.10.tgz",
|
||||
"integrity": "sha512-7RTytDPGU6fek/hWuN9qQpeGPBZFfB4zZgcz2VK2Z5VpdUxEI8JKYsg3JfO0n/Z1E/6l05n0unDCNc4HnhQGig==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
@@ -2016,9 +2016,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/openbsd-arm64": {
|
||||
"version": "0.25.9",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.25.9.tgz",
|
||||
"integrity": "sha512-YaFBlPGeDasft5IIM+CQAhJAqS3St3nJzDEgsgFixcfZeyGPCd6eJBWzke5piZuZ7CtL656eOSYKk4Ls2C0FRQ==",
|
||||
"version": "0.25.10",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.25.10.tgz",
|
||||
"integrity": "sha512-5Se0VM9Wtq797YFn+dLimf2Zx6McttsH2olUBsDml+lm0GOCRVebRWUvDtkY4BWYv/3NgzS8b/UM3jQNh5hYyw==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
@@ -2033,9 +2033,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/openbsd-x64": {
|
||||
"version": "0.25.9",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.25.9.tgz",
|
||||
"integrity": "sha512-1MkgTCuvMGWuqVtAvkpkXFmtL8XhWy+j4jaSO2wxfJtilVCi0ZE37b8uOdMItIHz4I6z1bWWtEX4CJwcKYLcuA==",
|
||||
"version": "0.25.10",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.25.10.tgz",
|
||||
"integrity": "sha512-XkA4frq1TLj4bEMB+2HnI0+4RnjbuGZfet2gs/LNs5Hc7D89ZQBHQ0gL2ND6Lzu1+QVkjp3x1gIcPKzRNP8bXw==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
@@ -2050,9 +2050,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/openharmony-arm64": {
|
||||
"version": "0.25.9",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/openharmony-arm64/-/openharmony-arm64-0.25.9.tgz",
|
||||
"integrity": "sha512-4Xd0xNiMVXKh6Fa7HEJQbrpP3m3DDn43jKxMjxLLRjWnRsfxjORYJlXPO4JNcXtOyfajXorRKY9NkOpTHptErg==",
|
||||
"version": "0.25.10",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/openharmony-arm64/-/openharmony-arm64-0.25.10.tgz",
|
||||
"integrity": "sha512-AVTSBhTX8Y/Fz6OmIVBip9tJzZEUcY8WLh7I59+upa5/GPhh2/aM6bvOMQySspnCCHvFi79kMtdJS1w0DXAeag==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
@@ -2067,9 +2067,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/sunos-x64": {
|
||||
"version": "0.25.9",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.25.9.tgz",
|
||||
"integrity": "sha512-WjH4s6hzo00nNezhp3wFIAfmGZ8U7KtrJNlFMRKxiI9mxEK1scOMAaa9i4crUtu+tBr+0IN6JCuAcSBJZfnphw==",
|
||||
"version": "0.25.10",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.25.10.tgz",
|
||||
"integrity": "sha512-fswk3XT0Uf2pGJmOpDB7yknqhVkJQkAQOcW/ccVOtfx05LkbWOaRAtn5SaqXypeKQra1QaEa841PgrSL9ubSPQ==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
@@ -2084,9 +2084,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/win32-arm64": {
|
||||
"version": "0.25.9",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.25.9.tgz",
|
||||
"integrity": "sha512-mGFrVJHmZiRqmP8xFOc6b84/7xa5y5YvR1x8djzXpJBSv/UsNK6aqec+6JDjConTgvvQefdGhFDAs2DLAds6gQ==",
|
||||
"version": "0.25.10",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.25.10.tgz",
|
||||
"integrity": "sha512-ah+9b59KDTSfpaCg6VdJoOQvKjI33nTaQr4UluQwW7aEwZQsbMCfTmfEO4VyewOxx4RaDT/xCy9ra2GPWmO7Kw==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
@@ -2101,9 +2101,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/win32-ia32": {
|
||||
"version": "0.25.9",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.25.9.tgz",
|
||||
"integrity": "sha512-b33gLVU2k11nVx1OhX3C8QQP6UHQK4ZtN56oFWvVXvz2VkDoe6fbG8TOgHFxEvqeqohmRnIHe5A1+HADk4OQww==",
|
||||
"version": "0.25.10",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.25.10.tgz",
|
||||
"integrity": "sha512-QHPDbKkrGO8/cz9LKVnJU22HOi4pxZnZhhA2HYHez5Pz4JeffhDjf85E57Oyco163GnzNCVkZK0b/n4Y0UHcSw==",
|
||||
"cpu": [
|
||||
"ia32"
|
||||
],
|
||||
@@ -2118,9 +2118,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/win32-x64": {
|
||||
"version": "0.25.9",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.25.9.tgz",
|
||||
"integrity": "sha512-PPOl1mi6lpLNQxnGoyAfschAodRFYXJ+9fs6WHXz7CSWKbOqiMZsubC+BQsVKuul+3vKLuwTHsS2c2y9EoKwxQ==",
|
||||
"version": "0.25.10",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.25.10.tgz",
|
||||
"integrity": "sha512-9KpxSVFCu0iK1owoez6aC/s/EdUQLDN3adTxGCqxMVhrPDj6bt5dbrHDXUuq+Bs2vATFBBrQS5vdQ/Ed2P+nbw==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
@@ -2589,9 +2589,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@rollup/rollup-android-arm-eabi": {
|
||||
"version": "4.50.1",
|
||||
"resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.50.1.tgz",
|
||||
"integrity": "sha512-HJXwzoZN4eYTdD8bVV22DN8gsPCAj3V20NHKOs8ezfXanGpmVPR7kalUHd+Y31IJp9stdB87VKPFbsGY3H/2ag==",
|
||||
"version": "4.52.0",
|
||||
"resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.52.0.tgz",
|
||||
"integrity": "sha512-VxDYCDqOaR7NXzAtvRx7G1u54d2kEHopb28YH/pKzY6y0qmogP3gG7CSiWsq9WvDFxOQMpNEyjVAHZFXfH3o/A==",
|
||||
"cpu": [
|
||||
"arm"
|
||||
],
|
||||
@@ -2603,9 +2603,9 @@
|
||||
]
|
||||
},
|
||||
"node_modules/@rollup/rollup-android-arm64": {
|
||||
"version": "4.50.1",
|
||||
"resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.50.1.tgz",
|
||||
"integrity": "sha512-PZlsJVcjHfcH53mOImyt3bc97Ep3FJDXRpk9sMdGX0qgLmY0EIWxCag6EigerGhLVuL8lDVYNnSo8qnTElO4xw==",
|
||||
"version": "4.52.0",
|
||||
"resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.52.0.tgz",
|
||||
"integrity": "sha512-pqDirm8koABIKvzL59YI9W9DWbRlTX7RWhN+auR8HXJxo89m4mjqbah7nJZjeKNTNYopqL+yGg+0mhCpf3xZtQ==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
@@ -2617,9 +2617,9 @@
|
||||
]
|
||||
},
|
||||
"node_modules/@rollup/rollup-darwin-arm64": {
|
||||
"version": "4.50.1",
|
||||
"resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.50.1.tgz",
|
||||
"integrity": "sha512-xc6i2AuWh++oGi4ylOFPmzJOEeAa2lJeGUGb4MudOtgfyyjr4UPNK+eEWTPLvmPJIY/pgw6ssFIox23SyrkkJw==",
|
||||
"version": "4.52.0",
|
||||
"resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.52.0.tgz",
|
||||
"integrity": "sha512-YCdWlY/8ltN6H78HnMsRHYlPiKvqKagBP1r+D7SSylxX+HnsgXGCmLiV3Y4nSyY9hW8qr8U9LDUx/Lo7M6MfmQ==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
@@ -2631,9 +2631,9 @@
|
||||
]
|
||||
},
|
||||
"node_modules/@rollup/rollup-darwin-x64": {
|
||||
"version": "4.50.1",
|
||||
"resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.50.1.tgz",
|
||||
"integrity": "sha512-2ofU89lEpDYhdLAbRdeyz/kX3Y2lpYc6ShRnDjY35bZhd2ipuDMDi6ZTQ9NIag94K28nFMofdnKeHR7BT0CATw==",
|
||||
"version": "4.52.0",
|
||||
"resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.52.0.tgz",
|
||||
"integrity": "sha512-z4nw6y1j+OOSGzuVbSWdIp1IUks9qNw4dc7z7lWuWDKojY38VMWBlEN7F9jk5UXOkUcp97vA1N213DF+Lz8BRg==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
@@ -2645,9 +2645,9 @@
|
||||
]
|
||||
},
|
||||
"node_modules/@rollup/rollup-freebsd-arm64": {
|
||||
"version": "4.50.1",
|
||||
"resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-arm64/-/rollup-freebsd-arm64-4.50.1.tgz",
|
||||
"integrity": "sha512-wOsE6H2u6PxsHY/BeFHA4VGQN3KUJFZp7QJBmDYI983fgxq5Th8FDkVuERb2l9vDMs1D5XhOrhBrnqcEY6l8ZA==",
|
||||
"version": "4.52.0",
|
||||
"resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-arm64/-/rollup-freebsd-arm64-4.52.0.tgz",
|
||||
"integrity": "sha512-Q/dv9Yvyr5rKlK8WQJZVrp5g2SOYeZUs9u/t2f9cQ2E0gJjYB/BWoedXfUT0EcDJefi2zzVfhcOj8drWCzTviw==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
@@ -2659,9 +2659,9 @@
|
||||
]
|
||||
},
|
||||
"node_modules/@rollup/rollup-freebsd-x64": {
|
||||
"version": "4.50.1",
|
||||
"resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-x64/-/rollup-freebsd-x64-4.50.1.tgz",
|
||||
"integrity": "sha512-A/xeqaHTlKbQggxCqispFAcNjycpUEHP52mwMQZUNqDUJFFYtPHCXS1VAG29uMlDzIVr+i00tSFWFLivMcoIBQ==",
|
||||
"version": "4.52.0",
|
||||
"resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-x64/-/rollup-freebsd-x64-4.52.0.tgz",
|
||||
"integrity": "sha512-kdBsLs4Uile/fbjZVvCRcKB4q64R+1mUq0Yd7oU1CMm1Av336ajIFqNFovByipciuUQjBCPMxwJhCgfG2re3rg==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
@@ -2673,9 +2673,9 @@
|
||||
]
|
||||
},
|
||||
"node_modules/@rollup/rollup-linux-arm-gnueabihf": {
|
||||
"version": "4.50.1",
|
||||
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.50.1.tgz",
|
||||
"integrity": "sha512-54v4okehwl5TaSIkpp97rAHGp7t3ghinRd/vyC1iXqXMfjYUTm7TfYmCzXDoHUPTTf36L8pr0E7YsD3CfB3ZDg==",
|
||||
"version": "4.52.0",
|
||||
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.52.0.tgz",
|
||||
"integrity": "sha512-aL6hRwu0k7MTUESgkg7QHY6CoqPgr6gdQXRJI1/VbFlUMwsSzPGSR7sG5d+MCbYnJmJwThc2ol3nixj1fvI/zQ==",
|
||||
"cpu": [
|
||||
"arm"
|
||||
],
|
||||
@@ -2687,9 +2687,9 @@
|
||||
]
|
||||
},
|
||||
"node_modules/@rollup/rollup-linux-arm-musleabihf": {
|
||||
"version": "4.50.1",
|
||||
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.50.1.tgz",
|
||||
"integrity": "sha512-p/LaFyajPN/0PUHjv8TNyxLiA7RwmDoVY3flXHPSzqrGcIp/c2FjwPPP5++u87DGHtw+5kSH5bCJz0mvXngYxw==",
|
||||
"version": "4.52.0",
|
||||
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.52.0.tgz",
|
||||
"integrity": "sha512-BTs0M5s1EJejgIBJhCeiFo7GZZ2IXWkFGcyZhxX4+8usnIo5Mti57108vjXFIQmmJaRyDwmV59Tw64Ap1dkwMw==",
|
||||
"cpu": [
|
||||
"arm"
|
||||
],
|
||||
@@ -2701,9 +2701,9 @@
|
||||
]
|
||||
},
|
||||
"node_modules/@rollup/rollup-linux-arm64-gnu": {
|
||||
"version": "4.50.1",
|
||||
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.50.1.tgz",
|
||||
"integrity": "sha512-2AbMhFFkTo6Ptna1zO7kAXXDLi7H9fGTbVaIq2AAYO7yzcAsuTNWPHhb2aTA6GPiP+JXh85Y8CiS54iZoj4opw==",
|
||||
"version": "4.52.0",
|
||||
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.52.0.tgz",
|
||||
"integrity": "sha512-uj672IVOU9m08DBGvoPKPi/J8jlVgjh12C9GmjjBxCTQc3XtVmRkRKyeHSmIKQpvJ7fIm1EJieBUcnGSzDVFyw==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
@@ -2715,9 +2715,9 @@
|
||||
]
|
||||
},
|
||||
"node_modules/@rollup/rollup-linux-arm64-musl": {
|
||||
"version": "4.50.1",
|
||||
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.50.1.tgz",
|
||||
"integrity": "sha512-Cgef+5aZwuvesQNw9eX7g19FfKX5/pQRIyhoXLCiBOrWopjo7ycfB292TX9MDcDijiuIJlx1IzJz3IoCPfqs9w==",
|
||||
"version": "4.52.0",
|
||||
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.52.0.tgz",
|
||||
"integrity": "sha512-/+IVbeDMDCtB/HP/wiWsSzduD10SEGzIZX2945KSgZRNi4TSkjHqRJtNTVtVb8IRwhJ65ssI56krlLik+zFWkw==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
@@ -2728,10 +2728,10 @@
|
||||
"linux"
|
||||
]
|
||||
},
|
||||
"node_modules/@rollup/rollup-linux-loongarch64-gnu": {
|
||||
"version": "4.50.1",
|
||||
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loongarch64-gnu/-/rollup-linux-loongarch64-gnu-4.50.1.tgz",
|
||||
"integrity": "sha512-RPhTwWMzpYYrHrJAS7CmpdtHNKtt2Ueo+BlLBjfZEhYBhK00OsEqM08/7f+eohiF6poe0YRDDd8nAvwtE/Y62Q==",
|
||||
"node_modules/@rollup/rollup-linux-loong64-gnu": {
|
||||
"version": "4.52.0",
|
||||
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loong64-gnu/-/rollup-linux-loong64-gnu-4.52.0.tgz",
|
||||
"integrity": "sha512-U1vVzvSWtSMWKKrGoROPBXMh3Vwn93TA9V35PldokHGqiUbF6erSzox/5qrSMKp6SzakvyjcPiVF8yB1xKr9Pg==",
|
||||
"cpu": [
|
||||
"loong64"
|
||||
],
|
||||
@@ -2743,9 +2743,9 @@
|
||||
]
|
||||
},
|
||||
"node_modules/@rollup/rollup-linux-ppc64-gnu": {
|
||||
"version": "4.50.1",
|
||||
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-ppc64-gnu/-/rollup-linux-ppc64-gnu-4.50.1.tgz",
|
||||
"integrity": "sha512-eSGMVQw9iekut62O7eBdbiccRguuDgiPMsw++BVUg+1K7WjZXHOg/YOT9SWMzPZA+w98G+Fa1VqJgHZOHHnY0Q==",
|
||||
"version": "4.52.0",
|
||||
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-ppc64-gnu/-/rollup-linux-ppc64-gnu-4.52.0.tgz",
|
||||
"integrity": "sha512-X/4WfuBAdQRH8cK3DYl8zC00XEE6aM472W+QCycpQJeLWVnHfkv7RyBFVaTqNUMsTgIX8ihMjCvFF9OUgeABzw==",
|
||||
"cpu": [
|
||||
"ppc64"
|
||||
],
|
||||
@@ -2757,9 +2757,9 @@
|
||||
]
|
||||
},
|
||||
"node_modules/@rollup/rollup-linux-riscv64-gnu": {
|
||||
"version": "4.50.1",
|
||||
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.50.1.tgz",
|
||||
"integrity": "sha512-S208ojx8a4ciIPrLgazF6AgdcNJzQE4+S9rsmOmDJkusvctii+ZvEuIC4v/xFqzbuP8yDjn73oBlNDgF6YGSXQ==",
|
||||
"version": "4.52.0",
|
||||
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.52.0.tgz",
|
||||
"integrity": "sha512-xIRYc58HfWDBZoLmWfWXg2Sq8VCa2iJ32B7mqfWnkx5mekekl0tMe7FHpY8I72RXEcUkaWawRvl3qA55og+cwQ==",
|
||||
"cpu": [
|
||||
"riscv64"
|
||||
],
|
||||
@@ -2771,9 +2771,9 @@
|
||||
]
|
||||
},
|
||||
"node_modules/@rollup/rollup-linux-riscv64-musl": {
|
||||
"version": "4.50.1",
|
||||
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-musl/-/rollup-linux-riscv64-musl-4.50.1.tgz",
|
||||
"integrity": "sha512-3Ag8Ls1ggqkGUvSZWYcdgFwriy2lWo+0QlYgEFra/5JGtAd6C5Hw59oojx1DeqcA2Wds2ayRgvJ4qxVTzCHgzg==",
|
||||
"version": "4.52.0",
|
||||
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-musl/-/rollup-linux-riscv64-musl-4.52.0.tgz",
|
||||
"integrity": "sha512-mbsoUey05WJIOz8U1WzNdf+6UMYGwE3fZZnQqsM22FZ3wh1N887HT6jAOjXs6CNEK3Ntu2OBsyQDXfIjouI4dw==",
|
||||
"cpu": [
|
||||
"riscv64"
|
||||
],
|
||||
@@ -2785,9 +2785,9 @@
|
||||
]
|
||||
},
|
||||
"node_modules/@rollup/rollup-linux-s390x-gnu": {
|
||||
"version": "4.50.1",
|
||||
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.50.1.tgz",
|
||||
"integrity": "sha512-t9YrKfaxCYe7l7ldFERE1BRg/4TATxIg+YieHQ966jwvo7ddHJxPj9cNFWLAzhkVsbBvNA4qTbPVNsZKBO4NSg==",
|
||||
"version": "4.52.0",
|
||||
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.52.0.tgz",
|
||||
"integrity": "sha512-qP6aP970bucEi5KKKR4AuPFd8aTx9EF6BvutvYxmZuWLJHmnq4LvBfp0U+yFDMGwJ+AIJEH5sIP+SNypauMWzg==",
|
||||
"cpu": [
|
||||
"s390x"
|
||||
],
|
||||
@@ -2799,9 +2799,9 @@
|
||||
]
|
||||
},
|
||||
"node_modules/@rollup/rollup-linux-x64-gnu": {
|
||||
"version": "4.50.1",
|
||||
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.50.1.tgz",
|
||||
"integrity": "sha512-MCgtFB2+SVNuQmmjHf+wfI4CMxy3Tk8XjA5Z//A0AKD7QXUYFMQcns91K6dEHBvZPCnhJSyDWLApk40Iq/H3tA==",
|
||||
"version": "4.52.0",
|
||||
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.52.0.tgz",
|
||||
"integrity": "sha512-nmSVN+F2i1yKZ7rJNKO3G7ZzmxJgoQBQZ/6c4MuS553Grmr7WqR7LLDcYG53Z2m9409z3JLt4sCOhLdbKQ3HmA==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
@@ -2813,9 +2813,9 @@
|
||||
]
|
||||
},
|
||||
"node_modules/@rollup/rollup-linux-x64-musl": {
|
||||
"version": "4.50.1",
|
||||
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.50.1.tgz",
|
||||
"integrity": "sha512-nEvqG+0jeRmqaUMuwzlfMKwcIVffy/9KGbAGyoa26iu6eSngAYQ512bMXuqqPrlTyfqdlB9FVINs93j534UJrg==",
|
||||
"version": "4.52.0",
|
||||
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.52.0.tgz",
|
||||
"integrity": "sha512-2d0qRo33G6TfQVjaMR71P+yJVGODrt5V6+T0BDYH4EMfGgdC/2HWDVjSSFw888GSzAZUwuska3+zxNUCDco6rQ==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
@@ -2827,9 +2827,9 @@
|
||||
]
|
||||
},
|
||||
"node_modules/@rollup/rollup-openharmony-arm64": {
|
||||
"version": "4.50.1",
|
||||
"resolved": "https://registry.npmjs.org/@rollup/rollup-openharmony-arm64/-/rollup-openharmony-arm64-4.50.1.tgz",
|
||||
"integrity": "sha512-RDsLm+phmT3MJd9SNxA9MNuEAO/J2fhW8GXk62G/B4G7sLVumNFbRwDL6v5NrESb48k+QMqdGbHgEtfU0LCpbA==",
|
||||
"version": "4.52.0",
|
||||
"resolved": "https://registry.npmjs.org/@rollup/rollup-openharmony-arm64/-/rollup-openharmony-arm64-4.52.0.tgz",
|
||||
"integrity": "sha512-A1JalX4MOaFAAyGgpO7XP5khquv/7xKzLIyLmhNrbiCxWpMlnsTYr8dnsWM7sEeotNmxvSOEL7F65j0HXFcFsw==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
@@ -2841,9 +2841,9 @@
|
||||
]
|
||||
},
|
||||
"node_modules/@rollup/rollup-win32-arm64-msvc": {
|
||||
"version": "4.50.1",
|
||||
"resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.50.1.tgz",
|
||||
"integrity": "sha512-hpZB/TImk2FlAFAIsoElM3tLzq57uxnGYwplg6WDyAxbYczSi8O2eQ+H2Lx74504rwKtZ3N2g4bCUkiamzS6TQ==",
|
||||
"version": "4.52.0",
|
||||
"resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.52.0.tgz",
|
||||
"integrity": "sha512-YQugafP/rH0eOOHGjmNgDURrpYHrIX0yuojOI8bwCyXwxC9ZdTd3vYkmddPX0oHONLXu9Rb1dDmT0VNpjkzGGw==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
@@ -2855,9 +2855,9 @@
|
||||
]
|
||||
},
|
||||
"node_modules/@rollup/rollup-win32-ia32-msvc": {
|
||||
"version": "4.50.1",
|
||||
"resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.50.1.tgz",
|
||||
"integrity": "sha512-SXjv8JlbzKM0fTJidX4eVsH+Wmnp0/WcD8gJxIZyR6Gay5Qcsmdbi9zVtnbkGPG8v2vMR1AD06lGWy5FLMcG7A==",
|
||||
"version": "4.52.0",
|
||||
"resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.52.0.tgz",
|
||||
"integrity": "sha512-zYdUYhi3Qe2fndujBqL5FjAFzvNeLxtIqfzNEVKD1I7C37/chv1VxhscWSQHTNfjPCrBFQMnynwA3kpZpZ8w4A==",
|
||||
"cpu": [
|
||||
"ia32"
|
||||
],
|
||||
@@ -2868,10 +2868,24 @@
|
||||
"win32"
|
||||
]
|
||||
},
|
||||
"node_modules/@rollup/rollup-win32-x64-gnu": {
|
||||
"version": "4.52.0",
|
||||
"resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-gnu/-/rollup-win32-x64-gnu-4.52.0.tgz",
|
||||
"integrity": "sha512-fGk03kQylNaCOQ96HDMeT7E2n91EqvCDd3RwvT5k+xNdFCeMGnj5b5hEgTGrQuyidqSsD3zJDQ21QIaxXqTBJw==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"win32"
|
||||
]
|
||||
},
|
||||
"node_modules/@rollup/rollup-win32-x64-msvc": {
|
||||
"version": "4.50.1",
|
||||
"resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.50.1.tgz",
|
||||
"integrity": "sha512-StxAO/8ts62KZVRAm4JZYq9+NqNsV7RvimNK+YM7ry//zebEH6meuugqW/P5OFUCjyQgui+9fUxT6d5NShvMvA==",
|
||||
"version": "4.52.0",
|
||||
"resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.52.0.tgz",
|
||||
"integrity": "sha512-6iKDCVSIUQ8jPMoIV0OytRKniaYyy5EbY/RRydmLW8ZR3cEBhxbWl5ro0rkUNe0ef6sScvhbY79HrjRm8i3vDQ==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
@@ -3159,13 +3173,13 @@
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/@types/node": {
|
||||
"version": "24.3.3",
|
||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-24.3.3.tgz",
|
||||
"integrity": "sha512-GKBNHjoNw3Kra1Qg5UXttsY5kiWMEfoHq2TmXb+b1rcm6N7B3wTrFYIf/oSZ1xNQ+hVVijgLkiDZh7jRRsh+Gw==",
|
||||
"version": "24.5.2",
|
||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-24.5.2.tgz",
|
||||
"integrity": "sha512-FYxk1I7wPv3K2XBaoyH2cTnocQEu8AOZ60hPbsyukMPLv5/5qr7V1i8PLHdl6Zf87I+xZXFvPCXYjiTFq+YSDQ==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"undici-types": "~7.10.0"
|
||||
"undici-types": "~7.12.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@types/node-forge": {
|
||||
@@ -3949,9 +3963,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/axios": {
|
||||
"version": "1.12.1",
|
||||
"resolved": "https://registry.npmjs.org/axios/-/axios-1.12.1.tgz",
|
||||
"integrity": "sha512-Kn4kbSXpkFHCGE6rBFNwIv0GQs4AvDT80jlveJDKFxjbTYMUeB4QtsdPCv6H8Cm19Je7IU6VFtRl2zWZI0rudQ==",
|
||||
"version": "1.12.2",
|
||||
"resolved": "https://registry.npmjs.org/axios/-/axios-1.12.2.tgz",
|
||||
"integrity": "sha512-vMJzPewAlRyOgxV2dU0Cuz2O8zzzx9VYtbJOaBgXFeLc4IV/Eg50n4LowmehOOR61S8ZMpc2K5Sa7g6A4jfkUw==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
@@ -4061,9 +4075,9 @@
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/baseline-browser-mapping": {
|
||||
"version": "2.8.3",
|
||||
"resolved": "https://registry.npmjs.org/baseline-browser-mapping/-/baseline-browser-mapping-2.8.3.tgz",
|
||||
"integrity": "sha512-mcE+Wr2CAhHNWxXN/DdTI+n4gsPc5QpXpWnyCQWiQYIYZX+ZMJ8juXZgjRa/0/YPJo/NSsgW15/YgmI4nbysYw==",
|
||||
"version": "2.8.6",
|
||||
"resolved": "https://registry.npmjs.org/baseline-browser-mapping/-/baseline-browser-mapping-2.8.6.tgz",
|
||||
"integrity": "sha512-wrH5NNqren/QMtKUEEJf7z86YjfqW/2uw3IL3/xpqZUC95SSVIFXYQeeGjL6FT/X68IROu6RMehZQS5foy2BXw==",
|
||||
"dev": true,
|
||||
"license": "Apache-2.0",
|
||||
"bin": {
|
||||
@@ -4347,9 +4361,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/browserslist": {
|
||||
"version": "4.26.0",
|
||||
"resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.26.0.tgz",
|
||||
"integrity": "sha512-P9go2WrP9FiPwLv3zqRD/Uoxo0RSHjzFCiQz7d4vbmwNqQFo9T9WCeP/Qn5EbcKQY6DBbkxEXNcpJOmncNrb7A==",
|
||||
"version": "4.26.2",
|
||||
"resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.26.2.tgz",
|
||||
"integrity": "sha512-ECFzp6uFOSB+dcZ5BK/IBaGWssbSYBHvuMeMt3MMFyhI0Z8SqGgEkBLARgpRH3hutIgPVsALcMwbDrJqPxQ65A==",
|
||||
"dev": true,
|
||||
"funding": [
|
||||
{
|
||||
@@ -4367,7 +4381,7 @@
|
||||
],
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"baseline-browser-mapping": "^2.8.2",
|
||||
"baseline-browser-mapping": "^2.8.3",
|
||||
"caniuse-lite": "^1.0.30001741",
|
||||
"electron-to-chromium": "^1.5.218",
|
||||
"node-releases": "^2.0.21",
|
||||
@@ -4508,9 +4522,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/caniuse-lite": {
|
||||
"version": "1.0.30001741",
|
||||
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001741.tgz",
|
||||
"integrity": "sha512-QGUGitqsc8ARjLdgAfxETDhRbJ0REsP6O3I96TAth/mVjh2cYzN2u+3AzPP3aVSm2FehEItaJw1xd+IGBXWeSw==",
|
||||
"version": "1.0.30001743",
|
||||
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001743.tgz",
|
||||
"integrity": "sha512-e6Ojr7RV14Un7dz6ASD0aZDmQPT/A+eZU+nuTNfjqmRrmkmQlnTNWH0SKmqagx9PeW87UVqapSurtAXifmtdmw==",
|
||||
"dev": true,
|
||||
"funding": [
|
||||
{
|
||||
@@ -5375,9 +5389,9 @@
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/debug": {
|
||||
"version": "4.4.1",
|
||||
"resolved": "https://registry.npmjs.org/debug/-/debug-4.4.1.tgz",
|
||||
"integrity": "sha512-KcKCqiftBJcZr++7ykoDIEwSa3XWowTfNPo92BYxjXiyYEVrUQh2aLyhxBCwww+heortUFxEJYcRzosstTEBYQ==",
|
||||
"version": "4.4.3",
|
||||
"resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz",
|
||||
"integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
@@ -5722,9 +5736,9 @@
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/electron-to-chromium": {
|
||||
"version": "1.5.218",
|
||||
"resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.218.tgz",
|
||||
"integrity": "sha512-uwwdN0TUHs8u6iRgN8vKeWZMRll4gBkz+QMqdS7DDe49uiK68/UX92lFb61oiFPrpYZNeZIqa4bA7O6Aiasnzg==",
|
||||
"version": "1.5.222",
|
||||
"resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.222.tgz",
|
||||
"integrity": "sha512-gA7psSwSwQRE60CEoLz6JBCQPIxNeuzB2nL8vE03GK/OHxlvykbLyeiumQy1iH5C2f3YbRAZpGCMT12a/9ih9w==",
|
||||
"dev": true,
|
||||
"license": "ISC"
|
||||
},
|
||||
@@ -5819,9 +5833,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/error-ex": {
|
||||
"version": "1.3.2",
|
||||
"resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz",
|
||||
"integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==",
|
||||
"version": "1.3.4",
|
||||
"resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.4.tgz",
|
||||
"integrity": "sha512-sqQamAnR14VgCr1A618A3sGrygcpK+HEbenA/HiEAkkUwcZIIB/tgWqHFxWgOyDh4nB4JCRimh79dR5Ywc9MDQ==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
@@ -5885,9 +5899,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/esbuild": {
|
||||
"version": "0.25.9",
|
||||
"resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.25.9.tgz",
|
||||
"integrity": "sha512-CRbODhYyQx3qp7ZEwzxOk4JBqmD/seJrzPa/cGjY1VtIn5E09Oi9/dB4JwctnfZ8Q8iT7rioVv5k/FNT/uf54g==",
|
||||
"version": "0.25.10",
|
||||
"resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.25.10.tgz",
|
||||
"integrity": "sha512-9RiGKvCwaqxO2owP61uQ4BgNborAQskMR6QusfWzQqv7AZOg5oGehdY2pRJMTKuwxd1IDBP4rSbI5lHzU7SMsQ==",
|
||||
"dev": true,
|
||||
"hasInstallScript": true,
|
||||
"license": "MIT",
|
||||
@@ -5898,32 +5912,32 @@
|
||||
"node": ">=18"
|
||||
},
|
||||
"optionalDependencies": {
|
||||
"@esbuild/aix-ppc64": "0.25.9",
|
||||
"@esbuild/android-arm": "0.25.9",
|
||||
"@esbuild/android-arm64": "0.25.9",
|
||||
"@esbuild/android-x64": "0.25.9",
|
||||
"@esbuild/darwin-arm64": "0.25.9",
|
||||
"@esbuild/darwin-x64": "0.25.9",
|
||||
"@esbuild/freebsd-arm64": "0.25.9",
|
||||
"@esbuild/freebsd-x64": "0.25.9",
|
||||
"@esbuild/linux-arm": "0.25.9",
|
||||
"@esbuild/linux-arm64": "0.25.9",
|
||||
"@esbuild/linux-ia32": "0.25.9",
|
||||
"@esbuild/linux-loong64": "0.25.9",
|
||||
"@esbuild/linux-mips64el": "0.25.9",
|
||||
"@esbuild/linux-ppc64": "0.25.9",
|
||||
"@esbuild/linux-riscv64": "0.25.9",
|
||||
"@esbuild/linux-s390x": "0.25.9",
|
||||
"@esbuild/linux-x64": "0.25.9",
|
||||
"@esbuild/netbsd-arm64": "0.25.9",
|
||||
"@esbuild/netbsd-x64": "0.25.9",
|
||||
"@esbuild/openbsd-arm64": "0.25.9",
|
||||
"@esbuild/openbsd-x64": "0.25.9",
|
||||
"@esbuild/openharmony-arm64": "0.25.9",
|
||||
"@esbuild/sunos-x64": "0.25.9",
|
||||
"@esbuild/win32-arm64": "0.25.9",
|
||||
"@esbuild/win32-ia32": "0.25.9",
|
||||
"@esbuild/win32-x64": "0.25.9"
|
||||
"@esbuild/aix-ppc64": "0.25.10",
|
||||
"@esbuild/android-arm": "0.25.10",
|
||||
"@esbuild/android-arm64": "0.25.10",
|
||||
"@esbuild/android-x64": "0.25.10",
|
||||
"@esbuild/darwin-arm64": "0.25.10",
|
||||
"@esbuild/darwin-x64": "0.25.10",
|
||||
"@esbuild/freebsd-arm64": "0.25.10",
|
||||
"@esbuild/freebsd-x64": "0.25.10",
|
||||
"@esbuild/linux-arm": "0.25.10",
|
||||
"@esbuild/linux-arm64": "0.25.10",
|
||||
"@esbuild/linux-ia32": "0.25.10",
|
||||
"@esbuild/linux-loong64": "0.25.10",
|
||||
"@esbuild/linux-mips64el": "0.25.10",
|
||||
"@esbuild/linux-ppc64": "0.25.10",
|
||||
"@esbuild/linux-riscv64": "0.25.10",
|
||||
"@esbuild/linux-s390x": "0.25.10",
|
||||
"@esbuild/linux-x64": "0.25.10",
|
||||
"@esbuild/netbsd-arm64": "0.25.10",
|
||||
"@esbuild/netbsd-x64": "0.25.10",
|
||||
"@esbuild/openbsd-arm64": "0.25.10",
|
||||
"@esbuild/openbsd-x64": "0.25.10",
|
||||
"@esbuild/openharmony-arm64": "0.25.10",
|
||||
"@esbuild/sunos-x64": "0.25.10",
|
||||
"@esbuild/win32-arm64": "0.25.10",
|
||||
"@esbuild/win32-ia32": "0.25.10",
|
||||
"@esbuild/win32-x64": "0.25.10"
|
||||
}
|
||||
},
|
||||
"node_modules/escalade": {
|
||||
@@ -10145,9 +10159,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/rollup": {
|
||||
"version": "4.50.1",
|
||||
"resolved": "https://registry.npmjs.org/rollup/-/rollup-4.50.1.tgz",
|
||||
"integrity": "sha512-78E9voJHwnXQMiQdiqswVLZwJIzdBKJ1GdI5Zx6XwoFKUIk09/sSrr+05QFzvYb8q6Y9pPV45zzDuYa3907TZA==",
|
||||
"version": "4.52.0",
|
||||
"resolved": "https://registry.npmjs.org/rollup/-/rollup-4.52.0.tgz",
|
||||
"integrity": "sha512-+IuescNkTJQgX7AkIDtITipZdIGcWF0pnVvZTWStiazUmcGA2ag8dfg0urest2XlXUi9kuhfQ+qmdc5Stc3z7g==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
@@ -10161,27 +10175,28 @@
|
||||
"npm": ">=8.0.0"
|
||||
},
|
||||
"optionalDependencies": {
|
||||
"@rollup/rollup-android-arm-eabi": "4.50.1",
|
||||
"@rollup/rollup-android-arm64": "4.50.1",
|
||||
"@rollup/rollup-darwin-arm64": "4.50.1",
|
||||
"@rollup/rollup-darwin-x64": "4.50.1",
|
||||
"@rollup/rollup-freebsd-arm64": "4.50.1",
|
||||
"@rollup/rollup-freebsd-x64": "4.50.1",
|
||||
"@rollup/rollup-linux-arm-gnueabihf": "4.50.1",
|
||||
"@rollup/rollup-linux-arm-musleabihf": "4.50.1",
|
||||
"@rollup/rollup-linux-arm64-gnu": "4.50.1",
|
||||
"@rollup/rollup-linux-arm64-musl": "4.50.1",
|
||||
"@rollup/rollup-linux-loongarch64-gnu": "4.50.1",
|
||||
"@rollup/rollup-linux-ppc64-gnu": "4.50.1",
|
||||
"@rollup/rollup-linux-riscv64-gnu": "4.50.1",
|
||||
"@rollup/rollup-linux-riscv64-musl": "4.50.1",
|
||||
"@rollup/rollup-linux-s390x-gnu": "4.50.1",
|
||||
"@rollup/rollup-linux-x64-gnu": "4.50.1",
|
||||
"@rollup/rollup-linux-x64-musl": "4.50.1",
|
||||
"@rollup/rollup-openharmony-arm64": "4.50.1",
|
||||
"@rollup/rollup-win32-arm64-msvc": "4.50.1",
|
||||
"@rollup/rollup-win32-ia32-msvc": "4.50.1",
|
||||
"@rollup/rollup-win32-x64-msvc": "4.50.1",
|
||||
"@rollup/rollup-android-arm-eabi": "4.52.0",
|
||||
"@rollup/rollup-android-arm64": "4.52.0",
|
||||
"@rollup/rollup-darwin-arm64": "4.52.0",
|
||||
"@rollup/rollup-darwin-x64": "4.52.0",
|
||||
"@rollup/rollup-freebsd-arm64": "4.52.0",
|
||||
"@rollup/rollup-freebsd-x64": "4.52.0",
|
||||
"@rollup/rollup-linux-arm-gnueabihf": "4.52.0",
|
||||
"@rollup/rollup-linux-arm-musleabihf": "4.52.0",
|
||||
"@rollup/rollup-linux-arm64-gnu": "4.52.0",
|
||||
"@rollup/rollup-linux-arm64-musl": "4.52.0",
|
||||
"@rollup/rollup-linux-loong64-gnu": "4.52.0",
|
||||
"@rollup/rollup-linux-ppc64-gnu": "4.52.0",
|
||||
"@rollup/rollup-linux-riscv64-gnu": "4.52.0",
|
||||
"@rollup/rollup-linux-riscv64-musl": "4.52.0",
|
||||
"@rollup/rollup-linux-s390x-gnu": "4.52.0",
|
||||
"@rollup/rollup-linux-x64-gnu": "4.52.0",
|
||||
"@rollup/rollup-linux-x64-musl": "4.52.0",
|
||||
"@rollup/rollup-openharmony-arm64": "4.52.0",
|
||||
"@rollup/rollup-win32-arm64-msvc": "4.52.0",
|
||||
"@rollup/rollup-win32-ia32-msvc": "4.52.0",
|
||||
"@rollup/rollup-win32-x64-gnu": "4.52.0",
|
||||
"@rollup/rollup-win32-x64-msvc": "4.52.0",
|
||||
"fsevents": "~2.3.2"
|
||||
}
|
||||
},
|
||||
@@ -10237,9 +10252,9 @@
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/sass": {
|
||||
"version": "1.92.1",
|
||||
"resolved": "https://registry.npmjs.org/sass/-/sass-1.92.1.tgz",
|
||||
"integrity": "sha512-ffmsdbwqb3XeyR8jJR6KelIXARM9bFQe8A6Q3W4Klmwy5Ckd5gz7jgUNHo4UOqutU5Sk1DtKLbpDP0nLCg1xqQ==",
|
||||
"version": "1.93.0",
|
||||
"resolved": "https://registry.npmjs.org/sass/-/sass-1.93.0.tgz",
|
||||
"integrity": "sha512-CQi5/AzCwiubU3dSqRDJ93RfOfg/hhpW1l6wCIvolmehfwgCI35R/0QDs1+R+Ygrl8jFawwwIojE2w47/mf94A==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
@@ -11357,9 +11372,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/undici-types": {
|
||||
"version": "7.10.0",
|
||||
"resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.10.0.tgz",
|
||||
"integrity": "sha512-t5Fy/nfn+14LuOc2KNYg75vZqClpAiqscVvMygNnlsHBFpSXdJaYtXMcdNLpl/Qvc3P2cB3s6lOV51nqsFq4ag==",
|
||||
"version": "7.12.0",
|
||||
"resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.12.0.tgz",
|
||||
"integrity": "sha512-goOacqME2GYyOZZfb5Lgtu+1IDmAlAEu5xnD3+xTzS10hT0vzpf0SPjkXwAw9Jm+4n/mQGDP3LO8CPbYROeBfQ==",
|
||||
"dev": true,
|
||||
"license": "MIT"
|
||||
},
|
||||
@@ -11398,9 +11413,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/unicode-property-aliases-ecmascript": {
|
||||
"version": "2.1.0",
|
||||
"resolved": "https://registry.npmjs.org/unicode-property-aliases-ecmascript/-/unicode-property-aliases-ecmascript-2.1.0.tgz",
|
||||
"integrity": "sha512-6t3foTQI9qne+OZoVQB/8x8rk2k1eVy1gRXhV3oFQ5T6R1dqQ1xtin3XqSlx3+ATBkliTaR/hHyJBm+LVPNM8w==",
|
||||
"version": "2.2.0",
|
||||
"resolved": "https://registry.npmjs.org/unicode-property-aliases-ecmascript/-/unicode-property-aliases-ecmascript-2.2.0.tgz",
|
||||
"integrity": "sha512-hpbDzxUY9BFwX+UeBnxv3Sh1q7HFxj48DTmXchNgRa46lO8uj3/1iEn3MiNUYTg1g9ctIqXCCERn8gYZhHC5lQ==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
@@ -11554,9 +11569,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/vite": {
|
||||
"version": "7.1.5",
|
||||
"resolved": "https://registry.npmjs.org/vite/-/vite-7.1.5.tgz",
|
||||
"integrity": "sha512-4cKBO9wR75r0BeIWWWId9XK9Lj6La5X846Zw9dFfzMRw38IlTk2iCcUt6hsyiDRcPidc55ZParFYDXi0nXOeLQ==",
|
||||
"version": "7.1.6",
|
||||
"resolved": "https://registry.npmjs.org/vite/-/vite-7.1.6.tgz",
|
||||
"integrity": "sha512-SRYIB8t/isTwNn8vMB3MR6E+EQZM/WG1aKmmIUCfDXfVvKfc20ZpamngWHKzAmmu9ppsgxsg4b2I7c90JZudIQ==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
|
@@ -53,7 +53,7 @@
|
||||
"external_url": "Extern\u00ed URL adresa",
|
||||
"update_transaction": "Aktualizovat transakci",
|
||||
"after_update_create_another": "Po aktualizaci se vr\u00e1tit sem pro pokra\u010dov\u00e1n\u00ed v \u00faprav\u00e1ch.",
|
||||
"store_as_new": "Store as a new transaction instead of updating.",
|
||||
"store_as_new": "Vytvo\u0159it novou transakci m\u00edsto aktualizov\u00e1n\u00ed t\u00e9 sou\u010dasn\u00e9.",
|
||||
"split_title_help": "Pokud vytvo\u0159\u00edte roz\u00fa\u010dtov\u00e1n\u00ed, je t\u0159eba, aby zde byl celkov\u00fd popis pro v\u0161echna roz\u00fa\u010dtov\u00e1n\u00ed dan\u00e9 transakce.",
|
||||
"none_in_select_list": "(\u017e\u00e1dn\u00e9)",
|
||||
"no_piggy_bank": "(\u017e\u00e1dn\u00e1 pokladni\u010dka)",
|
||||
|
@@ -2,9 +2,9 @@
|
||||
"firefly": {
|
||||
"administrations_page_title": "Amministrazioni finanziarie",
|
||||
"administrations_index_menu": "Amministrazioni finanziarie",
|
||||
"expires_at": "Expires at",
|
||||
"temp_administrations_introduction": "Firefly III will soon get the ability to manage multiple financial administrations. Right now, you only have the one. You can set the title of this administration and its primary currency. This replaces the previous setting where you would set your \"default currency\". This setting is now tied to the financial administration and can be different per administration.",
|
||||
"administration_currency_form_help": "It may take a long time for the page to load if you change the primary currency because transaction may need to be converted to your (new) primary currency.",
|
||||
"expires_at": "Scade il",
|
||||
"temp_administrations_introduction": "Firefly III avr\u00e0 presto la possibilit\u00e0 di gestire pi\u00f9 amministrazioni finanziarie. Al momento, ne hai solo una. Puoi impostare il titolo di questa amministrazione e la sua valuta principale. Questa impostazione sostituisce la precedente, che prevedeva di impostare la \"valuta predefinita\". Questa impostazione \u00e8 ora legata all'amministrazione finanziaria e pu\u00f2 essere diversa per ogni amministrazione.",
|
||||
"administration_currency_form_help": "Se modifichi la valuta principale, il caricamento della pagina potrebbe richiedere molto tempo, poich\u00e9 potrebbe essere necessario convertire la transazione nella (nuova) valuta principale.",
|
||||
"administrations_page_edit_sub_title_js": "Modifica amministrazione finanziaria \"{title}\"",
|
||||
"table": "Tabella",
|
||||
"welcome_back": "La tua situazione finanziaria",
|
||||
@@ -102,23 +102,23 @@
|
||||
"profile_oauth_client_secret_title": "Segreto del client",
|
||||
"profile_oauth_client_secret_expl": "Ecco il segreto del nuovo client. Questa \u00e8 l'unica occasione in cui viene mostrato pertanto non perderlo! Ora puoi usare questo segreto per effettuare delle richieste alle API.",
|
||||
"profile_oauth_confidential": "Riservato",
|
||||
"profile_oauth_confidential_help": "Require the client to authenticate with a secret. Confidential clients can hold credentials in a secure way without exposing them to unauthorized parties. Public applications, such as native desktop or JavaScript SPA applications, are unable to hold secrets securely.",
|
||||
"profile_oauth_confidential_help": "Richiedere al client di autenticarsi con un segreto. I client riservati possono conservare le credenziali in modo sicuro senza esporle a soggetti non autorizzati. Le applicazioni pubbliche, come le applicazioni desktop native o le applicazioni SPA JavaScript, non sono in grado di conservare i segreti in modo sicuro.",
|
||||
"multi_account_warning_unknown": "A seconda del tipo di transazione che hai creato, il conto di origine e\/o destinazione delle successive suddivisioni pu\u00f2 essere sovrascritto da qualsiasi cosa sia definita nella prima suddivisione della transazione.",
|
||||
"multi_account_warning_withdrawal": "Ricorda che il conto di origine delle successive suddivisioni verr\u00e0 sovrascritto da quello definito nella prima suddivisione del prelievo.",
|
||||
"multi_account_warning_deposit": "Ricorda che il conto di destinazione delle successive suddivisioni verr\u00e0 sovrascritto da quello definito nella prima suddivisione del deposito.",
|
||||
"multi_account_warning_transfer": "Ricorda che il conto di origine e il conto di destinazione delle successive suddivisioni verranno sovrascritti da quelli definiti nella prima suddivisione del trasferimento.",
|
||||
"webhook_trigger_ANY": "After any event",
|
||||
"webhook_trigger_ANY": "Dopo ogni evento",
|
||||
"webhook_trigger_STORE_TRANSACTION": "Dopo aver creato la transazione",
|
||||
"webhook_trigger_UPDATE_TRANSACTION": "Dopo aver aggiornato la transazione",
|
||||
"webhook_trigger_DESTROY_TRANSACTION": "Dopo aver eliminato la transazione",
|
||||
"webhook_trigger_STORE_BUDGET": "After budget creation",
|
||||
"webhook_trigger_UPDATE_BUDGET": "After budget update",
|
||||
"webhook_trigger_DESTROY_BUDGET": "After budget delete",
|
||||
"webhook_trigger_STORE_UPDATE_BUDGET_LIMIT": "After budgeted amount change",
|
||||
"webhook_trigger_STORE_BUDGET": "Dopo la creazione del budget",
|
||||
"webhook_trigger_UPDATE_BUDGET": "Dopo l'aggiornamento del budget",
|
||||
"webhook_trigger_DESTROY_BUDGET": "Dopo l'eliminazione del budget",
|
||||
"webhook_trigger_STORE_UPDATE_BUDGET_LIMIT": "Dopo la modifica dell'importo preventivato",
|
||||
"webhook_response_TRANSACTIONS": "Dettagli transazione",
|
||||
"webhook_response_RELEVANT": "Relevant details",
|
||||
"webhook_response_RELEVANT": "Dettagli rilevanti",
|
||||
"webhook_response_ACCOUNTS": "Dettagli conto",
|
||||
"webhook_response_NONE": "No details",
|
||||
"webhook_response_NONE": "Nessun dettaglio",
|
||||
"webhook_delivery_JSON": "JSON",
|
||||
"actions": "Azioni",
|
||||
"meta_data": "Meta dati",
|
||||
@@ -160,7 +160,7 @@
|
||||
"url": "URL",
|
||||
"active": "Attivo",
|
||||
"interest_date": "Data di valuta",
|
||||
"administration_currency": "Primary currency",
|
||||
"administration_currency": "Valuta primaria",
|
||||
"title": "Titolo",
|
||||
"date": "Data",
|
||||
"book_date": "Data contabile",
|
||||
@@ -180,7 +180,7 @@
|
||||
"list": {
|
||||
"title": "Titolo",
|
||||
"active": "\u00c8 attivo?",
|
||||
"primary_currency": "Primary currency",
|
||||
"primary_currency": "Valuta primaria",
|
||||
"trigger": "Trigger",
|
||||
"response": "Risposta",
|
||||
"delivery": "Consegna",
|
||||
|
@@ -211,14 +211,6 @@ export default () => ({
|
||||
(new Get).show(accountId, new Date(window.store.get('end'))).then((response) => {
|
||||
let parent = response.data.data;
|
||||
|
||||
// apply function to each element of parent:
|
||||
// parent.attributes.balances = parent.attributes.balances.map((balance) => {
|
||||
// balance.amount_formatted = formatMoney(balance.amount, balance.currency_code);
|
||||
// return balance;
|
||||
// });
|
||||
// console.log(parent);
|
||||
|
||||
|
||||
// get groups for account:
|
||||
const params = {
|
||||
page: 1,
|
||||
@@ -261,11 +253,14 @@ export default () => ({
|
||||
accounts.push({
|
||||
name: parent.attributes.name,
|
||||
order: parent.attributes.order,
|
||||
|
||||
current_balance: formatMoney(parent.attributes.current_balance, parent.attributes.currency_code),
|
||||
pc_current_balance: null === parent.attributes.pc_current_balance ? null : formatMoney(parent.attributes.pc_current_balance, parent.attributes.primary_currency_code),
|
||||
|
||||
id: parent.id,
|
||||
balances: parent.attributes.balances,
|
||||
//balances: parent.attributes.balances,
|
||||
groups: groups,
|
||||
});
|
||||
// console.log(parent.attributes);
|
||||
count++;
|
||||
if (count === totalAccounts) {
|
||||
accounts.sort((a, b) => a.order - b.order); // b - a for reverse sort
|
||||
|
@@ -54,46 +54,69 @@ export default () => ({
|
||||
if (data.hasOwnProperty(i)) {
|
||||
let current = data[i];
|
||||
let code = current.currency_code;
|
||||
if (!series.hasOwnProperty(code)) {
|
||||
series[code] = {
|
||||
name: code,
|
||||
yAxisID: '',
|
||||
data: {},
|
||||
};
|
||||
|
||||
// create two series, "spent" and "earned".
|
||||
for(const type of ['spent', 'earned']) {
|
||||
let typeCode = code + '_' + type;
|
||||
if (!series.hasOwnProperty(typeCode)) {
|
||||
series[typeCode] = {
|
||||
name: typeCode,
|
||||
code: code,
|
||||
type: type,
|
||||
yAxisID: '',
|
||||
data: {},
|
||||
};
|
||||
}
|
||||
}
|
||||
if (!currencies.includes(code)) {
|
||||
currencies.push(code);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// loop data again to add amounts to each series.
|
||||
for (const i in data) {
|
||||
if (data.hasOwnProperty(i)) {
|
||||
let yAxis = 'y';
|
||||
let current = data[i];
|
||||
|
||||
// allow switch to primary currency.
|
||||
let code = current.currency_code;
|
||||
if(this.convertToPrimary) {
|
||||
code = current.primary_currency_code;
|
||||
}
|
||||
|
||||
// loop series, add 0 if not present or add actual amount.
|
||||
for (const ii in series) {
|
||||
if (series.hasOwnProperty(ii)) {
|
||||
let amount = 0.0;
|
||||
if (code === ii) {
|
||||
// this series' currency matches this column's currency.
|
||||
amount = parseFloat(current.amount);
|
||||
yAxis = 'y' + current.currency_code;
|
||||
}
|
||||
if (series[ii].data.hasOwnProperty(current.label)) {
|
||||
// there is a value for this particular currency. The amount from this column will be added.
|
||||
// (even if this column isn't recorded in this currency and a new filler value is written)
|
||||
// this is so currency conversion works.
|
||||
series[ii].data[current.label] = series[ii].data[current.label] + amount;
|
||||
}
|
||||
// twice again, for speny AND earned.
|
||||
for(const type of ['spent', 'earned']) {
|
||||
let typeCode = code + '_' + type;
|
||||
// loop series, add 0 if not present or add actual amount.
|
||||
for (const ii in series) {
|
||||
if (series.hasOwnProperty(typeCode)) {
|
||||
let amount = 0.0;
|
||||
if (typeCode === ii) {
|
||||
// this series' currency matches this column's currency.
|
||||
amount = parseFloat(current.entries[type]);
|
||||
if(this.convertToPrimary) {
|
||||
amount = parseFloat(current.entries.pc_entries[type]);
|
||||
}
|
||||
yAxis = 'y' + typeCode;
|
||||
}
|
||||
if (series[typeCode].data.hasOwnProperty(current.label)) {
|
||||
// there is a value for this particular currency. The amount from this column will be added.
|
||||
// (even if this column isn't recorded in this currency and a new filler value is written)
|
||||
// this is so currency conversion works.
|
||||
series[typeCode].data[current.label] = series[typeCode].data[current.label] + amount;
|
||||
}
|
||||
|
||||
if (!series[ii].data.hasOwnProperty(current.label)) {
|
||||
// this column's amount is not yet set in this series.
|
||||
series[ii].data[current.label] = amount;
|
||||
if (!series[typeCode].data.hasOwnProperty(current.label)) {
|
||||
// this column's amount is not yet set in this series.
|
||||
series[typeCode].data[current.label] = amount;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
// add label to x-axis, not unimportant.
|
||||
if (!options.data.labels.includes(current.label)) {
|
||||
options.data.labels.push(current.label);
|
||||
@@ -103,11 +126,11 @@ export default () => ({
|
||||
// loop the series and create ChartJS-compatible data sets.
|
||||
let count = 0;
|
||||
for (const i in series) {
|
||||
// console.log('series');
|
||||
let yAxisID = 'y' + i;
|
||||
let currencyCode = i.replace('_spent', '').replace('_earned', '');
|
||||
let dataset = {
|
||||
label: i,
|
||||
currency_code: i,
|
||||
currency_code: currencyCode,
|
||||
yAxisID: yAxisID,
|
||||
data: [],
|
||||
// backgroundColor: getColors(null, 'background'),
|
||||
@@ -148,16 +171,15 @@ export default () => ({
|
||||
const end = new Date(window.store.get('end'));
|
||||
const cacheKey = getCacheKey('ds_ct_chart', {convertToPrimary: this.convertToPrimary, start: start, end: end});
|
||||
|
||||
const cacheValid = window.store.get('cacheValid');
|
||||
// const cacheValid = window.store.get('cacheValid');
|
||||
const cacheValid = false;
|
||||
let cachedData = window.store.get(cacheKey);
|
||||
|
||||
if (cacheValid && typeof cachedData !== 'undefined') {
|
||||
chartData = cachedData; // save chart data for later.
|
||||
this.drawChart(this.generateOptions(chartData));
|
||||
this.loading = false;
|
||||
return;
|
||||
}
|
||||
|
||||
const dashboard = new Dashboard();
|
||||
dashboard.dashboard(start, end, null).then((response) => {
|
||||
chartData = response.data; // save chart data for later.
|
||||
@@ -181,7 +203,6 @@ export default () => ({
|
||||
this.getFreshData();
|
||||
},
|
||||
init() {
|
||||
// console.log('categories init');
|
||||
Promise.all([getVariable('convert_to_primary', false),]).then((values) => {
|
||||
this.convertToPrimary = values[0];
|
||||
afterPromises = true;
|
||||
|
@@ -72,8 +72,6 @@ let transactions = function () {
|
||||
resetButton: true,
|
||||
rulesButton: true,
|
||||
webhooksButton: true,
|
||||
|
||||
|
||||
},
|
||||
|
||||
// form behaviour during transaction
|
||||
@@ -85,7 +83,7 @@ let transactions = function () {
|
||||
|
||||
// form data (except transactions) is stored in formData
|
||||
formData: {
|
||||
defaultCurrency: null,
|
||||
primaryCurrency: null,
|
||||
enabledCurrencies: [],
|
||||
primaryCurrencies: [],
|
||||
foreignCurrencies: [],
|
||||
@@ -200,8 +198,7 @@ let transactions = function () {
|
||||
// addedSplit, is called from the HTML
|
||||
// for source account
|
||||
const renderAccount = function (item, b, c) {
|
||||
console.log(item);
|
||||
return item.title + '<br><small class="text-muted">' + i18next.t('firefly.account_type_' + item.meta.type) + '</small>';
|
||||
return item.name_with_balance + '<br><small class="text-muted">' + i18next.t('firefly.account_type_' + item.type) + '</small>';
|
||||
};
|
||||
addAutocomplete({
|
||||
selector: 'input.ac-source',
|
||||
@@ -209,7 +206,7 @@ let transactions = function () {
|
||||
account_types: this.filters.source,
|
||||
onRenderItem: renderAccount,
|
||||
valueField: 'id',
|
||||
labelField: 'title',
|
||||
labelField: 'name',
|
||||
onChange: changeSourceAccount,
|
||||
onSelectItem: selectSourceAccount
|
||||
});
|
||||
@@ -217,7 +214,7 @@ let transactions = function () {
|
||||
selector: 'input.ac-dest',
|
||||
serverUrl: urls.account,
|
||||
valueField: 'id',
|
||||
labelField: 'title',
|
||||
labelField: 'name',
|
||||
account_types: this.filters.destination,
|
||||
onRenderItem: renderAccount,
|
||||
onChange: changeDestinationAccount,
|
||||
@@ -227,7 +224,7 @@ let transactions = function () {
|
||||
selector: 'input.ac-category',
|
||||
serverUrl: urls.category,
|
||||
valueField: 'id',
|
||||
labelField: 'title',
|
||||
labelField: 'name',
|
||||
onChange: changeCategory,
|
||||
onSelectItem: changeCategory
|
||||
});
|
||||
@@ -330,7 +327,7 @@ let transactions = function () {
|
||||
// load meta data.
|
||||
loadCurrencies().then(data => {
|
||||
this.formStates.loadingCurrencies = false;
|
||||
this.formData.defaultCurrency = data.defaultCurrency;
|
||||
this.formData.primaryCurrency = data.primaryCurrency;
|
||||
this.formData.enabledCurrencies = data.enabledCurrencies;
|
||||
this.formData.primaryCurrencies = data.primaryCurrencies;
|
||||
this.formData.foreignCurrencies = data.foreignCurrencies;
|
||||
|
@@ -28,7 +28,7 @@ export function loadCurrencies() {
|
||||
let getter = new Get();
|
||||
return getter.list(params).then((response) => {
|
||||
let returnData = {
|
||||
defaultCurrency: {},
|
||||
primaryCurrency: {},
|
||||
primaryCurrencies: [],
|
||||
foreignCurrencies: [],
|
||||
enabledCurrencies: [],
|
||||
@@ -46,13 +46,13 @@ export function loadCurrencies() {
|
||||
id: current.id,
|
||||
name: current.attributes.name,
|
||||
code: current.attributes.code,
|
||||
default: current.attributes.default,
|
||||
primary: current.attributes.primary,
|
||||
symbol: current.attributes.symbol,
|
||||
decimal_places: current.attributes.decimal_places,
|
||||
|
||||
};
|
||||
if (obj.default) {
|
||||
returnData.defaultCurrency = obj;
|
||||
if (obj.primary) {
|
||||
returnData.primaryCurrency = obj;
|
||||
}
|
||||
returnData.enabledCurrencies.push(obj);
|
||||
returnData.primaryCurrencies.push(obj);
|
||||
|
@@ -24,9 +24,10 @@
|
||||
declare(strict_types=1);
|
||||
|
||||
return [
|
||||
'limit_exists' => 'There is already a budget limit (amount) for this budget and currency in the given period.',
|
||||
'invalid_sort_instruction' => 'The sort instruction is invalid for an object of type ":object".',
|
||||
'invalid_sort_instruction_index' => 'The sort instruction at index #:index is invalid for an object of type ":object".',
|
||||
'no_sort_instructions' => 'There are no sort instructions defined for an object of type ":object".',
|
||||
'invalid_sort_instruction_index' => 'The sort instruction at index #:index is invalid for an object of type ":object".',
|
||||
'no_sort_instructions' => 'There are no sort instructions defined for an object of type ":object".',
|
||||
'webhook_budget_info' => 'Cannot deliver budget information for transaction related webhooks.',
|
||||
'webhook_account_info' => 'Cannot deliver account information for budget related webhooks.',
|
||||
'webhook_transaction_info' => 'Cannot deliver transaction information for budget related webhooks.',
|
||||
@@ -39,8 +40,8 @@ return [
|
||||
'nog_logged_in' => 'You are not logged in.',
|
||||
'prohibited' => 'You must not submit anything in field.',
|
||||
'bad_webhook_combination' => 'Webhook trigger ":trigger" cannot be combined with webhook response ":response".',
|
||||
'unknown_webhook_trigger' => 'Unknown webhook trigger ":trigger".',
|
||||
'only_any_trigger' => 'If you select the "Any event"-trigger, you may not select any other triggers.',
|
||||
'unknown_webhook_trigger' => 'Unknown webhook trigger ":trigger".',
|
||||
'only_any_trigger' => 'If you select the "Any event"-trigger, you may not select any other triggers.',
|
||||
'bad_type_source' => 'Firefly III can\'t determine the transaction type based on this source account.',
|
||||
'bad_type_destination' => 'Firefly III can\'t determine the transaction type based on this destination account.',
|
||||
'missing_where' => 'Array is missing "where"-clause',
|
||||
@@ -122,7 +123,7 @@ return [
|
||||
'between.file' => 'The :attribute must be between :min and :max kilobytes.',
|
||||
'between.string' => 'The :attribute must be between :min and :max characters.',
|
||||
'between.array' => 'The :attribute must have between :min and :max items.',
|
||||
'between_date' => 'The date must be between the given start and end date.',
|
||||
'between_date' => 'The date must be between the given start and end date.',
|
||||
'boolean' => 'The :attribute field must be true or false.',
|
||||
'confirmed' => 'The :attribute confirmation does not match.',
|
||||
'date' => 'The :attribute is not a valid date.',
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user