mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-09-05 04:03:26 +00:00
Clean up code.
This commit is contained in:
@@ -284,7 +284,6 @@ class CategoryController extends Controller
|
|||||||
$spent = $this->opsRepository->listExpenses($start, $end, $accounts, $categories);
|
$spent = $this->opsRepository->listExpenses($start, $end, $accounts, $categories);
|
||||||
$result = [];
|
$result = [];
|
||||||
foreach ($spent as $currency) {
|
foreach ($spent as $currency) {
|
||||||
$currencyId = $currency['currency_id'];
|
|
||||||
foreach ($currency['categories'] as $category) {
|
foreach ($currency['categories'] as $category) {
|
||||||
foreach ($category['transaction_journals'] as $journal) {
|
foreach ($category['transaction_journals'] as $journal) {
|
||||||
$destinationId = $journal['destination_account_id'];
|
$destinationId = $journal['destination_account_id'];
|
||||||
@@ -337,7 +336,6 @@ class CategoryController extends Controller
|
|||||||
$spent = $this->opsRepository->listIncome($start, $end, $accounts, $categories);
|
$spent = $this->opsRepository->listIncome($start, $end, $accounts, $categories);
|
||||||
$result = [];
|
$result = [];
|
||||||
foreach ($spent as $currency) {
|
foreach ($spent as $currency) {
|
||||||
$currencyId = $currency['currency_id'];
|
|
||||||
foreach ($currency['categories'] as $category) {
|
foreach ($currency['categories'] as $category) {
|
||||||
foreach ($category['transaction_journals'] as $journal) {
|
foreach ($category['transaction_journals'] as $journal) {
|
||||||
$sourceId = $journal['source_account_id'];
|
$sourceId = $journal['source_account_id'];
|
||||||
@@ -536,7 +534,7 @@ class CategoryController extends Controller
|
|||||||
'entries' => [],
|
'entries' => [],
|
||||||
|
|
||||||
];
|
];
|
||||||
foreach ($categoryRow['transaction_journals'] as $journalId => $journal) {
|
foreach ($categoryRow['transaction_journals'] as $journal) {
|
||||||
$date = $journal['date']->format($format);
|
$date = $journal['date']->format($format);
|
||||||
$data[$key]['entries'][$date] = $data[$key]['entries'][$date] ?? '0';
|
$data[$key]['entries'][$date] = $data[$key]['entries'][$date] ?? '0';
|
||||||
$data[$key]['entries'][$date] = bcadd($data[$key]['entries'][$date], $journal['amount']);
|
$data[$key]['entries'][$date] = bcadd($data[$key]['entries'][$date], $journal['amount']);
|
||||||
@@ -616,7 +614,7 @@ class CategoryController extends Controller
|
|||||||
'entries' => [],
|
'entries' => [],
|
||||||
|
|
||||||
];
|
];
|
||||||
foreach ($categoryRow['transaction_journals'] as $journalId => $journal) {
|
foreach ($categoryRow['transaction_journals'] as $journal) {
|
||||||
$date = $journal['date']->format($format);
|
$date = $journal['date']->format($format);
|
||||||
$data[$key]['entries'][$date] = $data[$key]['entries'][$date] ?? '0';
|
$data[$key]['entries'][$date] = $data[$key]['entries'][$date] ?? '0';
|
||||||
$data[$key]['entries'][$date] = bcadd($data[$key]['entries'][$date], $journal['amount']);
|
$data[$key]['entries'][$date] = bcadd($data[$key]['entries'][$date], $journal['amount']);
|
||||||
@@ -662,7 +660,7 @@ class CategoryController extends Controller
|
|||||||
$cache->addProperty('category-report');
|
$cache->addProperty('category-report');
|
||||||
$cache->addProperty($accounts->pluck('id')->toArray());
|
$cache->addProperty($accounts->pluck('id')->toArray());
|
||||||
if ($cache->has()) {
|
if ($cache->has()) {
|
||||||
//return $cache->get(); // @codeCoverageIgnore
|
return $cache->get(); // @codeCoverageIgnore
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @var CategoryReportGenerator $generator */
|
/** @var CategoryReportGenerator $generator */
|
||||||
@@ -700,7 +698,6 @@ class CategoryController extends Controller
|
|||||||
$spent = $this->opsRepository->listExpenses($start, $end, $accounts, $categories);
|
$spent = $this->opsRepository->listExpenses($start, $end, $accounts, $categories);
|
||||||
$result = [];
|
$result = [];
|
||||||
foreach ($spent as $currency) {
|
foreach ($spent as $currency) {
|
||||||
$currencyId = $currency['currency_id'];
|
|
||||||
foreach ($currency['categories'] as $category) {
|
foreach ($currency['categories'] as $category) {
|
||||||
foreach ($category['transaction_journals'] as $journal) {
|
foreach ($category['transaction_journals'] as $journal) {
|
||||||
$result[] = [
|
$result[] = [
|
||||||
@@ -750,7 +747,6 @@ class CategoryController extends Controller
|
|||||||
$spent = $this->opsRepository->listIncome($start, $end, $accounts, $categories);
|
$spent = $this->opsRepository->listIncome($start, $end, $accounts, $categories);
|
||||||
$result = [];
|
$result = [];
|
||||||
foreach ($spent as $currency) {
|
foreach ($spent as $currency) {
|
||||||
$currencyId = $currency['currency_id'];
|
|
||||||
foreach ($currency['categories'] as $category) {
|
foreach ($currency['categories'] as $category) {
|
||||||
foreach ($category['transaction_journals'] as $journal) {
|
foreach ($category['transaction_journals'] as $journal) {
|
||||||
$result[] = [
|
$result[] = [
|
||||||
@@ -787,17 +783,4 @@ class CategoryController extends Controller
|
|||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @param array $array
|
|
||||||
*
|
|
||||||
* @return bool
|
|
||||||
*/
|
|
||||||
private function noAmountInArray(array $array): bool
|
|
||||||
{
|
|
||||||
if (0 === count($array)) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@@ -168,23 +168,6 @@ class CreateRecurringTransactions implements ShouldQueue
|
|||||||
return $recurrence->active;
|
return $recurrence->active;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Helper function for debug information.
|
|
||||||
*
|
|
||||||
* @param array $occurrences
|
|
||||||
*
|
|
||||||
* @return array
|
|
||||||
*/
|
|
||||||
private function debugArray(array $occurrences): array
|
|
||||||
{
|
|
||||||
$return = [];
|
|
||||||
foreach ($occurrences as $entry) {
|
|
||||||
$return[] = $entry->format('Y-m-d');
|
|
||||||
}
|
|
||||||
|
|
||||||
return $return;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param Collection $recurrences
|
* @param Collection $recurrences
|
||||||
*
|
*
|
||||||
@@ -427,23 +410,6 @@ class CreateRecurringTransactions implements ShouldQueue
|
|||||||
return $startDate->gt($this->date);
|
return $startDate->gt($this->date);
|
||||||
}
|
}
|
||||||
|
|
||||||
/***
|
|
||||||
* @param Recurrence $recurrence
|
|
||||||
* @param TransactionGroup $group
|
|
||||||
*/
|
|
||||||
private function linkGroupToPiggies(Recurrence $recurrence, TransactionGroup $group): void
|
|
||||||
{
|
|
||||||
/** @var TransactionJournal $journal */
|
|
||||||
foreach ($group->transactionJournals as $journal) {
|
|
||||||
// get piggy bank ID from meta data:
|
|
||||||
$piggyBank = $this->repository->getPiggyBank($recurrence);
|
|
||||||
if (null !== $piggyBank) {
|
|
||||||
/** @var PiggyBankEventFactory $factory */
|
|
||||||
$factory = app(PiggyBankEventFactory::class);
|
|
||||||
$factory->create($journal, $piggyBank);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return true if the $repeat_until date is in the past.
|
* Return true if the $repeat_until date is in the past.
|
||||||
|
@@ -582,46 +582,4 @@ class TagRepository implements TagRepositoryInterface
|
|||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @param string $oldName
|
|
||||||
* @param string $newName
|
|
||||||
*/
|
|
||||||
private function updateRuleActions(string $oldName, string $newName): void
|
|
||||||
{
|
|
||||||
$types = ['add_tag', 'remove_tag'];
|
|
||||||
$actions = RuleAction::leftJoin('rules', 'rules.id', '=', 'rule_actions.rule_id')
|
|
||||||
->where('rules.user_id', $this->user->id)
|
|
||||||
->whereIn('rule_actions.action_type', $types)
|
|
||||||
->where('rule_actions.action_value', $oldName)
|
|
||||||
->get(['rule_actions.*']);
|
|
||||||
Log::debug(sprintf('Found %d actions to update.', $actions->count()));
|
|
||||||
/** @var RuleAction $action */
|
|
||||||
foreach ($actions as $action) {
|
|
||||||
$action->action_value = $newName;
|
|
||||||
$action->save();
|
|
||||||
Log::debug(sprintf('Updated action %d: %s', $action->id, $action->action_value));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param string $oldName
|
|
||||||
* @param string $newName
|
|
||||||
*/
|
|
||||||
private function updateRuleTriggers(string $oldName, string $newName): void
|
|
||||||
{
|
|
||||||
$types = ['tag_is',];
|
|
||||||
$triggers = RuleTrigger::leftJoin('rules', 'rules.id', '=', 'rule_triggers.rule_id')
|
|
||||||
->where('rules.user_id', $this->user->id)
|
|
||||||
->whereIn('rule_triggers.trigger_type', $types)
|
|
||||||
->where('rule_triggers.trigger_value', $oldName)
|
|
||||||
->get(['rule_triggers.*']);
|
|
||||||
Log::debug(sprintf('Found %d triggers to update.', $triggers->count()));
|
|
||||||
/** @var RuleTrigger $trigger */
|
|
||||||
foreach ($triggers as $trigger) {
|
|
||||||
$trigger->trigger_value = $newName;
|
|
||||||
$trigger->save();
|
|
||||||
Log::debug(sprintf('Updated trigger %d: %s', $trigger->id, $trigger->trigger_value));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@@ -81,6 +81,7 @@ class OperatorQuerySearch implements SearchInterface
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* OperatorQuerySearch constructor.
|
* OperatorQuerySearch constructor.
|
||||||
|
*
|
||||||
* @codeCoverageIgnore
|
* @codeCoverageIgnore
|
||||||
*/
|
*/
|
||||||
public function __construct()
|
public function __construct()
|
||||||
@@ -194,6 +195,7 @@ class OperatorQuerySearch implements SearchInterface
|
|||||||
if (0 === count($this->getWords()) && 0 === count($this->getOperators())) {
|
if (0 === count($this->getWords()) && 0 === count($this->getOperators())) {
|
||||||
return new LengthAwarePaginator;
|
return new LengthAwarePaginator;
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this->collector->getPaginatedGroups();
|
return $this->collector->getPaginatedGroups();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -212,12 +214,13 @@ class OperatorQuerySearch implements SearchInterface
|
|||||||
$this->collector->setUser($this->user);
|
$this->collector->setUser($this->user);
|
||||||
$this->collector->withAccountInformation()->withCategoryInformation()->withBudgetInformation();
|
$this->collector->withAccountInformation()->withCategoryInformation()->withBudgetInformation();
|
||||||
|
|
||||||
$this->setLimit((int) app('preferences')->getForUser($user, 'listPageSize', 50)->data);
|
$this->setLimit((int)app('preferences')->getForUser($user, 'listPageSize', 50)->data);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param Node $searchNode
|
* @param Node $searchNode
|
||||||
|
*
|
||||||
* @throws FireflyException
|
* @throws FireflyException
|
||||||
*/
|
*/
|
||||||
private function handleSearchNode(Node $searchNode): void
|
private function handleSearchNode(Node $searchNode): void
|
||||||
@@ -237,7 +240,7 @@ class OperatorQuerySearch implements SearchInterface
|
|||||||
case Emoji::class:
|
case Emoji::class:
|
||||||
case Mention::class:
|
case Mention::class:
|
||||||
Log::debug(sprintf('Now handle %s', $class));
|
Log::debug(sprintf('Now handle %s', $class));
|
||||||
$this->words[] = (string) $searchNode->getValue();
|
$this->words[] = (string)$searchNode->getValue();
|
||||||
break;
|
break;
|
||||||
case Field::class:
|
case Field::class:
|
||||||
Log::debug(sprintf('Now handle %s', $class));
|
Log::debug(sprintf('Now handle %s', $class));
|
||||||
@@ -246,15 +249,13 @@ class OperatorQuerySearch implements SearchInterface
|
|||||||
$operator = strtolower($searchNode->getValue());
|
$operator = strtolower($searchNode->getValue());
|
||||||
$value = $searchNode->getNode()->getValue();
|
$value = $searchNode->getNode()->getValue();
|
||||||
// must be valid operator:
|
// must be valid operator:
|
||||||
if (in_array($operator, $this->validOperators, true)) {
|
if (in_array($operator, $this->validOperators, true) && $this->updateCollector($operator, (string)$value)) {
|
||||||
if ($this->updateCollector($operator, (string) $value)) {
|
$this->operators->push(
|
||||||
$this->operators->push(
|
[
|
||||||
[
|
'type' => self::getRootOperator($operator),
|
||||||
'type' => self::getRootOperator($operator),
|
'value' => (string)$value,
|
||||||
'value' => (string) $value,
|
]
|
||||||
]
|
);
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -264,6 +265,7 @@ class OperatorQuerySearch implements SearchInterface
|
|||||||
/**
|
/**
|
||||||
* @param string $operator
|
* @param string $operator
|
||||||
* @param string $value
|
* @param string $value
|
||||||
|
*
|
||||||
* @return bool
|
* @return bool
|
||||||
* @throws FireflyException
|
* @throws FireflyException
|
||||||
*/
|
*/
|
||||||
@@ -283,6 +285,7 @@ class OperatorQuerySearch implements SearchInterface
|
|||||||
// some search operators are ignored, basically:
|
// some search operators are ignored, basically:
|
||||||
case 'user_action':
|
case 'user_action':
|
||||||
Log::info(sprintf('Ignore search operator "%s"', $operator));
|
Log::info(sprintf('Ignore search operator "%s"', $operator));
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
//
|
//
|
||||||
// all account related searches:
|
// all account related searches:
|
||||||
@@ -312,7 +315,7 @@ class OperatorQuerySearch implements SearchInterface
|
|||||||
$this->searchAccount($value, 1, 3);
|
$this->searchAccount($value, 1, 3);
|
||||||
break;
|
break;
|
||||||
case 'source_account_id':
|
case 'source_account_id':
|
||||||
$account = $this->accountRepository->findNull((int) $value);
|
$account = $this->accountRepository->findNull((int)$value);
|
||||||
if (null !== $account) {
|
if (null !== $account) {
|
||||||
$this->collector->setSourceAccounts(new Collection([$account]));
|
$this->collector->setSourceAccounts(new Collection([$account]));
|
||||||
}
|
}
|
||||||
@@ -346,7 +349,7 @@ class OperatorQuerySearch implements SearchInterface
|
|||||||
$this->searchAccount($value, 2, 3);
|
$this->searchAccount($value, 2, 3);
|
||||||
break;
|
break;
|
||||||
case 'destination_account_id':
|
case 'destination_account_id':
|
||||||
$account = $this->accountRepository->findNull((int) $value);
|
$account = $this->accountRepository->findNull((int)$value);
|
||||||
if (null !== $account) {
|
if (null !== $account) {
|
||||||
$this->collector->setDestinationAccounts(new Collection([$account]));
|
$this->collector->setDestinationAccounts(new Collection([$account]));
|
||||||
}
|
}
|
||||||
@@ -355,7 +358,7 @@ class OperatorQuerySearch implements SearchInterface
|
|||||||
$parts = explode(',', $value);
|
$parts = explode(',', $value);
|
||||||
$collection = new Collection;
|
$collection = new Collection;
|
||||||
foreach ($parts as $accountId) {
|
foreach ($parts as $accountId) {
|
||||||
$account = $this->accountRepository->findNull((int) $accountId);
|
$account = $this->accountRepository->findNull((int)$accountId);
|
||||||
if (null !== $account) {
|
if (null !== $account) {
|
||||||
$collection->push($account);
|
$collection->push($account);
|
||||||
}
|
}
|
||||||
@@ -390,6 +393,7 @@ class OperatorQuerySearch implements SearchInterface
|
|||||||
break;
|
break;
|
||||||
case 'description_contains':
|
case 'description_contains':
|
||||||
$this->words[] = $value;
|
$this->words[] = $value;
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
case 'description_is':
|
case 'description_is':
|
||||||
$this->collector->descriptionIs($value);
|
$this->collector->descriptionIs($value);
|
||||||
@@ -494,17 +498,17 @@ class OperatorQuerySearch implements SearchInterface
|
|||||||
// amount
|
// amount
|
||||||
//
|
//
|
||||||
case 'amount_exactly':
|
case 'amount_exactly':
|
||||||
$amount = app('steam')->positive((string) $value);
|
$amount = app('steam')->positive((string)$value);
|
||||||
Log::debug(sprintf('Set "%s" using collector with value "%s"', $operator, $amount));
|
Log::debug(sprintf('Set "%s" using collector with value "%s"', $operator, $amount));
|
||||||
$this->collector->amountIs($amount);
|
$this->collector->amountIs($amount);
|
||||||
break;
|
break;
|
||||||
case 'amount_less':
|
case 'amount_less':
|
||||||
$amount = app('steam')->positive((string) $value);
|
$amount = app('steam')->positive((string)$value);
|
||||||
Log::debug(sprintf('Set "%s" using collector with value "%s"', $operator, $amount));
|
Log::debug(sprintf('Set "%s" using collector with value "%s"', $operator, $amount));
|
||||||
$this->collector->amountLess($amount);
|
$this->collector->amountLess($amount);
|
||||||
break;
|
break;
|
||||||
case 'amount_more':
|
case 'amount_more':
|
||||||
$amount = app('steam')->positive((string) $value);
|
$amount = app('steam')->positive((string)$value);
|
||||||
Log::debug(sprintf('Set "%s" using collector with value "%s"', $operator, $amount));
|
Log::debug(sprintf('Set "%s" using collector with value "%s"', $operator, $amount));
|
||||||
$this->collector->amountMore($amount);
|
$this->collector->amountMore($amount);
|
||||||
break;
|
break;
|
||||||
@@ -520,7 +524,12 @@ class OperatorQuerySearch implements SearchInterface
|
|||||||
//
|
//
|
||||||
case 'date_is':
|
case 'date_is':
|
||||||
$range = $this->parseDateRange($value);
|
$range = $this->parseDateRange($value);
|
||||||
Log::debug(sprintf('Set "%s" using collector with value "%s" (%s - %s)', $operator, $value, $range['start']->format('Y-m-d'), $range['end']->format('Y-m-d')));
|
Log::debug(
|
||||||
|
sprintf(
|
||||||
|
'Set "%s" using collector with value "%s" (%s - %s)', $operator, $value, $range['start']->format('Y-m-d'),
|
||||||
|
$range['end']->format('Y-m-d')
|
||||||
|
)
|
||||||
|
);
|
||||||
$this->collector->setRange($range['start'], $range['end']);
|
$this->collector->setRange($range['start'], $range['end']);
|
||||||
|
|
||||||
// add to operators manually:
|
// add to operators manually:
|
||||||
@@ -531,7 +540,12 @@ class OperatorQuerySearch implements SearchInterface
|
|||||||
case 'date_before':
|
case 'date_before':
|
||||||
Log::debug(sprintf('Value for date_before is "%s"', $value));
|
Log::debug(sprintf('Value for date_before is "%s"', $value));
|
||||||
$range = $this->parseDateRange($value);
|
$range = $this->parseDateRange($value);
|
||||||
Log::debug(sprintf('Set "%s" using collector with value "%s" (%s - %s)', $operator, $value, $range['start']->format('Y-m-d'), $range['end']->format('Y-m-d')));
|
Log::debug(
|
||||||
|
sprintf(
|
||||||
|
'Set "%s" using collector with value "%s" (%s - %s)', $operator, $value, $range['start']->format('Y-m-d'),
|
||||||
|
$range['end']->format('Y-m-d')
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
// add to operators manually:
|
// add to operators manually:
|
||||||
$this->operators->push(['type' => 'date_before', 'value' => $range['start']->format('Y-m-d'),]);
|
$this->operators->push(['type' => 'date_before', 'value' => $range['start']->format('Y-m-d'),]);
|
||||||
@@ -541,7 +555,12 @@ class OperatorQuerySearch implements SearchInterface
|
|||||||
case 'date_after':
|
case 'date_after':
|
||||||
Log::debug(sprintf('Value for date_after is "%s"', $value));
|
Log::debug(sprintf('Value for date_after is "%s"', $value));
|
||||||
$range = $this->parseDateRange($value);
|
$range = $this->parseDateRange($value);
|
||||||
Log::debug(sprintf('Set "%s" using collector with value "%s" (%s - %s)', $operator, $value, $range['start']->format('Y-m-d'), $range['end']->format('Y-m-d')));
|
Log::debug(
|
||||||
|
sprintf(
|
||||||
|
'Set "%s" using collector with value "%s" (%s - %s)', $operator, $value, $range['start']->format('Y-m-d'),
|
||||||
|
$range['end']->format('Y-m-d')
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
// add to operators manually:
|
// add to operators manually:
|
||||||
$this->operators->push(['type' => 'date_after', 'value' => $range['end']->format('Y-m-d'),]);
|
$this->operators->push(['type' => 'date_after', 'value' => $range['end']->format('Y-m-d'),]);
|
||||||
@@ -568,12 +587,14 @@ class OperatorQuerySearch implements SearchInterface
|
|||||||
$this->collector->setInternalReference($value);
|
$this->collector->setInternalReference($value);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* searchDirection: 1 = source (default), 2 = destination
|
* searchDirection: 1 = source (default), 2 = destination
|
||||||
* stringPosition: 1 = start (default), 2 = end, 3 = contains, 4 = is
|
* stringPosition: 1 = start (default), 2 = end, 3 = contains, 4 = is
|
||||||
|
*
|
||||||
* @param string $value
|
* @param string $value
|
||||||
* @param int $searchDirection
|
* @param int $searchDirection
|
||||||
* @param int $stringPosition
|
* @param int $stringPosition
|
||||||
@@ -617,15 +638,18 @@ class OperatorQuerySearch implements SearchInterface
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Log::debug(sprintf('Found %d accounts, will filter.', $accounts->count()));
|
Log::debug(sprintf('Found %d accounts, will filter.', $accounts->count()));
|
||||||
$filtered = $accounts->filter(function (Account $account) use ($value, $stringMethod) {
|
$filtered = $accounts->filter(
|
||||||
return $stringMethod(strtolower($account->name), strtolower($value));
|
function (Account $account) use ($value, $stringMethod) {
|
||||||
});
|
return $stringMethod(strtolower($account->name), strtolower($value));
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
if (0 === $filtered->count()) {
|
if (0 === $filtered->count()) {
|
||||||
Log::debug('Left with zero accounts, search for invalid account.');
|
Log::debug('Left with zero accounts, search for invalid account.');
|
||||||
$account = new Account;
|
$account = new Account;
|
||||||
$account->id = 0;
|
$account->id = 0;
|
||||||
$this->collector->$collectorMethod(new Collection([$account]));
|
$this->collector->$collectorMethod(new Collection([$account]));
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Log::debug(sprintf('Left with %d, set as %s().', $filtered->count(), $collectorMethod));
|
Log::debug(sprintf('Left with %d, set as %s().', $filtered->count(), $collectorMethod));
|
||||||
@@ -636,6 +660,7 @@ class OperatorQuerySearch implements SearchInterface
|
|||||||
/**
|
/**
|
||||||
* searchDirection: 1 = source (default), 2 = destination
|
* searchDirection: 1 = source (default), 2 = destination
|
||||||
* stringPosition: 1 = start (default), 2 = end, 3 = contains, 4 = is
|
* stringPosition: 1 = start (default), 2 = end, 3 = contains, 4 = is
|
||||||
|
*
|
||||||
* @param string $value
|
* @param string $value
|
||||||
* @param int $searchDirection
|
* @param int $searchDirection
|
||||||
* @param int $stringPosition
|
* @param int $stringPosition
|
||||||
@@ -675,29 +700,34 @@ class OperatorQuerySearch implements SearchInterface
|
|||||||
$account = new Account;
|
$account = new Account;
|
||||||
$account->id = 0;
|
$account->id = 0;
|
||||||
$this->collector->$collectorMethod(new Collection([$account]));
|
$this->collector->$collectorMethod(new Collection([$account]));
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// if found, do filter
|
// if found, do filter
|
||||||
Log::debug(sprintf('Found %d accounts, will filter.', $accounts->count()));
|
Log::debug(sprintf('Found %d accounts, will filter.', $accounts->count()));
|
||||||
$filtered = $accounts->filter(function (Account $account) use ($value, $stringMethod) {
|
$filtered = $accounts->filter(
|
||||||
// either IBAN or account number!
|
function (Account $account) use ($value, $stringMethod) {
|
||||||
$ibanMatch = $stringMethod(strtolower((string) $account->iban), strtolower((string) $value));
|
// either IBAN or account number!
|
||||||
$accountNrMatch = false;
|
$ibanMatch = $stringMethod(strtolower((string)$account->iban), strtolower((string)$value));
|
||||||
/** @var AccountMeta $meta */
|
$accountNrMatch = false;
|
||||||
foreach ($account->accountMeta as $meta) {
|
/** @var AccountMeta $meta */
|
||||||
if ('account_number' === $meta->name && $stringMethod(strtolower($meta->data), strtolower($value))) {
|
foreach ($account->accountMeta as $meta) {
|
||||||
$accountNrMatch = true;
|
if ('account_number' === $meta->name && $stringMethod(strtolower($meta->data), strtolower($value))) {
|
||||||
|
$accountNrMatch = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return $ibanMatch || $accountNrMatch;
|
||||||
}
|
}
|
||||||
return $ibanMatch || $accountNrMatch;
|
);
|
||||||
});
|
|
||||||
|
|
||||||
if (0 === $filtered->count()) {
|
if (0 === $filtered->count()) {
|
||||||
Log::debug('Left with zero, search for invalid account');
|
Log::debug('Left with zero, search for invalid account');
|
||||||
$account = new Account;
|
$account = new Account;
|
||||||
$account->id = 0;
|
$account->id = 0;
|
||||||
$this->collector->$collectorMethod(new Collection([$account]));
|
$this->collector->$collectorMethod(new Collection([$account]));
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Log::debug(sprintf('Left with %d, set as %s().', $filtered->count(), $collectorMethod));
|
Log::debug(sprintf('Left with %d, set as %s().', $filtered->count(), $collectorMethod));
|
||||||
@@ -706,6 +736,7 @@ class OperatorQuerySearch implements SearchInterface
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param string $value
|
* @param string $value
|
||||||
|
*
|
||||||
* @return TransactionCurrency|null
|
* @return TransactionCurrency|null
|
||||||
*/
|
*/
|
||||||
private function findCurrency(string $value): ?TransactionCurrency
|
private function findCurrency(string $value): ?TransactionCurrency
|
||||||
@@ -721,11 +752,13 @@ class OperatorQuerySearch implements SearchInterface
|
|||||||
if (null === $result) {
|
if (null === $result) {
|
||||||
$result = $this->currencyRepository->findByNameNull($value);
|
$result = $this->currencyRepository->findByNameNull($value);
|
||||||
}
|
}
|
||||||
|
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param string $operator
|
* @param string $operator
|
||||||
|
*
|
||||||
* @return string
|
* @return string
|
||||||
* @throws FireflyException
|
* @throws FireflyException
|
||||||
*/
|
*/
|
||||||
@@ -737,6 +770,7 @@ class OperatorQuerySearch implements SearchInterface
|
|||||||
}
|
}
|
||||||
if (true === $config['alias']) {
|
if (true === $config['alias']) {
|
||||||
Log::debug(sprintf('"%s" is an alias for "%s", so return that instead.', $operator, $config['alias_for']));
|
Log::debug(sprintf('"%s" is an alias for "%s", so return that instead.', $operator, $config['alias_for']));
|
||||||
|
|
||||||
return $config['alias_for'];
|
return $config['alias_for'];
|
||||||
}
|
}
|
||||||
Log::debug(sprintf('"%s" is not an alias.', $operator));
|
Log::debug(sprintf('"%s" is not an alias.', $operator));
|
||||||
@@ -746,6 +780,7 @@ class OperatorQuerySearch implements SearchInterface
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param string $value
|
* @param string $value
|
||||||
|
*
|
||||||
* @return array
|
* @return array
|
||||||
* @throws FireflyException
|
* @throws FireflyException
|
||||||
*/
|
*/
|
||||||
@@ -756,6 +791,7 @@ class OperatorQuerySearch implements SearchInterface
|
|||||||
return $parser->parseRange($value, today(config('app.timezone')));
|
return $parser->parseRange($value, today(config('app.timezone')));
|
||||||
}
|
}
|
||||||
$date = $parser->parseDate($value);
|
$date = $parser->parseDate($value);
|
||||||
|
|
||||||
return [
|
return [
|
||||||
'start' => $date,
|
'start' => $date,
|
||||||
'end' => $date,
|
'end' => $date,
|
||||||
|
@@ -49,9 +49,6 @@ class Steam
|
|||||||
*/
|
*/
|
||||||
public function balance(Account $account, Carbon $date, ?TransactionCurrency $currency = null): string
|
public function balance(Account $account, Carbon $date, ?TransactionCurrency $currency = null): string
|
||||||
{
|
{
|
||||||
if ('testing' === config('app.env')) {
|
|
||||||
Log::warning(sprintf('%s should NOT be called in the TEST environment!', __METHOD__));
|
|
||||||
}
|
|
||||||
// abuse chart properties:
|
// abuse chart properties:
|
||||||
$cache = new CacheProperties;
|
$cache = new CacheProperties;
|
||||||
$cache->addProperty($account->id);
|
$cache->addProperty($account->id);
|
||||||
@@ -105,9 +102,6 @@ class Steam
|
|||||||
*/
|
*/
|
||||||
public function balanceIgnoreVirtual(Account $account, Carbon $date): string
|
public function balanceIgnoreVirtual(Account $account, Carbon $date): string
|
||||||
{
|
{
|
||||||
if ('testing' === config('app.env')) {
|
|
||||||
Log::warning(sprintf('%s should NOT be called in the TEST environment!', __METHOD__));
|
|
||||||
}
|
|
||||||
// abuse chart properties:
|
// abuse chart properties:
|
||||||
$cache = new CacheProperties;
|
$cache = new CacheProperties;
|
||||||
$cache->addProperty($account->id);
|
$cache->addProperty($account->id);
|
||||||
@@ -177,9 +171,6 @@ class Steam
|
|||||||
*/
|
*/
|
||||||
public function balanceInRange(Account $account, Carbon $start, Carbon $end, ?TransactionCurrency $currency = null): array
|
public function balanceInRange(Account $account, Carbon $start, Carbon $end, ?TransactionCurrency $currency = null): array
|
||||||
{
|
{
|
||||||
if ('testing' === config('app.env')) {
|
|
||||||
Log::warning(sprintf('%s should NOT be called in the TEST environment!', __METHOD__));
|
|
||||||
}
|
|
||||||
// abuse chart properties:
|
// abuse chart properties:
|
||||||
$cache = new CacheProperties;
|
$cache = new CacheProperties;
|
||||||
$cache->addProperty($account->id);
|
$cache->addProperty($account->id);
|
||||||
@@ -264,9 +255,6 @@ class Steam
|
|||||||
*/
|
*/
|
||||||
public function balancePerCurrency(Account $account, Carbon $date): array
|
public function balancePerCurrency(Account $account, Carbon $date): array
|
||||||
{
|
{
|
||||||
if ('testing' === config('app.env')) {
|
|
||||||
Log::warning(sprintf('%s should NOT be called in the TEST environment!', __METHOD__));
|
|
||||||
}
|
|
||||||
// abuse chart properties:
|
// abuse chart properties:
|
||||||
$cache = new CacheProperties;
|
$cache = new CacheProperties;
|
||||||
$cache->addProperty($account->id);
|
$cache->addProperty($account->id);
|
||||||
@@ -300,9 +288,6 @@ class Steam
|
|||||||
*/
|
*/
|
||||||
public function balancesByAccounts(Collection $accounts, Carbon $date): array
|
public function balancesByAccounts(Collection $accounts, Carbon $date): array
|
||||||
{
|
{
|
||||||
if ('testing' === config('app.env')) {
|
|
||||||
Log::warning(sprintf('%s should NOT be called in the TEST environment!', __METHOD__));
|
|
||||||
}
|
|
||||||
$ids = $accounts->pluck('id')->toArray();
|
$ids = $accounts->pluck('id')->toArray();
|
||||||
// cache this property.
|
// cache this property.
|
||||||
$cache = new CacheProperties;
|
$cache = new CacheProperties;
|
||||||
@@ -335,9 +320,6 @@ class Steam
|
|||||||
*/
|
*/
|
||||||
public function balancesPerCurrencyByAccounts(Collection $accounts, Carbon $date): array
|
public function balancesPerCurrencyByAccounts(Collection $accounts, Carbon $date): array
|
||||||
{
|
{
|
||||||
if ('testing' === config('app.env')) {
|
|
||||||
Log::warning(sprintf('%s should NOT be called in the TEST environment!', __METHOD__));
|
|
||||||
}
|
|
||||||
$ids = $accounts->pluck('id')->toArray();
|
$ids = $accounts->pluck('id')->toArray();
|
||||||
// cache this property.
|
// cache this property.
|
||||||
$cache = new CacheProperties;
|
$cache = new CacheProperties;
|
||||||
@@ -497,9 +479,6 @@ class Steam
|
|||||||
*/
|
*/
|
||||||
public function getLastActivities(array $accounts): array
|
public function getLastActivities(array $accounts): array
|
||||||
{
|
{
|
||||||
if ('testing' === config('app.env')) {
|
|
||||||
Log::warning(sprintf('%s should NOT be called in the TEST environment!', __METHOD__));
|
|
||||||
}
|
|
||||||
$list = [];
|
$list = [];
|
||||||
|
|
||||||
$set = auth()->user()->transactions()
|
$set = auth()->user()->transactions()
|
||||||
|
@@ -77,7 +77,7 @@ class Rule extends AbstractExtension
|
|||||||
return new TwigFunction(
|
return new TwigFunction(
|
||||||
'allRuleTriggers',
|
'allRuleTriggers',
|
||||||
static function () {
|
static function () {
|
||||||
$ruleTriggers = array_keys(config('firefly.search.operators'));;
|
$ruleTriggers = array_keys(config('firefly.search.operators'));
|
||||||
$possibleTriggers = [];
|
$possibleTriggers = [];
|
||||||
foreach ($ruleTriggers as $key) {
|
foreach ($ruleTriggers as $key) {
|
||||||
if ('user_action' !== $key) {
|
if ('user_action' !== $key) {
|
||||||
|
@@ -362,7 +362,7 @@ class FireflyValidator extends Validator
|
|||||||
}
|
}
|
||||||
|
|
||||||
// and finally a "will match everything check":
|
// and finally a "will match everything check":
|
||||||
$classes = array_keys(config('firefly.search.operators'));;
|
$classes = array_keys(config('firefly.search.operators'));
|
||||||
/** @var TriggerInterface $class */
|
/** @var TriggerInterface $class */
|
||||||
$class = $classes[$triggerType] ?? false;
|
$class = $classes[$triggerType] ?? false;
|
||||||
if (false === $class) {
|
if (false === $class) {
|
||||||
|
@@ -225,57 +225,57 @@ return [
|
|||||||
'liability' => 'Liabilities',
|
'liability' => 'Liabilities',
|
||||||
],
|
],
|
||||||
'subIconsByIdentifier' => [
|
'subIconsByIdentifier' => [
|
||||||
'asset' => 'fa-money',
|
'asset' => 'fa-money',
|
||||||
'Asset account' => 'fa-money',
|
AccountType::ASSET => 'fa-money',
|
||||||
'Default account' => 'fa-money',
|
AccountType::DEFAULT => 'fa-money',
|
||||||
'Cash account' => 'fa-money',
|
AccountType::CASH => 'fa-money',
|
||||||
'expense' => 'fa-shopping-cart',
|
'expense' => 'fa-shopping-cart',
|
||||||
'Expense account' => 'fa-shopping-cart',
|
AccountType::EXPENSE => 'fa-shopping-cart',
|
||||||
'Beneficiary account' => 'fa-shopping-cart',
|
AccountType::BENEFICIARY => 'fa-shopping-cart',
|
||||||
'revenue' => 'fa-download',
|
'revenue' => 'fa-download',
|
||||||
'Revenue account' => 'fa-download',
|
AccountType::REVENUE => 'fa-download',
|
||||||
'import' => 'fa-download',
|
'import' => 'fa-download',
|
||||||
'Import account' => 'fa-download',
|
AccountType::IMPORT => 'fa-download',
|
||||||
'liabilities' => 'fa-ticket',
|
'liabilities' => 'fa-ticket',
|
||||||
],
|
],
|
||||||
'accountTypesByIdentifier' => [
|
'accountTypesByIdentifier' => [
|
||||||
'asset' => ['Default account', 'Asset account'],
|
'asset' => [AccountType::DEFAULT, AccountType::ASSET],
|
||||||
'expense' => ['Expense account', 'Beneficiary account'],
|
'expense' => [AccountType::EXPENSE, AccountType::BENEFICIARY],
|
||||||
'revenue' => ['Revenue account'],
|
'revenue' => [AccountType::REVENUE],
|
||||||
'import' => ['Import account'],
|
'import' => [AccountType::IMPORT],
|
||||||
'liabilities' => ['Loan', 'Debt', 'Credit card', 'Mortgage'],
|
'liabilities' => [AccountType::LOAN, AccountType::DEBT, AccountType::CREDITCARD, AccountType::MORTGAGE],
|
||||||
],
|
],
|
||||||
'accountTypeByIdentifier' => [
|
'accountTypeByIdentifier' => [
|
||||||
'asset' => ['Asset account'],
|
'asset' => [AccountType::ASSET],
|
||||||
'expense' => ['Expense account'],
|
'expense' => [AccountType::EXPENSE],
|
||||||
'revenue' => ['Revenue account'],
|
'revenue' => [AccountType::REVENUE],
|
||||||
'opening' => ['Initial balance account'],
|
'opening' => [AccountType::INITIAL_BALANCE],
|
||||||
'initial' => ['Initial balance account'],
|
'initial' => [AccountType::INITIAL_BALANCE],
|
||||||
'import' => ['Import account'],
|
'import' => [AccountType::IMPORT],
|
||||||
'reconcile' => ['Reconciliation account'],
|
'reconcile' => [AccountType::RECONCILIATION],
|
||||||
'liabilities' => ['Loan', 'Debt', 'Mortgage', 'Credit card'],
|
'liabilities' => [AccountType::LOAN, AccountType::DEBT, AccountType::MORTGAGE, AccountType::CREDITCARD],
|
||||||
'liability' => ['Loan', 'Debt', 'Mortgage', 'Credit card'],
|
'liability' => [AccountType::LOAN, AccountType::DEBT, AccountType::MORTGAGE, AccountType::CREDITCARD],
|
||||||
],
|
],
|
||||||
'shortNamesByFullName' => [
|
'shortNamesByFullName' => [
|
||||||
'Default account' => 'asset',
|
AccountType::DEFAULT => 'asset',
|
||||||
'Asset account' => 'asset',
|
AccountType::ASSET => 'asset',
|
||||||
'Import account' => 'import',
|
AccountType::IMPORT => 'import',
|
||||||
'Expense account' => 'expense',
|
AccountType::EXPENSE => 'expense',
|
||||||
'Beneficiary account' => 'expense',
|
AccountType::BENEFICIARY => 'expense',
|
||||||
'Revenue account' => 'revenue',
|
AccountType::REVENUE => 'revenue',
|
||||||
'Cash account' => 'cash',
|
AccountType::CASH => 'cash',
|
||||||
'Initial balance account' => 'initial-balance',
|
AccountType::INITIAL_BALANCE => 'initial-balance',
|
||||||
'Reconciliation account' => 'reconciliation',
|
AccountType::RECONCILIATION => 'reconciliation',
|
||||||
'Credit card' => 'liabilities',
|
AccountType::CREDITCARD => 'liabilities',
|
||||||
'Loan' => 'liabilities',
|
AccountType::LOAN => 'liabilities',
|
||||||
'Debt' => 'liabilities',
|
AccountType::DEBT => 'liabilities',
|
||||||
'Mortgage' => 'liabilities',
|
AccountType::MORTGAGE => 'liabilities',
|
||||||
],
|
],
|
||||||
'shortLiabilityNameByFullName' => [
|
'shortLiabilityNameByFullName' => [
|
||||||
'Credit card' => 'creditcard',
|
AccountType::CREDITCARD => 'creditcard',
|
||||||
'Loan' => 'loan',
|
AccountType::LOAN => AccountType::LOAN,
|
||||||
'Debt' => 'debt',
|
AccountType::DEBT => AccountType::DEBT,
|
||||||
'Mortgage' => 'mortgage',
|
AccountType::MORTGAGE => AccountType::MORTGAGE,
|
||||||
],
|
],
|
||||||
/**
|
/**
|
||||||
* Languages configuration.
|
* Languages configuration.
|
||||||
@@ -576,7 +576,7 @@ return [
|
|||||||
'to_account_nr_ends' => ['alias' => true, 'alias_for' => 'destination_account_nr_ends', 'needs_context' => true,],
|
'to_account_nr_ends' => ['alias' => true, 'alias_for' => 'destination_account_nr_ends', 'needs_context' => true,],
|
||||||
|
|
||||||
// any account id is
|
// any account id is
|
||||||
'account_id' => ['alias' => false, 'needs_context' => true,], // TODO
|
'account_id' => ['alias' => false, 'needs_context' => true,],
|
||||||
|
|
||||||
// category
|
// category
|
||||||
'category_is' => ['alias' => false, 'needs_context' => true,],
|
'category_is' => ['alias' => false, 'needs_context' => true,],
|
||||||
@@ -587,7 +587,7 @@ return [
|
|||||||
'budget' => ['alias' => true, 'alias_for' => 'budget_is', 'needs_context' => true,],
|
'budget' => ['alias' => true, 'alias_for' => 'budget_is', 'needs_context' => true,],
|
||||||
|
|
||||||
// bill
|
// bill
|
||||||
'bill_is' => ['alias' => false, 'needs_context' => true,], // TODO
|
'bill_is' => ['alias' => false, 'needs_context' => true,],
|
||||||
'bill' => ['alias' => true, 'alias_for' => 'bill_is', 'needs_context' => true,],
|
'bill' => ['alias' => true, 'alias_for' => 'bill_is', 'needs_context' => true,],
|
||||||
|
|
||||||
// type
|
// type
|
||||||
@@ -692,8 +692,8 @@ return [
|
|||||||
TransactionTypeModel::OPENING_BALANCE,],
|
TransactionTypeModel::OPENING_BALANCE,],
|
||||||
AccountType::MORTGAGE => [TransactionTypeModel::WITHDRAWAL, TransactionTypeModel::DEPOSIT, TransactionTypeModel::TRANSFER,
|
AccountType::MORTGAGE => [TransactionTypeModel::WITHDRAWAL, TransactionTypeModel::DEPOSIT, TransactionTypeModel::TRANSFER,
|
||||||
TransactionTypeModel::OPENING_BALANCE,],
|
TransactionTypeModel::OPENING_BALANCE,],
|
||||||
AccountType::INITIAL_BALANCE => [], // todo fill me in.
|
AccountType::INITIAL_BALANCE => [TransactionTypeModel::OPENING_BALANCE],
|
||||||
AccountType::RECONCILIATION => [], // todo fill me in.
|
AccountType::RECONCILIATION => [TransactionTypeModel::RECONCILIATION],
|
||||||
],
|
],
|
||||||
'destination' => [
|
'destination' => [
|
||||||
AccountType::ASSET => [TransactionTypeModel::DEPOSIT, TransactionTypeModel::TRANSFER, TransactionTypeModel::OPENING_BALANCE,
|
AccountType::ASSET => [TransactionTypeModel::DEPOSIT, TransactionTypeModel::TRANSFER, TransactionTypeModel::OPENING_BALANCE,
|
||||||
@@ -706,8 +706,8 @@ return [
|
|||||||
TransactionTypeModel::OPENING_BALANCE,],
|
TransactionTypeModel::OPENING_BALANCE,],
|
||||||
AccountType::MORTGAGE => [TransactionTypeModel::WITHDRAWAL, TransactionTypeModel::DEPOSIT, TransactionTypeModel::TRANSFER,
|
AccountType::MORTGAGE => [TransactionTypeModel::WITHDRAWAL, TransactionTypeModel::DEPOSIT, TransactionTypeModel::TRANSFER,
|
||||||
TransactionTypeModel::OPENING_BALANCE,],
|
TransactionTypeModel::OPENING_BALANCE,],
|
||||||
AccountType::INITIAL_BALANCE => [], // todo fill me in.
|
AccountType::INITIAL_BALANCE => [TransactionTypeModel::OPENING_BALANCE],
|
||||||
AccountType::RECONCILIATION => [], // todo fill me in.
|
AccountType::RECONCILIATION => [TransactionTypeModel::RECONCILIATION],
|
||||||
],
|
],
|
||||||
|
|
||||||
],
|
],
|
||||||
|
@@ -35,18 +35,6 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- TODO -->
|
|
||||||
<!--
|
|
||||||
<div class="card-tools">
|
|
||||||
<ul class="pagination pagination-sm float-right">
|
|
||||||
<li class="page-item"><a class="page-link" href="#">«</a></li>
|
|
||||||
<li class="page-item"><a class="page-link" href="#">1</a></li>
|
|
||||||
<li class="page-item"><a class="page-link" href="#">2</a></li>
|
|
||||||
<li class="page-item"><a class="page-link" href="#">3</a></li>
|
|
||||||
<li class="page-item"><a class="page-link" href="#">»</a></li>
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
-->
|
|
||||||
</div>
|
</div>
|
||||||
<div class="card-body p-0">
|
<div class="card-body p-0">
|
||||||
<table class="table table-sm table-striped">
|
<table class="table table-sm table-striped">
|
||||||
|
1
frontend/src/pages/dashboard.js
vendored
1
frontend/src/pages/dashboard.js
vendored
@@ -31,7 +31,6 @@ import MainPiggyList from "../components/dashboard/MainPiggyList";
|
|||||||
import TransactionListLarge from "../components/transactions/TransactionListLarge";
|
import TransactionListLarge from "../components/transactions/TransactionListLarge";
|
||||||
import TransactionListMedium from "../components/transactions/TransactionListMedium";
|
import TransactionListMedium from "../components/transactions/TransactionListMedium";
|
||||||
import TransactionListSmall from "../components/transactions/TransactionListSmall";
|
import TransactionListSmall from "../components/transactions/TransactionListSmall";
|
||||||
import {Chart} from 'vue-chartjs'
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* First we will load Axios via bootstrap.js
|
* First we will load Axios via bootstrap.js
|
||||||
|
3
frontend/src/pages/register.js
vendored
3
frontend/src/pages/register.js
vendored
@@ -18,9 +18,6 @@
|
|||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import Dashboard from "../components/dashboard/Dashboard";
|
|
||||||
import TopBoxes from "../components/dashboard/TopBoxes";
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* First we will load Axios via bootstrap.js
|
* First we will load Axios via bootstrap.js
|
||||||
* jquery and bootstrap-sass preloaded in app.js
|
* jquery and bootstrap-sass preloaded in app.js
|
||||||
|
4
public/v1/css/firefly.css
vendored
4
public/v1/css/firefly.css
vendored
@@ -179,10 +179,6 @@ span.info-box-text a:hover, span.info-box-number a:hover {
|
|||||||
overflow-x: hidden;
|
overflow-x: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
.bootstrap-tagsinput {
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
|
|
||||||
.accordion {
|
.accordion {
|
||||||
margin-bottom:-3px;
|
margin-bottom:-3px;
|
||||||
}
|
}
|
||||||
|
1
public/v1/js/ff/accounts/index.js
vendored
1
public/v1/js/ff/accounts/index.js
vendored
@@ -63,7 +63,6 @@ function stopSorting() {
|
|||||||
"use strict";
|
"use strict";
|
||||||
$.each($('#sortable-table>tbody>tr.sortable-object'), function (i, v) {
|
$.each($('#sortable-table>tbody>tr.sortable-object'), function (i, v) {
|
||||||
var holder = $(v);
|
var holder = $(v);
|
||||||
var parentBody = holder.parent();
|
|
||||||
var position = parseInt(holder.data('position'));
|
var position = parseInt(holder.data('position'));
|
||||||
var originalOrder = parseInt(holder.data('order'));
|
var originalOrder = parseInt(holder.data('order'));
|
||||||
var id = holder.data('id');
|
var id = holder.data('id');
|
||||||
|
3
public/v1/js/ff/charts.js
vendored
3
public/v1/js/ff/charts.js
vendored
@@ -45,12 +45,9 @@ var colourSet = [
|
|||||||
];
|
];
|
||||||
|
|
||||||
var fillColors = [];
|
var fillColors = [];
|
||||||
var strokePointHighColors = [];
|
|
||||||
|
|
||||||
|
|
||||||
for (var i = 0; i < colourSet.length; i++) {
|
for (var i = 0; i < colourSet.length; i++) {
|
||||||
fillColors.push("rgba(" + colourSet[i][0] + ", " + colourSet[i][1] + ", " + colourSet[i][2] + ", 0.5)");
|
fillColors.push("rgba(" + colourSet[i][0] + ", " + colourSet[i][1] + ", " + colourSet[i][2] + ", 0.5)");
|
||||||
strokePointHighColors.push("rgba(" + colourSet[i][0] + ", " + colourSet[i][1] + ", " + colourSet[i][2] + ", 0.9)");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Chart.defaults.global.legend.display = false;
|
Chart.defaults.global.legend.display = false;
|
||||||
|
1
public/v1/js/ff/index.js
vendored
1
public/v1/js/ff/index.js
vendored
@@ -108,7 +108,6 @@ function getBillsBox() {
|
|||||||
var unpaid = [];
|
var unpaid = [];
|
||||||
var paid = [];
|
var paid = [];
|
||||||
for (key in data) {
|
for (key in data) {
|
||||||
var row = data[key];
|
|
||||||
//console.log(key);
|
//console.log(key);
|
||||||
if (key.substr(0, 16) === 'bills-unpaid-in-') {
|
if (key.substr(0, 16) === 'bills-unpaid-in-') {
|
||||||
// only when less than 3.
|
// only when less than 3.
|
||||||
|
2
public/v1/js/ff/reports/index.js
vendored
2
public/v1/js/ff/reports/index.js
vendored
@@ -51,7 +51,7 @@ $(function () {
|
|||||||
);
|
);
|
||||||
|
|
||||||
// set report type from cookie, if any:
|
// set report type from cookie, if any:
|
||||||
if (!(readCookie('report-type') === null)) {
|
if (null !== readCookie('report-type')) {
|
||||||
$('select[name="report_type"]').val(readCookie('report-type'));
|
$('select[name="report_type"]').val(readCookie('report-type'));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
3
public/v1/js/ff/rules/create-edit.js
vendored
3
public/v1/js/ff/rules/create-edit.js
vendored
@@ -252,9 +252,6 @@ function updateActionInput(selectList) {
|
|||||||
createAutoComplete(inputResult, 'api/v1/autocomplete/transactions');
|
createAutoComplete(inputResult, 'api/v1/autocomplete/transactions');
|
||||||
break;
|
break;
|
||||||
case 'set_source_account':
|
case 'set_source_account':
|
||||||
console.log('Select list value is ' + selectList.val() + ', so input needs auto complete.');
|
|
||||||
createAutoComplete(inputResult, 'api/v1/autocomplete/accounts');
|
|
||||||
break;
|
|
||||||
case 'set_destination_account':
|
case 'set_destination_account':
|
||||||
console.log('Select list value is ' + selectList.val() + ', so input needs auto complete.');
|
console.log('Select list value is ' + selectList.val() + ', so input needs auto complete.');
|
||||||
createAutoComplete(inputResult, 'api/v1/autocomplete/accounts');
|
createAutoComplete(inputResult, 'api/v1/autocomplete/accounts');
|
||||||
|
@@ -121,7 +121,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Create Client Form -->
|
<!-- Create Client Form -->
|
||||||
<form role="form">
|
<form role="form" aria-label="form">
|
||||||
<!-- Name -->
|
<!-- Name -->
|
||||||
<div class="form-group row">
|
<div class="form-group row">
|
||||||
<label class="col-md-3 col-form-label">{{ $t('firefly.name') }}</label>
|
<label class="col-md-3 col-form-label">{{ $t('firefly.name') }}</label>
|
||||||
@@ -208,7 +208,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Edit Client Form -->
|
<!-- Edit Client Form -->
|
||||||
<form role="form">
|
<form role="form" aria-label="form">
|
||||||
<!-- Name -->
|
<!-- Name -->
|
||||||
<div class="form-group row">
|
<div class="form-group row">
|
||||||
<label class="col-md-3 col-form-label">{{ $t('firefly.name') }}</label>
|
<label class="col-md-3 col-form-label">{{ $t('firefly.name') }}</label>
|
||||||
|
@@ -842,19 +842,7 @@ export default {
|
|||||||
|
|
||||||
deleteTransaction: function (index, event) {
|
deleteTransaction: function (index, event) {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
for (const key in this.transactions) {
|
|
||||||
if (
|
|
||||||
this.transactions.hasOwnProperty(key) && /^0$|^[1-9]\d*$/.test(key) && key <= 4294967294) {
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
this.transactions.splice(index, 1);
|
this.transactions.splice(index, 1);
|
||||||
|
|
||||||
for (const key in this.transactions) {
|
|
||||||
if (
|
|
||||||
this.transactions.hasOwnProperty(key) && /^0$|^[1-9]\d*$/.test(key) && key <= 4294967294) {
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
limitSourceType: function (type) {
|
limitSourceType: function (type) {
|
||||||
let i;
|
let i;
|
||||||
|
@@ -585,7 +585,6 @@ export default {
|
|||||||
|
|
||||||
tagList = [];
|
tagList = [];
|
||||||
foreignAmount = '0';
|
foreignAmount = '0';
|
||||||
foreignCurrency = null;
|
|
||||||
// loop tags
|
// loop tags
|
||||||
for (let tagKey in row.tags) {
|
for (let tagKey in row.tags) {
|
||||||
if (row.tags.hasOwnProperty(tagKey) && /^0$|^[1-9]\d*$/.test(tagKey) && tagKey <= 4294967294) {
|
if (row.tags.hasOwnProperty(tagKey) && /^0$|^[1-9]\d*$/.test(tagKey) && tagKey <= 4294967294) {
|
||||||
|
Reference in New Issue
Block a user