mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-09-04 11:48:05 +00:00
Clean up code.
This commit is contained in:
@@ -255,7 +255,7 @@ class ListController extends Controller
|
||||
$unfiltered = $recurringRepos->getAll();
|
||||
|
||||
// filter selection
|
||||
$collection = $unfiltered->filter(/** @phpstan-ignore-line */
|
||||
$collection = $unfiltered->filter( // @phpstan-ignore-line
|
||||
static function (Recurrence $recurrence) use ($currency) { // @phpstan-ignore-line
|
||||
/** @var RecurrenceTransaction $transaction */
|
||||
foreach ($recurrence->recurrenceTransactions as $transaction) {
|
||||
@@ -305,7 +305,7 @@ class ListController extends Controller
|
||||
$ruleRepos = app(RuleRepositoryInterface::class);
|
||||
$unfiltered = $ruleRepos->getAll();
|
||||
|
||||
$collection = $unfiltered->filter(/** @phpstan-ignore-line */
|
||||
$collection = $unfiltered->filter( // @phpstan-ignore-line
|
||||
static function (Rule $rule) use ($currency) { // @phpstan-ignore-line
|
||||
/** @var RuleTrigger $trigger */
|
||||
foreach ($rule->ruleTriggers as $trigger) {
|
||||
|
@@ -61,8 +61,7 @@ class DeleteEmptyJournals extends Command
|
||||
{
|
||||
$set = Transaction::whereNull('deleted_at')
|
||||
->groupBy('transactions.transaction_journal_id')
|
||||
->get([DB::raw('COUNT(transactions.transaction_journal_id) as the_count'), 'transaction_journal_id']);
|
||||
/** @phpstan-ignore-line */
|
||||
->get([DB::raw('COUNT(transactions.transaction_journal_id) as the_count'), 'transaction_journal_id']); // @phpstan-ignore-line
|
||||
$total = 0;
|
||||
/** @var Transaction $row */
|
||||
foreach ($set as $row) {
|
||||
|
@@ -33,8 +33,7 @@ class DestroyedTransactionLink extends Event
|
||||
{
|
||||
use SerializesModels;
|
||||
|
||||
private TransactionJournalLink $link;
|
||||
/** @phpstan-ignore-line */
|
||||
private TransactionJournalLink $link; // @phpstan-ignore-line
|
||||
|
||||
/**
|
||||
* DestroyedTransactionLink constructor.
|
||||
|
@@ -50,7 +50,7 @@ class APIEventHandler
|
||||
if (null !== $user) {
|
||||
try {
|
||||
Notification::send($user, new NewAccessToken());
|
||||
} catch (Exception $e) { /** @phpstan-ignore-line */
|
||||
} catch (Exception $e) { // @phpstan-ignore-line
|
||||
$message = $e->getMessage();
|
||||
if (str_contains($message, 'Bcc')) {
|
||||
app('log')->warning('[Bcc] Could not send notification. Please validate your email settings, use the .env.example file as a guide.');
|
||||
|
@@ -31,7 +31,6 @@ use FireflyIII\Notifications\Admin\TestNotification;
|
||||
use FireflyIII\Notifications\Admin\UserInvitation;
|
||||
use FireflyIII\Notifications\Admin\VersionCheckResult;
|
||||
use FireflyIII\Repositories\User\UserRepositoryInterface;
|
||||
use FireflyIII\Support\Facades\FireflyConfig;
|
||||
use Illuminate\Support\Facades\Notification;
|
||||
|
||||
/**
|
||||
@@ -58,7 +57,7 @@ class AdminEventHandler
|
||||
if ($repository->hasRole($user, 'owner')) {
|
||||
try {
|
||||
Notification::send($user, new UserInvitation($event->invitee));
|
||||
} catch (Exception $e) { /** @phpstan-ignore-line */
|
||||
} catch (Exception $e) { // @phpstan-ignore-line
|
||||
$message = $e->getMessage();
|
||||
if (str_contains($message, 'Bcc')) {
|
||||
app('log')->warning('[Bcc] Could not send notification. Please validate your email settings, use the .env.example file as a guide.');
|
||||
@@ -96,7 +95,7 @@ class AdminEventHandler
|
||||
if ($repository->hasRole($user, 'owner')) {
|
||||
try {
|
||||
Notification::send($user, new VersionCheckResult($event->message));
|
||||
} catch (Exception $e) { /** @phpstan-ignore-line */
|
||||
} catch (Exception $e) {// @phpstan-ignore-line
|
||||
$message = $e->getMessage();
|
||||
if (str_contains($message, 'Bcc')) {
|
||||
app('log')->warning('[Bcc] Could not send notification. Please validate your email settings, use the .env.example file as a guide.');
|
||||
@@ -130,7 +129,7 @@ class AdminEventHandler
|
||||
}
|
||||
try {
|
||||
Notification::send($event->user, new TestNotification($event->user->email));
|
||||
} catch (Exception $e) { /** @phpstan-ignore-line */
|
||||
} catch (Exception $e) { // @phpstan-ignore-line
|
||||
$message = $e->getMessage();
|
||||
if (str_contains($message, 'Bcc')) {
|
||||
app('log')->warning('[Bcc] Could not send notification. Please validate your email settings, use the .env.example file as a guide.');
|
||||
|
@@ -75,7 +75,7 @@ class AutomationHandler
|
||||
}
|
||||
try {
|
||||
Notification::send($user, new TransactionCreation($groups));
|
||||
} catch (Exception $e) { /** @phpstan-ignore-line */
|
||||
} catch (Exception $e) { // @phpstan-ignore-line
|
||||
$message = $e->getMessage();
|
||||
if (str_contains($message, 'Bcc')) {
|
||||
app('log')->warning('[Bcc] Could not send notification. Please validate your email settings, use the .env.example file as a guide.');
|
||||
|
@@ -51,7 +51,7 @@ class BillEventHandler
|
||||
app('log')->debug('Bill reminder is true!');
|
||||
try {
|
||||
Notification::send($bill->user, new BillReminder($bill, $event->field, $event->diff));
|
||||
} catch (Exception $e) { /** @phpstan-ignore-line */
|
||||
} catch (Exception $e) { // @phpstan-ignore-line
|
||||
$message = $e->getMessage();
|
||||
if (str_contains($message, 'Bcc')) {
|
||||
app('log')->warning('[Bcc] Could not send notification. Please validate your email settings, use the .env.example file as a guide.');
|
||||
|
@@ -131,7 +131,7 @@ class UserEventHandler
|
||||
$group = null;
|
||||
|
||||
// create a new group.
|
||||
while (true === $groupExists) { /** @phpstan-ignore-line */
|
||||
while (true === $groupExists) { // @phpstan-ignore-line
|
||||
$groupExists = UserGroup::where('title', $groupTitle)->count() > 0;
|
||||
if (false === $groupExists) {
|
||||
$group = UserGroup::create(['title' => $groupTitle]);
|
||||
@@ -205,7 +205,7 @@ class UserEventHandler
|
||||
if (false === $entry['notified']) {
|
||||
try {
|
||||
Notification::send($user, new UserLogin($ipAddress));
|
||||
} catch (Exception $e) {/** @phpstan-ignore-line */
|
||||
} catch (Exception $e) { // @phpstan-ignore-line
|
||||
$message = $e->getMessage();
|
||||
if (str_contains($message, 'Bcc')) {
|
||||
app('log')->warning('[Bcc] Could not send notification. Please validate your email settings, use the .env.example file as a guide.');
|
||||
@@ -239,7 +239,7 @@ class UserEventHandler
|
||||
if ($repository->hasRole($user, 'owner')) {
|
||||
try {
|
||||
Notification::send($user, new AdminRegistrationNotification($event->user));
|
||||
} catch (Exception $e) { /** @phpstan-ignore-line */
|
||||
} catch (Exception $e) { // @phpstan-ignore-line
|
||||
$message = $e->getMessage();
|
||||
if (str_contains($message, 'Bcc')) {
|
||||
app('log')->warning('[Bcc] Could not send notification. Please validate your email settings, use the .env.example file as a guide.');
|
||||
@@ -316,7 +316,7 @@ class UserEventHandler
|
||||
{
|
||||
try {
|
||||
Notification::send($event->user, new UserNewPassword(route('password.reset', [$event->token])));
|
||||
} catch (Exception $e) { /** @phpstan-ignore-line */
|
||||
} catch (Exception $e) { // @phpstan-ignore-line
|
||||
$message = $e->getMessage();
|
||||
if (str_contains($message, 'Bcc')) {
|
||||
app('log')->warning('[Bcc] Could not send notification. Please validate your email settings, use the .env.example file as a guide.');
|
||||
@@ -364,7 +364,7 @@ class UserEventHandler
|
||||
if ($sendMail) {
|
||||
try {
|
||||
Notification::send($event->user, new UserRegistrationNotification());
|
||||
} catch (Exception $e) { /** @phpstan-ignore-line */
|
||||
} catch (Exception $e) { // @phpstan-ignore-line
|
||||
$message = $e->getMessage();
|
||||
if (str_contains($message, 'Bcc')) {
|
||||
app('log')->warning('[Bcc] Could not send notification. Please validate your email settings, use the .env.example file as a guide.');
|
||||
|
@@ -26,7 +26,6 @@ namespace FireflyIII\Http\Controllers\Admin;
|
||||
use FireflyIII\Events\AdminRequestedTestMessage;
|
||||
use FireflyIII\Http\Controllers\Controller;
|
||||
use FireflyIII\Http\Middleware\IsDemoUser;
|
||||
use FireflyIII\Support\Facades\FireflyConfig;
|
||||
use FireflyIII\Support\Notifications\UrlValidator;
|
||||
use FireflyIII\User;
|
||||
use Illuminate\Contracts\View\Factory;
|
||||
|
@@ -283,8 +283,7 @@ class IndexController extends Controller
|
||||
foreach ($budget['spent'] as $spent) {
|
||||
$currencyId = $spent['currency_id'];
|
||||
$sums['spent'][$currencyId]
|
||||
??=
|
||||
[
|
||||
??= [
|
||||
'amount' => '0',
|
||||
'currency_id' => $spent['currency_id'],
|
||||
'currency_symbol' => $spent['currency_symbol'],
|
||||
@@ -297,8 +296,7 @@ class IndexController extends Controller
|
||||
foreach ($budget['budgeted'] as $budgeted) {
|
||||
$currencyId = $budgeted['currency_id'];
|
||||
$sums['budgeted'][$currencyId]
|
||||
??=
|
||||
[
|
||||
??= [
|
||||
'amount' => '0',
|
||||
'currency_id' => $budgeted['currency_id'],
|
||||
'currency_symbol' => $budgeted['currency_symbol'],
|
||||
@@ -307,8 +305,8 @@ class IndexController extends Controller
|
||||
$sums['budgeted'][$currencyId]['amount'] = bcadd($sums['budgeted'][$currencyId]['amount'], $budgeted['amount']);
|
||||
|
||||
// also calculate how much left from budgeted:
|
||||
$sums['left'][$currencyId] ??=
|
||||
[
|
||||
$sums['left'][$currencyId]
|
||||
??= [
|
||||
'amount' => '0',
|
||||
'currency_id' => $budgeted['currency_id'],
|
||||
'currency_symbol' => $budgeted['currency_symbol'],
|
||||
|
@@ -147,7 +147,7 @@ class ExpenseReportController extends Controller
|
||||
|
||||
while ($currentStart < $end) {
|
||||
$currentEnd = clone $currentStart;
|
||||
$currentEnd = $currentEnd->$function(); /** @phpstan-ignore-line */
|
||||
$currentEnd = $currentEnd->$function(); // @phpstan-ignore-line
|
||||
|
||||
// get expenses grouped by opposing name:
|
||||
$expenses = $this->groupByName($this->getExpensesForOpposing($accounts, $all, $currentStart, $currentEnd));
|
||||
|
@@ -42,6 +42,7 @@ use Illuminate\View\View;
|
||||
use Monolog\Handler\RotatingFileHandler;
|
||||
use Psr\Container\ContainerExceptionInterface;
|
||||
use Psr\Container\NotFoundExceptionInterface;
|
||||
use const PHP_SAPI;
|
||||
|
||||
/**
|
||||
* Class DebugController
|
||||
@@ -127,7 +128,7 @@ class DebugController extends Controller
|
||||
// get latest log file:
|
||||
$logger = Log::driver();
|
||||
// PHPstan doesn't recognize the method because of its polymorphic nature.
|
||||
$handlers = $logger->getHandlers(); /** @phpstan-ignore-line */
|
||||
$handlers = $logger->getHandlers(); // @phpstan-ignore-line
|
||||
$logContent = '';
|
||||
foreach ($handlers as $handler) {
|
||||
if ($handler instanceof RotatingFileHandler) {
|
||||
@@ -172,7 +173,7 @@ class DebugController extends Controller
|
||||
'db_version' => app('fireflyconfig')->get('db_version', 1)->data,
|
||||
'php_version' => PHP_VERSION,
|
||||
'php_os' => PHP_OS,
|
||||
'interface' => \PHP_SAPI,
|
||||
'interface' => PHP_SAPI,
|
||||
'bcscale' => bcscale(),
|
||||
'display_errors' => ini_get('display_errors'),
|
||||
'error_reporting' => $this->errorReporting((int)ini_get('error_reporting')),
|
||||
|
@@ -107,9 +107,7 @@ class CategoryController extends Controller
|
||||
];
|
||||
|
||||
$report[$sourceAccountId]['currencies'][$currencyId]['categories'][$category['id']]
|
||||
??=
|
||||
|
||||
[
|
||||
??= [
|
||||
'spent' => '0',
|
||||
'earned' => '0',
|
||||
'sum' => '0',
|
||||
@@ -134,8 +132,7 @@ class CategoryController extends Controller
|
||||
foreach ($category['transaction_journals'] as $journal) {
|
||||
$destinationId = $journal['destination_account_id'];
|
||||
$report[$destinationId]['currencies'][$currencyId]
|
||||
??=
|
||||
[
|
||||
??= [
|
||||
'currency_id' => $currency['currency_id'],
|
||||
'currency_symbol' => $currency['currency_symbol'],
|
||||
'currency_name' => $currency['currency_name'],
|
||||
@@ -143,9 +140,7 @@ class CategoryController extends Controller
|
||||
'categories' => [],
|
||||
];
|
||||
$report[$destinationId]['currencies'][$currencyId]['categories'][$category['id']]
|
||||
??=
|
||||
|
||||
[
|
||||
??= [
|
||||
'spent' => '0',
|
||||
'earned' => '0',
|
||||
'sum' => '0',
|
||||
|
@@ -100,9 +100,7 @@ class TagController extends Controller
|
||||
];
|
||||
|
||||
$report[$sourceAccountId]['currencies'][$currencyId]['tags'][$tag['id']]
|
||||
??=
|
||||
|
||||
[
|
||||
??= [
|
||||
'spent' => '0',
|
||||
'earned' => '0',
|
||||
'sum' => '0',
|
||||
@@ -127,8 +125,7 @@ class TagController extends Controller
|
||||
foreach ($tag['transaction_journals'] as $journal) {
|
||||
$destinationId = $journal['destination_account_id'];
|
||||
$report[$destinationId]['currencies'][$currencyId]
|
||||
??=
|
||||
[
|
||||
??= [
|
||||
'currency_id' => $currency['currency_id'],
|
||||
'currency_symbol' => $currency['currency_symbol'],
|
||||
'currency_name' => $currency['currency_name'],
|
||||
@@ -136,9 +133,7 @@ class TagController extends Controller
|
||||
'tags' => [],
|
||||
];
|
||||
$report[$destinationId]['currencies'][$currencyId]['tags'][$tag['id']]
|
||||
??=
|
||||
|
||||
[
|
||||
??= [
|
||||
'spent' => '0',
|
||||
'earned' => '0',
|
||||
'sum' => '0',
|
||||
|
@@ -49,6 +49,7 @@ use Psr\Container\NotFoundExceptionInterface;
|
||||
class ReportController extends Controller
|
||||
{
|
||||
use RenderPartialViews;
|
||||
|
||||
protected ReportHelperInterface $helper;
|
||||
private BudgetRepositoryInterface $repository;
|
||||
|
||||
|
@@ -32,7 +32,6 @@ use FireflyIII\Repositories\TransactionGroup\TransactionGroupRepositoryInterface
|
||||
use FireflyIII\Transformers\TransactionGroupTransformer;
|
||||
use Illuminate\Contracts\View\Factory;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\View\View;
|
||||
use Symfony\Component\HttpFoundation\ParameterBag;
|
||||
|
||||
|
@@ -26,7 +26,6 @@ namespace FireflyIII\Http\Controllers\Webhooks;
|
||||
|
||||
use FireflyIII\Http\Controllers\Controller;
|
||||
use Illuminate\Contracts\View\Factory;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\View\View;
|
||||
|
||||
/**
|
||||
|
@@ -24,7 +24,6 @@ declare(strict_types=1);
|
||||
namespace FireflyIII\Jobs;
|
||||
|
||||
use Exception;
|
||||
use FireflyIII\Exceptions\FireflyException;
|
||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||
use Illuminate\Mail\Message;
|
||||
use Illuminate\Queue\InteractsWithQueue;
|
||||
@@ -90,7 +89,7 @@ class MailError extends Job implements ShouldQueue
|
||||
}
|
||||
}
|
||||
);
|
||||
} catch (Exception | TransportException $e) { /** @phpstan-ignore-line */
|
||||
} catch (Exception | TransportException $e) { // @phpstan-ignore-line
|
||||
$message = $e->getMessage();
|
||||
if (str_contains($message, 'Bcc')) {
|
||||
app('log')->warning('[Bcc] Could not email or log the error. Please validate your email settings, use the .env.example file as a guide.');
|
||||
|
@@ -40,9 +40,7 @@ class AccessTokenCreatedMail extends Mailable
|
||||
/**
|
||||
* AccessTokenCreatedMail constructor.
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
}
|
||||
public function __construct() {}
|
||||
|
||||
/**
|
||||
* Build the message.
|
||||
|
@@ -44,9 +44,7 @@ class AdminTestMail extends Mailable
|
||||
/**
|
||||
* AdminTestMail constructor.
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
}
|
||||
public function __construct() {}
|
||||
|
||||
/**
|
||||
* Build the message.
|
||||
|
@@ -292,22 +292,9 @@ class Account extends Model
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the virtual balance
|
||||
*
|
||||
* @return Attribute
|
||||
*/
|
||||
protected function virtualBalance(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: static fn($value) => (string)$value,
|
||||
);
|
||||
}
|
||||
/**
|
||||
* Get the user ID
|
||||
*
|
||||
* @return Attribute
|
||||
*/
|
||||
protected function accountTypeId(): Attribute
|
||||
protected function accountId(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: static fn($value) => (int)$value,
|
||||
@@ -315,9 +302,11 @@ class Account extends Model
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the user ID
|
||||
*
|
||||
* @return Attribute
|
||||
*/
|
||||
protected function accountId(): Attribute
|
||||
protected function accountTypeId(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: static fn($value) => (int)$value,
|
||||
@@ -334,4 +323,16 @@ class Account extends Model
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the virtual balance
|
||||
*
|
||||
* @return Attribute
|
||||
*/
|
||||
protected function virtualBalance(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: static fn($value) => (string)$value,
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -24,6 +24,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Models;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Eloquent;
|
||||
use FireflyIII\Support\Models\ReturnsIntegerIdTrait;
|
||||
use Illuminate\Database\Eloquent\Casts\Attribute;
|
||||
@@ -31,7 +32,6 @@ use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
use Illuminate\Database\Query\Builder;
|
||||
use Carbon\Carbon;
|
||||
|
||||
/**
|
||||
* FireflyIII\Models\AutoBudget
|
||||
|
@@ -23,6 +23,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Models;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Eloquent;
|
||||
use FireflyIII\Support\Models\ReturnsIntegerIdTrait;
|
||||
use FireflyIII\Support\Models\ReturnsIntegerUserIdTrait;
|
||||
@@ -32,7 +33,6 @@ use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
use Illuminate\Database\Query\Builder;
|
||||
use Carbon\Carbon;
|
||||
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
|
||||
|
||||
/**
|
||||
@@ -134,6 +134,7 @@ class AvailableBudget extends Model
|
||||
get: static fn($value) => (string)$value,
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Attribute
|
||||
*/
|
||||
|
@@ -246,18 +246,6 @@ class Bill extends Model
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the skip
|
||||
*
|
||||
* @return Attribute
|
||||
*/
|
||||
protected function skip(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: static fn ($value) => (int)$value,
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the min amount
|
||||
*
|
||||
@@ -273,7 +261,19 @@ class Bill extends Model
|
||||
/**
|
||||
* @return Attribute
|
||||
*/
|
||||
protected function transactionCurrencyId(): Attribute
|
||||
protected function order(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: static fn($value) => (int)$value,
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the skip
|
||||
*
|
||||
* @return Attribute
|
||||
*/
|
||||
protected function skip(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: static fn($value) => (int)$value,
|
||||
@@ -283,7 +283,7 @@ class Bill extends Model
|
||||
/**
|
||||
* @return Attribute
|
||||
*/
|
||||
protected function order(): Attribute
|
||||
protected function transactionCurrencyId(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: static fn($value) => (int)$value,
|
||||
|
@@ -181,6 +181,7 @@ class Budget extends Model
|
||||
{
|
||||
return $this->belongsToMany(Transaction::class, 'budget_transaction', 'budget_id');
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Attribute
|
||||
*/
|
||||
|
@@ -25,6 +25,7 @@ namespace FireflyIII\Models;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Eloquent;
|
||||
use FireflyIII\Support\Models\ReturnsIntegerIdTrait;
|
||||
use FireflyIII\Support\Models\ReturnsIntegerUserIdTrait;
|
||||
use FireflyIII\User;
|
||||
use Illuminate\Database\Eloquent\Collection;
|
||||
@@ -35,7 +36,7 @@ use Illuminate\Database\Eloquent\Relations\MorphMany;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
use Illuminate\Database\Query\Builder;
|
||||
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
|
||||
use FireflyIII\Support\Models\ReturnsIntegerIdTrait;
|
||||
|
||||
/**
|
||||
* FireflyIII\Models\Category
|
||||
*
|
||||
|
@@ -25,10 +25,11 @@ namespace FireflyIII\Models;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Eloquent;
|
||||
use FireflyIII\Support\Models\ReturnsIntegerIdTrait;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
use Illuminate\Database\Query\Builder;
|
||||
use FireflyIII\Support\Models\ReturnsIntegerIdTrait;
|
||||
|
||||
/**
|
||||
* FireflyIII\Models\Configuration
|
||||
*
|
||||
|
@@ -22,8 +22,10 @@
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Models;
|
||||
use FireflyIII\Support\Models\ReturnsIntegerIdTrait;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Eloquent;
|
||||
use FireflyIII\Support\Models\ReturnsIntegerIdTrait;
|
||||
use FireflyIII\Support\Models\ReturnsIntegerUserIdTrait;
|
||||
use FireflyIII\User;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
@@ -31,7 +33,6 @@ use Illuminate\Database\Eloquent\Casts\Attribute;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
use Carbon\Carbon;
|
||||
|
||||
/**
|
||||
* Class CurrencyExchangeRate
|
||||
@@ -111,26 +112,6 @@ class CurrencyExchangeRate extends Model
|
||||
return $this->belongsTo(User::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Attribute
|
||||
*/
|
||||
protected function rate(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: static fn ($value) => (string)$value,
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Attribute
|
||||
*/
|
||||
protected function userRate(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: static fn ($value) => (string)$value,
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Attribute
|
||||
*/
|
||||
@@ -141,6 +122,16 @@ class CurrencyExchangeRate extends Model
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Attribute
|
||||
*/
|
||||
protected function rate(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: static fn($value) => (string)$value,
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Attribute
|
||||
*/
|
||||
@@ -151,5 +142,15 @@ class CurrencyExchangeRate extends Model
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Attribute
|
||||
*/
|
||||
protected function userRate(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: static fn($value) => (string)$value,
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@@ -26,13 +26,14 @@ namespace FireflyIII\Models;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Eloquent;
|
||||
use FireflyIII\Support\Models\ReturnsIntegerIdTrait;
|
||||
use FireflyIII\Support\Models\ReturnsIntegerUserIdTrait;
|
||||
use FireflyIII\User;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
use Illuminate\Database\Eloquent\Casts\Attribute;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use FireflyIII\Support\Models\ReturnsIntegerIdTrait;
|
||||
|
||||
/**
|
||||
* Class GroupMembership
|
||||
*
|
||||
|
@@ -26,13 +26,14 @@ namespace FireflyIII\Models;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Eloquent;
|
||||
use FireflyIII\Support\Models\ReturnsIntegerIdTrait;
|
||||
use FireflyIII\Support\Models\ReturnsIntegerUserIdTrait;
|
||||
use FireflyIII\User;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
|
||||
use FireflyIII\Support\Models\ReturnsIntegerIdTrait;
|
||||
|
||||
/**
|
||||
* Class InvitedUser
|
||||
*
|
||||
|
@@ -25,13 +25,14 @@ namespace FireflyIII\Models;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Eloquent;
|
||||
use FireflyIII\Support\Models\ReturnsIntegerIdTrait;
|
||||
use Illuminate\Database\Eloquent\Collection;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
use Illuminate\Database\Query\Builder;
|
||||
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
|
||||
use FireflyIII\Support\Models\ReturnsIntegerIdTrait;
|
||||
|
||||
/**
|
||||
* FireflyIII\Models\LinkType
|
||||
*
|
||||
|
@@ -26,13 +26,14 @@ namespace FireflyIII\Models;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Eloquent;
|
||||
use FireflyIII\Support\Models\ReturnsIntegerIdTrait;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
use Illuminate\Database\Eloquent\Casts\Attribute;
|
||||
use Illuminate\Database\Eloquent\Collection;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\MorphMany;
|
||||
use Illuminate\Database\Eloquent\Relations\MorphTo;
|
||||
use FireflyIII\Support\Models\ReturnsIntegerIdTrait;
|
||||
|
||||
/**
|
||||
* FireflyIII\Models\Location
|
||||
*
|
||||
|
@@ -25,12 +25,13 @@ namespace FireflyIII\Models;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Eloquent;
|
||||
use FireflyIII\Support\Models\ReturnsIntegerIdTrait;
|
||||
use Illuminate\Database\Eloquent\Casts\Attribute;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\MorphTo;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
use Illuminate\Database\Query\Builder;
|
||||
use FireflyIII\Support\Models\ReturnsIntegerIdTrait;
|
||||
|
||||
/**
|
||||
* FireflyIII\Models\Note
|
||||
*
|
||||
|
@@ -26,6 +26,7 @@ namespace FireflyIII\Models;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Eloquent;
|
||||
use FireflyIII\Support\Models\ReturnsIntegerIdTrait;
|
||||
use FireflyIII\Support\Models\ReturnsIntegerUserIdTrait;
|
||||
use FireflyIII\User;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
@@ -35,7 +36,7 @@ use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use Illuminate\Database\Eloquent\Relations\MorphToMany;
|
||||
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
|
||||
use FireflyIII\Support\Models\ReturnsIntegerIdTrait;
|
||||
|
||||
/**
|
||||
* FireflyIII\Models\ObjectGroup
|
||||
*
|
||||
|
@@ -23,7 +23,9 @@ declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Models;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Eloquent;
|
||||
use FireflyIII\Support\Models\ReturnsIntegerIdTrait;
|
||||
use Illuminate\Database\Eloquent\Casts\Attribute;
|
||||
use Illuminate\Database\Eloquent\Collection;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
@@ -33,9 +35,8 @@ use Illuminate\Database\Eloquent\Relations\MorphMany;
|
||||
use Illuminate\Database\Eloquent\Relations\MorphToMany;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
use Illuminate\Database\Query\Builder;
|
||||
use Carbon\Carbon;
|
||||
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
|
||||
use FireflyIII\Support\Models\ReturnsIntegerIdTrait;
|
||||
|
||||
/**
|
||||
* FireflyIII\Models\PiggyBank
|
||||
*
|
||||
@@ -182,18 +183,6 @@ class PiggyBank extends Model
|
||||
$this->attributes['targetamount'] = (string)$value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the max amount
|
||||
*
|
||||
* @return Attribute
|
||||
*/
|
||||
protected function targetamount(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: static fn ($value) => (string)$value,
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Attribute
|
||||
*/
|
||||
@@ -214,4 +203,16 @@ class PiggyBank extends Model
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the max amount
|
||||
*
|
||||
* @return Attribute
|
||||
*/
|
||||
protected function targetamount(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: static fn($value) => (string)$value,
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -23,13 +23,14 @@ declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Models;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Eloquent;
|
||||
use FireflyIII\Support\Models\ReturnsIntegerIdTrait;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
use Illuminate\Database\Eloquent\Casts\Attribute;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use Carbon\Carbon;
|
||||
use FireflyIII\Support\Models\ReturnsIntegerIdTrait;
|
||||
|
||||
/**
|
||||
* FireflyIII\Models\PiggyBankEvent
|
||||
*
|
||||
|
@@ -25,11 +25,12 @@ namespace FireflyIII\Models;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Eloquent;
|
||||
use FireflyIII\Support\Models\ReturnsIntegerIdTrait;
|
||||
use Illuminate\Database\Eloquent\Builder as EloquentBuilder;
|
||||
use Illuminate\Database\Eloquent\Casts\Attribute;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use FireflyIII\Support\Models\ReturnsIntegerIdTrait;
|
||||
|
||||
/**
|
||||
* FireflyIII\Models\PiggyBankRepetition
|
||||
*
|
||||
|
@@ -25,13 +25,14 @@ namespace FireflyIII\Models;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Eloquent;
|
||||
use FireflyIII\Support\Models\ReturnsIntegerIdTrait;
|
||||
use FireflyIII\Support\Models\ReturnsIntegerUserIdTrait;
|
||||
use FireflyIII\User;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
|
||||
use FireflyIII\Support\Models\ReturnsIntegerIdTrait;
|
||||
|
||||
/**
|
||||
* FireflyIII\Models\Preference
|
||||
*
|
||||
|
@@ -25,6 +25,7 @@ namespace FireflyIII\Models;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Eloquent;
|
||||
use FireflyIII\Support\Models\ReturnsIntegerIdTrait;
|
||||
use FireflyIII\Support\Models\ReturnsIntegerUserIdTrait;
|
||||
use FireflyIII\User;
|
||||
use Illuminate\Database\Eloquent\Casts\Attribute;
|
||||
@@ -36,7 +37,7 @@ use Illuminate\Database\Eloquent\Relations\MorphMany;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
use Illuminate\Database\Query\Builder;
|
||||
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
|
||||
use FireflyIII\Support\Models\ReturnsIntegerIdTrait;
|
||||
|
||||
/**
|
||||
* FireflyIII\Models\Recurrence
|
||||
*
|
||||
|
@@ -25,12 +25,13 @@ namespace FireflyIII\Models;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Eloquent;
|
||||
use FireflyIII\Support\Models\ReturnsIntegerIdTrait;
|
||||
use Illuminate\Database\Eloquent\Casts\Attribute;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
use Illuminate\Database\Query\Builder;
|
||||
use FireflyIII\Support\Models\ReturnsIntegerIdTrait;
|
||||
|
||||
/**
|
||||
* FireflyIII\Models\RecurrenceMeta
|
||||
*
|
||||
|
@@ -23,7 +23,9 @@ declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Models;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Eloquent;
|
||||
use FireflyIII\Support\Models\ReturnsIntegerIdTrait;
|
||||
use Illuminate\Database\Eloquent\Casts\Attribute;
|
||||
use Illuminate\Database\Eloquent\Collection;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
@@ -31,8 +33,7 @@ use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
use Illuminate\Database\Query\Builder;
|
||||
use Carbon\Carbon;
|
||||
use FireflyIII\Support\Models\ReturnsIntegerIdTrait;
|
||||
|
||||
/**
|
||||
* FireflyIII\Models\RecurrenceTransaction
|
||||
*
|
||||
@@ -174,6 +175,16 @@ class RecurrenceTransaction extends Model
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Attribute
|
||||
*/
|
||||
protected function destinationId(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: static fn($value) => (int)$value,
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Attribute
|
||||
*/
|
||||
@@ -195,16 +206,6 @@ class RecurrenceTransaction extends Model
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Attribute
|
||||
*/
|
||||
protected function transactionCurrencyId(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: static fn($value) => (int)$value,
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Attribute
|
||||
*/
|
||||
@@ -218,7 +219,7 @@ class RecurrenceTransaction extends Model
|
||||
/**
|
||||
* @return Attribute
|
||||
*/
|
||||
protected function destinationId(): Attribute
|
||||
protected function transactionCurrencyId(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: static fn($value) => (int)$value,
|
||||
|
@@ -25,12 +25,13 @@ namespace FireflyIII\Models;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Eloquent;
|
||||
use FireflyIII\Support\Models\ReturnsIntegerIdTrait;
|
||||
use Illuminate\Database\Eloquent\Casts\Attribute;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
use Illuminate\Database\Query\Builder;
|
||||
use FireflyIII\Support\Models\ReturnsIntegerIdTrait;
|
||||
|
||||
/**
|
||||
* FireflyIII\Models\RecurrenceTransactionMeta
|
||||
*
|
||||
|
@@ -23,9 +23,9 @@ declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Models;
|
||||
|
||||
use FireflyIII\Support\Models\ReturnsIntegerIdTrait;
|
||||
use Carbon\Carbon;
|
||||
use Eloquent;
|
||||
use FireflyIII\Support\Models\ReturnsIntegerIdTrait;
|
||||
use FireflyIII\User;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
use Illuminate\Database\Eloquent\Collection;
|
||||
|
@@ -25,6 +25,7 @@ namespace FireflyIII\Models;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Eloquent;
|
||||
use FireflyIII\Support\Models\ReturnsIntegerIdTrait;
|
||||
use FireflyIII\Support\Models\ReturnsIntegerUserIdTrait;
|
||||
use FireflyIII\User;
|
||||
use Illuminate\Database\Eloquent\Casts\Attribute;
|
||||
@@ -35,7 +36,7 @@ use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
use Illuminate\Database\Query\Builder;
|
||||
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
|
||||
use FireflyIII\Support\Models\ReturnsIntegerIdTrait;
|
||||
|
||||
/**
|
||||
* FireflyIII\Models\Rule
|
||||
*
|
||||
@@ -178,7 +179,7 @@ class Rule extends Model
|
||||
/**
|
||||
* @return Attribute
|
||||
*/
|
||||
protected function ruleGroupId(): Attribute
|
||||
protected function order(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: static fn($value) => (int)$value,
|
||||
@@ -188,7 +189,7 @@ class Rule extends Model
|
||||
/**
|
||||
* @return Attribute
|
||||
*/
|
||||
protected function order(): Attribute
|
||||
protected function ruleGroupId(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: static fn($value) => (int)$value,
|
||||
|
@@ -25,11 +25,12 @@ namespace FireflyIII\Models;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Eloquent;
|
||||
use FireflyIII\Support\Models\ReturnsIntegerIdTrait;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
use Illuminate\Database\Eloquent\Casts\Attribute;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use FireflyIII\Support\Models\ReturnsIntegerIdTrait;
|
||||
|
||||
/**
|
||||
* FireflyIII\Models\RuleAction
|
||||
*
|
||||
@@ -84,7 +85,7 @@ class RuleAction extends Model
|
||||
/**
|
||||
* @return Attribute
|
||||
*/
|
||||
protected function ruleId(): Attribute
|
||||
protected function order(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: static fn($value) => (int)$value,
|
||||
@@ -94,7 +95,7 @@ class RuleAction extends Model
|
||||
/**
|
||||
* @return Attribute
|
||||
*/
|
||||
protected function order(): Attribute
|
||||
protected function ruleId(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: static fn($value) => (int)$value,
|
||||
|
@@ -25,6 +25,7 @@ namespace FireflyIII\Models;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Eloquent;
|
||||
use FireflyIII\Support\Models\ReturnsIntegerIdTrait;
|
||||
use FireflyIII\Support\Models\ReturnsIntegerUserIdTrait;
|
||||
use FireflyIII\User;
|
||||
use Illuminate\Database\Eloquent\Casts\Attribute;
|
||||
@@ -35,7 +36,7 @@ use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
use Illuminate\Database\Query\Builder;
|
||||
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
|
||||
use FireflyIII\Support\Models\ReturnsIntegerIdTrait;
|
||||
|
||||
/**
|
||||
* FireflyIII\Models\RuleGroup
|
||||
*
|
||||
|
@@ -25,11 +25,12 @@ namespace FireflyIII\Models;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Eloquent;
|
||||
use FireflyIII\Support\Models\ReturnsIntegerIdTrait;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
use Illuminate\Database\Eloquent\Casts\Attribute;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use FireflyIII\Support\Models\ReturnsIntegerIdTrait;
|
||||
|
||||
/**
|
||||
* FireflyIII\Models\RuleTrigger
|
||||
*
|
||||
@@ -84,7 +85,7 @@ class RuleTrigger extends Model
|
||||
/**
|
||||
* @return Attribute
|
||||
*/
|
||||
protected function ruleId(): Attribute
|
||||
protected function order(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: static fn($value) => (int)$value,
|
||||
@@ -94,7 +95,7 @@ class RuleTrigger extends Model
|
||||
/**
|
||||
* @return Attribute
|
||||
*/
|
||||
protected function order(): Attribute
|
||||
protected function ruleId(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: static fn($value) => (int)$value,
|
||||
|
@@ -25,6 +25,7 @@ namespace FireflyIII\Models;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Eloquent;
|
||||
use FireflyIII\Support\Models\ReturnsIntegerIdTrait;
|
||||
use FireflyIII\Support\Models\ReturnsIntegerUserIdTrait;
|
||||
use FireflyIII\User;
|
||||
use Illuminate\Database\Eloquent\Collection;
|
||||
@@ -35,7 +36,7 @@ use Illuminate\Database\Eloquent\Relations\MorphMany;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
use Illuminate\Database\Query\Builder;
|
||||
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
|
||||
use FireflyIII\Support\Models\ReturnsIntegerIdTrait;
|
||||
|
||||
/**
|
||||
* FireflyIII\Models\Tag
|
||||
*
|
||||
|
@@ -25,6 +25,7 @@ namespace FireflyIII\Models;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Eloquent;
|
||||
use FireflyIII\Support\Models\ReturnsIntegerIdTrait;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
use Illuminate\Database\Eloquent\Casts\Attribute;
|
||||
use Illuminate\Database\Eloquent\Collection;
|
||||
@@ -33,7 +34,7 @@ use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
use FireflyIII\Support\Models\ReturnsIntegerIdTrait;
|
||||
|
||||
/**
|
||||
* FireflyIII\Models\Transaction
|
||||
*
|
||||
@@ -253,6 +254,16 @@ class Transaction extends Model
|
||||
return $this->belongsTo(TransactionJournal::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Attribute
|
||||
*/
|
||||
protected function accountId(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: static fn($value) => (int)$value,
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the amount
|
||||
*
|
||||
@@ -277,15 +288,6 @@ class Transaction extends Model
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Attribute
|
||||
*/
|
||||
protected function accountId(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: static fn($value) => (int)$value,
|
||||
);
|
||||
}
|
||||
/**
|
||||
* @return Attribute
|
||||
*/
|
||||
|
@@ -25,6 +25,7 @@ namespace FireflyIII\Models;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Eloquent;
|
||||
use FireflyIII\Support\Models\ReturnsIntegerIdTrait;
|
||||
use FireflyIII\Support\Models\ReturnsIntegerUserIdTrait;
|
||||
use FireflyIII\User;
|
||||
use Illuminate\Database\Eloquent\Collection;
|
||||
@@ -34,7 +35,7 @@ use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
use Illuminate\Database\Query\Builder;
|
||||
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
|
||||
use FireflyIII\Support\Models\ReturnsIntegerIdTrait;
|
||||
|
||||
/**
|
||||
* FireflyIII\Models\TransactionGroup
|
||||
*
|
||||
|
@@ -25,6 +25,7 @@ namespace FireflyIII\Models;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Eloquent;
|
||||
use FireflyIII\Support\Models\ReturnsIntegerIdTrait;
|
||||
use FireflyIII\Support\Models\ReturnsIntegerUserIdTrait;
|
||||
use FireflyIII\User;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
@@ -39,7 +40,7 @@ use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
use Illuminate\Database\Eloquent\Relations\MorphMany;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
|
||||
use FireflyIII\Support\Models\ReturnsIntegerIdTrait;
|
||||
|
||||
/**
|
||||
* FireflyIII\Models\TransactionJournal
|
||||
*
|
||||
@@ -395,15 +396,6 @@ class TransactionJournal extends Model
|
||||
return $this->hasMany(Transaction::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Attribute
|
||||
*/
|
||||
protected function transactionTypeId(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: static fn($value) => (int)$value,
|
||||
);
|
||||
}
|
||||
/**
|
||||
* @return Attribute
|
||||
*/
|
||||
@@ -413,4 +405,14 @@ class TransactionJournal extends Model
|
||||
get: static fn($value) => (int)$value,
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Attribute
|
||||
*/
|
||||
protected function transactionTypeId(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: static fn($value) => (int)$value,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@@ -25,6 +25,7 @@ namespace FireflyIII\Models;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Eloquent;
|
||||
use FireflyIII\Support\Models\ReturnsIntegerIdTrait;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
use Illuminate\Database\Eloquent\Casts\Attribute;
|
||||
use Illuminate\Database\Eloquent\Collection;
|
||||
@@ -32,7 +33,7 @@ use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use Illuminate\Database\Eloquent\Relations\MorphMany;
|
||||
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
|
||||
use FireflyIII\Support\Models\ReturnsIntegerIdTrait;
|
||||
|
||||
/**
|
||||
* FireflyIII\Models\TransactionJournalLink
|
||||
*
|
||||
@@ -131,6 +132,17 @@ class TransactionJournalLink extends Model
|
||||
{
|
||||
return $this->belongsTo(TransactionJournal::class, 'source_id');
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Attribute
|
||||
*/
|
||||
protected function destinationId(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: static fn($value) => (int)$value,
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Attribute
|
||||
*/
|
||||
@@ -150,13 +162,4 @@ class TransactionJournalLink extends Model
|
||||
get: static fn($value) => (int)$value,
|
||||
);
|
||||
}
|
||||
/**
|
||||
* @return Attribute
|
||||
*/
|
||||
protected function destinationId(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: static fn($value) => (int)$value,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@@ -25,12 +25,13 @@ namespace FireflyIII\Models;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Eloquent;
|
||||
use FireflyIII\Support\Models\ReturnsIntegerIdTrait;
|
||||
use Illuminate\Database\Eloquent\Casts\Attribute;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
use Illuminate\Database\Query\Builder;
|
||||
use FireflyIII\Support\Models\ReturnsIntegerIdTrait;
|
||||
|
||||
/**
|
||||
* FireflyIII\Models\TransactionJournalMeta
|
||||
*
|
||||
@@ -105,6 +106,7 @@ class TransactionJournalMeta extends Model
|
||||
{
|
||||
return $this->belongsTo(TransactionJournal::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Attribute
|
||||
*/
|
||||
|
@@ -25,13 +25,14 @@ namespace FireflyIII\Models;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Eloquent;
|
||||
use FireflyIII\Support\Models\ReturnsIntegerIdTrait;
|
||||
use Illuminate\Database\Eloquent\Collection;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
use Illuminate\Database\Query\Builder;
|
||||
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
|
||||
use FireflyIII\Support\Models\ReturnsIntegerIdTrait;
|
||||
|
||||
/**
|
||||
* FireflyIII\Models\TransactionType
|
||||
*
|
||||
|
@@ -27,6 +27,7 @@ namespace FireflyIII\Models;
|
||||
use Carbon\Carbon;
|
||||
use Eloquent;
|
||||
use FireflyIII\Enums\UserRoleEnum;
|
||||
use FireflyIII\Support\Models\ReturnsIntegerIdTrait;
|
||||
use FireflyIII\User;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
use Illuminate\Database\Eloquent\Collection;
|
||||
@@ -35,7 +36,7 @@ use Illuminate\Database\Eloquent\Relations\BelongsToMany;
|
||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
use Illuminate\Database\Eloquent\Relations\HasManyThrough;
|
||||
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
|
||||
use FireflyIII\Support\Models\ReturnsIntegerIdTrait;
|
||||
|
||||
/**
|
||||
* Class UserGroup
|
||||
*
|
||||
|
@@ -26,11 +26,12 @@ namespace FireflyIII\Models;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Eloquent;
|
||||
use FireflyIII\Support\Models\ReturnsIntegerIdTrait;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
use Illuminate\Database\Eloquent\Collection;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
use FireflyIII\Support\Models\ReturnsIntegerIdTrait;
|
||||
|
||||
/**
|
||||
* Class UserRole
|
||||
*
|
||||
|
@@ -28,6 +28,7 @@ use Eloquent;
|
||||
use FireflyIII\Enums\WebhookDelivery;
|
||||
use FireflyIII\Enums\WebhookResponse;
|
||||
use FireflyIII\Enums\WebhookTrigger;
|
||||
use FireflyIII\Support\Models\ReturnsIntegerIdTrait;
|
||||
use FireflyIII\Support\Models\ReturnsIntegerUserIdTrait;
|
||||
use FireflyIII\User;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
@@ -37,7 +38,7 @@ use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
|
||||
use FireflyIII\Support\Models\ReturnsIntegerIdTrait;
|
||||
|
||||
/**
|
||||
* FireflyIII\Models\Webhook
|
||||
*
|
||||
|
@@ -25,6 +25,7 @@ namespace FireflyIII\Models;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Eloquent;
|
||||
use FireflyIII\Support\Models\ReturnsIntegerIdTrait;
|
||||
use FireflyIII\User;
|
||||
use Illuminate\Database\Eloquent\Casts\Attribute;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
@@ -32,7 +33,7 @@ use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
use Illuminate\Database\Query\Builder;
|
||||
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
|
||||
use FireflyIII\Support\Models\ReturnsIntegerIdTrait;
|
||||
|
||||
/**
|
||||
* Class WebhookAttempt
|
||||
*
|
||||
|
@@ -23,7 +23,9 @@ declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Models;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Eloquent;
|
||||
use FireflyIII\Support\Models\ReturnsIntegerIdTrait;
|
||||
use FireflyIII\User;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
use Illuminate\Database\Eloquent\Casts\Attribute;
|
||||
@@ -31,9 +33,8 @@ use Illuminate\Database\Eloquent\Collection;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
use Carbon\Carbon;
|
||||
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
|
||||
use FireflyIII\Support\Models\ReturnsIntegerIdTrait;
|
||||
|
||||
/**
|
||||
* FireflyIII\Models\WebhookMessage
|
||||
*
|
||||
|
@@ -43,9 +43,7 @@ class NewAccessToken extends Notification
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
}
|
||||
public function __construct() {}
|
||||
|
||||
/**
|
||||
* Get the array representation of the notification.
|
||||
|
@@ -40,9 +40,7 @@ class UserRegistration extends Notification
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
}
|
||||
public function __construct() {}
|
||||
|
||||
/**
|
||||
* Get the array representation of the notification.
|
||||
|
@@ -42,9 +42,7 @@ class AccountServiceProvider extends ServiceProvider
|
||||
/**
|
||||
* Bootstrap the application services.
|
||||
*/
|
||||
public function boot(): void
|
||||
{
|
||||
}
|
||||
public function boot(): void {}
|
||||
|
||||
/**
|
||||
* Register the application services.
|
||||
|
@@ -36,9 +36,7 @@ class AdminServiceProvider extends ServiceProvider
|
||||
/**
|
||||
* Bootstrap the application services.
|
||||
*/
|
||||
public function boot(): void
|
||||
{
|
||||
}
|
||||
public function boot(): void {}
|
||||
|
||||
/**
|
||||
* Register the application services.
|
||||
|
@@ -36,9 +36,7 @@ class AttachmentServiceProvider extends ServiceProvider
|
||||
/**
|
||||
* Bootstrap the application services.
|
||||
*/
|
||||
public function boot(): void
|
||||
{
|
||||
}
|
||||
public function boot(): void {}
|
||||
|
||||
/**
|
||||
* Register the application services.
|
||||
|
@@ -38,9 +38,7 @@ class BillServiceProvider extends ServiceProvider
|
||||
/**
|
||||
* Bootstrap the application services.
|
||||
*/
|
||||
public function boot(): void
|
||||
{
|
||||
}
|
||||
public function boot(): void {}
|
||||
|
||||
/**
|
||||
* Register the application services.
|
||||
|
@@ -50,9 +50,7 @@ class BudgetServiceProvider extends ServiceProvider
|
||||
/**
|
||||
* Bootstrap the application services.
|
||||
*/
|
||||
public function boot(): void
|
||||
{
|
||||
}
|
||||
public function boot(): void {}
|
||||
|
||||
/**
|
||||
* Register the application services.
|
||||
|
@@ -40,9 +40,7 @@ class CategoryServiceProvider extends ServiceProvider
|
||||
/**
|
||||
* Bootstrap the application services.
|
||||
*/
|
||||
public function boot(): void
|
||||
{
|
||||
}
|
||||
public function boot(): void {}
|
||||
|
||||
/**
|
||||
* Register the application services.
|
||||
|
@@ -38,9 +38,7 @@ class CurrencyServiceProvider extends ServiceProvider
|
||||
/**
|
||||
* Bootstrap the application services.
|
||||
*/
|
||||
public function boot(): void
|
||||
{
|
||||
}
|
||||
public function boot(): void {}
|
||||
|
||||
/**
|
||||
* Register the application services.
|
||||
|
@@ -46,9 +46,7 @@ class JournalServiceProvider extends ServiceProvider
|
||||
/**
|
||||
* Bootstrap the application services.
|
||||
*/
|
||||
public function boot(): void
|
||||
{
|
||||
}
|
||||
public function boot(): void {}
|
||||
|
||||
/**
|
||||
* Register the application services.
|
||||
|
@@ -38,9 +38,7 @@ class PiggyBankServiceProvider extends ServiceProvider
|
||||
/**
|
||||
* Bootstrap the application services.
|
||||
*/
|
||||
public function boot(): void
|
||||
{
|
||||
}
|
||||
public function boot(): void {}
|
||||
|
||||
/**
|
||||
* Register the application services.
|
||||
|
@@ -36,9 +36,7 @@ class RecurringServiceProvider extends ServiceProvider
|
||||
/**
|
||||
* Bootstrap the application services.
|
||||
*/
|
||||
public function boot(): void
|
||||
{
|
||||
}
|
||||
public function boot(): void {}
|
||||
|
||||
/**
|
||||
* Register the application services.
|
||||
|
@@ -36,9 +36,7 @@ class RuleGroupServiceProvider extends ServiceProvider
|
||||
/**
|
||||
* Bootstrap the application services.
|
||||
*/
|
||||
public function boot(): void
|
||||
{
|
||||
}
|
||||
public function boot(): void {}
|
||||
|
||||
/**
|
||||
* Register the application services.
|
||||
|
@@ -36,9 +36,7 @@ class RuleServiceProvider extends ServiceProvider
|
||||
/**
|
||||
* Bootstrap the application services.
|
||||
*/
|
||||
public function boot(): void
|
||||
{
|
||||
}
|
||||
public function boot(): void {}
|
||||
|
||||
/**
|
||||
* Register the application services.
|
||||
|
@@ -36,9 +36,7 @@ class SearchServiceProvider extends ServiceProvider
|
||||
/**
|
||||
* Bootstrap the application services.
|
||||
*/
|
||||
public function boot(): void
|
||||
{
|
||||
}
|
||||
public function boot(): void {}
|
||||
|
||||
/**
|
||||
* Register the application services.
|
||||
|
@@ -38,9 +38,7 @@ class TagServiceProvider extends ServiceProvider
|
||||
/**
|
||||
* Bootstrap the application services.
|
||||
*/
|
||||
public function boot(): void
|
||||
{
|
||||
}
|
||||
public function boot(): void {}
|
||||
|
||||
/**
|
||||
* Register the application services.
|
||||
|
@@ -116,7 +116,7 @@ class AccountRepository implements AccountRepositoryInterface
|
||||
->leftJoin('account_meta', 'accounts.id', '=', 'account_meta.account_id')
|
||||
->where('accounts.active', true)
|
||||
->where(
|
||||
static function (EloquentBuilder $q1) use ($number) { /** @phpstan-ignore-line */
|
||||
static function (EloquentBuilder $q1) use ($number) { // @phpstan-ignore-line
|
||||
$json = json_encode($number);
|
||||
$q1->where('account_meta.name', '=', 'account_number');
|
||||
$q1->where('account_meta.data', '=', $json);
|
||||
|
@@ -272,7 +272,7 @@ class OperationsRepository implements OperationsRepositoryInterface
|
||||
'currency_code' => $journal['currency_code'],
|
||||
'currency_decimal_places' => $journal['currency_decimal_places'],
|
||||
];
|
||||
$array[$currencyId]['sum'] = bcadd($array[$currencyId]['sum'], app('steam')->$direction($journal['amount']));/** @phpstan-ignore-line */
|
||||
$array[$currencyId]['sum'] = bcadd($array[$currencyId]['sum'], app('steam')->$direction($journal['amount'])); // @phpstan-ignore-line
|
||||
|
||||
// also do foreign amount:
|
||||
$foreignId = (int)$journal['foreign_currency_id'];
|
||||
|
@@ -200,7 +200,7 @@ class JournalCLIRepository implements JournalCLIRepositoryInterface
|
||||
{
|
||||
$query = TransactionJournal::leftJoin('transactions', 'transaction_journals.id', '=', 'transactions.transaction_journal_id')
|
||||
->groupBy('transaction_journals.id');
|
||||
$result = $query->get(['transaction_journals.id as id', DB::raw('count(transactions.id) as transaction_count')]); /** @phpstan-ignore-line */
|
||||
$result = $query->get(['transaction_journals.id as id', DB::raw('count(transactions.id) as transaction_count')]); // @phpstan-ignore-line
|
||||
$journalIds = [];
|
||||
/** @var stdClass $row */
|
||||
foreach ($result as $row) {
|
||||
|
@@ -374,6 +374,26 @@ class TagRepository implements TagRepositoryInterface
|
||||
return $sums;
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
public function tagEndsWith(string $query): Collection
|
||||
{
|
||||
$search = sprintf('%%%s', $query);
|
||||
|
||||
return $this->user->tags()->where('tag', 'LIKE', $search)->get(['tags.*']);
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
public function tagStartsWith(string $query): Collection
|
||||
{
|
||||
$search = sprintf('%s%%', $query);
|
||||
|
||||
return $this->user->tags()->where('tag', 'LIKE', $search)->get(['tags.*']);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Tag $tag
|
||||
* @param Carbon $start
|
||||
@@ -454,24 +474,4 @@ class TagRepository implements TagRepositoryInterface
|
||||
/** @var Location|null */
|
||||
return $tag->locations()->first();
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
public function tagStartsWith(string $query): Collection
|
||||
{
|
||||
$search = sprintf('%s%%', $query);
|
||||
|
||||
return $this->user->tags()->where('tag', 'LIKE', $search)->get(['tags.*']);
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
public function tagEndsWith(string $query): Collection
|
||||
{
|
||||
$search = sprintf('%%%s', $query);
|
||||
|
||||
return $this->user->tags()->where('tag', 'LIKE', $search)->get(['tags.*']);
|
||||
}
|
||||
}
|
||||
|
@@ -153,24 +153,6 @@ interface TagRepositoryInterface
|
||||
*/
|
||||
public function searchTag(string $query): Collection;
|
||||
|
||||
/**
|
||||
* Find one or more tags that start with the string in the query
|
||||
*
|
||||
* @param string $query
|
||||
*
|
||||
* @return Collection
|
||||
*/
|
||||
public function tagStartsWith(string $query): Collection;
|
||||
|
||||
/**
|
||||
* Find one or more tags that start with the string in the query
|
||||
*
|
||||
* @param string $query
|
||||
*
|
||||
* @return Collection
|
||||
*/
|
||||
public function tagEndsWith(string $query): Collection;
|
||||
|
||||
/**
|
||||
* Search the users tags.
|
||||
*
|
||||
@@ -206,6 +188,24 @@ interface TagRepositoryInterface
|
||||
*/
|
||||
public function sumsOfTag(Tag $tag, ?Carbon $start, ?Carbon $end): array;
|
||||
|
||||
/**
|
||||
* Find one or more tags that start with the string in the query
|
||||
*
|
||||
* @param string $query
|
||||
*
|
||||
* @return Collection
|
||||
*/
|
||||
public function tagEndsWith(string $query): Collection;
|
||||
|
||||
/**
|
||||
* Find one or more tags that start with the string in the query
|
||||
*
|
||||
* @param string $query
|
||||
*
|
||||
* @return Collection
|
||||
*/
|
||||
public function tagStartsWith(string $query): Collection;
|
||||
|
||||
/**
|
||||
* @param Tag $tag
|
||||
* @param Carbon $start
|
||||
|
@@ -40,6 +40,50 @@ class AccountRepository implements AccountRepositoryInterface
|
||||
{
|
||||
use UserGroupTrait;
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
public function findByAccountNumber(string $number, array $types): ?Account
|
||||
{
|
||||
$dbQuery = $this->userGroup
|
||||
->accounts()
|
||||
->leftJoin('account_meta', 'accounts.id', '=', 'account_meta.account_id')
|
||||
->where('accounts.active', true)
|
||||
->where(
|
||||
static function (EloquentBuilder $q1) use ($number) { // @phpstan-ignore-line
|
||||
$json = json_encode($number);
|
||||
$q1->where('account_meta.name', '=', 'account_number');
|
||||
$q1->where('account_meta.data', '=', $json);
|
||||
}
|
||||
);
|
||||
|
||||
if (0 !== count($types)) {
|
||||
$dbQuery->leftJoin('account_types', 'accounts.account_type_id', '=', 'account_types.id');
|
||||
$dbQuery->whereIn('account_types.type', $types);
|
||||
}
|
||||
/** @var Account|null */
|
||||
return $dbQuery->first(['accounts.*']);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $iban
|
||||
* @param array $types
|
||||
*
|
||||
* @return Account|null
|
||||
*/
|
||||
public function findByIbanNull(string $iban, array $types): ?Account
|
||||
{
|
||||
$query = $this->userGroup->accounts()->where('iban', '!=', '')->whereNotNull('iban');
|
||||
|
||||
if (0 !== count($types)) {
|
||||
$query->leftJoin('account_types', 'accounts.account_type_id', '=', 'account_types.id');
|
||||
$query->whereIn('account_types.type', $types);
|
||||
}
|
||||
|
||||
/** @var Account|null */
|
||||
return $query->where('iban', $iban)->first(['accounts.*']);
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
@@ -66,31 +110,6 @@ class AccountRepository implements AccountRepositoryInterface
|
||||
return $account;
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
public function findByAccountNumber(string $number, array $types): ?Account
|
||||
{
|
||||
$dbQuery = $this->userGroup
|
||||
->accounts()
|
||||
->leftJoin('account_meta', 'accounts.id', '=', 'account_meta.account_id')
|
||||
->where('accounts.active', true)
|
||||
->where(
|
||||
static function (EloquentBuilder $q1) use ($number) { /** @phpstan-ignore-line */
|
||||
$json = json_encode($number);
|
||||
$q1->where('account_meta.name', '=', 'account_number');
|
||||
$q1->where('account_meta.data', '=', $json);
|
||||
}
|
||||
);
|
||||
|
||||
if (0 !== count($types)) {
|
||||
$dbQuery->leftJoin('account_types', 'accounts.account_type_id', '=', 'account_types.id');
|
||||
$dbQuery->whereIn('account_types.type', $types);
|
||||
}
|
||||
/** @var Account|null */
|
||||
return $dbQuery->first(['accounts.*']);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Account $account
|
||||
*
|
||||
@@ -245,22 +264,4 @@ class AccountRepository implements AccountRepositoryInterface
|
||||
|
||||
return $dbQuery->take($limit)->get(['accounts.*']);
|
||||
}
|
||||
/**
|
||||
* @param string $iban
|
||||
* @param array $types
|
||||
*
|
||||
* @return Account|null
|
||||
*/
|
||||
public function findByIbanNull(string $iban, array $types): ?Account
|
||||
{
|
||||
$query = $this->userGroup->accounts()->where('iban', '!=', '')->whereNotNull('iban');
|
||||
|
||||
if (0 !== count($types)) {
|
||||
$query->leftJoin('account_types', 'accounts.account_type_id', '=', 'account_types.id');
|
||||
$query->whereIn('account_types.type', $types);
|
||||
}
|
||||
|
||||
/** @var Account|null */
|
||||
return $query->where('iban', $iban)->first(['accounts.*']);
|
||||
}
|
||||
}
|
||||
|
@@ -37,19 +37,11 @@ use Illuminate\Support\Collection;
|
||||
interface AccountRepositoryInterface
|
||||
{
|
||||
/**
|
||||
* @param UserGroup $userGroup
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setUserGroup(UserGroup $userGroup): void;
|
||||
|
||||
/**
|
||||
* @param string $iban
|
||||
* @param array $types
|
||||
* @param int $accountId
|
||||
*
|
||||
* @return Account|null
|
||||
*/
|
||||
public function findByIbanNull(string $iban, array $types): ?Account;
|
||||
public function find(int $accountId): ?Account;
|
||||
|
||||
/**
|
||||
* @param string $number
|
||||
@@ -60,18 +52,12 @@ interface AccountRepositoryInterface
|
||||
public function findByAccountNumber(string $number, array $types): ?Account;
|
||||
|
||||
/**
|
||||
* @param User $user
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setUser(User $user): void;
|
||||
|
||||
/**
|
||||
* @param int $accountId
|
||||
* @param string $iban
|
||||
* @param array $types
|
||||
*
|
||||
* @return Account|null
|
||||
*/
|
||||
public function find(int $accountId): ?Account;
|
||||
public function findByIbanNull(string $iban, array $types): ?Account;
|
||||
|
||||
/**
|
||||
* @param string $name
|
||||
@@ -129,5 +115,19 @@ interface AccountRepositoryInterface
|
||||
*/
|
||||
public function searchAccount(string $query, array $types, int $limit): Collection;
|
||||
|
||||
/**
|
||||
* @param User $user
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setUser(User $user): void;
|
||||
|
||||
/**
|
||||
* @param UserGroup $userGroup
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setUserGroup(UserGroup $userGroup): void;
|
||||
|
||||
|
||||
}
|
||||
|
@@ -35,13 +35,6 @@ use Illuminate\Support\Collection;
|
||||
*/
|
||||
interface BillRepositoryInterface
|
||||
{
|
||||
/**
|
||||
* @param User $user
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setUser(User $user): void;
|
||||
|
||||
/**
|
||||
* TODO duplicate of other repos
|
||||
* Add correct order to bills.
|
||||
@@ -84,6 +77,13 @@ interface BillRepositoryInterface
|
||||
*/
|
||||
public function nextDateMatch(Bill $bill, Carbon $date): Carbon;
|
||||
|
||||
/**
|
||||
* @param User $user
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setUser(User $user): void;
|
||||
|
||||
/**
|
||||
* Collect multi-currency of sum of bills already paid.
|
||||
*
|
||||
|
@@ -33,12 +33,6 @@ use FireflyIII\User;
|
||||
*/
|
||||
interface AvailableBudgetRepositoryInterface
|
||||
{
|
||||
/**
|
||||
* @param User $user
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setUser(User $user): void;
|
||||
/**
|
||||
* @param Carbon $start
|
||||
* @param Carbon $end
|
||||
@@ -47,4 +41,11 @@ interface AvailableBudgetRepositoryInterface
|
||||
*/
|
||||
public function getAvailableBudgetWithCurrency(Carbon $start, Carbon $end): array;
|
||||
|
||||
/**
|
||||
* @param User $user
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setUser(User $user): void;
|
||||
|
||||
}
|
||||
|
@@ -34,6 +34,11 @@ use Illuminate\Support\Collection;
|
||||
*/
|
||||
interface BudgetRepositoryInterface
|
||||
{
|
||||
/**
|
||||
* @return Collection
|
||||
*/
|
||||
public function getActiveBudgets(): Collection;
|
||||
|
||||
/**
|
||||
* @param User $user
|
||||
*
|
||||
@@ -47,8 +52,4 @@ interface BudgetRepositoryInterface
|
||||
* @return void
|
||||
*/
|
||||
public function setUserGroup(UserGroup $userGroup): void;
|
||||
/**
|
||||
* @return Collection
|
||||
*/
|
||||
public function getActiveBudgets(): Collection;
|
||||
}
|
||||
|
@@ -34,13 +34,6 @@ use Illuminate\Support\Collection;
|
||||
*/
|
||||
interface OperationsRepositoryInterface
|
||||
{
|
||||
/**
|
||||
* @param User $user
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setUser(User $user): void;
|
||||
|
||||
/**
|
||||
* This method returns a list of all the withdrawal transaction journals (as arrays) set in that period
|
||||
* which have the specified budget set to them. It's grouped per currency, with as few details in the array
|
||||
@@ -54,4 +47,11 @@ interface OperationsRepositoryInterface
|
||||
* @return array
|
||||
*/
|
||||
public function listExpenses(Carbon $start, Carbon $end, ?Collection $accounts = null, ?Collection $budgets = null): array;
|
||||
|
||||
/**
|
||||
* @param User $user
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setUser(User $user): void;
|
||||
}
|
||||
|
@@ -25,7 +25,6 @@ declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Repositories\UserGroups\Currency;
|
||||
|
||||
use FireflyIII\Api\V1\Controllers\Data\Bulk\TransactionController;
|
||||
use FireflyIII\Exceptions\FireflyException;
|
||||
use FireflyIII\Models\TransactionCurrency;
|
||||
use FireflyIII\User;
|
||||
@@ -33,12 +32,6 @@ use Illuminate\Support\Collection;
|
||||
|
||||
interface CurrencyRepositoryInterface
|
||||
{
|
||||
/**
|
||||
* @param User $user
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setUser(User $user): void;
|
||||
/**
|
||||
* @param TransactionCurrency $currency
|
||||
*
|
||||
@@ -162,6 +155,13 @@ interface CurrencyRepositoryInterface
|
||||
*/
|
||||
public function searchCurrency(string $search, int $limit): Collection;
|
||||
|
||||
/**
|
||||
* @param User $user
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setUser(User $user): void;
|
||||
|
||||
/**
|
||||
* @param array $data
|
||||
*
|
||||
|
@@ -31,13 +31,6 @@ use Illuminate\Support\Collection;
|
||||
*/
|
||||
interface JournalRepositoryInterface
|
||||
{
|
||||
/**
|
||||
* @param User $user
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setUser(User $user): void;
|
||||
|
||||
/**
|
||||
* Search in journal descriptions.
|
||||
*
|
||||
@@ -47,4 +40,11 @@ interface JournalRepositoryInterface
|
||||
* @return Collection
|
||||
*/
|
||||
public function searchJournalDescriptions(string $search, int $limit): Collection;
|
||||
|
||||
/**
|
||||
* @param User $user
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setUser(User $user): void;
|
||||
}
|
||||
|
@@ -49,7 +49,6 @@ class IsDateOrTime implements ValidationRule
|
||||
$value = (string)$value;
|
||||
if ('' === $value) {
|
||||
$fail('validation.date_or_time')->translate();
|
||||
;
|
||||
return;
|
||||
}
|
||||
if (10 === strlen($value)) {
|
||||
@@ -60,13 +59,11 @@ class IsDateOrTime implements ValidationRule
|
||||
app('log')->error(sprintf('"%s" is not a valid date: %s', $value, $e->getMessage()));
|
||||
|
||||
$fail('validation.date_or_time')->translate();
|
||||
;
|
||||
return;
|
||||
} catch (InvalidFormatException $e) { // @phpstan-ignore-line
|
||||
app('log')->error(sprintf('"%s" is of an invalid format: %s', $value, $e->getMessage()));
|
||||
|
||||
$fail('validation.date_or_time')->translate();
|
||||
;
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -79,13 +76,11 @@ class IsDateOrTime implements ValidationRule
|
||||
app('log')->error(sprintf('"%s" is not a valid date or time: %s', $value, $e->getMessage()));
|
||||
|
||||
$fail('validation.date_or_time')->translate();
|
||||
;
|
||||
return;
|
||||
} catch (InvalidFormatException $e) {
|
||||
app('log')->error(sprintf('"%s" is of an invalid format: %s', $value, $e->getMessage()));
|
||||
|
||||
$fail('validation.date_or_time')->translate();
|
||||
;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@@ -164,19 +164,6 @@ class IsValidAttachmentModel implements ValidationRule
|
||||
return null !== $repository->find($value);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $value
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
private function validateJournal(int $value): bool
|
||||
{
|
||||
$repository = app(JournalRepositoryInterface::class);
|
||||
$repository->setUser(auth()->user());
|
||||
|
||||
return null !== $repository->find($value);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $value
|
||||
*
|
||||
@@ -218,4 +205,17 @@ class IsValidAttachmentModel implements ValidationRule
|
||||
|
||||
return null !== $repository->findTransaction($value);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $value
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
private function validateJournal(int $value): bool
|
||||
{
|
||||
$repository = app(JournalRepositoryInterface::class);
|
||||
$repository->setUser(auth()->user());
|
||||
|
||||
return null !== $repository->find($value);
|
||||
}
|
||||
}
|
||||
|
@@ -135,7 +135,8 @@ class GroupUpdateService
|
||||
TransactionGroup $transactionGroup,
|
||||
TransactionJournal $journal,
|
||||
array $data
|
||||
): void {
|
||||
): void
|
||||
{
|
||||
app('log')->debug(sprintf('Now in %s', __METHOD__));
|
||||
if (0 === count($data)) {
|
||||
return;
|
||||
|
@@ -123,17 +123,6 @@ class Amount
|
||||
return $this->getDefaultCurrencyByUserGroup($user->userGroup);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param User $user
|
||||
*
|
||||
* @return TransactionCurrency
|
||||
* @deprecated use getDefaultCurrencyByUserGroup instead.
|
||||
*/
|
||||
public function getDefaultCurrencyByUser(User $user): TransactionCurrency
|
||||
{
|
||||
return $this->getDefaultCurrencyByUserGroup($user->userGroup);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param UserGroup $userGroup
|
||||
*
|
||||
@@ -166,6 +155,17 @@ class Amount
|
||||
return TransactionCurrency::where('code', 'EUR')->first();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param User $user
|
||||
*
|
||||
* @return TransactionCurrency
|
||||
* @deprecated use getDefaultCurrencyByUserGroup instead.
|
||||
*/
|
||||
public function getDefaultCurrencyByUser(User $user): TransactionCurrency
|
||||
{
|
||||
return $this->getDefaultCurrencyByUserGroup($user->userGroup);
|
||||
}
|
||||
|
||||
/**
|
||||
* This method returns the correct format rules required by accounting.js,
|
||||
* the library used to format amounts in charts.
|
||||
|
@@ -226,7 +226,7 @@ class ExpandedForm
|
||||
/** @var Eloquent $entry */
|
||||
foreach ($set as $entry) {
|
||||
// All Eloquent models have an ID
|
||||
$entryId = $entry->id; /** @phpstan-ignore-line */
|
||||
$entryId = $entry->id; // @phpstan-ignore-line
|
||||
$current = $entry->toArray();
|
||||
$title = null;
|
||||
foreach ($fields as $field) {
|
||||
|
@@ -36,7 +36,6 @@ use FireflyIII\Repositories\Budget\BudgetRepositoryInterface;
|
||||
use FireflyIII\Repositories\Budget\OperationsRepositoryInterface;
|
||||
use FireflyIII\Repositories\Category\CategoryRepositoryInterface;
|
||||
use FireflyIII\Support\CacheProperties;
|
||||
use FireflyIII\Support\Facades\Amount;
|
||||
use Illuminate\Support\Collection;
|
||||
|
||||
/**
|
||||
|
@@ -33,6 +33,7 @@ trait ReturnsIntegerIdTrait
|
||||
/**
|
||||
* Get the ID
|
||||
* @SuppressWarnings(PHPMD.ShortMethodName)
|
||||
*
|
||||
* @return Attribute
|
||||
*/
|
||||
protected function id(): Attribute
|
||||
|
@@ -30,16 +30,6 @@ use Illuminate\Database\Eloquent\Casts\Attribute;
|
||||
*/
|
||||
trait ReturnsIntegerUserIdTrait
|
||||
{
|
||||
/**
|
||||
* @return Attribute
|
||||
*/
|
||||
protected function userId(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: static fn($value) => (int)$value,
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the user group ID
|
||||
*
|
||||
@@ -51,4 +41,14 @@ trait ReturnsIntegerUserIdTrait
|
||||
get: static fn($value) => (int)$value,
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Attribute
|
||||
*/
|
||||
protected function userId(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: static fn($value) => (int)$value,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@@ -181,7 +181,7 @@ trait ConvertsDataTypes
|
||||
/** @var AccountRepositoryInterface $repository */
|
||||
$repository = app(AccountRepositoryInterface::class);
|
||||
|
||||
if (method_exists($this, 'validateUserGroup')) { /** @phpstan-ignore-line */
|
||||
if (method_exists($this, 'validateUserGroup')) { // @phpstan-ignore-line
|
||||
$userGroup = $this->validateUserGroup($this);
|
||||
if (null !== $userGroup) {
|
||||
$repository->setUserGroup($userGroup);
|
||||
|
@@ -77,7 +77,7 @@ class AccountSearch implements GenericSearchInterface
|
||||
);
|
||||
// meta data:
|
||||
$searchQuery->orWhere(
|
||||
static function (Builder $q) use ($originalQuery) { /** @phpstan-ignore-line */
|
||||
static function (Builder $q) use ($originalQuery) { // @phpstan-ignore-line
|
||||
$json = json_encode($originalQuery, JSON_THROW_ON_ERROR);
|
||||
$q->where('account_meta.name', '=', 'account_number');
|
||||
$q->where('account_meta.data', 'LIKE', $json);
|
||||
@@ -96,7 +96,7 @@ class AccountSearch implements GenericSearchInterface
|
||||
case self::SEARCH_NUMBER:
|
||||
// meta data:
|
||||
$searchQuery->Where(
|
||||
static function (Builder $q) use ($originalQuery) { /** @phpstan-ignore-line */
|
||||
static function (Builder $q) use ($originalQuery) { // @phpstan-ignore-line
|
||||
$json = json_encode($originalQuery, JSON_THROW_ON_ERROR);
|
||||
$q->where('account_meta.name', 'account_number');
|
||||
$q->where('account_meta.data', $json);
|
||||
|
@@ -57,6 +57,8 @@ use Gdbots\QueryParser\QueryParser;
|
||||
use Illuminate\Pagination\LengthAwarePaginator;
|
||||
use Illuminate\Support\Collection;
|
||||
use LogicException;
|
||||
use Psr\Container\ContainerExceptionInterface;
|
||||
use Psr\Container\NotFoundExceptionInterface;
|
||||
use TypeError;
|
||||
|
||||
/**
|
||||
@@ -71,6 +73,8 @@ class OperatorQuerySearch implements SearchInterface
|
||||
private CategoryRepositoryInterface $categoryRepository;
|
||||
private GroupCollectorInterface $collector;
|
||||
private CurrencyRepositoryInterface $currencyRepository;
|
||||
private array $excludeTags;
|
||||
private array $includeTags;
|
||||
private array $invalidOperators;
|
||||
private int $limit;
|
||||
private Collection $operators;
|
||||
@@ -81,9 +85,6 @@ class OperatorQuerySearch implements SearchInterface
|
||||
private array $validOperators;
|
||||
private array $words;
|
||||
|
||||
private array $excludeTags;
|
||||
private array $includeTags;
|
||||
|
||||
/**
|
||||
* OperatorQuerySearch constructor.
|
||||
*
|
||||
@@ -2165,6 +2166,44 @@ class OperatorQuerySearch implements SearchInterface
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
* @throws ContainerExceptionInterface
|
||||
* @throws NotFoundExceptionInterface
|
||||
*/
|
||||
private function parseTagInstructions(): void
|
||||
{
|
||||
app('log')->debug('Now in parseTagInstructions()');
|
||||
// if exclude tags, remove excluded tags.
|
||||
if (count($this->excludeTags) > 0) {
|
||||
app('log')->debug(sprintf('%d exclude tag(s)', count($this->excludeTags)));
|
||||
$collection = new Collection;
|
||||
foreach ($this->excludeTags as $tagId) {
|
||||
$tag = $this->tagRepository->find($tagId);
|
||||
if (null !== $tag) {
|
||||
app('log')->debug(sprintf('Exclude tag "%s"', $tag->tag));
|
||||
$collection->push($tag);
|
||||
}
|
||||
}
|
||||
app('log')->debug(sprintf('Selecting all tags except %d excluded tag(s).', $collection->count()));
|
||||
$this->collector->setWithoutSpecificTags($collection);
|
||||
}
|
||||
// if include tags, include them:
|
||||
if (count($this->includeTags) > 0) {
|
||||
app('log')->debug(sprintf('%d include tag(s)', count($this->includeTags)));
|
||||
$collection = new Collection;
|
||||
foreach ($this->includeTags as $tagId) {
|
||||
$tag = $this->tagRepository->find($tagId);
|
||||
if (null !== $tag) {
|
||||
app('log')->debug(sprintf('Include tag "%s"', $tag->tag));
|
||||
$collection->push($tag);
|
||||
}
|
||||
}
|
||||
$this->collector->setTags($collection);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
@@ -2235,42 +2274,4 @@ class OperatorQuerySearch implements SearchInterface
|
||||
$this->limit = $limit;
|
||||
$this->collector->setLimit($this->limit);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
* @throws \Psr\Container\ContainerExceptionInterface
|
||||
* @throws \Psr\Container\NotFoundExceptionInterface
|
||||
*/
|
||||
private function parseTagInstructions(): void
|
||||
{
|
||||
app('log')->debug('Now in parseTagInstructions()');
|
||||
// if exclude tags, remove excluded tags.
|
||||
if (count($this->excludeTags) > 0) {
|
||||
app('log')->debug(sprintf('%d exclude tag(s)', count($this->excludeTags)));
|
||||
$collection = new Collection;
|
||||
foreach ($this->excludeTags as $tagId) {
|
||||
$tag = $this->tagRepository->find($tagId);
|
||||
if (null !== $tag) {
|
||||
app('log')->debug(sprintf('Exclude tag "%s"', $tag->tag));
|
||||
$collection->push($tag);
|
||||
}
|
||||
}
|
||||
app('log')->debug(sprintf('Selecting all tags except %d excluded tag(s).', $collection->count()));
|
||||
$this->collector->setWithoutSpecificTags($collection);
|
||||
}
|
||||
// if include tags, include them:
|
||||
if (count($this->includeTags) > 0) {
|
||||
app('log')->debug(sprintf('%d include tag(s)', count($this->includeTags)));
|
||||
$collection = new Collection;
|
||||
foreach ($this->includeTags as $tagId) {
|
||||
$tag = $this->tagRepository->find($tagId);
|
||||
if (null !== $tag) {
|
||||
app('log')->debug(sprintf('Include tag "%s"', $tag->tag));
|
||||
$collection->push($tag);
|
||||
}
|
||||
}
|
||||
$this->collector->setTags($collection);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
@@ -604,7 +604,7 @@ class Steam
|
||||
->leftJoin('transaction_journals', 'transaction_journals.id', '=', 'transactions.transaction_journal_id')
|
||||
->where('transaction_journals.date', '<=', $date->format('Y-m-d 23:59:59'))
|
||||
->groupBy('transactions.transaction_currency_id');
|
||||
$balances = $query->get(['transactions.transaction_currency_id', DB::raw('SUM(transactions.amount) as sum_for_currency')]); /** @phpstan-ignore-line */
|
||||
$balances = $query->get(['transactions.transaction_currency_id', DB::raw('SUM(transactions.amount) as sum_for_currency')]); // @phpstan-ignore-line
|
||||
$return = [];
|
||||
/** @var stdClass $entry */
|
||||
foreach ($balances as $entry) {
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user