Code cleanup.

This commit is contained in:
James Cole
2016-05-15 18:36:40 +02:00
parent 260b611293
commit 962965b5b7
53 changed files with 55 additions and 203 deletions

View File

@@ -10,7 +10,6 @@
namespace FireflyIII\Crud\Split; namespace FireflyIII\Crud\Split;
use FireflyIII\Models\Transaction;
use FireflyIII\Models\TransactionJournal; use FireflyIII\Models\TransactionJournal;
use Illuminate\Support\Collection; use Illuminate\Support\Collection;

View File

@@ -14,7 +14,6 @@ namespace FireflyIII\Events;
use Carbon\Carbon; use Carbon\Carbon;
use FireflyIII\Models\BudgetLimit; use FireflyIII\Models\BudgetLimit;
use Illuminate\Queue\SerializesModels; use Illuminate\Queue\SerializesModels;
use Log;
/** /**
* Class BudgetLimitStored * Class BudgetLimitStored
@@ -40,7 +39,6 @@ class BudgetLimitStored extends Event
*/ */
public function __construct(BudgetLimit $budgetLimit, Carbon $end) public function __construct(BudgetLimit $budgetLimit, Carbon $end)
{ {
Log::debug('Created new BudgetLimitStored.');
// //
$this->budgetLimit = $budgetLimit; $this->budgetLimit = $budgetLimit;
$this->end = $end; $this->end = $end;

View File

@@ -14,7 +14,6 @@ namespace FireflyIII\Events;
use Carbon\Carbon; use Carbon\Carbon;
use FireflyIII\Models\BudgetLimit; use FireflyIII\Models\BudgetLimit;
use Illuminate\Queue\SerializesModels; use Illuminate\Queue\SerializesModels;
use Log;
/** /**
* Class BudgetLimitUpdated * Class BudgetLimitUpdated
@@ -40,7 +39,6 @@ class BudgetLimitUpdated extends Event
*/ */
public function __construct(BudgetLimit $budgetLimit, Carbon $end) public function __construct(BudgetLimit $budgetLimit, Carbon $end)
{ {
Log::debug('Created new BudgetLimitUpdated.');
// //
$this->budgetLimit = $budgetLimit; $this->budgetLimit = $budgetLimit;
$this->end = $end; $this->end = $end;

View File

@@ -12,7 +12,6 @@ namespace FireflyIII\Events;
use FireflyIII\Models\TransactionJournal; use FireflyIII\Models\TransactionJournal;
use Illuminate\Queue\SerializesModels; use Illuminate\Queue\SerializesModels;
use Log;
/** /**
* Class TransactionJournalStored * Class TransactionJournalStored
@@ -35,7 +34,6 @@ class TransactionJournalStored extends Event
*/ */
public function __construct(TransactionJournal $journal, int $piggyBankId) public function __construct(TransactionJournal $journal, int $piggyBankId)
{ {
Log::debug('Created new TransactionJournalStored.');
// //
$this->journal = $journal; $this->journal = $journal;
$this->piggyBankId = $piggyBankId; $this->piggyBankId = $piggyBankId;

View File

@@ -5,7 +5,6 @@ namespace FireflyIII\Events;
use FireflyIII\Models\TransactionJournal; use FireflyIII\Models\TransactionJournal;
use Illuminate\Queue\SerializesModels; use Illuminate\Queue\SerializesModels;
use Log;
/** /**
* Class TransactionJournalUpdated * Class TransactionJournalUpdated
@@ -26,7 +25,6 @@ class TransactionJournalUpdated extends Event
*/ */
public function __construct(TransactionJournal $journal) public function __construct(TransactionJournal $journal)
{ {
Log::debug('Created new TransactionJournalUpdated');
// //
$this->journal = $journal; $this->journal = $journal;
} }

View File

@@ -69,7 +69,6 @@ class AttachmentCollector extends BasicCollector implements CollectorInterface
// put the explanation string in a file and attach it as well. // put the explanation string in a file and attach it as well.
$file = $this->job->key . '-Source of all your attachments explained.txt'; $file = $this->job->key . '-Source of all your attachments explained.txt';
$this->exportDisk->put($file, $this->explanationString); $this->exportDisk->put($file, $this->explanationString);
Log::debug('Also put explanation file "' . $file . '" in the zip.');
$this->getFiles()->push($file); $this->getFiles()->push($file);
return true; return true;
@@ -104,14 +103,12 @@ class AttachmentCollector extends BasicCollector implements CollectorInterface
private function exportAttachment(Attachment $attachment): bool private function exportAttachment(Attachment $attachment): bool
{ {
$file = $attachment->fileName(); $file = $attachment->fileName();
Log::debug('Original file is at "' . $file . '".');
if ($this->uploadDisk->exists($file)) { if ($this->uploadDisk->exists($file)) {
try { try {
$decrypted = Crypt::decrypt($this->uploadDisk->get($file)); $decrypted = Crypt::decrypt($this->uploadDisk->get($file));
$exportFile = $this->exportFileName($attachment); $exportFile = $this->exportFileName($attachment);
$this->exportDisk->put($exportFile, $decrypted); $this->exportDisk->put($exportFile, $decrypted);
$this->getFiles()->push($exportFile); $this->getFiles()->push($exportFile);
Log::debug('Stored file content in new file "' . $exportFile . '", which will be in the final zip file.');
// explain: // explain:
$this->explain($attachment); $this->explain($attachment);
@@ -144,8 +141,6 @@ class AttachmentCollector extends BasicCollector implements CollectorInterface
{ {
$attachments = $this->repository->get(); $attachments = $this->repository->get();
Log::debug('Found ' . $attachments->count() . ' attachments.');
return $attachments; return $attachments;
} }
} }

View File

@@ -53,7 +53,6 @@ class UploadCollector extends BasicCollector implements CollectorInterface
{ {
// grab upload directory. // grab upload directory.
$files = $this->uploadDisk->files(); $files = $this->uploadDisk->files();
Log::debug('Found ' . count($files) . ' files in the upload directory.');
foreach ($files as $entry) { foreach ($files as $entry) {
$this->processOldUpload($entry); $this->processOldUpload($entry);
@@ -86,11 +85,9 @@ class UploadCollector extends BasicCollector implements CollectorInterface
{ {
$len = strlen($this->expected); $len = strlen($this->expected);
if (substr($entry, 0, $len) === $this->expected) { if (substr($entry, 0, $len) === $this->expected) {
Log::debug($entry . ' is part of this users original uploads.');
return true; return true;
} }
Log::debug($entry . ' is not part of this users original uploads.');
return false; return false;
} }
@@ -113,7 +110,6 @@ class UploadCollector extends BasicCollector implements CollectorInterface
// continue with file: // continue with file:
$date = $this->getOriginalUploadDate($entry); $date = $this->getOriginalUploadDate($entry);
$file = $this->job->key . '-Old CSV import dated ' . $date . '.csv'; $file = $this->job->key . '-Old CSV import dated ' . $date . '.csv';
Log::debug('Will put "' . $file . '" in the zip file.');
$this->exportDisk->put($file, $content); $this->exportDisk->put($file, $content);
$this->getFiles()->push($file); $this->getFiles()->push($file);
} }

View File

@@ -12,7 +12,6 @@ namespace FireflyIII\Export;
use FireflyIII\Export\Entry\Entry; use FireflyIII\Export\Entry\Entry;
use FireflyIII\Models\ExportJob; use FireflyIII\Models\ExportJob;
use Log;
use Storage; use Storage;
/** /**
@@ -58,8 +57,6 @@ class ConfigurationFile
$configuration['roles'][] = $types[$field]; $configuration['roles'][] = $types[$field];
} }
$file = $this->job->key . '-configuration.json'; $file = $this->job->key . '-configuration.json';
Log::debug('Created JSON config file.');
Log::debug('Will put "' . $file . '" in the ZIP file.');
$this->exportDisk->put($file, json_encode($configuration, JSON_PRETTY_PRINT)); $this->exportDisk->put($file, json_encode($configuration, JSON_PRETTY_PRINT));
return $file; return $file;

View File

@@ -19,7 +19,6 @@ use FireflyIII\Models\TransactionJournal;
use FireflyIII\Repositories\Journal\JournalRepositoryInterface; use FireflyIII\Repositories\Journal\JournalRepositoryInterface;
use Illuminate\Filesystem\FilesystemAdapter; use Illuminate\Filesystem\FilesystemAdapter;
use Illuminate\Support\Collection; use Illuminate\Support\Collection;
use Log;
use Storage; use Storage;
use ZipArchive; use ZipArchive;
@@ -97,14 +96,6 @@ class Processor
$repository = app(JournalRepositoryInterface::class); $repository = app(JournalRepositoryInterface::class);
$this->journals = $repository->getJournalsInRange($this->accounts, $this->settings['startDate'], $this->settings['endDate']); $this->journals = $repository->getJournalsInRange($this->accounts, $this->settings['startDate'], $this->settings['endDate']);
Log::debug(
'Collected ' .
$this->journals->count() . ' journals (between ' .
$this->settings['startDate']->format('Y-m-d') . ' and ' .
$this->settings['endDate']->format('Y-m-d')
. ').'
);
return true; return true;
} }
@@ -133,7 +124,6 @@ class Processor
$this->exportEntries->push(Entry::fromJournal($journal)); $this->exportEntries->push(Entry::fromJournal($journal));
$count++; $count++;
} }
Log::debug('Converted ' . $count . ' journals to "Entry" objects.');
return true; return true;
} }
@@ -158,7 +148,6 @@ class Processor
$zip = new ZipArchive; $zip = new ZipArchive;
$file = $this->job->key . '.zip'; $file = $this->job->key . '.zip';
$fullPath = storage_path('export') . '/' . $file; $fullPath = storage_path('export') . '/' . $file;
Log::debug('Will create zip file at ' . $fullPath);
if ($zip->open($fullPath, ZipArchive::CREATE) !== true) { if ($zip->open($fullPath, ZipArchive::CREATE) !== true) {
throw new FireflyException('Cannot store zip file.'); throw new FireflyException('Cannot store zip file.');
@@ -170,7 +159,6 @@ class Processor
$zipFileName = str_replace($this->job->key . '-', '', $entry); $zipFileName = str_replace($this->job->key . '-', '', $entry);
$result = $zip->addFromString($zipFileName, $disk->get($entry)); $result = $zip->addFromString($zipFileName, $disk->get($entry));
if (!$result) { if (!$result) {
Log::error('Could not add "' . $entry . '" into zip file as "' . $zipFileName . '".');
} }
} }
@@ -178,7 +166,6 @@ class Processor
// delete the files: // delete the files:
$this->deleteFiles($disk); $this->deleteFiles($disk);
Log::debug('Done!');
return true; return true;
} }
@@ -190,11 +177,9 @@ class Processor
{ {
$exporterClass = config('firefly.export_formats.' . $this->exportFormat); $exporterClass = config('firefly.export_formats.' . $this->exportFormat);
$exporter = app($exporterClass, [$this->job]); $exporter = app($exporterClass, [$this->job]);
Log::debug('Going to export ' . $this->exportEntries->count() . ' export entries into ' . $this->exportFormat . ' format.');
$exporter->setEntries($this->exportEntries); $exporter->setEntries($this->exportEntries);
$exporter->run(); $exporter->run();
$this->files->push($exporter->getFileName()); $this->files->push($exporter->getFileName());
Log::debug('Added "' . $exporter->getFileName() . '" to the list of files to include in the zip.');
return true; return true;
} }
@@ -212,9 +197,7 @@ class Processor
*/ */
private function deleteFiles(FilesystemAdapter $disk) private function deleteFiles(FilesystemAdapter $disk)
{ {
Log::debug('Class of $disk: ' . get_class($disk));
foreach ($this->getFiles() as $file) { foreach ($this->getFiles() as $file) {
Log::debug('Will now delete file "' . $file . '".');
$disk->delete($file); $disk->delete($file);
} }
} }

View File

@@ -5,7 +5,6 @@ namespace FireflyIII\Generator\Chart\Account;
use Carbon\Carbon; use Carbon\Carbon;
use FireflyIII\Models\Account; use FireflyIII\Models\Account;
use Illuminate\Support\Collection; use Illuminate\Support\Collection;
use Steam;
/** /**
* Class ChartJsAccountChartGenerator * Class ChartJsAccountChartGenerator
@@ -83,7 +82,7 @@ class ChartJsAccountChartGenerator implements AccountChartGeneratorInterface
*/ */
public function single(Account $account, array $labels, array $dataSet): array public function single(Account $account, array $labels, array $dataSet): array
{ {
$data = [ $data = [
'count' => 1, 'count' => 1,
'labels' => $labels, 'labels' => $labels,
'datasets' => [ 'datasets' => [
@@ -93,6 +92,7 @@ class ChartJsAccountChartGenerator implements AccountChartGeneratorInterface
], ],
], ],
]; ];
return $data; return $data;
} }

View File

@@ -13,7 +13,6 @@ namespace FireflyIII\Handlers\Events;
use FireflyIII\Events\UserRegistration; use FireflyIII\Events\UserRegistration;
use FireflyIII\Repositories\User\UserRepositoryInterface; use FireflyIII\Repositories\User\UserRepositoryInterface;
use Log;
/** /**
* Class AttachUserRole * Class AttachUserRole
@@ -38,13 +37,11 @@ class AttachUserRole
*/ */
public function handle(UserRegistration $event) public function handle(UserRegistration $event)
{ {
Log::debug('Trigger attachuserrole');
/** @var UserRepositoryInterface $repository */ /** @var UserRepositoryInterface $repository */
$repository = app(UserRepositoryInterface::class); $repository = app(UserRepositoryInterface::class);
// first user ever? // first user ever?
if ($repository->count() == 1) { if ($repository->count() == 1) {
Log::debug('Will attach role.');
$repository->attachRole($event->user, 'owner'); $repository->attachRole($event->user, 'owner');
} }
} }

View File

@@ -17,7 +17,6 @@ use FireflyIII\Models\RuleGroup;
use FireflyIII\Rules\Processor; use FireflyIII\Rules\Processor;
use FireflyIII\User; use FireflyIII\User;
use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\Auth;
use Log;
/** /**
* Class FireRulesForStore * Class FireRulesForStore
@@ -36,7 +35,6 @@ class FireRulesForStore
*/ */
public function handle(TransactionJournalStored $event): bool public function handle(TransactionJournalStored $event): bool
{ {
Log::debug('Now running FireRulesForStore because TransactionJournalStored fired.');
// get all the user's rule groups, with the rules, order by 'order'. // get all the user's rule groups, with the rules, order by 'order'.
/** @var User $user */ /** @var User $user */
$user = Auth::user(); $user = Auth::user();
@@ -44,7 +42,6 @@ class FireRulesForStore
// //
/** @var RuleGroup $group */ /** @var RuleGroup $group */
foreach ($groups as $group) { foreach ($groups as $group) {
Log::debug('Now processing group "' . $group->title . '".');
$rules = $group->rules() $rules = $group->rules()
->leftJoin('rule_triggers', 'rules.id', '=', 'rule_triggers.rule_id') ->leftJoin('rule_triggers', 'rules.id', '=', 'rule_triggers.rule_id')
->where('rule_triggers.trigger_type', 'user_action') ->where('rule_triggers.trigger_type', 'user_action')
@@ -54,7 +51,6 @@ class FireRulesForStore
/** @var Rule $rule */ /** @var Rule $rule */
foreach ($rules as $rule) { foreach ($rules as $rule) {
Log::debug('Now handling rule #' . $rule->id . ' (' . $rule->title . ')');
$processor = Processor::make($rule); $processor = Processor::make($rule);
$processor->handleTransactionJournal($event->journal); $processor->handleTransactionJournal($event->journal);

View File

@@ -16,7 +16,6 @@ use FireflyIII\Models\Rule;
use FireflyIII\Models\RuleGroup; use FireflyIII\Models\RuleGroup;
use FireflyIII\Rules\Processor; use FireflyIII\Rules\Processor;
use FireflyIII\User; use FireflyIII\User;
use Log;
/** /**
* Class FireRulesForUpdate * Class FireRulesForUpdate
@@ -34,7 +33,6 @@ class FireRulesForUpdate
*/ */
public function handle(TransactionJournalUpdated $event): bool public function handle(TransactionJournalUpdated $event): bool
{ {
Log::debug('Now running FireRulesForUpdate because TransactionJournalUpdated fired.');
// get all the user's rule groups, with the rules, order by 'order'. // get all the user's rule groups, with the rules, order by 'order'.
/** @var User $user */ /** @var User $user */
$user = Auth::user(); $user = Auth::user();
@@ -42,7 +40,6 @@ class FireRulesForUpdate
// //
/** @var RuleGroup $group */ /** @var RuleGroup $group */
foreach ($groups as $group) { foreach ($groups as $group) {
Log::debug('Now processing group "' . $group->title . '".');
$rules = $group->rules() $rules = $group->rules()
->leftJoin('rule_triggers', 'rules.id', '=', 'rule_triggers.rule_id') ->leftJoin('rule_triggers', 'rules.id', '=', 'rule_triggers.rule_id')
->where('rule_triggers.trigger_type', 'user_action') ->where('rule_triggers.trigger_type', 'user_action')
@@ -51,9 +48,6 @@ class FireRulesForUpdate
->get(['rules.*']); ->get(['rules.*']);
/** @var Rule $rule */ /** @var Rule $rule */
foreach ($rules as $rule) { foreach ($rules as $rule) {
Log::debug('Now handling rule #' . $rule->id . ' (' . $rule->title . ')');
Log::debug('Now handling rule #' . $rule->id . ' (' . $rule->title . ')');
$processor = Processor::make($rule); $processor = Processor::make($rule);
$processor->handleTransactionJournal($event->journal); $processor->handleTransactionJournal($event->journal);

View File

@@ -73,10 +73,8 @@ class UserConfirmation
*/ */
private function doConfirm(User $user, string $ipAddress) private function doConfirm(User $user, string $ipAddress)
{ {
Log::debug('Trigger UserConfirmation::doConfirm');
$confirmAccount = env('MUST_CONFIRM_ACCOUNT', false); $confirmAccount = env('MUST_CONFIRM_ACCOUNT', false);
if ($confirmAccount === false) { if ($confirmAccount === false) {
Log::debug('Confirm account is false, so user will be auto-confirmed.');
Preferences::setForUser($user, 'user_confirmed', true); Preferences::setForUser($user, 'user_confirmed', true);
Preferences::setForUser($user, 'user_confirmed_last_mail', 0); Preferences::setForUser($user, 'user_confirmed_last_mail', 0);
Preferences::mark(); Preferences::mark();
@@ -90,7 +88,6 @@ class UserConfirmation
Preferences::setForUser($user, 'user_confirmed_last_mail', time()); Preferences::setForUser($user, 'user_confirmed_last_mail', time());
Preferences::setForUser($user, 'user_confirmed_code', $code); Preferences::setForUser($user, 'user_confirmed_code', $code);
try { try {
Log::debug('Now in try block for user email message thing to ' . $email . '.');
Mail::send( Mail::send(
['emails.confirm-account-html', 'emails.confirm-account'], ['route' => $route, 'ip' => $ipAddress], ['emails.confirm-account-html', 'emails.confirm-account'], ['route' => $route, 'ip' => $ipAddress],
function (Message $message) use ($email) { function (Message $message) use ($email) {
@@ -100,10 +97,8 @@ class UserConfirmation
} catch (Swift_TransportException $e) { } catch (Swift_TransportException $e) {
Log::error($e->getMessage()); Log::error($e->getMessage());
} catch (Exception $e) { } catch (Exception $e) {
Log::debug('Caught general exception.');
Log::error($e->getMessage()); Log::error($e->getMessage());
} }
Log::debug('Finished mail handling for activation.');
return; return;
} }

View File

@@ -251,6 +251,7 @@ class AttachmentHelper implements AttachmentHelperInterface
$this->processFile($entry, $model); $this->processFile($entry, $model);
} }
} }
return true; return true;
} }

View File

@@ -6,7 +6,6 @@ use Auth;
use Carbon\Carbon; use Carbon\Carbon;
use FireflyIII\Models\Account; use FireflyIII\Models\Account;
use FireflyIII\Repositories\Account\AccountRepositoryInterface; use FireflyIII\Repositories\Account\AccountRepositoryInterface;
use Log;
/** /**
* Class AssetAccountIban * Class AssetAccountIban
@@ -27,7 +26,6 @@ class AssetAccountIban extends BasicConverter implements ConverterInterface
// is mapped? Then it's easy! // is mapped? Then it's easy!
if (isset($this->mapped[$this->index][$this->value])) { if (isset($this->mapped[$this->index][$this->value])) {
$account = $repository->find(intval($this->mapped[$this->index][$this->value])); $account = $repository->find(intval($this->mapped[$this->index][$this->value]));
Log::debug('Found mapped account for value "' . $this->value . '". It is account #' . $account->id);
return $account; return $account;
} }
@@ -54,13 +52,11 @@ class AssetAccountIban extends BasicConverter implements ConverterInterface
/** @var Account $entry */ /** @var Account $entry */
foreach ($set as $entry) { foreach ($set as $entry) {
if ($entry->iban == $this->value) { if ($entry->iban == $this->value) {
Log::debug('Found an account with the same IBAN ("' . $this->value . '"). It is account #' . $entry->id);
return $entry; return $entry;
} }
} }
Log::debug('Found no account with the same IBAN ("' . $this->value . '"), so will create a new one.');
// create it if doesn't exist. // create it if doesn't exist.
$accountData = [ $accountData = [

View File

@@ -108,7 +108,6 @@ class Importer
foreach ($this->data->getReader() as $index => $row) { foreach ($this->data->getReader() as $index => $row) {
if ($this->parseRow($index)) { if ($this->parseRow($index)) {
Log::debug('--- Importing row ' . $index);
$this->rows++; $this->rows++;
$result = $this->importRow($row); $result = $this->importRow($row);
if (!($result instanceof TransactionJournal)) { if (!($result instanceof TransactionJournal)) {
@@ -119,7 +118,6 @@ class Importer
$this->journals->push($result); $this->journals->push($result);
event(new TransactionJournalStored($result, 0)); event(new TransactionJournalStored($result, 0));
} }
Log::debug('---');
} }
} }
} }
@@ -221,7 +219,6 @@ class Importer
$class = config('csv.roles.' . $role . '.converter'); $class = config('csv.roles.' . $role . '.converter');
$field = config('csv.roles.' . $role . '.field'); $field = config('csv.roles.' . $role . '.field');
Log::debug('Column #' . $index . ' (role: ' . $role . ') : converter ' . $class . ' stores its data into field ' . $field . ':');
// here would be the place where preprocessors would fire. // here would be the place where preprocessors would fire.
@@ -275,7 +272,6 @@ class Importer
if ($specifix->getProcessorType() == SpecifixInterface::POST_PROCESSOR) { if ($specifix->getProcessorType() == SpecifixInterface::POST_PROCESSOR) {
$specifix->setData($this->importData); $specifix->setData($this->importData);
$specifix->setRow($this->importRow); $specifix->setRow($this->importRow);
Log::debug('Now post-process specifix named ' . $className . ':');
$this->importData = $specifix->fix(); $this->importData = $specifix->fix();
} }
} }
@@ -287,7 +283,6 @@ class Importer
$postProcessor = app('FireflyIII\Helpers\Csv\PostProcessing\\' . $className); $postProcessor = app('FireflyIII\Helpers\Csv\PostProcessing\\' . $className);
$array = $this->importData ?? []; $array = $this->importData ?? [];
$postProcessor->setData($array); $postProcessor->setData($array);
Log::debug('Now post-process processor named ' . $className . ':');
$this->importData = $postProcessor->process(); $this->importData = $postProcessor->process();
} }

View File

@@ -7,7 +7,6 @@ use Carbon\Carbon;
use FireflyIII\Models\Account; use FireflyIII\Models\Account;
use FireflyIII\Models\AccountType; use FireflyIII\Models\AccountType;
use FireflyIII\Repositories\Account\AccountRepositoryInterface; use FireflyIII\Repositories\Account\AccountRepositoryInterface;
use Log;
use Validator; use Validator;
/** /**
@@ -207,7 +206,6 @@ class AssetAccount implements PostProcessorInterface
$accounts = Auth::user()->accounts()->where('account_type_id', $accountType->id)->get(); $accounts = Auth::user()->accounts()->where('account_type_id', $accountType->id)->get();
foreach ($accounts as $entry) { foreach ($accounts as $entry) {
if ($entry->name == $this->data['asset-account-name']) { if ($entry->name == $this->data['asset-account-name']) {
Log::debug('Found an asset account with this name (#' . $entry->id . ': ******)');
return $entry; return $entry;
} }
@@ -239,7 +237,6 @@ class AssetAccount implements PostProcessorInterface
foreach ($accounts as $entry) { foreach ($accounts as $entry) {
$metaFieldValue = $entry->getMeta('accountNumber'); $metaFieldValue = $entry->getMeta('accountNumber');
if ($metaFieldValue === $accountNumber && $metaFieldValue !== '') { if ($metaFieldValue === $accountNumber && $metaFieldValue !== '') {
Log::debug('Found an asset account with this account number (#' . $entry->id . ')');
return $entry; return $entry;
} }

View File

@@ -5,7 +5,6 @@ namespace FireflyIII\Helpers\Csv\PostProcessing;
use Auth; use Auth;
use FireflyIII\Models\Account; use FireflyIII\Models\Account;
use FireflyIII\Models\AccountType; use FireflyIII\Models\AccountType;
use Log;
use Validator; use Validator;
/** /**
@@ -65,7 +64,6 @@ class OpposingAccount implements PostProcessorInterface
$validator = Validator::make($check, $rules); $validator = Validator::make($check, $rules);
if (is_string($iban) && strlen($iban) > 0 && !$validator->fails()) { if (is_string($iban) && strlen($iban) > 0 && !$validator->fails()) {
Log::debug('OpposingAccountPostProcession: opposing-account-iban is a string (******).');
$this->data['opposing-account-object'] = $this->parseIbanString(); $this->data['opposing-account-object'] = $this->parseIbanString();
return $this->data; return $this->data;
@@ -80,13 +78,11 @@ class OpposingAccount implements PostProcessorInterface
protected function checkIdNameObject() protected function checkIdNameObject()
{ {
if ($this->data['opposing-account-id'] instanceof Account) { // first priority. try to find the account based on ID, if any if ($this->data['opposing-account-id'] instanceof Account) { // first priority. try to find the account based on ID, if any
Log::debug('OpposingAccountPostProcession: opposing-account-id is an Account.');
$this->data['opposing-account-object'] = $this->data['opposing-account-id']; $this->data['opposing-account-object'] = $this->data['opposing-account-id'];
return $this->data; return $this->data;
} }
if ($this->data['opposing-account-iban'] instanceof Account) { // second: try to find the account based on IBAN, if any. if ($this->data['opposing-account-iban'] instanceof Account) { // second: try to find the account based on IBAN, if any.
Log::debug('OpposingAccountPostProcession: opposing-account-iban is an Account.');
$this->data['opposing-account-object'] = $this->data['opposing-account-iban']; $this->data['opposing-account-object'] = $this->data['opposing-account-iban'];
return $this->data; return $this->data;
@@ -101,7 +97,6 @@ class OpposingAccount implements PostProcessorInterface
protected function checkNameString() protected function checkNameString()
{ {
if ($this->data['opposing-account-name'] instanceof Account) { // third: try to find account based on name, if any. if ($this->data['opposing-account-name'] instanceof Account) { // third: try to find account based on name, if any.
Log::debug('OpposingAccountPostProcession: opposing-account-name is an Account.');
$this->data['opposing-account-object'] = $this->data['opposing-account-name']; $this->data['opposing-account-object'] = $this->data['opposing-account-name'];
return $this->data; return $this->data;
@@ -135,7 +130,6 @@ class OpposingAccount implements PostProcessorInterface
'active' => true, 'active' => true,
] ]
); );
Log::debug('OpposingAccountPostProcession: created a new account.');
return $account; return $account;
} }
@@ -169,7 +163,6 @@ class OpposingAccount implements PostProcessorInterface
$accounts = Auth::user()->accounts()->get(); $accounts = Auth::user()->accounts()->get();
foreach ($accounts as $entry) { foreach ($accounts as $entry) {
if ($entry->iban == $this->data['opposing-account-iban']) { if ($entry->iban == $this->data['opposing-account-iban']) {
Log::debug('OpposingAccountPostProcession: opposing-account-iban matches an Account.');
return $entry; return $entry;
} }
@@ -189,7 +182,6 @@ class OpposingAccount implements PostProcessorInterface
$accounts = Auth::user()->accounts()->where('account_type_id', $accountType->id)->get(); $accounts = Auth::user()->accounts()->where('account_type_id', $accountType->id)->get();
foreach ($accounts as $entry) { foreach ($accounts as $entry) {
if ($entry->name == $this->data['opposing-account-name']) { if ($entry->name == $this->data['opposing-account-name']) {
Log::debug('Found an account with this name (#' . $entry->id . ': ******)');
return $entry; return $entry;
} }

View File

@@ -2,8 +2,6 @@
declare(strict_types = 1); declare(strict_types = 1);
namespace FireflyIII\Helpers\Csv\Specifix; namespace FireflyIII\Helpers\Csv\Specifix;
use Log;
/** /**
* Parses the description from txt files for ABN AMRO bank accounts. * Parses the description from txt files for ABN AMRO bank accounts.
* *
@@ -71,7 +69,6 @@ class AbnAmroDescription extends Specifix implements SpecifixInterface
{ {
// See if the current description is formatted in ABN AMRO format // See if the current description is formatted in ABN AMRO format
if (preg_match('/ABN AMRO.{24} (.*)/', $this->data['description'], $matches)) { if (preg_match('/ABN AMRO.{24} (.*)/', $this->data['description'], $matches)) {
Log::debug('AbnAmroSpecifix: Description is structured as costs from ABN AMRO itself.');
$this->data['opposing-account-name'] = 'ABN AMRO'; $this->data['opposing-account-name'] = 'ABN AMRO';
$this->data['description'] = $matches[1]; $this->data['description'] = $matches[1];
@@ -91,7 +88,6 @@ class AbnAmroDescription extends Specifix implements SpecifixInterface
{ {
// See if the current description is formatted in GEA/BEA format // See if the current description is formatted in GEA/BEA format
if (preg_match('/([BG]EA) +(NR:[a-zA-Z:0-9]+) +([0-9.\/]+) +([^,]*)/', $this->data['description'], $matches)) { if (preg_match('/([BG]EA) +(NR:[a-zA-Z:0-9]+) +([0-9.\/]+) +([^,]*)/', $this->data['description'], $matches)) {
Log::debug('AbnAmroSpecifix: Description is structured as GEA or BEA format.');
// description and opposing account will be the same. // description and opposing account will be the same.
$this->data['opposing-account-name'] = $matches[4]; $this->data['opposing-account-name'] = $matches[4];
@@ -116,7 +112,6 @@ class AbnAmroDescription extends Specifix implements SpecifixInterface
{ {
// See if the current description is formatted as a SEPA plain description // See if the current description is formatted as a SEPA plain description
if (preg_match('/^SEPA(.{28})/', $this->data['description'], $matches)) { if (preg_match('/^SEPA(.{28})/', $this->data['description'], $matches)) {
Log::debug('AbnAmroSpecifix: Description is structured as SEPA plain description.');
$type = $matches[1]; $type = $matches[1];
$reference = ''; $reference = '';
@@ -130,7 +125,6 @@ class AbnAmroDescription extends Specifix implements SpecifixInterface
foreach ($matches as $match) { foreach ($matches as $match) {
$key = $match[1]; $key = $match[1];
$value = trim($match[2]); $value = trim($match[2]);
Log::debug('SEPA: ' . $key . ' - ' . $value);
switch (strtoupper($key)) { switch (strtoupper($key)) {
case 'OMSCHRIJVING': case 'OMSCHRIJVING':
$newDescription = $value; $newDescription = $value;
@@ -173,7 +167,6 @@ class AbnAmroDescription extends Specifix implements SpecifixInterface
{ {
// See if the current description is formatted in TRTP format // See if the current description is formatted in TRTP format
if (preg_match_all('!\/([A-Z]{3,4})\/([^/]*)!', $this->data['description'], $matches, PREG_SET_ORDER)) { if (preg_match_all('!\/([A-Z]{3,4})\/([^/]*)!', $this->data['description'], $matches, PREG_SET_ORDER)) {
Log::debug('AbnAmroSpecifix: Description is structured as TRTP format.');
$type = ''; $type = '';
$name = ''; $name = '';

View File

@@ -2,8 +2,6 @@
declare(strict_types = 1); declare(strict_types = 1);
namespace FireflyIII\Helpers\Csv\Specifix; namespace FireflyIII\Helpers\Csv\Specifix;
use Log;
/** /**
* Class RabobankDescription * Class RabobankDescription
* *
@@ -58,14 +56,10 @@ class RabobankDescription extends Specifix implements SpecifixInterface
*/ */
protected function rabobankFixEmptyOpposing() protected function rabobankFixEmptyOpposing()
{ {
Log::debug('RaboSpecifix: Opposing account name is "******".');
if (is_string($this->data['opposing-account-name']) && strlen($this->data['opposing-account-name']) == 0) { if (is_string($this->data['opposing-account-name']) && strlen($this->data['opposing-account-name']) == 0) {
Log::debug('RaboSpecifix: opp-name is zero length, changed to: "******"');
$this->data['opposing-account-name'] = $this->row[10]; $this->data['opposing-account-name'] = $this->row[10];
Log::debug('Description was: "******".');
$this->data['description'] = trim(str_replace($this->row[10], '', $this->data['description'])); $this->data['description'] = trim(str_replace($this->row[10], '', $this->data['description']));
Log::debug('Description is now: "******".');
} }
} }

View File

@@ -4,7 +4,6 @@ namespace FireflyIII\Helpers\Help;
use Cache; use Cache;
use League\CommonMark\CommonMarkConverter; use League\CommonMark\CommonMarkConverter;
use Log;
use Requests; use Requests;
use Route; use Route;
@@ -44,11 +43,9 @@ class Help implements HelpInterface
'title' => $title, 'title' => $title,
]; ];
Log::debug('Going to get from Github: ' . $uri);
$result = Requests::get($uri); $result = Requests::get($uri);
Log::debug('Status code was ' . $result->status_code . '.');
if ($result->status_code === 200) { if ($result->status_code === 200) {
$content['text'] = $result->body; $content['text'] = $result->body;
@@ -56,7 +53,6 @@ class Help implements HelpInterface
if (strlen(trim($content['text'])) == 0) { if (strlen(trim($content['text'])) == 0) {
Log::debug('No actual help text for this route (even though a page was found).');
$content['text'] = '<p>' . strval(trans('firefly.route_has_no_help')) . '</p>'; $content['text'] = '<p>' . strval(trans('firefly.route_has_no_help')) . '</p>';
} }
$converter = new CommonMarkConverter(); $converter = new CommonMarkConverter();

View File

@@ -17,18 +17,15 @@ use FireflyIII\Helpers\Collection\Balance;
use FireflyIII\Helpers\Collection\BalanceEntry; use FireflyIII\Helpers\Collection\BalanceEntry;
use FireflyIII\Helpers\Collection\BalanceHeader; use FireflyIII\Helpers\Collection\BalanceHeader;
use FireflyIII\Helpers\Collection\BalanceLine; use FireflyIII\Helpers\Collection\BalanceLine;
use FireflyIII\Models\Account;
use FireflyIII\Models\Budget; use FireflyIII\Models\Budget;
use FireflyIII\Models\Budget as BudgetModel; use FireflyIII\Models\Budget as BudgetModel;
use FireflyIII\Models\LimitRepetition; use FireflyIII\Models\LimitRepetition;
use FireflyIII\Models\Tag; use FireflyIII\Models\Tag;
use FireflyIII\Models\TransactionJournal;
use FireflyIII\Models\TransactionType; use FireflyIII\Models\TransactionType;
use FireflyIII\Repositories\Budget\BudgetRepositoryInterface; use FireflyIII\Repositories\Budget\BudgetRepositoryInterface;
use FireflyIII\Repositories\Tag\TagRepositoryInterface; use FireflyIII\Repositories\Tag\TagRepositoryInterface;
use Illuminate\Database\Query\JoinClause; use Illuminate\Database\Query\JoinClause;
use Illuminate\Support\Collection; use Illuminate\Support\Collection;
use Log;
/** /**
* Class BalanceReportHelper * Class BalanceReportHelper
@@ -67,19 +64,16 @@ class BalanceReportHelper implements BalanceReportHelperInterface
public function getBalanceReport(Carbon $start, Carbon $end, Collection $accounts): Balance public function getBalanceReport(Carbon $start, Carbon $end, Collection $accounts): Balance
{ {
$balance = new Balance; $balance = new Balance;
Log::debug('Build new report.');
// build a balance header: // build a balance header:
$header = new BalanceHeader; $header = new BalanceHeader;
$limitRepetitions = $this->budgetRepository->getAllBudgetLimitRepetitions($start, $end); $limitRepetitions = $this->budgetRepository->getAllBudgetLimitRepetitions($start, $end);
foreach ($accounts as $account) { foreach ($accounts as $account) {
$header->addAccount($account); $header->addAccount($account);
Log::debug('Add account #' . $account->id . ' to header.');
} }
/** @var LimitRepetition $repetition */ /** @var LimitRepetition $repetition */
foreach ($limitRepetitions as $repetition) { foreach ($limitRepetitions as $repetition) {
$budget = $this->budgetRepository->find($repetition->budget_id); $budget = $this->budgetRepository->find($repetition->budget_id);
Log::debug('Create and add balance line for budget #' . $budget->id);
$balance->addBalanceLine($this->createBalanceLine($budget, $repetition, $accounts)); $balance->addBalanceLine($this->createBalanceLine($budget, $repetition, $accounts));
} }
$noBudgetLine = $this->createNoBudgetLine($accounts, $start, $end); $noBudgetLine = $this->createNoBudgetLine($accounts, $start, $end);
@@ -155,7 +149,6 @@ class BalanceReportHelper implements BalanceReportHelperInterface
*/ */
private function createBalanceLine(BudgetModel $budget, LimitRepetition $repetition, Collection $accounts): BalanceLine private function createBalanceLine(BudgetModel $budget, LimitRepetition $repetition, Collection $accounts): BalanceLine
{ {
Log::debug('Create line for budget #' . $budget->id . ' and repetition #' . $repetition->id);
$line = new BalanceLine; $line = new BalanceLine;
$budget->amount = $repetition->amount; $budget->amount = $repetition->amount;
$line->setBudget($budget); $line->setBudget($budget);

View File

@@ -19,7 +19,6 @@ use FireflyIII\Models\LimitRepetition;
use FireflyIII\Models\TransactionJournal; use FireflyIII\Models\TransactionJournal;
use FireflyIII\Repositories\Budget\BudgetRepositoryInterface; use FireflyIII\Repositories\Budget\BudgetRepositoryInterface;
use Illuminate\Support\Collection; use Illuminate\Support\Collection;
use Log;
/** /**
* Class BudgetReportHelper * Class BudgetReportHelper
@@ -45,12 +44,10 @@ class BudgetReportHelper implements BudgetReportHelperInterface
/** @var Budget $budget */ /** @var Budget $budget */
foreach ($set as $budget) { foreach ($set as $budget) {
Log::debug('Now at budget #' . $budget->id . ' (' . $budget->name . ')');
$repetitions = $budget->limitrepetitions()->before($end)->after($start)->get(); $repetitions = $budget->limitrepetitions()->before($end)->after($start)->get();
// no repetition(s) for this budget: // no repetition(s) for this budget:
if ($repetitions->count() == 0) { if ($repetitions->count() == 0) {
Log::debug('Found zero repetitions.');
// spent for budget in time range: // spent for budget in time range:
$spent = $repository->spentInPeriod(new Collection([$budget]), $accounts, $start, $end); $spent = $repository->spentInPeriod(new Collection([$budget]), $accounts, $start, $end);
@@ -63,7 +60,6 @@ class BudgetReportHelper implements BudgetReportHelperInterface
} }
continue; continue;
} }
Log::debug('Found ' . $repetitions->count() . ' repetitions.');
// one or more repetitions for budget: // one or more repetitions for budget:
/** @var LimitRepetition $repetition */ /** @var LimitRepetition $repetition */
foreach ($repetitions as $repetition) { foreach ($repetitions as $repetition) {
@@ -72,7 +68,6 @@ class BudgetReportHelper implements BudgetReportHelperInterface
$budgetLine->setBudget($budget); $budgetLine->setBudget($budget);
$budgetLine->setRepetition($repetition); $budgetLine->setRepetition($repetition);
$expenses = $repository->spentInPeriod(new Collection([$budget]), $accounts, $repetition->startdate, $repetition->enddate); $expenses = $repository->spentInPeriod(new Collection([$budget]), $accounts, $repetition->startdate, $repetition->enddate);
Log::debug('Spent in p. [' . $repetition->startdate->format('Y-m-d') . '] to [' . $repetition->enddate->format('Y-m-d') . '] is ' . $expenses);
$left = bccomp(bcadd($repetition->amount, $expenses), '0') === 1 ? bcadd($repetition->amount, $expenses) : '0'; $left = bccomp(bcadd($repetition->amount, $expenses), '0') === 1 ? bcadd($repetition->amount, $expenses) : '0';
$spent = bccomp(bcadd($repetition->amount, $expenses), '0') === 1 ? $expenses : '0'; $spent = bccomp(bcadd($repetition->amount, $expenses), '0') === 1 ? $expenses : '0';

View File

@@ -13,7 +13,6 @@ use FireflyIII\Repositories\Budget\BudgetRepositoryInterface;
use Illuminate\Pagination\LengthAwarePaginator; use Illuminate\Pagination\LengthAwarePaginator;
use Illuminate\Support\Collection; use Illuminate\Support\Collection;
use Input; use Input;
use Log;
use Navigation; use Navigation;
use Preferences; use Preferences;
use Response; use Response;
@@ -193,7 +192,6 @@ class BudgetController extends Controller
/** @var LimitRepetition $repetition */ /** @var LimitRepetition $repetition */
foreach ($allRepetitions as $repetition) { foreach ($allRepetitions as $repetition) {
if ($repetition->budget_id == $budget->id) { if ($repetition->budget_id == $budget->id) {
Log::debug('Repetition #' . $repetition->id . ' with budget #' . $repetition->budget_id . ' (current = ' . $budget->id . ')');
if ($repetition->budgetLimit->repeat_freq == $repeatFreq if ($repetition->budgetLimit->repeat_freq == $repeatFreq
&& $repetition->startdate->format('Y-m-d') == $startAsString && $repetition->startdate->format('Y-m-d') == $startAsString
&& $repetition->enddate->format('Y-m-d') == $endAsString && $repetition->enddate->format('Y-m-d') == $endAsString

View File

@@ -53,7 +53,7 @@ class AccountController extends Controller
$cache->addProperty('expenseAccounts'); $cache->addProperty('expenseAccounts');
$cache->addProperty('accounts'); $cache->addProperty('accounts');
if ($cache->has()) { if ($cache->has()) {
return Response::json($cache->get()); return Response::json($cache->get());
} }
$accounts = $repository->getAccountsByType(['Expense account', 'Beneficiary account']); $accounts = $repository->getAccountsByType(['Expense account', 'Beneficiary account']);
@@ -105,7 +105,7 @@ class AccountController extends Controller
$cache->addProperty('frontpage'); $cache->addProperty('frontpage');
$cache->addProperty('accounts'); $cache->addProperty('accounts');
if ($cache->has()) { if ($cache->has()) {
return Response::json($cache->get()); return Response::json($cache->get());
} }
$frontPage = Preferences::get('frontPageAccounts', $repository->getAccountsByType([AccountType::DEFAULT, AccountType::ASSET])->pluck('id')->toArray()); $frontPage = Preferences::get('frontPageAccounts', $repository->getAccountsByType([AccountType::DEFAULT, AccountType::ASSET])->pluck('id')->toArray());
@@ -151,7 +151,7 @@ class AccountController extends Controller
$cache->addProperty('default'); $cache->addProperty('default');
$cache->addProperty($accounts); $cache->addProperty($accounts);
if ($cache->has()) { if ($cache->has()) {
return Response::json($cache->get()); return Response::json($cache->get());
} }
foreach ($accounts as $account) { foreach ($accounts as $account) {
@@ -196,7 +196,7 @@ class AccountController extends Controller
$cache->addProperty('single'); $cache->addProperty('single');
$cache->addProperty($account->id); $cache->addProperty($account->id);
if ($cache->has()) { if ($cache->has()) {
return Response::json($cache->get()); return Response::json($cache->get());
} }
$format = (string)trans('config.month_and_day'); $format = (string)trans('config.month_and_day');

View File

@@ -12,7 +12,6 @@ use FireflyIII\Models\TransactionJournal;
use FireflyIII\Repositories\Budget\BudgetRepositoryInterface; use FireflyIII\Repositories\Budget\BudgetRepositoryInterface;
use FireflyIII\Support\CacheProperties; use FireflyIII\Support\CacheProperties;
use Illuminate\Support\Collection; use Illuminate\Support\Collection;
use Log;
use Navigation; use Navigation;
use Preferences; use Preferences;
use Response; use Response;
@@ -67,7 +66,6 @@ class BudgetController extends Controller
$budgetCollection = new Collection([$budget]); $budgetCollection = new Collection([$budget]);
$last = Navigation::endOfX($last, $range, $final); // not to overshoot. $last = Navigation::endOfX($last, $range, $final); // not to overshoot.
$entries = new Collection; $entries = new Collection;
Log::debug('---- now at chart');
while ($first < $last) { while ($first < $last) {
// periodspecific dates: // periodspecific dates:
@@ -115,7 +113,6 @@ class BudgetController extends Controller
$entries = new Collection; $entries = new Collection;
$amount = $repetition->amount; $amount = $repetition->amount;
$budgetCollection = new Collection([$budget]); $budgetCollection = new Collection([$budget]);
Log::debug('amount starts ' . $amount);
while ($start <= $end) { while ($start <= $end) {
$spent = $repository->spentInPeriod($budgetCollection, new Collection, $start, $start); $spent = $repository->spentInPeriod($budgetCollection, new Collection, $start, $start);
$amount = bcadd($amount, $spent); $amount = bcadd($amount, $spent);

View File

@@ -11,7 +11,6 @@ use FireflyIII\Models\Category;
use FireflyIII\Repositories\Category\CategoryRepositoryInterface as CRI; use FireflyIII\Repositories\Category\CategoryRepositoryInterface as CRI;
use FireflyIII\Support\CacheProperties; use FireflyIII\Support\CacheProperties;
use Illuminate\Support\Collection; use Illuminate\Support\Collection;
use Log;
use Navigation; use Navigation;
use Preferences; use Preferences;
use Response; use Response;
@@ -69,10 +68,9 @@ class CategoryController extends Controller
while ($start <= $end) { while ($start <= $end) {
$currentEnd = Navigation::endOfPeriod($start, $range); $currentEnd = Navigation::endOfPeriod($start, $range);
Log::debug('Searching for expenses from ' . $start . ' to ' . $currentEnd); $spent = $repository->spentInPeriod($categoryCollection, new Collection, $start, $currentEnd);
$spent = $repository->spentInPeriod($categoryCollection, new Collection, $start, $currentEnd); $earned = $repository->earnedInPeriod($categoryCollection, new Collection, $start, $currentEnd);
$earned = $repository->earnedInPeriod($categoryCollection, new Collection, $start, $currentEnd); $date = Navigation::periodShow($start, $range);
$date = Navigation::periodShow($start, $range);
$entries->push([clone $start, $date, $spent, $earned]); $entries->push([clone $start, $date, $spent, $earned]);
$start = Navigation::addPeriod($start, $range, 0); $start = Navigation::addPeriod($start, $range, 0);
} }
@@ -126,7 +124,6 @@ class CategoryController extends Controller
/** @var Category $category */ /** @var Category $category */
foreach ($categories as $category) { foreach ($categories as $category) {
$spent = $repository->spentInPeriod(new Collection([$category]), new Collection, $start, $end); $spent = $repository->spentInPeriod(new Collection([$category]), new Collection, $start, $end);
Log::debug('Spent for ' . $category->name . ' is ' . $spent . ' (' . bccomp($spent, '0') . ')');
if (bccomp($spent, '0') === -1) { if (bccomp($spent, '0') === -1) {
$category->spent = $spent; $category->spent = $spent;
$set->push($category); $set->push($category);
@@ -255,17 +252,13 @@ class CategoryController extends Controller
$cache->addProperty('specific-period'); $cache->addProperty('specific-period');
if ($cache->has()) { if ($cache->has()) {
return $cache->get(); return $cache->get();
} }
$entries = new Collection; $entries = new Collection;
Log::debug('Start is ' . $start . ' en end is ' . $end);
while ($start <= $end) { while ($start <= $end) {
Log::debug('Now at ' . $start); $spent = $repository->spentInPeriod($categoryCollection, new Collection, $start, $start);
$spent = $repository->spentInPeriod($categoryCollection, new Collection, $start, $start);
Log::debug('spent: ' . $spent);
$earned = $repository->earnedInPeriod($categoryCollection, new Collection, $start, $start); $earned = $repository->earnedInPeriod($categoryCollection, new Collection, $start, $start);
Log::debug('earned: ' . $earned); $date = Navigation::periodShow($start, '1D');
$date = Navigation::periodShow($start, '1D');
$entries->push([clone $start, $date, $spent, $earned]); $entries->push([clone $start, $date, $spent, $earned]);
$start->addDay(); $start->addDay();
} }

View File

@@ -100,7 +100,7 @@ class ReportController extends Controller
$cache->addProperty($accounts); $cache->addProperty($accounts);
$cache->addProperty($end); $cache->addProperty($end);
if ($cache->has()) { if ($cache->has()) {
return Response::json($cache->get()); return Response::json($cache->get());
} }
// always per month. // always per month.

View File

@@ -311,12 +311,10 @@ class CsvController extends Controller
return redirect(route('csv.index')); return redirect(route('csv.index'));
} }
Log::debug('Created importer');
/** @var Importer $importer */ /** @var Importer $importer */
$importer = app(Importer::class); $importer = app(Importer::class);
$importer->setData($this->data); $importer->setData($this->data);
$importer->run(); $importer->run();
Log::debug('Done importing!');
$rows = $importer->getRows(); $rows = $importer->getRows();
$errors = $importer->getErrors(); $errors = $importer->getErrors();

View File

@@ -19,7 +19,6 @@ use FireflyIII\Http\Requests\ExportFormRequest;
use FireflyIII\Models\ExportJob; use FireflyIII\Models\ExportJob;
use FireflyIII\Repositories\Account\AccountRepositoryInterface as ARI; use FireflyIII\Repositories\Account\AccountRepositoryInterface as ARI;
use FireflyIII\Repositories\ExportJob\ExportJobRepositoryInterface as EJRI; use FireflyIII\Repositories\ExportJob\ExportJobRepositoryInterface as EJRI;
use Log;
use Preferences; use Preferences;
use Response; use Response;
use Storage; use Storage;
@@ -62,7 +61,6 @@ class ExportController extends Controller
$job->change('export_downloaded'); $job->change('export_downloaded');
Log::debug('Will send user file "' . $file . '".');
return response($disk->get($file), 200) return response($disk->get($file), 200)
->header('Content-Description', 'File Transfer') ->header('Content-Description', 'File Transfer')

View File

@@ -49,7 +49,6 @@ class HelpController extends Controller
return Response::json($content); return Response::json($content);
} }
Log::debug('Will get help from Github for language "' . $language . '" and route "' . $route . '".');
$content = $help->getFromGithub($language, $route); $content = $help->getFromGithub($language, $route);
$help->putInCache($route, $language, $content); $help->putInCache($route, $language, $content);

View File

@@ -226,7 +226,7 @@ class ReportController extends Controller
} }
); );
$view = view('popup.report.income-entry', compact('journals', 'account'))->render(); $view = view('popup.report.income-entry', compact('journals', 'account'))->render();
return $view; return $view;
} }

View File

@@ -12,7 +12,6 @@ use FireflyIII\Repositories\Account\AccountRepositoryInterface as ARI;
use FireflyIII\Repositories\Budget\BudgetRepositoryInterface; use FireflyIII\Repositories\Budget\BudgetRepositoryInterface;
use FireflyIII\Repositories\Category\CategoryRepositoryInterface; use FireflyIII\Repositories\Category\CategoryRepositoryInterface;
use Illuminate\Support\Collection; use Illuminate\Support\Collection;
use Log;
use Preferences; use Preferences;
use Session; use Session;
use Steam; use Steam;
@@ -100,7 +99,6 @@ class ReportController extends Controller
// lower threshold // lower threshold
if ($start < session('first')) { if ($start < session('first')) {
Log::debug('Start is ' . $start . ' but session first is ' . session('first'));
$start = session('first'); $start = session('first');
} }
@@ -167,7 +165,7 @@ class ReportController extends Controller
* Is there even activity on this account between the requested dates? * Is there even activity on this account between the requested dates?
*/ */
if ($start->between($first, $last) || $end->between($first, $last)) { if ($start->between($first, $last) || $end->between($first, $last)) {
$exists = true; $exists = true;
$journals = $repos->journalsInPeriod($accounts, [], $start, $end); $journals = $repos->journalsInPeriod($accounts, [], $start, $end);
} }

View File

@@ -19,7 +19,6 @@ use FireflyIII\Http\Requests\SplitJournalFormRequest;
use FireflyIII\Models\Transaction; use FireflyIII\Models\Transaction;
use FireflyIII\Models\TransactionJournal; use FireflyIII\Models\TransactionJournal;
use Illuminate\Http\Request; use Illuminate\Http\Request;
use Log;
use Preferences; use Preferences;
use Session; use Session;
use Steam; use Steam;
@@ -198,7 +197,6 @@ class SplitController extends Controller
private function arrayFromJournal(Request $request, TransactionJournal $journal): array private function arrayFromJournal(Request $request, TransactionJournal $journal): array
{ {
if (Session::has('_old_input')) { if (Session::has('_old_input')) {
Log::debug('Old input: ', session('_old_input'));
} }
$sourceAccounts = TransactionJournal::sourceAccountList($journal); $sourceAccounts = TransactionJournal::sourceAccountList($journal);
$destinationAccounts = TransactionJournal::destinationAccountList($journal); $destinationAccounts = TransactionJournal::destinationAccountList($journal);

View File

@@ -45,7 +45,6 @@ class MailError extends Job implements ShouldQueue
$this->ipAddress = $ipAddress; $this->ipAddress = $ipAddress;
$this->exception = $exceptionData; $this->exception = $exceptionData;
Log::debug('In mail job constructor for error handler.');
$debug = $exceptionData; $debug = $exceptionData;
unset($debug['stackTrace']); unset($debug['stackTrace']);
Log::error('Exception is: ' . json_encode($debug)); Log::error('Exception is: ' . json_encode($debug));
@@ -58,7 +57,6 @@ class MailError extends Job implements ShouldQueue
*/ */
public function handle() public function handle()
{ {
Log::debug('Start of handle()');
if ($this->attempts() < 3) { if ($this->attempts() < 3) {
// mail? // mail?
try { try {
@@ -82,7 +80,6 @@ class MailError extends Job implements ShouldQueue
} catch (ErrorException $e) { } catch (ErrorException $e) {
Log::error('ErrorException ' . $e->getMessage()); Log::error('ErrorException ' . $e->getMessage());
} }
Log::debug('Successfully handled error.');
} }
} }
} }

View File

@@ -10,21 +10,21 @@ use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
/** /**
* FireflyIII\Models\Budget * FireflyIII\Models\Budget
* *
* @property integer $id * @property integer $id
* @property \Carbon\Carbon $created_at * @property \Carbon\Carbon $created_at
* @property \Carbon\Carbon $updated_at * @property \Carbon\Carbon $updated_at
* @property \Carbon\Carbon $deleted_at * @property \Carbon\Carbon $deleted_at
* @property string $name * @property string $name
* @property integer $user_id * @property integer $user_id
* @property boolean $active * @property boolean $active
* @property boolean $encrypted * @property boolean $encrypted
* @property-read \Illuminate\Database\Eloquent\Collection|BudgetLimit[] $budgetlimits * @property-read \Illuminate\Database\Eloquent\Collection|BudgetLimit[] $budgetlimits
* @property-read \Illuminate\Database\Eloquent\Collection|TransactionJournal[] $transactionjournals * @property-read \Illuminate\Database\Eloquent\Collection|TransactionJournal[] $transactionjournals
* @property-read \FireflyIII\User $user * @property-read \FireflyIII\User $user
* @property string $dateFormatted * @property string $dateFormatted
* @property string $budgeted * @property string $budgeted
* @property float $amount * @property float $amount
* @property \Carbon\Carbon $date * @property \Carbon\Carbon $date
* @method static \Illuminate\Database\Query\Builder|\FireflyIII\Models\Budget whereId($value) * @method static \Illuminate\Database\Query\Builder|\FireflyIII\Models\Budget whereId($value)
* @method static \Illuminate\Database\Query\Builder|\FireflyIII\Models\Budget whereCreatedAt($value) * @method static \Illuminate\Database\Query\Builder|\FireflyIII\Models\Budget whereCreatedAt($value)
* @method static \Illuminate\Database\Query\Builder|\FireflyIII\Models\Budget whereUpdatedAt($value) * @method static \Illuminate\Database\Query\Builder|\FireflyIII\Models\Budget whereUpdatedAt($value)

View File

@@ -10,19 +10,19 @@ use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
/** /**
* FireflyIII\Models\Category * FireflyIII\Models\Category
* *
* @property integer $id * @property integer $id
* @property \Carbon\Carbon $created_at * @property \Carbon\Carbon $created_at
* @property \Carbon\Carbon $updated_at * @property \Carbon\Carbon $updated_at
* @property \Carbon\Carbon $deleted_at * @property \Carbon\Carbon $deleted_at
* @property string $name * @property string $name
* @property integer $user_id * @property integer $user_id
* @property boolean $encrypted * @property boolean $encrypted
* @property-read \Illuminate\Database\Eloquent\Collection|TransactionJournal[] $transactionjournals * @property-read \Illuminate\Database\Eloquent\Collection|TransactionJournal[] $transactionjournals
* @property-read \FireflyIII\User $user * @property-read \FireflyIII\User $user
* @property string $dateFormatted * @property string $dateFormatted
* @property string $spent * @property string $spent
* @property \Carbon\Carbon $lastActivity * @property \Carbon\Carbon $lastActivity
* @property string $type * @property string $type
* @method static \Illuminate\Database\Query\Builder|\FireflyIII\Models\Category whereId($value) * @method static \Illuminate\Database\Query\Builder|\FireflyIII\Models\Category whereId($value)
* @method static \Illuminate\Database\Query\Builder|\FireflyIII\Models\Category whereCreatedAt($value) * @method static \Illuminate\Database\Query\Builder|\FireflyIII\Models\Category whereCreatedAt($value)
* @method static \Illuminate\Database\Query\Builder|\FireflyIII\Models\Category whereUpdatedAt($value) * @method static \Illuminate\Database\Query\Builder|\FireflyIII\Models\Category whereUpdatedAt($value)
@@ -117,6 +117,7 @@ class Category extends Model
{ {
return $this->belongsToMany('FireflyIII\Models\TransactionJournal', 'category_transaction_journal', 'category_id'); return $this->belongsToMany('FireflyIII\Models\TransactionJournal', 'category_transaction_journal', 'category_id');
} }
/** /**
* @return \Illuminate\Database\Eloquent\Relations\BelongsToMany * @return \Illuminate\Database\Eloquent\Relations\BelongsToMany
*/ */

View File

@@ -12,7 +12,6 @@ namespace FireflyIII\Models;
use Auth; use Auth;
use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Model;
use Log;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
/** /**
@@ -58,7 +57,6 @@ class ExportJob extends Model
*/ */
public function change($status) public function change($status)
{ {
Log::debug('Job ' . $this->key . ' to status "' . $status . '".');
$this->status = $status; $this->status = $status;
$this->save(); $this->save();
} }

View File

@@ -122,7 +122,7 @@ class Transaction extends Model
/** /**
* *
* @param Builder $query * @param Builder $query
* @param Carbon $date * @param Carbon $date
* *
*/ */
public function scopeBefore(Builder $query, Carbon $date) public function scopeBefore(Builder $query, Carbon $date)

View File

@@ -7,7 +7,6 @@ use FireflyIII\Support\Models\TransactionJournalSupport;
use Illuminate\Database\Eloquent\Builder as EloquentBuilder; use Illuminate\Database\Eloquent\Builder as EloquentBuilder;
use Illuminate\Database\Eloquent\Relations\HasMany; use Illuminate\Database\Eloquent\Relations\HasMany;
use Illuminate\Database\Eloquent\SoftDeletes; use Illuminate\Database\Eloquent\SoftDeletes;
use Illuminate\Database\Query\JoinClause;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
use Watson\Validating\ValidatingTrait; use Watson\Validating\ValidatingTrait;

View File

@@ -4,17 +4,11 @@ declare(strict_types = 1);
namespace FireflyIII\Providers; namespace FireflyIII\Providers;
use FireflyIII\Models\Account; use FireflyIII\Models\Account;
use FireflyIII\Models\BudgetLimit;
use FireflyIII\Models\LimitRepetition;
use FireflyIII\Models\PiggyBank; use FireflyIII\Models\PiggyBank;
use FireflyIII\Models\PiggyBankRepetition; use FireflyIII\Models\PiggyBankRepetition;
use FireflyIII\Models\Transaction; use FireflyIII\Models\Transaction;
use FireflyIII\Models\TransactionJournal;
use Illuminate\Contracts\Events\Dispatcher as DispatcherContract; use Illuminate\Contracts\Events\Dispatcher as DispatcherContract;
use Illuminate\Database\QueryException;
use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvider; use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvider;
use Log;
use Navigation;
/** /**
* Class EventServiceProvider * Class EventServiceProvider

View File

@@ -78,6 +78,7 @@ class ExportJobRepository implements ExportJobRepositoryInterface
$exportJob->key = Str::random(12); $exportJob->key = Str::random(12);
$exportJob->status = 'export_status_never_started'; $exportJob->status = 'export_status_never_started';
$exportJob->save(); $exportJob->save();
// breaks the loop: // breaks the loop:
return $exportJob; return $exportJob;

View File

@@ -15,7 +15,6 @@ use FireflyIII\Models\Budget;
use FireflyIII\Models\RuleAction; use FireflyIII\Models\RuleAction;
use FireflyIII\Models\TransactionJournal; use FireflyIII\Models\TransactionJournal;
use FireflyIII\Repositories\Budget\BudgetRepositoryInterface; use FireflyIII\Repositories\Budget\BudgetRepositoryInterface;
use Log;
/** /**
* Class SetBudget * Class SetBudget
@@ -55,10 +54,7 @@ class SetBudget implements ActionInterface
} }
)->first(); )->first();
if (!is_null($budget)) { if (!is_null($budget)) {
Log::debug('Will set budget "' . $search . '" (#' . $budget->id . ') on journal #' . $journal->id . '.');
$journal->budgets()->sync([$budget->id]); $journal->budgets()->sync([$budget->id]);
} else {
Log::debug('Could not find budget "' . $search . '". Failed.');
} }
return true; return true;

View File

@@ -15,7 +15,6 @@ use Auth;
use FireflyIII\Models\Category; use FireflyIII\Models\Category;
use FireflyIII\Models\RuleAction; use FireflyIII\Models\RuleAction;
use FireflyIII\Models\TransactionJournal; use FireflyIII\Models\TransactionJournal;
use Log;
/** /**
* Class SetCategory * Class SetCategory
@@ -47,7 +46,6 @@ class SetCategory implements ActionInterface
{ {
$name = $this->action->action_value; $name = $this->action->action_value;
$category = Category::firstOrCreateEncrypted(['name' => $name, 'user_id' => Auth::user()->id]); $category = Category::firstOrCreateEncrypted(['name' => $name, 'user_id' => Auth::user()->id]);
Log::debug('Will set category "' . $name . '" (#' . $category->id . ') on journal #' . $journal->id . '.');
$journal->categories()->sync([$category->id]); $journal->categories()->sync([$category->id]);
return true; return true;

View File

@@ -19,7 +19,6 @@ use FireflyIII\Rules\Factory\ActionFactory;
use FireflyIII\Rules\Factory\TriggerFactory; use FireflyIII\Rules\Factory\TriggerFactory;
use FireflyIII\Rules\Triggers\AbstractTrigger; use FireflyIII\Rules\Triggers\AbstractTrigger;
use Illuminate\Support\Collection; use Illuminate\Support\Collection;
use Log;
/** /**
* Class Processor * Class Processor
@@ -138,13 +137,11 @@ final class Processor
$triggered = $this->triggered(); $triggered = $this->triggered();
if ($triggered) { if ($triggered) {
if ($this->actions->count() > 0) { if ($this->actions->count() > 0) {
Log::debug('Journal #' . $journal->id . ' triggered, actions executed.');
$this->actions(); $this->actions();
} }
return true; return true;
} }
Log::debug('Journal #' . $journal->id . ' not triggered, did nothing.');
return false; return false;
@@ -195,7 +192,6 @@ final class Processor
} }
} }
Log::debug('Total: ' . $foundTriggers . ' found triggers. ' . $hitTriggers . ' triggers were hit.');
return ($hitTriggers == $foundTriggers && $foundTriggers > 0); return ($hitTriggers == $foundTriggers && $foundTriggers > 0);

View File

@@ -5,7 +5,6 @@ namespace FireflyIII\Support;
use Carbon\Carbon; use Carbon\Carbon;
use FireflyIII\Exceptions\FireflyException; use FireflyIII\Exceptions\FireflyException;
use Log;
/** /**
* Class Navigation * Class Navigation

View File

@@ -240,7 +240,7 @@ class Journal extends Twig_Extension
$cache->addProperty('transaction'); $cache->addProperty('transaction');
$cache->addProperty('budget-string'); $cache->addProperty('budget-string');
if ($cache->has()) { if ($cache->has()) {
return $cache->get(); return $cache->get();
} }
$budgets = []; $budgets = [];
@@ -270,7 +270,7 @@ class Journal extends Twig_Extension
$cache->addProperty('transaction'); $cache->addProperty('transaction');
$cache->addProperty('category-string'); $cache->addProperty('category-string');
if ($cache->has()) { if ($cache->has()) {
return $cache->get(); return $cache->get();
} }

View File

@@ -19,7 +19,6 @@ use FireflyIII\User;
use Google2FA; use Google2FA;
use Illuminate\Contracts\Encryption\DecryptException; use Illuminate\Contracts\Encryption\DecryptException;
use Illuminate\Validation\Validator; use Illuminate\Validation\Validator;
use Log;
use Session; use Session;
use Symfony\Component\Translation\TranslatorInterface; use Symfony\Component\Translation\TranslatorInterface;
@@ -135,7 +134,6 @@ class FireflyValidator extends Validator
$value = $this->data['rule-action-value'][$index] ?? false; $value = $this->data['rule-action-value'][$index] ?? false;
switch ($name) { switch ($name) {
default: default:
Log::debug(' (' . $attribute . ') (index:' . $index . ') Name is "' . $name . '" so no action is taken.');
return true; return true;
case 'set_budget': case 'set_budget':