Merge branch 'release/5.4.5' into main

This commit is contained in:
James Cole
2020-10-28 20:26:28 +01:00
165 changed files with 1006 additions and 973 deletions

View File

@@ -58,7 +58,6 @@ class BillController extends Controller
}
/**
* TODO add limit
* @param AutocompleteRequest $request
*
* @return JsonResponse

View File

@@ -58,7 +58,6 @@ class BudgetController extends Controller
}
/**
* TODO add limit
* @param AutocompleteRequest $request
*
* @return JsonResponse

View File

@@ -24,7 +24,8 @@ declare(strict_types=1);
namespace FireflyIII\Api\V1\Controllers;
use FireflyIII\Api\V1\Requests\BillRequest;
use FireflyIII\Api\V1\Requests\BillUpdateRequest;
use FireflyIII\Api\V1\Requests\BillStoreRequest;
use FireflyIII\Exceptions\FireflyException;
use FireflyIII\Helpers\Collector\GroupCollectorInterface;
use FireflyIII\Models\Bill;
@@ -49,8 +50,7 @@ class BillController extends Controller
{
use TransactionFilter;
/** @var BillRepositoryInterface The bill repository */
private $repository;
private BillRepositoryInterface $repository;
/**
@@ -205,12 +205,12 @@ class BillController extends Controller
/**
* Store a bill.
*
* @param BillRequest $request
* @param BillStoreRequest $request
*
* @return JsonResponse
* @throws FireflyException
*/
public function store(BillRequest $request): JsonResponse
public function store(BillStoreRequest $request): JsonResponse
{
$bill = $this->repository->store($request->getAll());
$manager = $this->getManager();
@@ -285,12 +285,12 @@ class BillController extends Controller
/**
* Update a bill.
*
* @param BillRequest $request
* @param BillUpdateRequest $request
* @param Bill $bill
*
* @return JsonResponse
*/
public function update(BillRequest $request, Bill $bill): JsonResponse
public function update(BillUpdateRequest $request, Bill $bill): JsonResponse
{
$data = $request->getAll();
$bill = $this->repository->update($bill, $data);

View File

@@ -38,15 +38,10 @@ use Illuminate\Http\JsonResponse;
*/
class CategoryController extends Controller
{
/** @var CategoryRepositoryInterface */
private $categoryRepository;
/** @var NoCategoryRepositoryInterface */
private $noCatRepository;
/** @var OperationsRepositoryInterface */
private $opsRepository;
private CategoryRepositoryInterface $categoryRepository;
private NoCategoryRepositoryInterface $noCatRepository;
private OperationsRepositoryInterface $opsRepository;
private array $categories;
/**
* AccountController constructor.
@@ -63,6 +58,7 @@ class CategoryController extends Controller
$this->categoryRepository = app(CategoryRepositoryInterface::class);
$this->opsRepository = app(OperationsRepositoryInterface::class);
$this->noCatRepository = app(NoCategoryRepositoryInterface::class);
$this->categories = [];
$this->categoryRepository->setUser($user);
$this->opsRepository->setUser($user);
$this->noCatRepository->setUser($user);
@@ -87,53 +83,75 @@ class CategoryController extends Controller
/** @var Carbon $end */
$end = $dates['end'];
$tempData = [];
$spentWith = $this->opsRepository->listExpenses($start, $end);
$spentWithout = $this->noCatRepository->listExpenses($start, $end);
$categories = [];
/** @var array $set */
foreach ([$spentWith, $spentWithout,] as $set) {
foreach ($set as $currency) {
foreach ($currency['categories'] as $category) {
$categories[] = $category['name'];
$outKey = sprintf('%d-e', $currency['currency_id']);
$tempData[$outKey] = $tempData[$outKey] ?? [
'currency_id' => $currency['currency_id'],
'label' => (string) trans('firefly.box_spent_in_currency', ['currency' => $currency['currency_name']]),
'currency_code' => $currency['currency_code'],
'currency_symbol' => $currency['currency_symbol'],
'currency_decimal_places' => $currency['currency_decimal_places'],
'type' => 'bar', // line, area or bar
'yAxisID' => 0, // 0, 1, 2
'entries' => [],
];
$tempData = $this->processArray($tempData, $set);
}
foreach ($category['transaction_journals'] as $journal) {
// is it expense or income?
$currentKey = sprintf('%d-%s', $currency['currency_id'], 'e');
$name = $category['name'];
$tempData[$currentKey]['entries'][$name] = $tempData[$currentKey]['entries'][$name] ?? '0';
$tempData[$currentKey]['entries'][$name] = bcadd($tempData[$currentKey]['entries'][$name], $journal['amount']);
}
$chartData = $this->sortArray($tempData);
return response()->json($chartData);
}
/**
* @param array $tempData
* @param array $set
*
* @return array
*/
private function processArray(array $tempData, array $set): array
{
foreach ($set as $currency) {
foreach ($currency['categories'] as $category) {
$this->categories[] = $category['name'];
$outKey = sprintf('%d-e', $currency['currency_id']);
$tempData[$outKey] = $tempData[$outKey] ?? [
'currency_id' => $currency['currency_id'],
'label' => (string)trans('firefly.box_spent_in_currency', ['currency' => $currency['currency_name']]),
'currency_code' => $currency['currency_code'],
'currency_symbol' => $currency['currency_symbol'],
'currency_decimal_places' => $currency['currency_decimal_places'],
'type' => 'bar', // line, area or bar
'yAxisID' => 0, // 0, 1, 2
'entries' => [],
];
foreach ($category['transaction_journals'] as $journal) {
// is it expense or income?
$currentKey = sprintf('%d-%s', $currency['currency_id'], 'e');
$name = $category['name'];
$tempData[$currentKey]['entries'][$name] = $tempData[$currentKey]['entries'][$name] ?? '0';
$tempData[$currentKey]['entries'][$name] = bcadd($tempData[$currentKey]['entries'][$name], $journal['amount']);
}
}
}
return $tempData;
}
/**
* @param array $tempData
*
* @return array
*/
private function sortArray(array $tempData): array
{
// re-sort every spent array and add 0 for missing entries.
foreach ($tempData as $index => $set) {
$oldSet = $set['entries'];
$newSet = [];
foreach ($categories as $category) {
foreach ($this->categories as $category) {
$value = $oldSet[$category] ?? '0';
$value = -1 === bccomp($value, '0') ? bcmul($value, '-1') : $value;
$newSet[$category] = $value;
}
$tempData[$index]['entries'] = $newSet;
}
$chartData = array_values($tempData);
return response()->json($chartData);
return array_values($tempData);
}
}

View File

@@ -1,7 +1,7 @@
<?php
/**
* BillRequest.php
* BillStoreRequest.php
* Copyright (c) 2019 james@firefly-iii.org
*
* This file is part of Firefly III (https://github.com/firefly-iii).
@@ -25,31 +25,19 @@ declare(strict_types=1);
namespace FireflyIII\Api\V1\Requests;
use FireflyIII\Rules\IsBoolean;
use FireflyIII\Support\Request\ChecksLogin;
use FireflyIII\Support\Request\ConvertsDataTypes;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Validation\Validator;
/**
* Class BillRequest
*
* TODO AFTER 4.8,0: split this into two request classes.
* Class BillStoreRequest
*
* @codeCoverageIgnore
*/
class BillRequest extends FormRequest
class BillStoreRequest extends FormRequest
{
use ConvertsDataTypes;
/**
* Authorize logged in users.
*
* @return bool
*/
public function authorize(): bool
{
// Only allow authenticated users
return auth()->check();
}
use ConvertsDataTypes, ChecksLogin;
/**
* Get all data from the request.
@@ -85,7 +73,7 @@ class BillRequest extends FormRequest
*/
public function rules(): array
{
$rules = [
return [
'name' => 'between:1,255|uniqueObjectForUser:bills,name',
'amount_min' => 'numeric|gt:0',
'amount_max' => 'numeric|gt:0',
@@ -97,17 +85,6 @@ class BillRequest extends FormRequest
'active' => [new IsBoolean],
'notes' => 'between:1,65536',
];
switch ($this->method()) {
default:
break;
case 'PUT':
case 'PATCH':
$bill = $this->route()->parameter('bill');
$rules['name'] .= ',' . $bill->id;
break;
}
return $rules;
}
/**

View File

@@ -0,0 +1,111 @@
<?php
/**
* BillUpdateRequest.php
* Copyright (c) 2019 james@firefly-iii.org
*
* This file is part of Firefly III (https://github.com/firefly-iii).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
declare(strict_types=1);
namespace FireflyIII\Api\V1\Requests;
use FireflyIII\Rules\IsBoolean;
use FireflyIII\Support\Request\ChecksLogin;
use FireflyIII\Support\Request\ConvertsDataTypes;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Validation\Validator;
/**
* Class BillUpdateRequest
*
* @codeCoverageIgnore
*/
class BillUpdateRequest extends FormRequest
{
use ConvertsDataTypes, ChecksLogin;
/**
* Get all data from the request.
*
* @return array
*/
public function getAll(): array
{
$active = true;
if (null !== $this->get('active')) {
$active = $this->boolean('active');
}
return [
'name' => $this->string('name'),
'amount_min' => $this->string('amount_min'),
'amount_max' => $this->string('amount_max'),
'currency_id' => $this->integer('currency_id'),
'currency_code' => $this->string('currency_code'),
'date' => $this->date('date'),
'repeat_freq' => $this->string('repeat_freq'),
'skip' => $this->integer('skip'),
'active' => $active,
'order' => $this->integer('order'),
'notes' => $this->nlString('notes'),
];
}
/**
* The rules that the incoming request must be matched against.
*
* @return array
*/
public function rules(): array
{
$bill = $this->route()->parameter('bill');
return [
'name' => sprintf('between:1,255|uniqueObjectForUser:bills,name,%d', $bill->id),
'amount_min' => 'numeric|gt:0',
'amount_max' => 'numeric|gt:0',
'currency_id' => 'numeric|exists:transaction_currencies,id',
'currency_code' => 'min:3|max:3|exists:transaction_currencies,code',
'date' => 'date',
'repeat_freq' => 'in:weekly,monthly,quarterly,half-year,yearly',
'skip' => 'between:0,31',
'active' => [new IsBoolean],
'notes' => 'between:1,65536',
];
}
/**
* Configure the validator instance.
*
* @param Validator $validator
*
* @return void
*/
public function withValidator(Validator $validator): void
{
$validator->after(
static function (Validator $validator) {
$data = $validator->getData();
$min = (float) ($data['amount_min'] ?? 0);
$max = (float) ($data['amount_max'] ?? 0);
if ($min > $max) {
$validator->errors()->add('amount_min', (string) trans('validation.amount_min_over_max'));
}
}
);
}
}

View File

@@ -82,10 +82,9 @@ class TransactionStoreRequest extends FormRequest
{
$return = [];
/**
* @var int $index
* @var array $transaction
*/
foreach ($this->get('transactions') as $index => $transaction) {
foreach ($this->get('transactions') as $transaction) {
$object = new NullArrayObject($transaction);
$return[] = [
'type' => $this->stringFromValue($object['type']),

View File

@@ -204,11 +204,11 @@ class DecryptDatabase extends Command
try {
$newValue = json_decode($value, true, 512, JSON_THROW_ON_ERROR) ?? $value;
} catch (JsonException $e) {
$message = sprintf('Could not JSON decode preference row #%d: %s', $id, $e->getMessage());
$message = sprintf('Could not JSON decode preference row #%d: %s. This does not have to be a problem.', $id, $e->getMessage());
$this->error($message);
Log::error($message);
Log::error($value);
Log::error($e->getTraceAsString());
Log::warning($message);
Log::warning($value);
Log::warning($e->getTraceAsString());
return;
}

View File

@@ -51,13 +51,13 @@ class CategoryFactory
* @param int|null $categoryId
* @param null|string $categoryName
*
* @throws FireflyException
* @return Category|null
* @throws FireflyException
*/
public function findOrCreate(?int $categoryId, ?string $categoryName): ?Category
{
$categoryId = (int) $categoryId;
$categoryName = (string) $categoryName;
$categoryId = (int)$categoryId;
$categoryName = (string)$categoryName;
Log::debug(sprintf('Going to find category with ID %d and name "%s"', $categoryId, $categoryName));

View File

@@ -63,7 +63,6 @@ class TransactionJournalFactory
private array $fields;
private PiggyBankEventFactory $piggyEventFactory;
private PiggyBankRepositoryInterface $piggyRepository;
private TransactionFactory $transactionFactory;
private TransactionTypeRepositoryInterface $typeRepository;
private User $user;

View File

@@ -155,7 +155,7 @@ class MonthReportGenerator implements ReportGeneratorInterface
return [
'journals' => $journals,
'currency' => $currency,
'exists' => count($journals) > 0,
'exists' => !empty($journals),
'end' => $this->end->formatLocalized((string) trans('config.month_and_day', [], $locale)),
'endBalance' => app('steam')->balance($account, $this->end),
'dayBefore' => $date->formatLocalized((string) trans('config.month_and_day', [], $locale)),

View File

@@ -224,7 +224,7 @@ class AttachmentHelper implements AttachmentHelperInterface
}
Log::debug('Done processing uploads.');
}
if (!is_array($files) || (is_array($files) && 0 === count($files))) {
if (!is_array($files) || empty($files)) {
Log::debug('Array of files is not an array. Probably nothing uploaded. Will not store attachments.');
}

View File

@@ -267,7 +267,7 @@ class GroupCollector implements GroupCollectorInterface
*/
public function setJournalIds(array $journalIds): GroupCollectorInterface
{
if (count($journalIds) > 0) {
if (!empty($journalIds)) {
$this->query->whereIn('transaction_journals.id', $journalIds);
}

View File

@@ -116,7 +116,7 @@ class LoginController extends Controller
$this->incrementLoginAttempts($request);
Log::channel('audit')->info(sprintf('Login failed. Attempt for user "%s" failed.', $request->get('email')));
return $this->sendFailedLoginResponse($request);
$this->sendFailedLoginResponse($request);
}
/**

View File

@@ -264,10 +264,9 @@ class IndexController extends Controller
return [];
}
/**
* @var int $objectGroupId
* @var array $array
*/
foreach ($sums as $objectGroupId => $array) {
foreach ($sums as $array) {
/**
* @var int $currencyId
* @var array $entry

View File

@@ -50,16 +50,11 @@ class BudgetController extends Controller
{
use DateCalculation, AugumentData;
/** @var GeneratorInterface Chart generation methods. */
protected $generator;
/** @var OperationsRepositoryInterface */
protected $opsRepository;
/** @var BudgetRepositoryInterface The budget repository */
protected $repository;
/** @var BudgetLimitRepositoryInterface */
private $blRepository;
/** @var NoBudgetRepositoryInterface */
private $nbRepository;
protected GeneratorInterface $generator;
protected OperationsRepositoryInterface $opsRepository;
protected BudgetRepositoryInterface $repository;
private BudgetLimitRepositoryInterface $blRepository;
private NoBudgetRepositoryInterface $nbRepository;
/**
* BudgetController constructor.
@@ -185,12 +180,12 @@ class BudgetController extends Controller
while ($start <= $end) {
$spent = $this->opsRepository->spentInPeriod($budgetCollection, new Collection, $start, $start);
$amount = bcadd($amount, $spent);
$format = $start->formatLocalized((string) trans('config.month_and_day', [], $locale));
$format = $start->formatLocalized((string)trans('config.month_and_day', [], $locale));
$entries[$format] = $amount;
$start->addDay();
}
$data = $this->generator->singleSet((string) trans('firefly.left'), $entries);
$data = $this->generator->singleSet((string)trans('firefly.left'), $entries);
// add currency symbol from budget limit:
$data['datasets'][0]['currency_symbol'] = $budgetLimit->transactionCurrency->symbol;
$data['datasets'][0]['currency_code'] = $budgetLimit->transactionCurrency->code;
@@ -239,7 +234,7 @@ class BudgetController extends Controller
// group by asset account ID:
foreach ($journals as $journal) {
$key = sprintf('%d-%d', (int) $journal['source_account_id'], $journal['currency_id']);
$key = sprintf('%d-%d', (int)$journal['source_account_id'], $journal['currency_id']);
$result[$key] = $result[$key] ?? [
'amount' => '0',
'currency_symbol' => $journal['currency_symbol'],
@@ -252,7 +247,7 @@ class BudgetController extends Controller
$names = $this->getAccountNames(array_keys($result));
foreach ($result as $combinedId => $info) {
$parts = explode('-', $combinedId);
$assetId = (int) $parts[0];
$assetId = (int)$parts[0];
$title = sprintf('%s (%s)', $names[$assetId] ?? '(empty)', $info['currency_name']);
$chartData[$title]
= [
@@ -319,7 +314,7 @@ class BudgetController extends Controller
$names = $this->getCategoryNames(array_keys($result));
foreach ($result as $combinedId => $info) {
$parts = explode('-', $combinedId);
$categoryId = (int) $parts[0];
$categoryId = (int)$parts[0];
$title = sprintf('%s (%s)', $names[$categoryId] ?? '(empty)', $info['currency_name']);
$chartData[$title] = [
'amount' => $info['amount'],
@@ -385,7 +380,7 @@ class BudgetController extends Controller
$names = $this->getAccountNames(array_keys($result));
foreach ($result as $combinedId => $info) {
$parts = explode('-', $combinedId);
$opposingId = (int) $parts[0];
$opposingId = (int)$parts[0];
$name = $names[$opposingId] ?? 'no name';
$title = sprintf('%s (%s)', $name, $info['currency_name']);
$chartData[$title] = [
@@ -422,12 +417,12 @@ class BudgetController extends Controller
return response()->json($cache->get()); // @codeCoverageIgnore
}
$generator = app(FrontpageChartGenerator::class);
$generator->setUser(auth()->user());
$generator->setStart($start);
$generator->setEnd($end);
$chartGenerator = app(FrontpageChartGenerator::class);
$chartGenerator->setUser(auth()->user());
$chartGenerator->setStart($start);
$chartGenerator->setEnd($end);
$chartData = $generator->generate();
$chartData = $chartGenerator->generate();
$data = $this->generator->multiSet($chartData);
$cache->store($data);
@@ -463,14 +458,14 @@ class BudgetController extends Controller
$preferredRange = app('navigation')->preferredRangeFormat($start, $end);
$chartData = [
[
'label' => (string) trans('firefly.box_spent_in_currency', ['currency' => $currency->name]),
'label' => (string)trans('firefly.box_spent_in_currency', ['currency' => $currency->name]),
'type' => 'bar',
'entries' => [],
'currency_symbol' => $currency->symbol,
'currency_code' => $currency->code,
],
[
'label' => (string) trans('firefly.box_budgeted_in_currency', ['currency' => $currency->name]),
'label' => (string)trans('firefly.box_budgeted_in_currency', ['currency' => $currency->name]),
'type' => 'bar',
'currency_symbol' => $currency->symbol,
'currency_code' => $currency->code,
@@ -549,7 +544,7 @@ class BudgetController extends Controller
$currentStart = app('navigation')->addPeriod($currentStart, $preferredRange, 0);
}
$data = $this->generator->singleSet((string) trans('firefly.spent'), $chartData);
$data = $this->generator->singleSet((string)trans('firefly.spent'), $chartData);
$cache->store($data);
return response()->json($data);

View File

@@ -187,7 +187,7 @@ class ExpenseReportController extends Controller
$newSet[$key] = $chartData[$key]; // @codeCoverageIgnore
}
}
if (0 === count($newSet)) {
if (empty($newSet)) {
$newSet = $chartData; // @codeCoverageIgnore
}
$data = $this->generator->multiSet($newSet);

View File

@@ -193,7 +193,7 @@ class BoxController extends Controller
$incomes[$currencyId] = app('amount')->formatAnything($currency, $incomes[$currencyId] ?? '0', false);
$expenses[$currencyId] = app('amount')->formatAnything($currency, $expenses[$currencyId] ?? '0', false);
}
if (0 === count($sums)) {
if (empty($sums)) {
$currency = app('amount')->getDefaultCurrency();
$sums[$currency->id] = app('amount')->formatAnything($currency, '0', false);
$incomes[$currency->id] = app('amount')->formatAnything($currency, '0', false);
@@ -257,7 +257,7 @@ class BoxController extends Controller
$return = [];
foreach ($netWorthSet as $index => $data) {
foreach ($netWorthSet as $data) {
/** @var TransactionCurrency $currency */
$currency = $data['currency'];
$return[$currency->id] = app('amount')->formatAnything($currency, $data['balance'], false);

View File

@@ -64,7 +64,7 @@ class FrontpageController extends Controller
}
}
$html = '';
if (count($info) > 0) {
if (!empty($info)) {
try {
$html = view('json.piggy-banks', compact('info'))->render();
// @codeCoverageIgnoreStart

View File

@@ -67,8 +67,6 @@ class EditController extends Controller
{
$subTitle = (string) trans('firefly.edit_object_group', ['title' => $objectGroup->title]);
$subTitleIcon = 'fa-pencil';
$targetDate = null;
$startDate = null;
if (true !== session('object-groups.edit.fromUpdate')) {
$this->rememberPreviousUri('object-groups.edit.uri');

View File

@@ -165,7 +165,6 @@ class BudgetController extends Controller
$spent = $this->opsRepository->listExpenses($start, $end, $accounts, $budgets);
$result = [];
foreach ($spent as $currency) {
$currencyId = $currency['currency_id'];
foreach ($currency['budgets'] as $budget) {
foreach ($budget['transaction_journals'] as $journal) {
$destinationId = $journal['destination_account_id'];
@@ -328,7 +327,6 @@ class BudgetController extends Controller
foreach ($expenses as $currency) {
foreach ($currency['budgets'] as $budget) {
$count = 0;
$total = '0';
foreach ($budget['transaction_journals'] as $journal) {
$count++;
$key = sprintf('%d-%d', $budget['id'], $currency['currency_id']);
@@ -377,7 +375,6 @@ class BudgetController extends Controller
$spent = $this->opsRepository->listExpenses($start, $end, $accounts, $budgets);
$result = [];
foreach ($spent as $currency) {
$currencyId = $currency['currency_id'];
foreach ($currency['budgets'] as $budget) {
foreach ($budget['transaction_journals'] as $journal) {
$result[] = [

View File

@@ -40,10 +40,7 @@ use Throwable;
*/
class TagController extends Controller
{
/** @var OperationsRepositoryInterface */
private $opsRepository;
private OperationsRepositoryInterface $opsRepository;
/**
* ExpenseReportController constructor.
@@ -282,7 +279,6 @@ class TagController extends Controller
$spent = $this->opsRepository->listExpenses($start, $end, $accounts, $tags);
$result = [];
foreach ($spent as $currency) {
$currencyId = $currency['currency_id'];
foreach ($currency['tags'] as $tag) {
foreach ($tag['transaction_journals'] as $journal) {
$destinationId = $journal['destination_account_id'];
@@ -335,7 +331,6 @@ class TagController extends Controller
$spent = $this->opsRepository->listIncome($start, $end, $accounts, $tags);
$result = [];
foreach ($spent as $currency) {
$currencyId = $currency['currency_id'];
foreach ($currency['tags'] as $tag) {
foreach ($tag['transaction_journals'] as $journal) {
$sourceId = $journal['source_account_id'];
@@ -496,7 +491,6 @@ class TagController extends Controller
$spent = $this->opsRepository->listExpenses($start, $end, $accounts, $tags);
$result = [];
foreach ($spent as $currency) {
$currencyId = $currency['currency_id'];
foreach ($currency['tags'] as $tag) {
foreach ($tag['transaction_journals'] as $journal) {
$result[] = [
@@ -546,7 +540,6 @@ class TagController extends Controller
$spent = $this->opsRepository->listIncome($start, $end, $accounts, $tags);
$result = [];
foreach ($spent as $currency) {
$currencyId = $currency['currency_id'];
foreach ($currency['tags'] as $tag) {
foreach ($tag['transaction_journals'] as $journal) {
$result[] = [

View File

@@ -346,7 +346,6 @@ class ReportController extends Controller
$budgets = implode(',', $request->getBudgetList()->pluck('id')->toArray());
$tags = implode(',', $request->getTagList()->pluck('id')->toArray());
$double = implode(',', $request->getDoubleList()->pluck('id')->toArray());
$uri = route('reports.index');
if (0 === $request->getAccountList()->count()) {
Log::debug('Account count is zero');

View File

@@ -242,17 +242,15 @@ class ConvertController extends Controller
private function getAssetAccounts(): array
{
// make repositories
/** @var AccountRepositoryInterface $accountRepository */
$accountRepository = app(AccountRepositoryInterface::class);
$accountList = $accountRepository->getActiveAccountsByType([AccountType::ASSET]);
$accountList = $this->accountRepository->getActiveAccountsByType([AccountType::ASSET]);
$defaultCurrency = app('amount')->getDefaultCurrency();
$grouped = [];
// group accounts:
/** @var Account $account */
foreach ($accountList as $account) {
$balance = app('steam')->balance($account, today());
$currency = $accountRepository->getAccountCurrency($account) ?? $defaultCurrency;
$role = (string)$accountRepository->getMetaValue($account, 'account_role');
$currency = $this->accountRepository->getAccountCurrency($account) ?? $defaultCurrency;
$role = (string)$this->accountRepository->getMetaValue($account, 'account_role');
if ('' === $role) {
$role = 'no_account_type'; // @codeCoverageIgnore
}
@@ -271,16 +269,14 @@ class ConvertController extends Controller
private function getLiabilities(): array
{
// make repositories
/** @var AccountRepositoryInterface $accountRepository */
$accountRepository = app(AccountRepositoryInterface::class);
$accountList = $accountRepository->getActiveAccountsByType([AccountType::LOAN, AccountType::DEBT, AccountType::MORTGAGE]);
$accountList = $this->accountRepository->getActiveAccountsByType([AccountType::LOAN, AccountType::DEBT, AccountType::MORTGAGE]);
$defaultCurrency = app('amount')->getDefaultCurrency();
$grouped = [];
// group accounts:
/** @var Account $account */
foreach ($accountList as $account) {
$balance = app('steam')->balance($account, today());
$currency = $accountRepository->getAccountCurrency($account) ?? $defaultCurrency;
$currency = $this->accountRepository->getAccountCurrency($account) ?? $defaultCurrency;
$role = 'l_' . $account->accountType->type;
$key = (string)trans('firefly.opt_group_' . $role);
$grouped[$key][$account->id] = $account->name . ' (' . app('amount')->formatAnything($currency, $balance, false) . ')';
@@ -295,16 +291,14 @@ class ConvertController extends Controller
private function getValidDepositSources(): array
{
// make repositories
/** @var AccountRepositoryInterface $accountRepository */
$accountRepository = app(AccountRepositoryInterface::class);
$liabilityTypes = [AccountType::MORTGAGE, AccountType::DEBT, AccountType::CREDITCARD, AccountType::LOAN];
$accountList = $accountRepository
$accountList = $this->accountRepository
->getActiveAccountsByType([AccountType::REVENUE, AccountType::CASH, AccountType::LOAN, AccountType::DEBT, AccountType::MORTGAGE]);
$grouped = [];
// group accounts:
/** @var Account $account */
foreach ($accountList as $account) {
$role = (string)$accountRepository->getMetaValue($account, 'account_role');
$role = (string)$this->accountRepository->getMetaValue($account, 'account_role');
$name = $account->name;
if ('' === $role) {
$role = 'no_account_type'; // @codeCoverageIgnore
@@ -337,17 +331,15 @@ class ConvertController extends Controller
private function getValidWithdrawalDests(): array
{
// make repositories
/** @var AccountRepositoryInterface $accountRepository */
$accountRepository = app(AccountRepositoryInterface::class);
$liabilityTypes = [AccountType::MORTGAGE, AccountType::DEBT, AccountType::CREDITCARD, AccountType::LOAN];
$accountList = $accountRepository->getActiveAccountsByType(
$accountList = $this->accountRepository->getActiveAccountsByType(
[AccountType::EXPENSE, AccountType::CASH, AccountType::LOAN, AccountType::DEBT, AccountType::MORTGAGE]
);
$grouped = [];
// group accounts:
/** @var Account $account */
foreach ($accountList as $account) {
$role = (string)$accountRepository->getMetaValue($account, 'account_role');
$role = (string)$this->accountRepository->getMetaValue($account, 'account_role');
$name = $account->name;
if ('' === $role) {
$role = 'no_account_type'; // @codeCoverageIgnore

View File

@@ -171,7 +171,7 @@ class ShowController extends Controller
{
$accounts = [];
foreach ($group['transactions'] as $index => $transaction) {
foreach ($group['transactions'] as $transaction) {
$accounts['source'][] = [
'type' => $transaction['source_type'],
'id' => $transaction['source_id'],

View File

@@ -47,7 +47,7 @@ class BudgetFormStoreRequest extends FormRequest
'name' => $this->string('name'),
'active' => $this->boolean('active'),
'auto_budget_type' => $this->integer('auto_budget_type'),
'transaction_currency_id' => $this->integer('transaction_currency_id'),
'transaction_currency_id' => $this->integer('auto_budget_currency_id'),
'auto_budget_amount' => $this->string('auto_budget_amount'),
'auto_budget_period' => $this->string('auto_budget_period'),
];

View File

@@ -42,7 +42,8 @@ class CategoryFormRequest extends FormRequest
public function getCategoryData(): array
{
return [
'name' => $this->string('name'),
'name' => $this->string('name'),
'notes' => $this->nlString('notes'),
];
}

View File

@@ -354,17 +354,7 @@ class CreateRecurringTransactions implements ShouldQueue
$includeWeekend = clone $this->date;
$includeWeekend->addDays(2);
$occurrences = $this->repository->getOccurrencesInRange($repetition, $recurrence->first_date, $includeWeekend);
/*
Log::debug(
sprintf(
'Calculated %d occurrences between %s and %s',
count($occurrences),
$recurrence->first_date->format('Y-m-d'),
$includeWeekend->format('Y-m-d')
),
$this->debugArray($occurrences)
);
*/
unset($includeWeekend);
$result = $this->handleOccurrences($recurrence, $repetition, $occurrences);

View File

@@ -70,12 +70,6 @@ class ReportNewJournalsMail extends Mailable
*/
public function build(): self
{
$subject = 1 === $this->groups->count()
? 'Firefly III has created a new transaction'
: sprintf(
'Firefly III has created new %d transactions',
$this->groups->count()
);
$this->transform();
return $this->view('emails.report-new-journals-html')->text('emails.report-new-journals-text')

View File

@@ -70,7 +70,6 @@ use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
* @property-read int|null $attachments_count
* @property-read int|null $transaction_journals_count
* @property-read int|null $transactions_count
* @property bool $encrypted
*/
class Category extends Model
{
@@ -135,6 +134,15 @@ class Category extends Model
return $this->morphMany(Attachment::class, 'attachable');
}
/**
* @codeCoverageIgnore
* Get all of the category's notes.
*/
public function notes(): MorphMany
{
return $this->morphMany(Note::class, 'noteable');
}
/**
* @codeCoverageIgnore
* @return BelongsToMany

View File

@@ -355,7 +355,7 @@ class TransactionJournal extends Model
if (!self::isJoined($query, 'transaction_types')) {
$query->leftJoin('transaction_types', 'transaction_types.id', '=', 'transaction_journals.transaction_type_id');
}
if (count($types) > 0) {
if (!empty($types)) {
$query->whereIn('transaction_types.type', $types);
}
}

View File

@@ -115,33 +115,6 @@ class AccountRepository implements AccountRepositoryInterface
}
/**
* @param string $number
* @param array $types
*
* @return Account|null
*/
public function findByAccountNumber(string $number, array $types): ?Account
{
$query = $this->user->accounts()
->leftJoin('account_meta', 'account_meta.account_id', '=', 'accounts.id')
->where('account_meta.name', 'account_number')
->where('account_meta.data', json_encode($number));
if (count($types) > 0) {
$query->leftJoin('account_types', 'accounts.account_type_id', '=', 'account_types.id');
$query->whereIn('account_types.type', $types);
}
/** @var Collection $accounts */
$accounts = $query->get(['accounts.*']);
if ($accounts->count() > 0) {
return $accounts->first();
}
return null;
}
/**
* @param string $iban
* @param array $types
@@ -152,7 +125,7 @@ class AccountRepository implements AccountRepositoryInterface
{
$query = $this->user->accounts()->where('iban', '!=', '')->whereNotNull('iban');
if (count($types) > 0) {
if (!empty($types)) {
$query->leftJoin('account_types', 'accounts.account_type_id', '=', 'account_types.id');
$query->whereIn('account_types.type', $types);
}
@@ -180,7 +153,7 @@ class AccountRepository implements AccountRepositoryInterface
{
$query = $this->user->accounts();
if (count($types) > 0) {
if (!empty($types)) {
$query->leftJoin('account_types', 'accounts.account_type_id', '=', 'account_types.id');
$query->whereIn('account_types.type', $types);
}
@@ -228,16 +201,6 @@ class AccountRepository implements AccountRepositoryInterface
return null;
}
/**
* @param Account $account
*
* @return string
*/
public function getAccountType(Account $account): string
{
return $account->accountType->type;
}
/**
* Return account type or null if not found.
*
@@ -260,7 +223,7 @@ class AccountRepository implements AccountRepositoryInterface
/** @var Collection $result */
$query = $this->user->accounts();
if (count($accountIds) > 0) {
if (!empty($accountIds)) {
$query->whereIn('accounts.id', $accountIds);
}
$query->orderBy('accounts.order', 'ASC');
@@ -279,7 +242,7 @@ class AccountRepository implements AccountRepositoryInterface
{
/** @var Collection $result */
$query = $this->user->accounts();
if (count($types) > 0) {
if (!empty($types)) {
$query->accountTypeIn($types);
}
$query->orderBy('accounts.order', 'ASC');
@@ -303,7 +266,7 @@ class AccountRepository implements AccountRepositoryInterface
$query->where('name', 'account_role');
}, 'attachments']
);
if (count($types) > 0) {
if (!empty($types)) {
$query->accountTypeIn($types);
}
$query->where('active', 1);
@@ -572,7 +535,7 @@ class AccountRepository implements AccountRepositoryInterface
}
}
if (count($types) > 0) {
if (!empty($types)) {
$dbQuery->leftJoin('account_types', 'accounts.account_type_id', '=', 'account_types.id');
$dbQuery->whereIn('account_types.type', $types);
}
@@ -630,7 +593,7 @@ class AccountRepository implements AccountRepositoryInterface
$query->where('name', 'account_role');
}]
);
if (count($types) > 0) {
if (!empty($types)) {
$query->accountTypeIn($types);
}
$query->where('active', 0);
@@ -728,7 +691,7 @@ class AccountRepository implements AccountRepositoryInterface
});
}
}
if (count($types) > 0) {
if (!empty($types)) {
$dbQuery->leftJoin('account_types', 'accounts.account_type_id', '=', 'account_types.id');
$dbQuery->whereIn('account_types.type', $types);
}

View File

@@ -80,7 +80,7 @@ interface AccountRepositoryInterface
/**
* Moved here from account CRUD.
*
* @param Account $account
* @param Account $account
* @param Account|null $moveTo
*
* @return bool
@@ -96,19 +96,9 @@ interface AccountRepositoryInterface
*/
public function expandWithDoubles(Collection $accounts): Collection;
/**
* Find by account number. Is used.
*
* @param string $number
* @param array $types
*
* @return Account|null
*/
public function findByAccountNumber(string $number, array $types): ?Account;
/**
* @param string $iban
* @param array $types
* @param array $types
*
* @return Account|null
*/
@@ -116,7 +106,7 @@ interface AccountRepositoryInterface
/**
* @param string $name
* @param array $types
* @param array $types
*
* @return Account|null
*/
@@ -136,13 +126,6 @@ interface AccountRepositoryInterface
*/
public function getAccountCurrency(Account $account): ?TransactionCurrency;
/**
* @param Account $account
*
* @return string
*/
public function getAccountType(Account $account): string;
/**
* Return account type or null if not found.
*
@@ -189,7 +172,7 @@ interface AccountRepositoryInterface
* Return meta value for account. Null if not found.
*
* @param Account $account
* @param string $field
* @param string $field
*
* @return null|string
*/
@@ -282,7 +265,7 @@ interface AccountRepositoryInterface
/**
* @param string $query
* @param array $types
* @param array $types
* @param int $limit
*
* @return Collection
@@ -291,7 +274,7 @@ interface AccountRepositoryInterface
/**
* @param string $query
* @param array $types
* @param array $types
* @param int $limit
*
* @return Collection
@@ -312,7 +295,7 @@ interface AccountRepositoryInterface
/**
* @param Account $account
* @param array $data
* @param array $data
*
* @return Account
*/

View File

@@ -157,11 +157,11 @@ class BudgetRepository implements BudgetRepositoryInterface
*/
public function firstUseDate(Budget $budget): ?Carbon
{
$oldest = null;
$journal = $budget->transactionJournals()->orderBy('date', 'ASC')->first();
if (null !== $journal) {
return $journal->date;
}
return null;
}
@@ -209,7 +209,7 @@ class BudgetRepository implements BudgetRepositoryInterface
/**
* @param string $query
* @param int $limit
* @param int $limit
*
* @return Collection
*/
@@ -221,7 +221,7 @@ class BudgetRepository implements BudgetRepositoryInterface
$search->where('name', 'LIKE', sprintf('%%%s%%', $query));
}
$search->orderBy('order', 'ASC')
->orderBy('name', 'ASC')->where('active', 1);
->orderBy('name', 'ASC')->where('active', 1);
return $search->take($limit)->get();
}
@@ -278,15 +278,15 @@ class BudgetRepository implements BudgetRepositoryInterface
if ('rollover' === $type) {
$type = AutoBudget::AUTO_BUDGET_ROLLOVER;
}
$repos = app(CurrencyRepositoryInterface::class);
$currencyId = (int)($data['transaction_currency_id'] ?? 0);
$repos = app(CurrencyRepositoryInterface::class);
$currencyId = (int)($data['transaction_currency_id'] ?? 0);
$currencyCode = (string)($data['transaction_currency_code'] ?? '');
$currency = $repos->findNull($currencyId);
if(null === $currency) {
if (null === $currency) {
$currency = $repos->findByCodeNull($currencyCode);
}
if(null === $currency) {
if (null === $currency) {
$currency = app('amount')->getDefaultCurrencyByUser($this->user);
}
@@ -307,11 +307,11 @@ class BudgetRepository implements BudgetRepositoryInterface
$limitRepos->setUser($this->user);
$limitRepos->store(
[
'budget_id' => $newBudget->id,
'transaction_currency_id' => $autoBudget->transaction_currency_id,
'start_date' => $start,
'end_date' => $end,
'amount' => $autoBudget->amount,
'budget_id' => $newBudget->id,
'currency_id' => $autoBudget->transaction_currency_id,
'start_date' => $start,
'end_date' => $end,
'amount' => $autoBudget->amount,
]
);
@@ -349,15 +349,15 @@ class BudgetRepository implements BudgetRepositoryInterface
$autoBudget->budget()->associate($budget);
}
$repos = app(CurrencyRepositoryInterface::class);
$currencyId = (int)($data['transaction_currency_id'] ?? 0);
$repos = app(CurrencyRepositoryInterface::class);
$currencyId = (int)($data['transaction_currency_id'] ?? 0);
$currencyCode = (string)($data['transaction_currency_code'] ?? '');
$currency = $repos->findNull($currencyId);
if(null === $currency) {
if (null === $currency) {
$currency = $repos->findByCodeNull($currencyCode);
}
if(null === $currency) {
if (null === $currency) {
$currency = app('amount')->getDefaultCurrencyByUser($this->user);
}

View File

@@ -160,6 +160,9 @@ class NoBudgetRepository implements NoBudgetRepositoryInterface
/** @noinspection MoreThanThreeArgumentsInspection */
/**
* TODO this method does not include foreign amount transactions. It only sums up "amount".
* TODO this probably also applies to the other "sumExpenses" methods.
*
* @param Carbon $start
* @param Carbon $end
* @param Collection|null $accounts
@@ -196,6 +199,7 @@ class NoBudgetRepository implements NoBudgetRepositoryInterface
'currency_decimal_places' => $journal['currency_decimal_places'],
];
$array[$currencyId]['sum'] = bcadd($array[$currencyId]['sum'], app('steam')->negative($journal['amount']));
}
return $array;

View File

@@ -28,6 +28,7 @@ use FireflyIII\Exceptions\FireflyException;
use FireflyIII\Factory\CategoryFactory;
use FireflyIII\Models\Attachment;
use FireflyIII\Models\Category;
use FireflyIII\Models\Note;
use FireflyIII\Models\RecurrenceTransactionMeta;
use FireflyIII\Models\RuleAction;
use FireflyIII\Services\Internal\Destroy\CategoryDestroyService;
@@ -202,7 +203,7 @@ class CategoryRepository implements CategoryRepositoryInterface
/**
* @param string $query
* @param int $limit
* @param int $limit
*
* @return Collection
*/
@@ -241,10 +242,28 @@ class CategoryRepository implements CategoryRepositoryInterface
if (null === $category) {
throw new FireflyException(sprintf('400003: Could not store new category with name "%s"', $data['name']));
}
if (array_key_exists('notes', $data) && '' === $data['notes']) {
$this->removeNotes($category);
}
if (array_key_exists('notes', $data) && '' !== $data['notes']) {
$this->updateNotes($category, $data['notes']);
}
return $category;
}
/**
* @param Category $category
*/
public function removeNotes(Category $category): void
{
$category->notes()->delete();
}
/**
* @param Category $category
* @param array $data
@@ -383,4 +402,31 @@ class CategoryRepository implements CategoryRepositoryInterface
}
);
}
/**
* @inheritDoc
*/
public function updateNotes(Category $category, string $notes): void
{
$dbNote = $category->notes()->first();
if (null === $dbNote) {
$dbNote = new Note;
$dbNote->noteable()->associate($category);
}
$dbNote->text = trim($notes);
$dbNote->save();
}
/**
* @inheritDoc
*/
public function getNoteText(Category $category): ?string
{
$dbNote = $category->notes()->first();
if (null === $dbNote) {
return null;
}
return $dbNote->text;
}
}

View File

@@ -33,6 +33,27 @@ use Illuminate\Support\Collection;
*/
interface CategoryRepositoryInterface
{
/**
* Remove notes.
*
* @param Category $category
*/
public function removeNotes(Category $category): void;
/**
* @param Category $category
* @param string $notes
*/
public function updateNotes(Category $category, string $notes): void;
/**
* @param Category $category
*
* @return string|null
*/
public function getNoteText(Category $category): ?string;
/**
* Delete all categories.
*/

View File

@@ -215,7 +215,6 @@ class JournalRepository implements JournalRepositoryInterface
*/
public function getLinkNoteText(TransactionJournalLink $link): string
{
$notes = null;
/** @var Note $note */
$note = $link->notes()->first();
if (null !== $note) {

View File

@@ -60,7 +60,6 @@ trait CreatesObjectGroups
*/
protected function findOrCreateObjectGroup(string $title): ?ObjectGroup
{
$group = null;
$maxOrder = $this->getObjectGroupMaxOrder();
if (!$this->hasObjectGroup($title)) {
return ObjectGroup::create(

View File

@@ -328,8 +328,7 @@ trait ModifiesPiggyBanks
*
* @return PiggyBank
*/
public function update(PiggyBank $piggyBank, array $data): PiggyBank
{
private function updateProperties(PiggyBank $piggyBank, array $data): PiggyBank {
if (array_key_exists('name', $data) && '' !== $data['name']) {
$piggyBank->name = $data['name'];
}
@@ -344,7 +343,18 @@ trait ModifiesPiggyBanks
}
$piggyBank->startdate = $data['startdate'] ?? $piggyBank->startdate;
$piggyBank->save();
return $piggyBank;
}
/**
* @param PiggyBank $piggyBank
* @param array $data
*
* @return PiggyBank
*/
public function update(PiggyBank $piggyBank, array $data): PiggyBank
{
$piggyBank = $this->updateProperties($piggyBank, $data);
$this->updateNote($piggyBank, $data['notes'] ?? '');
// update the order of the piggy bank:

View File

@@ -327,7 +327,7 @@ class RecurringRepository implements RecurringRepositoryInterface
foreach ($journalMeta as $journalId) {
$search[] = (int)$journalId;
}
if (0 === count($search)) {
if (empty($search)) {
return new Collection;
}

View File

@@ -476,7 +476,6 @@ class TagRepository implements TagRepositoryInterface
*/
public function update(Tag $tag, array $data): Tag
{
$oldTag = $data['tag'];
$tag->tag = $data['tag'];
$tag->date = $data['date'];
$tag->description = $data['description'];

View File

@@ -275,7 +275,7 @@ trait RecurringTransactionTrait
*/
protected function updateTags(RecurrenceTransaction $transaction, array $tags): void
{
if (count($tags) > 0) {
if (!empty($tags)) {
/** @var RecurrenceMeta $entry */
$entry = $transaction->recurrenceTransactionMeta()->where('name', 'tags')->first();
if (null === $entry) {
@@ -284,7 +284,7 @@ trait RecurringTransactionTrait
$entry->value = json_encode($tags);
$entry->save();
}
if (0 === count($tags)) {
if (empty($tags)) {
// delete if present
$transaction->recurrenceTransactionMeta()->where('name', 'tags')->delete();
}

View File

@@ -47,7 +47,7 @@ class BillUpdateService
protected User $user;
/**
* @param Bill $bill
* @param Bill $bill
* @param array $data
*
* @return Bill
@@ -69,43 +69,19 @@ class BillUpdateService
$currency->enabled = true;
$currency->save();
// old values
$oldData = [
'name' => $bill->name,
'amount_min' => $bill->amount_min,
'amount_max' => $bill->amount_max,
'transaction_currency_name' => $bill->transactionCurrency->name,
];
// new values
$data['transaction_currency_name'] = $currency->name;
if (isset($data['name']) && '' !== (string)$data['name']) {
$bill->name = $data['name'];
}
if (isset($data['amount_min']) && '' !== (string)$data['amount_min']) {
$bill->amount_min = $data['amount_min'];
}
if (isset($data['amount_max']) && '' !== (string)$data['amount_max']) {
$bill->amount_max = $data['amount_max'];
}
if (isset($data['date']) && '' !== (string)$data['date']) {
$bill->date = $data['date'];
}
if (isset($data['repeat_freq']) && '' !== (string)$data['repeat_freq']) {
$bill->repeat_freq = $data['repeat_freq'];
}
if (isset($data['skip']) && '' !== (string)$data['skip']) {
$bill->skip = $data['skip'];
}
if (isset($data['active']) && is_bool($data['active'])) {
$bill->active = $data['active'];
}
$bill->transaction_currency_id = $currency->id;
$bill->match = 'EMPTY';
$bill->automatch = true;
$bill = $this->updateBillProperties($bill, $data);
$bill->transaction_currency_id = $currency->id;
$bill->save();
// old values
$oldData = [
'name' => $bill->name,
'amount_min' => $bill->amount_min,
'amount_max' => $bill->amount_max,
'transaction_currency_name' => $bill->transactionCurrency->name,
];
// update note:
if (isset($data['notes'])) {
@@ -132,6 +108,7 @@ class BillUpdateService
$bill->objectGroups()->sync([$objectGroup->id]);
$bill->save();
}
return $bill;
}
// remove if name is empty. Should be overruled by ID.
@@ -148,9 +125,10 @@ class BillUpdateService
$bill->objectGroups()->sync([$objectGroup->id]);
$bill->save();
}
return $bill;
}
if(0 === $objectGroupId) {
if (0 === $objectGroupId) {
$bill->objectGroups()->sync([]);
$bill->save();
}
@@ -159,7 +137,7 @@ class BillUpdateService
}
/**
* @param Bill $bill
* @param Bill $bill
* @param array $oldData
* @param array $newData
*/
@@ -177,9 +155,9 @@ class BillUpdateService
}
Log::debug(sprintf('Found %d rules', $rules->count()));
$fields = [
'name' => 'description_contains',
'amount_min' => 'amount_more',
'amount_max' => 'amount_less',
'name' => 'description_contains',
'amount_min' => 'amount_more',
'amount_max' => 'amount_less',
'transaction_currency_name' => 'currency_is'];
foreach ($fields as $field => $ruleTriggerKey) {
if ($oldData[$field] === $newData[$field]) {
@@ -193,9 +171,9 @@ class BillUpdateService
/**
* @param Collection $rules
* @param string $key
* @param string $oldValue
* @param string $newValue
* @param string $key
* @param string $oldValue
* @param string $newValue
*/
private function updateRules(Collection $rules, string $key, string $oldValue, string $newValue): void
{
@@ -219,7 +197,7 @@ class BillUpdateService
/**
* @param Rule $rule
* @param Rule $rule
* @param string $key
*
* @return RuleTrigger|null
@@ -231,25 +209,64 @@ class BillUpdateService
/**
* @param Bill $bill
* @param int $oldOrder
* @param int $newOrder
* @param int $oldOrder
* @param int $newOrder
*/
private function updateOrder(Bill $bill, int $oldOrder, int $newOrder): void
{
if ($newOrder > $oldOrder) {
$this->user->bills()->where('order', '<=', $newOrder)->where('order', '>', $oldOrder)
->where('bills.id', '!=', $bill->id)
->update(['order' => DB::raw('bills.order-1')]);
->where('bills.id', '!=', $bill->id)
->update(['order' => DB::raw('bills.order-1')]);
$bill->order = $newOrder;
$bill->save();
}
if ($newOrder < $oldOrder) {
$this->user->bills()->where('order', '>=', $newOrder)->where('order', '<', $oldOrder)
->where('bills.id', '!=', $bill->id)
->update(['order' => DB::raw('bills.order+1')]);
->where('bills.id', '!=', $bill->id)
->update(['order' => DB::raw('bills.order+1')]);
$bill->order = $newOrder;
$bill->save();
}
}
/**
* @param Bill $bill
* @param array $data
*
* @return Bill
*/
private function updateBillProperties(Bill $bill, array $data): Bill
{
if (isset($data['name']) && '' !== (string)$data['name']) {
$bill->name = $data['name'];
}
if (isset($data['amount_min']) && '' !== (string)$data['amount_min']) {
$bill->amount_min = $data['amount_min'];
}
if (isset($data['amount_max']) && '' !== (string)$data['amount_max']) {
$bill->amount_max = $data['amount_max'];
}
if (isset($data['date']) && '' !== (string)$data['date']) {
$bill->date = $data['date'];
}
if (isset($data['repeat_freq']) && '' !== (string)$data['repeat_freq']) {
$bill->repeat_freq = $data['repeat_freq'];
}
if (isset($data['skip']) && '' !== (string)$data['skip']) {
$bill->skip = $data['skip'];
}
if (isset($data['active']) && is_bool($data['active'])) {
$bill->active = $data['active'];
}
$bill->match = 'EMPTY';
$bill->automatch = true;
$bill->save();
return $bill;
}
}

View File

@@ -76,10 +76,6 @@ class JournalUpdateService
private $transactionGroup;
/** @var TransactionJournal The journal to update. */
private $transactionJournal;
/** @var Account If new account info is submitted, this array will hold the valid destination. */
private $validDestination;
/** @var Account If new account info is submitted, this array will hold the valid source. */
private $validSource;
/**
* JournalUpdateService constructor.

View File

@@ -41,8 +41,7 @@ class RecurrenceUpdateService
{
use TransactionTypeTrait, RecurringTransactionTrait;
/** @var User */
private $user;
private User $user;
/**
* Updates a recurrence.
@@ -99,7 +98,7 @@ class RecurrenceUpdateService
$this->createRepetitions($recurrence, $data['repetitions'] ?? []);
}
// update all transactions (and associated meta-data);
// update all transactions (and associated meta-data)
if (null !== $data['transactions']) {
$this->deleteTransactions($recurrence);
$this->createTransactions($recurrence, $data['transactions'] ?? []);

View File

@@ -350,6 +350,7 @@ class Amount
try {
$value = Crypt::decrypt($value); // verified
} catch (DecryptException $e) {
// ignore decryption error.
}
return $value;

View File

@@ -31,6 +31,7 @@ use FireflyIII\Repositories\Budget\OperationsRepositoryInterface;
use FireflyIII\User;
use Illuminate\Support\Collection;
/**
* Class FrontpageChartGenerator
*/
@@ -64,9 +65,9 @@ class FrontpageChartGenerator
{
$budgets = $this->budgetRepository->getActiveBudgets();
$data = [
['label' => (string) trans('firefly.spent_in_budget'), 'entries' => [], 'type' => 'bar'],
['label' => (string) trans('firefly.left_to_spend'), 'entries' => [], 'type' => 'bar'],
['label' => (string) trans('firefly.overspent'), 'entries' => [], 'type' => 'bar'],
['label' => (string)trans('firefly.spent_in_budget'), 'entries' => [], 'type' => 'bar'],
['label' => (string)trans('firefly.left_to_spend'), 'entries' => [], 'type' => 'bar'],
['label' => (string)trans('firefly.overspent'), 'entries' => [], 'type' => 'bar'],
];
// loop al budgets:
@@ -91,7 +92,7 @@ class FrontpageChartGenerator
$this->opsRepository->setUser($user);
$locale = app('steam')->getLocale();
$this->monthAndDayFormat = (string) trans('config.month_and_day', [], $locale);
$this->monthAndDayFormat = (string)trans('config.month_and_day', [], $locale);
}
/**
@@ -117,6 +118,7 @@ class FrontpageChartGenerator
*
* @param array $data
* @param Budget $budget
*
* @return array
*/
private function processBudget(array $data, Budget $budget): array
@@ -133,6 +135,7 @@ class FrontpageChartGenerator
if (0 !== $limits->count()) {
return $this->budgetLimits($data, $budget, $limits);
}
return $data;
}
@@ -142,6 +145,7 @@ class FrontpageChartGenerator
*
* @param array $data
* @param Budget $budget
*
* @return array
*/
private function noBudgetLimits(array $data, Budget $budget): array
@@ -154,6 +158,7 @@ class FrontpageChartGenerator
$data[1]['entries'][$title] = 0; // left to spend
$data[2]['entries'][$title] = 0; // overspent
}
return $data;
}
@@ -163,6 +168,7 @@ class FrontpageChartGenerator
* @param array $data
* @param Budget $budget
* @param Collection $limits
*
* @return array
*/
private function budgetLimits(array $data, Budget $budget, Collection $limits): array
@@ -171,6 +177,7 @@ class FrontpageChartGenerator
foreach ($limits as $limit) {
$data = $this->processLimit($data, $budget, $limit);
}
return $data;
}
@@ -180,6 +187,7 @@ class FrontpageChartGenerator
* @param array $data
* @param Budget $budget
* @param BudgetLimit $limit
*
* @return array
*/
private function processLimit(array $data, Budget $budget, BudgetLimit $limit): array
@@ -187,8 +195,12 @@ class FrontpageChartGenerator
$spent = $this->opsRepository->sumExpenses($limit->start_date, $limit->end_date, null, new Collection([$budget]), $limit->transactionCurrency);
/** @var array $entry */
foreach ($spent as $entry) {
$data = $this->processRow($data, $budget, $limit, $entry);
// only spent the entry where the entry's currency matches the budget limit's currency
if ($entry['currency_id'] === (int)$limit->transaction_currency_id) {
$data = $this->processRow($data, $budget, $limit, $entry);
}
}
return $data;
}
@@ -202,6 +214,7 @@ class FrontpageChartGenerator
* @param Budget $budget
* @param BudgetLimit $limit
* @param array $entry
*
* @return array
*/
private function processRow(array $data, Budget $budget, BudgetLimit $limit, array $entry): array

View File

@@ -57,8 +57,6 @@ class WholePeriodChartGenerator
public function generate(Category $category, Carbon $start, Carbon $end): array
{
$collection = new Collection([$category]);
/** @var CategoryRepositoryInterface $repository */
$repository = app(CategoryRepositoryInterface::class);
/** @var OperationsRepositoryInterface $opsRepository */
$opsRepository = app(OperationsRepositoryInterface::class);

View File

@@ -717,7 +717,7 @@ class ExportDataGenerator
*/
private function mergeTags(array $tags): string
{
if (0 === count($tags)) {
if (empty($tags)) {
return '';
}
$smol = [];

View File

@@ -129,7 +129,7 @@ trait RequestInformation
$triggers = [];
$data = $request->get('triggers');
if (is_array($data)) {
foreach ($data as $index => $triggerInfo) {
foreach ($data as $triggerInfo) {
$triggers[] = [
'type' => $triggerInfo['type'] ?? '',
'value' => $triggerInfo['value'] ?? '',

View File

@@ -154,9 +154,9 @@ class BudgetReportGenerator
*/
private function generalBudgetReport(): void
{
$budgets = $this->repository->getBudgets();
$budgetList = $this->repository->getBudgets();
/** @var Budget $budget */
foreach ($budgets as $budget) {
foreach ($budgetList as $budget) {
$this->processBudget($budget);
}
}
@@ -192,14 +192,14 @@ class BudgetReportGenerator
*/
private function processLimit(Budget $budget, BudgetLimit $limit): void
{
$budgetId = (int)$budget->id;
$limitId = (int)$limit->id;
$currency = $limit->transactionCurrency ?? $this->currency;
$currencyId = (int)$currency->id;
$expenses = $this->opsRepository->sumExpenses($limit->start_date, $limit->end_date, $this->accounts, new Collection([$budget]));
$spent = $expenses[$currencyId]['sum'] ?? '0';
$left = -1 === bccomp(bcadd($limit->amount, $spent), '0') ? '0' : bcadd($limit->amount, $spent);
$overspent = 1 === bccomp(bcmul($spent, '-1'), $limit->amount) ? bcadd($spent, $limit->amount) : '0';
$budgetId = (int)$budget->id;
$limitId = (int)$limit->id;
$limitCurrency = $limit->transactionCurrency ?? $this->currency;
$currencyId = (int)$limitCurrency->id;
$expenses = $this->opsRepository->sumExpenses($limit->start_date, $limit->end_date, $this->accounts, new Collection([$budget]));
$spent = $expenses[$currencyId]['sum'] ?? '0';
$left = -1 === bccomp(bcadd($limit->amount, $spent), '0') ? '0' : bcadd($limit->amount, $spent);
$overspent = 1 === bccomp(bcmul($spent, '-1'), $limit->amount) ? bcadd($spent, $limit->amount) : '0';
$this->report['budgets'][$budgetId]['budget_limits'][$limitId] = $this->report['budgets'][$budgetId]['budget_limits'][$limitId] ?? [
'budget_limit_id' => $limitId,
@@ -212,10 +212,10 @@ class BudgetReportGenerator
'left' => $left,
'overspent' => $overspent,
'currency_id' => $currencyId,
'currency_code' => $currency->code,
'currency_name' => $currency->name,
'currency_symbol' => $currency->symbol,
'currency_decimal_places' => $currency->decimal_places,
'currency_code' => $limitCurrency->code,
'currency_name' => $limitCurrency->name,
'currency_symbol' => $limitCurrency->symbol,
'currency_decimal_places' => $limitCurrency->decimal_places,
];
// make sum information:
@@ -226,10 +226,10 @@ class BudgetReportGenerator
'left' => '0',
'overspent' => '0',
'currency_id' => $currencyId,
'currency_code' => $currency->code,
'currency_name' => $currency->name,
'currency_symbol' => $currency->symbol,
'currency_decimal_places' => $currency->decimal_places,
'currency_code' => $limitCurrency->code,
'currency_name' => $limitCurrency->name,
'currency_symbol' => $limitCurrency->symbol,
'currency_decimal_places' => $limitCurrency->decimal_places,
];
$this->report['sums'][$currencyId]['budgeted'] = bcadd($this->report['sums'][$currencyId]['budgeted'], $limit->amount);
$this->report['sums'][$currencyId]['spent'] = bcadd($this->report['sums'][$currencyId]['spent'], $spent);

View File

@@ -54,6 +54,7 @@ class Steam
$cache->addProperty($account->id);
$cache->addProperty('balance');
$cache->addProperty($date);
$cache->addProperty($currency ? $currency->id : 0);
if ($cache->has()) {
return $cache->get(); // @codeCoverageIgnore
}
@@ -186,7 +187,7 @@ class Steam
$end->addDay();
$balances = [];
$formatted = $start->format('Y-m-d');
$startBalance = $this->balance($account, $start);
$startBalance = $this->balance($account, $start, $currency);
/** @var AccountRepositoryInterface $repository */
@@ -196,7 +197,7 @@ class Steam
$repository->setUser($account->user);
$currency = $repository->getAccountCurrency($account) ?? app('amount')->getDefaultCurrencyByUser($account->user);
}
$currencyId = $currency->id;
$currencyId = (int)$currency->id;
$start->addDay();

View File

@@ -60,7 +60,7 @@ class Breadcrumbs extends AbstractExtension
}
$breadcrumbs = $this->getBreadcrumbs($arr);
return $this->getHtml($breadcrumbs);
return $this->getHtml($breadcrumbs, $args);
},
['is_safe' => ['html']]
@@ -87,7 +87,7 @@ class Breadcrumbs extends AbstractExtension
if (null !== $arr['parent']) {
$arr = config(sprintf('bc.%s', $arr['parent']));
if (null === $arr) {
throw new FireflyException(sprintf('No (2) breadcrumbs for route "%s".', $name));
throw new FireflyException(sprintf('No (2) breadcrumbs for route "%s".', $arr['parent']));
}
}
$loop++; // safety catch
@@ -98,11 +98,12 @@ class Breadcrumbs extends AbstractExtension
}
/**
* @param array $breadcrumbs
* @param array $breadcrumbs
* @param array|null $args
*
* @return string
*/
private function getHtml(array $breadcrumbs): string
private function getHtml(array $breadcrumbs, ?array $args): string
{
// get HTML
$html = '<ol class="breadcrumb float-sm-right">';

View File

@@ -25,6 +25,7 @@ namespace FireflyIII\Transformers;
use FireflyIII\Models\Category;
use FireflyIII\Repositories\Category\CategoryRepositoryInterface;
use FireflyIII\Repositories\Category\OperationsRepositoryInterface;
use Illuminate\Support\Collection;
@@ -33,8 +34,8 @@ use Illuminate\Support\Collection;
*/
class CategoryTransformer extends AbstractTransformer
{
/** @var OperationsRepositoryInterface */
private $opsRepository;
private OperationsRepositoryInterface $opsRepository;
private CategoryRepositoryInterface $repository;
/**
* CategoryTransformer constructor.
@@ -44,6 +45,7 @@ class CategoryTransformer extends AbstractTransformer
public function __construct()
{
$this->opsRepository = app(OperationsRepositoryInterface::class);
$this->repository = app(CategoryRepositoryInterface::class);
}
/**
@@ -56,6 +58,7 @@ class CategoryTransformer extends AbstractTransformer
public function transform(Category $category): array
{
$this->opsRepository->setUser($category->user);
$this->repository->setUser($category->user);
$spent = [];
$earned = [];
@@ -65,11 +68,14 @@ class CategoryTransformer extends AbstractTransformer
$earned = $this->beautify($this->opsRepository->sumIncome($start, $end, null, new Collection([$category])));
$spent = $this->beautify($this->opsRepository->sumExpenses($start, $end, null, new Collection([$category])));
}
$notes = $this->repository->getNoteText($category);
return [
'id' => (int)$category->id,
'created_at' => $category->created_at->toAtomString(),
'updated_at' => $category->updated_at->toAtomString(),
'name' => $category->name,
'notes' => $notes,
'spent' => $spent,
'earned' => $earned,
'links' => [
@@ -90,7 +96,7 @@ class CategoryTransformer extends AbstractTransformer
{
$return = [];
foreach ($array as $data) {
$data['sum'] = number_format((float) $data['sum'], (int) $data['currency_decimal_places'], '.', '');
$data['sum'] = number_format((float)$data['sum'], (int)$data['currency_decimal_places'], '.', '');
$return[] = $data;
}

View File

@@ -569,6 +569,6 @@ class TransactionGroupTransformer extends AbstractTransformer
return null;
}
return $object['interest_date']->toAtomString();
return $object[$key]->toAtomString();
}
}

View File

@@ -360,16 +360,8 @@ class FireflyValidator extends Validator
return false;
}
}
return true;
// and finally a "will match everything check":
$classes = array_keys(config('firefly.search.operators'));
/** @var TriggerInterface $class */
$class = $classes[$triggerType] ?? false;
if (false === $class) {
return false;
}
return !$class::willMatchEverything($value);
}
/**

View File

@@ -2,6 +2,18 @@
All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](http://semver.org/).
## 5.4.5 (API 1.4.0) - 2020-10-28
### Fixed
- [Issue 3853](https://github.com/firefly-iii/firefly-iii/issues/3853) Could not create rules with IBAN values.
- [Issue 3991](https://github.com/firefly-iii/firefly-iii/issues/3991) Hardcoded array key broke editing.
- [Issue 3992](https://github.com/firefly-iii/firefly-iii/issues/3992) Amount problems in account chart for multi-currency charts.
- [Issue 4000](https://github.com/firefly-iii/firefly-iii/issues/4000) Budget chart did not handle multiple currencies well.
- [Issue 4003](https://github.com/firefly-iii/firefly-iii/issues/4003) Was unable to create new auto budget limits in foreign currency.
### Security
- [Issue 3990](https://github.com/firefly-iii/firefly-iii/issues/3990) Unescaped content could break the auto-complete.
## 5.4.4 (API 1.4.0) - 2020-10-24
### Changed

616
composer.lock generated

File diff suppressed because it is too large Load Diff

View File

@@ -95,7 +95,7 @@ return [
],
//'encryption' => null === env('USE_ENCRYPTION') || true === env('USE_ENCRYPTION'),
'version' => '5.4.4',
'version' => '5.4.5',
'api_version' => '1.4.0',
'db_version' => 15,
'maxUploadSize' => 1073741824, // 1 GB

View File

@@ -36,14 +36,14 @@ $factory->state(TransactionJournal::class, 'ob_broken', function ($faker) {
$factory->afterCreatingState(TransactionJournal::class, TransactionType::OPENING_BALANCE, function ($journal, $faker) {
$obAccount = factory(Account::class)->state(AccountType::INITIAL_BALANCE)->create();
$assetAccount = factory(Account::class)->state(AccountType::ASSET)->create();
$sourceTransaction = factory(Transaction::class)->create(
factory(Transaction::class)->create(
[
'account_id' => $obAccount->id,
'transaction_journal_id' => $journal->id,
'amount' => '5',
]);
$destTransaction = factory(Transaction::class)->create(
factory(Transaction::class)->create(
[
'account_id' => $assetAccount->id,
'transaction_journal_id' => $journal->id,
@@ -55,14 +55,14 @@ $factory->afterCreatingState(TransactionJournal::class, 'ob_broken', function ($
$ob1 = factory(Account::class)->state(AccountType::INITIAL_BALANCE)->create();
$ob2 = factory(Account::class)->state(AccountType::INITIAL_BALANCE)->create();
$sourceTransaction = factory(Transaction::class)->create(
factory(Transaction::class)->create(
[
'account_id' => $ob1->id,
'transaction_journal_id' => $journal->id,
'amount' => '5',
]);
$destTransaction = factory(Transaction::class)->create(
factory(Transaction::class)->create(
[
'account_id' => $ob2->id,
'transaction_journal_id' => $journal->id,

View File

@@ -25,6 +25,7 @@ use Illuminate\Database\Schema\Blueprint;
/**
* Class CreateSupportTables.
* @codeCoverageIgnore
*/
class CreateSupportTables extends Migration
{

View File

@@ -25,6 +25,7 @@ use Illuminate\Database\Schema\Blueprint;
/**
* Class CreateUsersTable.
* @codeCoverageIgnore
*/
class CreateUsersTable extends Migration
{

View File

@@ -25,6 +25,7 @@ use Illuminate\Database\Schema\Blueprint;
/**
* Class CreateMainTables.
* @codeCoverageIgnore
*/
class CreateMainTables extends Migration
{

View File

@@ -25,6 +25,7 @@ use Illuminate\Database\Schema\Blueprint;
/**
* Class ChangesFor3101.
* @codeCoverageIgnore
*/
class ChangesFor3101 extends Migration
{

View File

@@ -25,6 +25,7 @@ use Illuminate\Database\Schema\Blueprint;
/**
* Class FixNullables.
* @codeCoverageIgnore
*/
class FixNullables extends Migration
{

View File

@@ -25,6 +25,7 @@ use Illuminate\Database\Schema\Blueprint;
/**
* Class ExpandTransactionsTable.
* @codeCoverageIgnore
*/
class ExpandTransactionsTable extends Migration
{

View File

@@ -25,6 +25,7 @@ use Illuminate\Database\Schema\Blueprint;
/**
* Class ChangesForV410.
* @codeCoverageIgnore
*/
class ChangesForV410 extends Migration
{

View File

@@ -25,6 +25,7 @@ use Illuminate\Database\Schema\Blueprint;
/**
* Class ChangesForV420.
* @codeCoverageIgnore
*/
class ChangesForV420 extends Migration
{

View File

@@ -25,6 +25,7 @@ use Illuminate\Database\Schema\Blueprint;
/**
* Class ChangesForV430.
* @codeCoverageIgnore
*/
class ChangesForV430 extends Migration
{

View File

@@ -25,6 +25,7 @@ use Illuminate\Database\Schema\Blueprint;
/**
* Class ChangesForV431.
* @codeCoverageIgnore
*/
class ChangesForV431 extends Migration
{

View File

@@ -25,6 +25,7 @@ use Illuminate\Database\Schema\Blueprint;
/**
* Class ChangesForV440.
* @codeCoverageIgnore
*/
class ChangesForV440 extends Migration
{

View File

@@ -25,6 +25,7 @@ use Illuminate\Database\Schema\Blueprint;
/**
* Class ChangesForV450.
* @codeCoverageIgnore
*/
class ChangesForV450 extends Migration
{

View File

@@ -26,6 +26,7 @@ use Illuminate\Support\Facades\Schema;
/**
* Class ChangesForV470.
* @codeCoverageIgnore
*/
class ChangesForV470 extends Migration
{

View File

@@ -26,6 +26,7 @@ use Illuminate\Support\Facades\Schema;
/**
* Class ChangesForV470a.
* @codeCoverageIgnore
*/
class ChangesForV470a extends Migration
{

View File

@@ -28,6 +28,7 @@ use Illuminate\Support\Facades\Schema;
/**
* Class CreateOauthAuthCodesTable.
* @codeCoverageIgnore
*/
class CreateOauthAuthCodesTable extends Migration
{

View File

@@ -28,6 +28,7 @@ use Illuminate\Support\Facades\Schema;
/**
* Class CreateOauthAccessTokensTable.
* @codeCoverageIgnore
*/
class CreateOauthAccessTokensTable extends Migration
{

View File

@@ -28,6 +28,7 @@ use Illuminate\Support\Facades\Schema;
/**
* Class CreateOauthRefreshTokensTable.
* @codeCoverageIgnore
*/
class CreateOauthRefreshTokensTable extends Migration
{

View File

@@ -28,6 +28,7 @@ use Illuminate\Support\Facades\Schema;
/**
* Class CreateOauthClientsTable.
* @codeCoverageIgnore
*/
class CreateOauthClientsTable extends Migration
{

View File

@@ -28,6 +28,7 @@ use Illuminate\Support\Facades\Schema;
/**
* Class CreateOauthPersonalAccessClientsTable.
* @codeCoverageIgnore
*/
class CreateOauthPersonalAccessClientsTable extends Migration
{

View File

@@ -27,6 +27,7 @@ use Illuminate\Database\Schema\Blueprint;
/**
* Class ChangesForV472.
* @codeCoverageIgnore
*/
class ChangesForV472 extends Migration
{

View File

@@ -28,6 +28,7 @@ use Illuminate\Support\Facades\Schema;
/**
* Class ChangesForV473.
* @codeCoverageIgnore
*/
class ChangesForV473 extends Migration
{

View File

@@ -27,6 +27,7 @@ use Illuminate\Database\Schema\Blueprint;
/**
* Class ChangesForV474.
* @codeCoverageIgnore
*/
class ChangesForV474 extends Migration
{

View File

@@ -27,6 +27,7 @@ use Illuminate\Database\Schema\Blueprint;
/**
* Class ChangesForV475.
* @codeCoverageIgnore
*/
class ChangesForV475 extends Migration
{

View File

@@ -27,6 +27,7 @@ use Illuminate\Database\Schema\Blueprint;
/**
* Class ChangesForV477.
* @codeCoverageIgnore
*/
class ChangesForV477 extends Migration
{

View File

@@ -27,6 +27,7 @@ use Illuminate\Database\Schema\Blueprint;
/**
* Class ChangesForV479.
* @codeCoverageIgnore
*/
class ChangesForV479 extends Migration
{

View File

@@ -26,6 +26,10 @@ use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
/**
* Class ChangesForV4710
* @codeCoverageIgnore
*/
class ChangesForV4710 extends Migration
{
/**

View File

@@ -26,6 +26,10 @@ use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
/**
* Class ChangesForV4711
* @codeCoverageIgnore
*/
class ChangesForV4711 extends Migration
{
/**

View File

@@ -27,6 +27,7 @@ use Illuminate\Support\Facades\Schema;
/**
* Class ChangesForV4712.
* @codeCoverageIgnore
*/
class ChangesForV4712 extends Migration
{

View File

@@ -27,6 +27,7 @@ use Illuminate\Support\Facades\Schema;
/**
* Class FixLdapConfiguration.
* @codeCoverageIgnore
*/
class FixLdapConfiguration extends Migration
{

View File

@@ -26,6 +26,7 @@ use Illuminate\Database\Schema\Blueprint;
/**
* Class ChangesForV480.
* @codeCoverageIgnore
*/
class ChangesForV480 extends Migration
{

View File

@@ -28,6 +28,7 @@ use Illuminate\Support\Facades\Schema;
/**
* Class MakeLocationsTable.
* @codeCoverageIgnore
*/
class MakeLocationsTable extends Migration
{

View File

@@ -28,6 +28,7 @@ use Illuminate\Database\Schema\Blueprint;
/**
* Class ChangesForV520.
* @codeCoverageIgnore
*/
class ChangesForV520 extends Migration
{

View File

@@ -27,6 +27,7 @@ use Illuminate\Database\Schema\Blueprint;
/**
* Class ChangesForV530
* @codeCoverageIgnore
*/
class ChangesForV530 extends Migration
{

View File

@@ -28,6 +28,7 @@ use Illuminate\Support\Facades\Schema;
/**
* Class ChangesForV530a
* @codeCoverageIgnore
*/
class ChangesForV530a extends Migration
{

View File

@@ -7,6 +7,7 @@ use Illuminate\Support\Facades\Schema;
/**
* Class ChangesForV540
* @codeCoverageIgnore
*/
class ChangesForV540 extends Migration
{

View File

@@ -1626,20 +1626,12 @@
}
},
"axios": {
"version": "0.20.0",
"resolved": "https://registry.npmjs.org/axios/-/axios-0.20.0.tgz",
"integrity": "sha512-ANA4rr2BDcmmAQLOKft2fufrtuvlqR+cXNNinUmvfeSNCOF98PZL+7M/v1zIdGo7OLjEA9J2gXJL+j4zGsl0bA==",
"version": "0.21.0",
"resolved": "https://registry.npmjs.org/axios/-/axios-0.21.0.tgz",
"integrity": "sha512-fmkJBknJKoZwem3/IKSSLpkdNXZeBu5Q7GA/aRsr2btgrptmSCxi2oFjZHqGdK9DoTil9PIHlPIZw2EcRJXRvw==",
"dev": true,
"requires": {
"follow-redirects": "^1.10.0"
},
"dependencies": {
"follow-redirects": {
"version": "1.13.0",
"resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.13.0.tgz",
"integrity": "sha512-aq6gF1BEKje4a9i9+5jimNFIpq4Q1WiwBToeRK5NvZBd/TRsmW8BsJfOEGkr76TbOyPVD3OVDN910EcUNtRYEA==",
"dev": true
}
}
},
"babel-code-frame": {
@@ -9309,9 +9301,9 @@
}
},
"vue-router": {
"version": "3.4.7",
"resolved": "https://registry.npmjs.org/vue-router/-/vue-router-3.4.7.tgz",
"integrity": "sha512-CbHXue5BLrDivOk5O4eZ0WT4Yj8XwdXa4kCnsEIOzYUPF/07ZukayA2jGxDCJxLc9SgVQX9QX0OuGOwGlVB4Qg=="
"version": "3.4.8",
"resolved": "https://registry.npmjs.org/vue-router/-/vue-router-3.4.8.tgz",
"integrity": "sha512-3BsR84AqarcmweXjItxw3jwQsiYNssYg090yi4rlzTnCJxmHtkyCvhNz9Z7qRSOkmiV485KkUCReTp5AjNY4wg=="
},
"vue-style-loader": {
"version": "4.1.2",

View File

@@ -10,7 +10,7 @@
"production": "cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --no-progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js"
},
"devDependencies": {
"axios": "^0.20",
"axios": "^0.21",
"cross-env": "^7.0",
"laravel-mix": "^5.0.7",
"laravel-mix-bundle-analyzer": "^1.0.5",
@@ -34,6 +34,6 @@
"overlayscrollbars": "^1.13.0",
"popper.js": "^1.16.1",
"vue-chartjs": "^3.5.1",
"vue-router": "^3.4.7"
"vue-router": "^3.4.8"
}
}

File diff suppressed because one or more lines are too long

View File

@@ -5,7 +5,7 @@
*/
/*!
* vue-router v3.4.7
* vue-router v3.4.8
* (c) 2020 Evan You
* @license MIT
*/

Some files were not shown because too many files have changed in this diff Show More