mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-02-25 18:45:27 -06:00
Always great when using conflicting tools
This commit is contained in:
parent
46e130fdfe
commit
ce023f2580
@ -13,6 +13,7 @@ parameters:
|
|||||||
- '#is not allowed to extend#'
|
- '#is not allowed to extend#'
|
||||||
- '#switch is forbidden to use#'
|
- '#switch is forbidden to use#'
|
||||||
- '#is neither abstract nor final#'
|
- '#is neither abstract nor final#'
|
||||||
|
- '#on left side of \?\?\= always exists and is not nullable#'
|
||||||
- '#has a nullable return type declaration#' # perhaps throw errors instead?
|
- '#has a nullable return type declaration#' # perhaps throw errors instead?
|
||||||
- '#with a nullable type declaration#' # decide what action should be if param is null.
|
- '#with a nullable type declaration#' # decide what action should be if param is null.
|
||||||
- '#with null as default value#'
|
- '#with null as default value#'
|
||||||
|
@ -43,8 +43,8 @@ class FixAccountTypes extends Command
|
|||||||
{
|
{
|
||||||
use ShowsFriendlyMessages;
|
use ShowsFriendlyMessages;
|
||||||
|
|
||||||
protected $description = 'Make sure all journals have the correct from/to account types.';
|
protected $description = 'Make sure all journals have the correct from/to account types.';
|
||||||
protected $signature = 'firefly-iii:fix-account-types';
|
protected $signature = 'firefly-iii:fix-account-types';
|
||||||
private int $count;
|
private int $count;
|
||||||
private array $expected;
|
private array $expected;
|
||||||
private AccountFactory $factory;
|
private AccountFactory $factory;
|
||||||
|
@ -37,8 +37,8 @@ class FixIbans extends Command
|
|||||||
{
|
{
|
||||||
use ShowsFriendlyMessages;
|
use ShowsFriendlyMessages;
|
||||||
|
|
||||||
protected $description = 'Removes spaces from IBANs';
|
protected $description = 'Removes spaces from IBANs';
|
||||||
protected $signature = 'firefly-iii:fix-ibans';
|
protected $signature = 'firefly-iii:fix-ibans';
|
||||||
private int $count = 0;
|
private int $count = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -40,8 +40,8 @@ class FixRecurringTransactions extends Command
|
|||||||
{
|
{
|
||||||
use ShowsFriendlyMessages;
|
use ShowsFriendlyMessages;
|
||||||
|
|
||||||
protected $description = 'Fixes recurring transactions with the wrong transaction type.';
|
protected $description = 'Fixes recurring transactions with the wrong transaction type.';
|
||||||
protected $signature = 'firefly-iii:fix-recurring-transactions';
|
protected $signature = 'firefly-iii:fix-recurring-transactions';
|
||||||
private int $count = 0;
|
private int $count = 0;
|
||||||
private RecurringRepositoryInterface $recurringRepos;
|
private RecurringRepositoryInterface $recurringRepos;
|
||||||
private UserRepositoryInterface $userRepos;
|
private UserRepositoryInterface $userRepos;
|
||||||
|
@ -51,7 +51,7 @@ class ExportData extends Command
|
|||||||
|
|
||||||
protected $description = 'Command to export data from Firefly III.';
|
protected $description = 'Command to export data from Firefly III.';
|
||||||
|
|
||||||
protected $signature = 'firefly-iii:export-data
|
protected $signature = 'firefly-iii:export-data
|
||||||
{--user=1 : The user ID that the export should run for.}
|
{--user=1 : The user ID that the export should run for.}
|
||||||
{--token= : The user\'s access token.}
|
{--token= : The user\'s access token.}
|
||||||
{--start= : First transaction to export. Defaults to your very first transaction. Only applies to transaction export.}
|
{--start= : First transaction to export. Defaults to your very first transaction. Only applies to transaction export.}
|
||||||
|
@ -42,7 +42,7 @@ class CreateFirstUser extends Command
|
|||||||
|
|
||||||
protected $description = 'Creates a new user and gives admin rights. Outputs the password on the command line. Strictly for testing.';
|
protected $description = 'Creates a new user and gives admin rights. Outputs the password on the command line. Strictly for testing.';
|
||||||
|
|
||||||
protected $signature = 'firefly-iii:create-first-user {email}';
|
protected $signature = 'firefly-iii:create-first-user {email}';
|
||||||
private UserRepositoryInterface $repository;
|
private UserRepositoryInterface $repository;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -53,8 +53,8 @@ class ForceDecimalSize extends Command
|
|||||||
{
|
{
|
||||||
use ShowsFriendlyMessages;
|
use ShowsFriendlyMessages;
|
||||||
|
|
||||||
protected $description = 'This command resizes DECIMAL columns in MySQL or PostgreSQL and correct amounts (only MySQL).';
|
protected $description = 'This command resizes DECIMAL columns in MySQL or PostgreSQL and correct amounts (only MySQL).';
|
||||||
protected $signature = 'firefly-iii:force-decimal-size';
|
protected $signature = 'firefly-iii:force-decimal-size';
|
||||||
private string $cast;
|
private string $cast;
|
||||||
private array $classes
|
private array $classes
|
||||||
= [
|
= [
|
||||||
|
@ -50,7 +50,7 @@ class ApplyRules extends Command
|
|||||||
|
|
||||||
protected $description = 'This command will apply your rules and rule groups on a selection of your transactions.';
|
protected $description = 'This command will apply your rules and rule groups on a selection of your transactions.';
|
||||||
|
|
||||||
protected $signature
|
protected $signature
|
||||||
= 'firefly-iii:apply-rules
|
= 'firefly-iii:apply-rules
|
||||||
{--user=1 : The user ID.}
|
{--user=1 : The user ID.}
|
||||||
{--token= : The user\'s access token.}
|
{--token= : The user\'s access token.}
|
||||||
|
@ -46,8 +46,8 @@ class AccountCurrencies extends Command
|
|||||||
|
|
||||||
public const string CONFIG_NAME = '480_account_currencies';
|
public const string CONFIG_NAME = '480_account_currencies';
|
||||||
|
|
||||||
protected $description = 'Give all accounts proper currency info.';
|
protected $description = 'Give all accounts proper currency info.';
|
||||||
protected $signature = 'firefly-iii:account-currencies {--F|force : Force the execution of this command.}';
|
protected $signature = 'firefly-iii:account-currencies {--F|force : Force the execution of this command.}';
|
||||||
private AccountRepositoryInterface $accountRepos;
|
private AccountRepositoryInterface $accountRepos;
|
||||||
private int $count;
|
private int $count;
|
||||||
private UserRepositoryInterface $userRepos;
|
private UserRepositoryInterface $userRepos;
|
||||||
|
@ -51,8 +51,8 @@ class MigrateToGroups extends Command
|
|||||||
use ShowsFriendlyMessages;
|
use ShowsFriendlyMessages;
|
||||||
|
|
||||||
public const string CONFIG_NAME = '480_migrated_to_groups';
|
public const string CONFIG_NAME = '480_migrated_to_groups';
|
||||||
protected $description = 'Migrates a pre-4.7.8 transaction structure to the 4.7.8+ transaction structure.';
|
protected $description = 'Migrates a pre-4.7.8 transaction structure to the 4.7.8+ transaction structure.';
|
||||||
protected $signature = 'firefly-iii:migrate-to-groups {--F|force : Force the migration, even if it fired before.}';
|
protected $signature = 'firefly-iii:migrate-to-groups {--F|force : Force the migration, even if it fired before.}';
|
||||||
private JournalCLIRepositoryInterface $cliRepository;
|
private JournalCLIRepositoryInterface $cliRepository;
|
||||||
private int $count;
|
private int $count;
|
||||||
private TransactionGroupFactory $groupFactory;
|
private TransactionGroupFactory $groupFactory;
|
||||||
|
@ -48,7 +48,7 @@ class MigrateToRules extends Command
|
|||||||
|
|
||||||
protected $description = 'Migrate bills to rules.';
|
protected $description = 'Migrate bills to rules.';
|
||||||
|
|
||||||
protected $signature = 'firefly-iii:bills-to-rules {--F|force : Force the execution of this command.}';
|
protected $signature = 'firefly-iii:bills-to-rules {--F|force : Force the execution of this command.}';
|
||||||
private BillRepositoryInterface $billRepository;
|
private BillRepositoryInterface $billRepository;
|
||||||
private int $count;
|
private int $count;
|
||||||
private RuleGroupRepositoryInterface $ruleGroupRepository;
|
private RuleGroupRepositoryInterface $ruleGroupRepository;
|
||||||
|
@ -45,8 +45,8 @@ class OtherCurrenciesCorrections extends Command
|
|||||||
use ShowsFriendlyMessages;
|
use ShowsFriendlyMessages;
|
||||||
|
|
||||||
public const string CONFIG_NAME = '480_other_currencies';
|
public const string CONFIG_NAME = '480_other_currencies';
|
||||||
protected $description = 'Update all journal currency information.';
|
protected $description = 'Update all journal currency information.';
|
||||||
protected $signature = 'firefly-iii:other-currencies {--F|force : Force the execution of this command.}';
|
protected $signature = 'firefly-iii:other-currencies {--F|force : Force the execution of this command.}';
|
||||||
private array $accountCurrencies;
|
private array $accountCurrencies;
|
||||||
private AccountRepositoryInterface $accountRepos;
|
private AccountRepositoryInterface $accountRepos;
|
||||||
private JournalCLIRepositoryInterface $cliRepos;
|
private JournalCLIRepositoryInterface $cliRepos;
|
||||||
|
@ -42,8 +42,8 @@ class TransactionIdentifier extends Command
|
|||||||
use ShowsFriendlyMessages;
|
use ShowsFriendlyMessages;
|
||||||
|
|
||||||
public const string CONFIG_NAME = '480_transaction_identifier';
|
public const string CONFIG_NAME = '480_transaction_identifier';
|
||||||
protected $description = 'Fixes transaction identifiers.';
|
protected $description = 'Fixes transaction identifiers.';
|
||||||
protected $signature = 'firefly-iii:transaction-identifiers {--F|force : Force the execution of this command.}';
|
protected $signature = 'firefly-iii:transaction-identifiers {--F|force : Force the execution of this command.}';
|
||||||
private JournalCLIRepositoryInterface $cliRepository;
|
private JournalCLIRepositoryInterface $cliRepository;
|
||||||
private int $count;
|
private int $count;
|
||||||
|
|
||||||
|
@ -43,8 +43,8 @@ class TransferCurrenciesCorrections extends Command
|
|||||||
use ShowsFriendlyMessages;
|
use ShowsFriendlyMessages;
|
||||||
|
|
||||||
public const string CONFIG_NAME = '480_transfer_currencies';
|
public const string CONFIG_NAME = '480_transfer_currencies';
|
||||||
protected $description = 'Updates transfer currency information.';
|
protected $description = 'Updates transfer currency information.';
|
||||||
protected $signature = 'firefly-iii:transfer-currencies {--F|force : Force the execution of this command.}';
|
protected $signature = 'firefly-iii:transfer-currencies {--F|force : Force the execution of this command.}';
|
||||||
private array $accountCurrencies;
|
private array $accountCurrencies;
|
||||||
private AccountRepositoryInterface $accountRepos;
|
private AccountRepositoryInterface $accountRepos;
|
||||||
private JournalCLIRepositoryInterface $cliRepos;
|
private JournalCLIRepositoryInterface $cliRepos;
|
||||||
|
@ -232,11 +232,11 @@ class Handler extends ExceptionHandler
|
|||||||
private function shouldntReportLocal(Throwable $e): bool
|
private function shouldntReportLocal(Throwable $e): bool
|
||||||
{
|
{
|
||||||
return null !== Arr::first(
|
return null !== Arr::first(
|
||||||
$this->dontReport,
|
$this->dontReport,
|
||||||
static function ($type) use ($e) {
|
static function ($type) use ($e) {
|
||||||
return $e instanceof $type;
|
return $e instanceof $type;
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -190,8 +190,8 @@ class BudgetLimitHandler
|
|||||||
);
|
);
|
||||||
// overlap in days:
|
// overlap in days:
|
||||||
$limitPeriod = Period::make(
|
$limitPeriod = Period::make(
|
||||||
$budgetLimit->start_date,
|
$budgetLimit->start_date,
|
||||||
$budgetLimit->end_date,
|
$budgetLimit->end_date,
|
||||||
precision : Precision::DAY(),
|
precision : Precision::DAY(),
|
||||||
boundaries: Boundaries::EXCLUDE_NONE()
|
boundaries: Boundaries::EXCLUDE_NONE()
|
||||||
);
|
);
|
||||||
@ -236,8 +236,8 @@ class BudgetLimitHandler
|
|||||||
return '0';
|
return '0';
|
||||||
}
|
}
|
||||||
$limitPeriod = Period::make(
|
$limitPeriod = Period::make(
|
||||||
$budgetLimit->start_date,
|
$budgetLimit->start_date,
|
||||||
$budgetLimit->end_date,
|
$budgetLimit->end_date,
|
||||||
precision : Precision::DAY(),
|
precision : Precision::DAY(),
|
||||||
boundaries: Boundaries::EXCLUDE_NONE()
|
boundaries: Boundaries::EXCLUDE_NONE()
|
||||||
);
|
);
|
||||||
|
@ -56,9 +56,9 @@ trait AttachmentCollection
|
|||||||
/** @var array $attachment */
|
/** @var array $attachment */
|
||||||
foreach ($transaction['attachments'] as $attachment) {
|
foreach ($transaction['attachments'] as $attachment) {
|
||||||
$result = str_contains(strtolower($attachment['filename']), strtolower($name)) || str_contains(
|
$result = str_contains(strtolower($attachment['filename']), strtolower($name)) || str_contains(
|
||||||
strtolower($attachment['title']),
|
strtolower($attachment['title']),
|
||||||
strtolower($name)
|
strtolower($name)
|
||||||
);
|
);
|
||||||
if (true === $result) {
|
if (true === $result) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -142,9 +142,9 @@ trait AttachmentCollection
|
|||||||
/** @var array $attachment */
|
/** @var array $attachment */
|
||||||
foreach ($transaction['attachments'] as $attachment) {
|
foreach ($transaction['attachments'] as $attachment) {
|
||||||
$result = !str_contains(strtolower($attachment['filename']), strtolower($name)) && !str_contains(
|
$result = !str_contains(strtolower($attachment['filename']), strtolower($name)) && !str_contains(
|
||||||
strtolower($attachment['title']),
|
strtolower($attachment['title']),
|
||||||
strtolower($name)
|
strtolower($name)
|
||||||
);
|
);
|
||||||
if (true === $result) {
|
if (true === $result) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -179,9 +179,9 @@ trait AttachmentCollection
|
|||||||
/** @var array $attachment */
|
/** @var array $attachment */
|
||||||
foreach ($transaction['attachments'] as $attachment) {
|
foreach ($transaction['attachments'] as $attachment) {
|
||||||
$result = !str_ends_with(strtolower($attachment['filename']), strtolower($name)) && !str_ends_with(
|
$result = !str_ends_with(strtolower($attachment['filename']), strtolower($name)) && !str_ends_with(
|
||||||
strtolower($attachment['title']),
|
strtolower($attachment['title']),
|
||||||
strtolower($name)
|
strtolower($name)
|
||||||
);
|
);
|
||||||
if (true === $result) {
|
if (true === $result) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -216,9 +216,9 @@ trait AttachmentCollection
|
|||||||
/** @var array $attachment */
|
/** @var array $attachment */
|
||||||
foreach ($transaction['attachments'] as $attachment) {
|
foreach ($transaction['attachments'] as $attachment) {
|
||||||
$result = !str_starts_with(strtolower($attachment['filename']), strtolower($name)) && !str_starts_with(
|
$result = !str_starts_with(strtolower($attachment['filename']), strtolower($name)) && !str_starts_with(
|
||||||
strtolower($attachment['title']),
|
strtolower($attachment['title']),
|
||||||
strtolower($name)
|
strtolower($name)
|
||||||
);
|
);
|
||||||
if (true === $result) {
|
if (true === $result) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -246,9 +246,9 @@ trait AttachmentCollection
|
|||||||
/** @var array $attachment */
|
/** @var array $attachment */
|
||||||
foreach ($transaction['attachments'] as $attachment) {
|
foreach ($transaction['attachments'] as $attachment) {
|
||||||
$result = str_ends_with(strtolower($attachment['filename']), strtolower($name)) || str_ends_with(
|
$result = str_ends_with(strtolower($attachment['filename']), strtolower($name)) || str_ends_with(
|
||||||
strtolower($attachment['title']),
|
strtolower($attachment['title']),
|
||||||
strtolower($name)
|
strtolower($name)
|
||||||
);
|
);
|
||||||
if (true === $result) {
|
if (true === $result) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -330,9 +330,9 @@ trait AttachmentCollection
|
|||||||
/** @var array $attachment */
|
/** @var array $attachment */
|
||||||
foreach ($transaction['attachments'] as $attachment) {
|
foreach ($transaction['attachments'] as $attachment) {
|
||||||
$result = str_starts_with(strtolower($attachment['filename']), strtolower($name)) || str_starts_with(
|
$result = str_starts_with(strtolower($attachment['filename']), strtolower($name)) || str_starts_with(
|
||||||
strtolower($attachment['title']),
|
strtolower($attachment['title']),
|
||||||
strtolower($name)
|
strtolower($name)
|
||||||
);
|
);
|
||||||
if (true === $result) {
|
if (true === $result) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -135,7 +135,7 @@ class IndexController extends Controller
|
|||||||
|
|
||||||
// get budgeted for default currency:
|
// get budgeted for default currency:
|
||||||
if (0 === count($availableBudgets)) {
|
if (0 === count($availableBudgets)) {
|
||||||
$budgeted = $this->blRepository->budgeted($start, $end, $defaultCurrency,);
|
$budgeted = $this->blRepository->budgeted($start, $end, $defaultCurrency, );
|
||||||
$spentArr = $this->opsRepository->sumExpenses($start, $end, null, null, $defaultCurrency);
|
$spentArr = $this->opsRepository->sumExpenses($start, $end, null, null, $defaultCurrency);
|
||||||
$spent = $spentArr[$defaultCurrency->id]['sum'] ?? '0';
|
$spent = $spentArr[$defaultCurrency->id]['sum'] ?? '0';
|
||||||
unset($spentArr);
|
unset($spentArr);
|
||||||
@ -194,7 +194,7 @@ class IndexController extends Controller
|
|||||||
$array['spent'] = $spentArr[$entry->transaction_currency_id]['sum'] ?? '0';
|
$array['spent'] = $spentArr[$entry->transaction_currency_id]['sum'] ?? '0';
|
||||||
|
|
||||||
// budgeted in period:
|
// budgeted in period:
|
||||||
$budgeted = $this->blRepository->budgeted($entry->start_date, $entry->end_date, $entry->transactionCurrency,);
|
$budgeted = $this->blRepository->budgeted($entry->start_date, $entry->end_date, $entry->transactionCurrency, );
|
||||||
$array['budgeted'] = $budgeted;
|
$array['budgeted'] = $budgeted;
|
||||||
$availableBudgets[] = $array;
|
$availableBudgets[] = $array;
|
||||||
unset($spentArr);
|
unset($spentArr);
|
||||||
|
@ -86,12 +86,12 @@ class BoxController extends Controller
|
|||||||
static function (AvailableBudget $availableBudget) use ($currency) { // @phpstan-ignore-line
|
static function (AvailableBudget $availableBudget) use ($currency) { // @phpstan-ignore-line
|
||||||
if ($availableBudget->transaction_currency_id === $currency->id) {
|
if ($availableBudget->transaction_currency_id === $currency->id) {
|
||||||
app('log')->debug(sprintf(
|
app('log')->debug(sprintf(
|
||||||
'Will include AB #%d: from %s-%s amount %s',
|
'Will include AB #%d: from %s-%s amount %s',
|
||||||
$availableBudget->id,
|
$availableBudget->id,
|
||||||
$availableBudget->start_date->format('Y-m-d'),
|
$availableBudget->start_date->format('Y-m-d'),
|
||||||
$availableBudget->end_date->format('Y-m-d'),
|
$availableBudget->end_date->format('Y-m-d'),
|
||||||
$availableBudget->amount
|
$availableBudget->amount
|
||||||
));
|
));
|
||||||
return $availableBudget;
|
return $availableBudget;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -161,9 +161,9 @@ class ShowController extends Controller
|
|||||||
$amounts[$symbol]['amount'] = bcadd($amounts[$symbol]['amount'], $transaction['amount']);
|
$amounts[$symbol]['amount'] = bcadd($amounts[$symbol]['amount'], $transaction['amount']);
|
||||||
if (null !== $transaction['foreign_amount'] && '' !== $transaction['foreign_amount']
|
if (null !== $transaction['foreign_amount'] && '' !== $transaction['foreign_amount']
|
||||||
&& bccomp(
|
&& bccomp(
|
||||||
'0',
|
'0',
|
||||||
$transaction['foreign_amount']
|
$transaction['foreign_amount']
|
||||||
) !== 0) {
|
) !== 0) {
|
||||||
// same for foreign currency:
|
// same for foreign currency:
|
||||||
$foreignSymbol = $transaction['foreign_currency_symbol'];
|
$foreignSymbol = $transaction['foreign_currency_symbol'];
|
||||||
if (!array_key_exists($foreignSymbol, $amounts)) {
|
if (!array_key_exists($foreignSymbol, $amounts)) {
|
||||||
|
@ -127,7 +127,7 @@ class Account extends Model
|
|||||||
|
|
||||||
protected $fillable = ['user_id', 'user_group_id', 'account_type_id', 'name', 'active', 'virtual_balance', 'iban'];
|
protected $fillable = ['user_id', 'user_group_id', 'account_type_id', 'name', 'active', 'virtual_balance', 'iban'];
|
||||||
|
|
||||||
protected $hidden = ['encrypted'];
|
protected $hidden = ['encrypted'];
|
||||||
private bool $joinedAccountTypes = false;
|
private bool $joinedAccountTypes = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -84,7 +84,7 @@ class TransactionCurrency extends Model
|
|||||||
|
|
||||||
public ?bool $userDefault;
|
public ?bool $userDefault;
|
||||||
public ?bool $userEnabled;
|
public ?bool $userEnabled;
|
||||||
protected $casts
|
protected $casts
|
||||||
= [
|
= [
|
||||||
'created_at' => 'datetime',
|
'created_at' => 'datetime',
|
||||||
'updated_at' => 'datetime',
|
'updated_at' => 'datetime',
|
||||||
|
@ -373,12 +373,12 @@ class BillRepository implements BillRepositoryInterface
|
|||||||
|
|
||||||
return $bill->transactionJournals()
|
return $bill->transactionJournals()
|
||||||
->before($end)->after($start)->get(
|
->before($end)->after($start)->get(
|
||||||
[
|
[
|
||||||
'transaction_journals.id',
|
'transaction_journals.id',
|
||||||
'transaction_journals.date',
|
'transaction_journals.date',
|
||||||
'transaction_journals.transaction_group_id',
|
'transaction_journals.transaction_group_id',
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -60,7 +60,7 @@ class BudgetLimitRepository implements BudgetLimitRepositoryInterface
|
|||||||
|
|
||||||
// same complex where query as below.
|
// same complex where query as below.
|
||||||
->where(
|
->where(
|
||||||
static function (Builder $q5) use ($start, $end) {
|
static function (Builder $q5) use ($start, $end) {
|
||||||
$q5->where(
|
$q5->where(
|
||||||
static function (Builder $q1) use ($start, $end) {
|
static function (Builder $q1) use ($start, $end) {
|
||||||
$q1->where(
|
$q1->where(
|
||||||
@ -85,7 +85,7 @@ class BudgetLimitRepository implements BudgetLimitRepositoryInterface
|
|||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
->where('budget_limits.transaction_currency_id', $currency->id)
|
->where('budget_limits.transaction_currency_id', $currency->id)
|
||||||
->whereNull('budgets.deleted_at')
|
->whereNull('budgets.deleted_at')
|
||||||
->where('budgets.active', true)
|
->where('budgets.active', true)
|
||||||
@ -252,11 +252,11 @@ class BudgetLimitRepository implements BudgetLimitRepositoryInterface
|
|||||||
)
|
)
|
||||||
// budget limit start within period
|
// budget limit start within period
|
||||||
->orWhere(
|
->orWhere(
|
||||||
static function (Builder $q3) use ($start, $end) {
|
static function (Builder $q3) use ($start, $end) {
|
||||||
$q3->where('budget_limits.start_date', '>=', $start->format('Y-m-d 00:00:00'));
|
$q3->where('budget_limits.start_date', '>=', $start->format('Y-m-d 00:00:00'));
|
||||||
$q3->where('budget_limits.start_date', '<=', $end->format('Y-m-d 23:59:59'));
|
$q3->where('budget_limits.start_date', '<=', $end->format('Y-m-d 23:59:59'));
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
->orWhere(
|
->orWhere(
|
||||||
|
@ -497,9 +497,9 @@ class JournalUpdateService
|
|||||||
{
|
{
|
||||||
$type = $this->transactionJournal->transactionType->type;
|
$type = $this->transactionJournal->transactionType->type;
|
||||||
if ((
|
if ((
|
||||||
array_key_exists('bill_id', $this->data)
|
array_key_exists('bill_id', $this->data)
|
||||||
|| array_key_exists('bill_name', $this->data)
|
|| array_key_exists('bill_name', $this->data)
|
||||||
)
|
)
|
||||||
&& TransactionType::WITHDRAWAL === $type
|
&& TransactionType::WITHDRAWAL === $type
|
||||||
) {
|
) {
|
||||||
$billId = (int)($this->data['bill_id'] ?? 0);
|
$billId = (int)($this->data['bill_id'] ?? 0);
|
||||||
|
@ -89,10 +89,10 @@ class Navigation
|
|||||||
|
|
||||||
if (!array_key_exists($repeatFreq, $functionMap)) {
|
if (!array_key_exists($repeatFreq, $functionMap)) {
|
||||||
Log::error(sprintf(
|
Log::error(sprintf(
|
||||||
'The periodicity %s is unknown. Choose one of available periodicity: %s',
|
'The periodicity %s is unknown. Choose one of available periodicity: %s',
|
||||||
$repeatFreq,
|
$repeatFreq,
|
||||||
implode(', ', array_keys($functionMap))
|
implode(', ', array_keys($functionMap))
|
||||||
));
|
));
|
||||||
return $theDate;
|
return $theDate;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -352,12 +352,12 @@ class Navigation
|
|||||||
public function diffInPeriods(string $period, int $skip, Carbon $beginning, Carbon $end): int
|
public function diffInPeriods(string $period, int $skip, Carbon $beginning, Carbon $end): int
|
||||||
{
|
{
|
||||||
Log::debug(sprintf(
|
Log::debug(sprintf(
|
||||||
'diffInPeriods: %s (skip: %d), between %s and %s.',
|
'diffInPeriods: %s (skip: %d), between %s and %s.',
|
||||||
$period,
|
$period,
|
||||||
$skip,
|
$skip,
|
||||||
$beginning->format('Y-m-d'),
|
$beginning->format('Y-m-d'),
|
||||||
$end->format('Y-m-d')
|
$end->format('Y-m-d')
|
||||||
));
|
));
|
||||||
$map = [
|
$map = [
|
||||||
'daily' => 'floatDiffInDays',
|
'daily' => 'floatDiffInDays',
|
||||||
'weekly' => 'floatDiffInWeeks',
|
'weekly' => 'floatDiffInWeeks',
|
||||||
@ -394,11 +394,11 @@ class Navigation
|
|||||||
$parameter = $skip + 1;
|
$parameter = $skip + 1;
|
||||||
$diff = ceil($diff / $parameter) * $parameter;
|
$diff = ceil($diff / $parameter) * $parameter;
|
||||||
Log::debug(sprintf(
|
Log::debug(sprintf(
|
||||||
'diffInPeriods: skip is %d, so param is %d, and diff becomes %d',
|
'diffInPeriods: skip is %d, so param is %d, and diff becomes %d',
|
||||||
$skip,
|
$skip,
|
||||||
$parameter,
|
$parameter,
|
||||||
$diff
|
$diff
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
return (int)$diff;
|
return (int)$diff;
|
||||||
|
@ -326,15 +326,15 @@ class Steam
|
|||||||
$balances[$format] = $currentBalance;
|
$balances[$format] = $currentBalance;
|
||||||
|
|
||||||
app('log')->debug(sprintf(
|
app('log')->debug(sprintf(
|
||||||
'%s: transaction in %s(!). Conversion rate is %s. %s %s = %s %s',
|
'%s: transaction in %s(!). Conversion rate is %s. %s %s = %s %s',
|
||||||
$format,
|
$format,
|
||||||
$currency->code,
|
$currency->code,
|
||||||
$rate,
|
$rate,
|
||||||
$currency->code,
|
$currency->code,
|
||||||
$transaction['amount'],
|
$transaction['amount'],
|
||||||
$native->code,
|
$native->code,
|
||||||
$convertedAmount
|
$convertedAmount
|
||||||
));
|
));
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
44
app/User.php
44
app/User.php
@ -416,37 +416,37 @@ class User extends Authenticatable
|
|||||||
->where('user_group_id', $userGroup->id)->get();
|
->where('user_group_id', $userGroup->id)->get();
|
||||||
if (0 === $groupMemberships->count()) {
|
if (0 === $groupMemberships->count()) {
|
||||||
app('log')->error(sprintf(
|
app('log')->error(sprintf(
|
||||||
'User #%d "%s" does not have roles %s in user group #%d "%s"',
|
'User #%d "%s" does not have roles %s in user group #%d "%s"',
|
||||||
$this->id,
|
$this->id,
|
||||||
$this->email,
|
$this->email,
|
||||||
implode(', ', $roles),
|
implode(', ', $roles),
|
||||||
$userGroup->id,
|
$userGroup->id,
|
||||||
$userGroup->title
|
$userGroup->title
|
||||||
));
|
));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
foreach ($groupMemberships as $membership) {
|
foreach ($groupMemberships as $membership) {
|
||||||
app('log')->debug(sprintf(
|
app('log')->debug(sprintf(
|
||||||
'User #%d "%s" has role "%s" in user group #%d "%s"',
|
'User #%d "%s" has role "%s" in user group #%d "%s"',
|
||||||
$this->id,
|
$this->id,
|
||||||
$this->email,
|
$this->email,
|
||||||
$membership->userRole->title,
|
$membership->userRole->title,
|
||||||
$userGroup->id,
|
$userGroup->id,
|
||||||
$userGroup->title
|
$userGroup->title
|
||||||
));
|
));
|
||||||
if (in_array($membership->userRole->title, $dbRolesTitles, true)) {
|
if (in_array($membership->userRole->title, $dbRolesTitles, true)) {
|
||||||
app('log')->debug(sprintf('Return true, found role "%s"', $membership->userRole->title));
|
app('log')->debug(sprintf('Return true, found role "%s"', $membership->userRole->title));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
app('log')->error(sprintf(
|
app('log')->error(sprintf(
|
||||||
'User #%d "%s" does not have roles %s in user group #%d "%s"',
|
'User #%d "%s" does not have roles %s in user group #%d "%s"',
|
||||||
$this->id,
|
$this->id,
|
||||||
$this->email,
|
$this->email,
|
||||||
implode(', ', $roles),
|
implode(', ', $roles),
|
||||||
$userGroup->id,
|
$userGroup->id,
|
||||||
$userGroup->title
|
$userGroup->title
|
||||||
));
|
));
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -696,7 +696,7 @@ class User extends Authenticatable
|
|||||||
*/
|
*/
|
||||||
public function userGroup(): BelongsTo
|
public function userGroup(): BelongsTo
|
||||||
{
|
{
|
||||||
return $this->belongsTo(UserGroup::class,);
|
return $this->belongsTo(UserGroup::class, );
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user