mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-12 23:45:10 +00:00
Rebuild new layout.
This commit is contained in:
@@ -98,17 +98,17 @@ class StoreRequest extends FormRequest
|
||||
|
||||
// source of transaction. If everything is null, assume cash account.
|
||||
'source_id' => $this->integerFromValue((string)$object['source_id']),
|
||||
'source_name' => $this->clearString((string)$object['source_name'], false),
|
||||
'source_iban' => $this->clearString((string)$object['source_iban'], false),
|
||||
'source_number' => $this->clearString((string)$object['source_number'], false),
|
||||
'source_bic' => $this->clearString((string)$object['source_bic'], false),
|
||||
'source_name' => $this->clearString($object['source_name'], false),
|
||||
'source_iban' => $this->clearString($object['source_iban'], false),
|
||||
'source_number' => $this->clearString($object['source_number'], false),
|
||||
'source_bic' => $this->clearString($object['source_bic'], false),
|
||||
|
||||
// destination of transaction. If everything is null, assume cash account.
|
||||
'destination_id' => $this->integerFromValue((string)$object['destination_id']),
|
||||
'destination_name' => $this->clearString((string)$object['destination_name'], false),
|
||||
'destination_iban' => $this->clearString((string)$object['destination_iban'], false),
|
||||
'destination_number' => $this->clearString((string)$object['destination_number'], false),
|
||||
'destination_bic' => $this->clearString((string)$object['destination_bic'], false),
|
||||
'destination_name' => $this->clearString($object['destination_name'], false),
|
||||
'destination_iban' => $this->clearString($object['destination_iban'], false),
|
||||
'destination_number' => $this->clearString($object['destination_number'], false),
|
||||
'destination_bic' => $this->clearString($object['destination_bic'], false),
|
||||
|
||||
// budget info
|
||||
'budget_id' => $this->integerFromValue((string)$object['budget_id']),
|
||||
|
@@ -188,9 +188,6 @@ class TransactionIdentifier extends Command
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
|
||||
return $opposing;
|
||||
}
|
||||
|
||||
|
@@ -181,7 +181,7 @@ class TransactionJournalFactory
|
||||
|
||||
/** create or get source and destination accounts */
|
||||
$sourceInfo = [
|
||||
'id' => (int)$row['source_id'],
|
||||
'id' => $row['source_id'],
|
||||
'name' => $row['source_name'],
|
||||
'iban' => $row['source_iban'],
|
||||
'number' => $row['source_number'],
|
||||
@@ -190,7 +190,7 @@ class TransactionJournalFactory
|
||||
];
|
||||
|
||||
$destInfo = [
|
||||
'id' => (int)$row['destination_id'],
|
||||
'id' => $row['destination_id'],
|
||||
'name' => $row['destination_name'],
|
||||
'iban' => $row['destination_iban'],
|
||||
'number' => $row['destination_number'],
|
||||
@@ -347,6 +347,7 @@ class TransactionJournalFactory
|
||||
*/
|
||||
private function validateAccounts(NullArrayObject $data): void
|
||||
{
|
||||
Log::debug(sprintf('Now in %s', __METHOD__));
|
||||
$transactionType = $data['type'] ?? 'invalid';
|
||||
$this->accountValidator->setUser($this->user);
|
||||
$this->accountValidator->setTransactionType($transactionType);
|
||||
|
@@ -186,9 +186,6 @@ class UserEventHandler
|
||||
} catch (Exception $e) { // @phpstan-ignore-line
|
||||
Log::error($e->getMessage());
|
||||
}
|
||||
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -214,9 +211,6 @@ class UserEventHandler
|
||||
} catch (Exception $e) { // @phpstan-ignore-line
|
||||
Log::error($e->getMessage());
|
||||
}
|
||||
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -242,9 +236,6 @@ class UserEventHandler
|
||||
} catch (Exception $e) { // @phpstan-ignore-line
|
||||
Log::error($e->getMessage());
|
||||
}
|
||||
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@@ -255,9 +255,6 @@ class ReconcileController extends Controller
|
||||
Log::debug(sprintf('Could not render: %s', $e->getMessage()));
|
||||
$html = sprintf('Could not render accounts.reconcile.transactions: %s', $e->getMessage());
|
||||
}
|
||||
|
||||
|
||||
|
||||
return response()->json(['html' => $html, 'startBalance' => $startBalance, 'endBalance' => $endBalance]);
|
||||
}
|
||||
|
||||
|
@@ -56,9 +56,6 @@ class RuleController extends Controller
|
||||
Log::error(sprintf('Cannot render rules.partials.action: %s', $e->getMessage()));
|
||||
$view = 'Could not render view.';
|
||||
}
|
||||
|
||||
|
||||
|
||||
return response()->json(['html' => $view]);
|
||||
}
|
||||
|
||||
|
@@ -676,9 +676,6 @@ class CategoryController extends Controller
|
||||
Log::error(sprintf('Could not render category::expenses: %s', $e->getMessage()));
|
||||
$result = sprintf('An error prevented Firefly III from rendering: %s. Apologies.', $e->getMessage());
|
||||
}
|
||||
|
||||
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
@@ -181,9 +181,6 @@ class SelectController extends Controller
|
||||
Log::error($exception->getTraceAsString());
|
||||
$view = sprintf('Could not render list.journals-tiny: %s', $exception->getMessage());
|
||||
}
|
||||
|
||||
|
||||
|
||||
return response()->json(['html' => $view, 'warning' => $warning]);
|
||||
}
|
||||
|
||||
@@ -225,9 +222,6 @@ class SelectController extends Controller
|
||||
Log::error(sprintf('Could not render view in testTriggersByRule(): %s', $exception->getMessage()));
|
||||
Log::error($exception->getTraceAsString());
|
||||
}
|
||||
|
||||
|
||||
|
||||
return response()->json(['html' => $view, 'warning' => $warning]);
|
||||
}
|
||||
}
|
||||
|
@@ -121,9 +121,6 @@ class SearchController extends Controller
|
||||
Log::error(sprintf('Cannot render search.search: %s', $e->getMessage()));
|
||||
$html = 'Could not render view.';
|
||||
}
|
||||
|
||||
|
||||
|
||||
return response()->json(['count' => $groups->count(), 'html' => $html]);
|
||||
}
|
||||
}
|
||||
|
@@ -407,9 +407,6 @@ trait AccountServiceTrait
|
||||
Log::error($e->getMessage());
|
||||
Log::error($e->getTraceAsString());
|
||||
}
|
||||
|
||||
|
||||
|
||||
return $group;
|
||||
}
|
||||
}
|
||||
|
@@ -168,7 +168,7 @@ trait JournalServiceTrait
|
||||
* @return Account
|
||||
* @throws FireflyException
|
||||
*/
|
||||
private function createAccount(?Account $account, array $data, string $preferredType): Account
|
||||
private function createAccount(?Account $account, array $data, string $preferredType): ?Account
|
||||
{
|
||||
Log::debug('Now in createAccount()', $data);
|
||||
// return new account.
|
||||
@@ -192,7 +192,15 @@ trait JournalServiceTrait
|
||||
Log::debug(sprintf('Account name is now IBAN ("%s")', $data['iban']));
|
||||
$data['name'] = $data['iban'];
|
||||
}
|
||||
|
||||
// fix name of account if only number is given:
|
||||
if ('' === (string)$data['name'] && '' !== (string)$data['number']) {
|
||||
Log::debug(sprintf('Account name is now account number ("%s")', $data['number']));
|
||||
$data['name'] = $data['number'];
|
||||
}
|
||||
// if name is still NULL, return NULL.
|
||||
if(null === $data['name']) {
|
||||
return null;
|
||||
}
|
||||
$data['name'] = $data['name'] ?? '(no name)';
|
||||
|
||||
$account = $this->accountRepository->store(
|
||||
|
@@ -38,7 +38,8 @@ class EitherConfigKey
|
||||
'firefly.accountRoles',
|
||||
'firefly.valid_liabilities',
|
||||
'firefly.interest_periods',
|
||||
'firefly.enable_external_map'
|
||||
'firefly.enable_external_map',
|
||||
'firefly.expected_source_types'
|
||||
];
|
||||
/**
|
||||
* @param string $value
|
||||
|
@@ -72,9 +72,6 @@ trait RenderPartialViews
|
||||
Log::error(sprintf('Could not render: %s', $e->getMessage()));
|
||||
$view = 'Firefly III could not render the view. Please see the log files.';
|
||||
}
|
||||
|
||||
|
||||
|
||||
return $view;
|
||||
}
|
||||
|
||||
@@ -95,9 +92,6 @@ trait RenderPartialViews
|
||||
Log::error(sprintf('Cannot render reports.options.tag: %s', $e->getMessage()));
|
||||
$result = 'Could not render view.';
|
||||
}
|
||||
|
||||
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
@@ -128,9 +122,6 @@ trait RenderPartialViews
|
||||
Log::error(sprintf('Could not render: %s', $e->getMessage()));
|
||||
$view = 'Firefly III could not render the view. Please see the log files.';
|
||||
}
|
||||
|
||||
|
||||
|
||||
return $view;
|
||||
}
|
||||
|
||||
@@ -178,9 +169,6 @@ trait RenderPartialViews
|
||||
Log::error(sprintf('Cannot render reports.options.category: %s', $e->getMessage()));
|
||||
$result = 'Could not render view.';
|
||||
}
|
||||
|
||||
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
@@ -221,9 +209,6 @@ trait RenderPartialViews
|
||||
Log::error(sprintf('Cannot render reports.options.tag: %s', $e->getMessage()));
|
||||
$result = 'Could not render view.';
|
||||
}
|
||||
|
||||
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
@@ -256,9 +241,6 @@ trait RenderPartialViews
|
||||
Log::error(sprintf('Could not render: %s', $e->getMessage()));
|
||||
$view = 'Firefly III could not render the view. Please see the log files.';
|
||||
}
|
||||
|
||||
|
||||
|
||||
return $view;
|
||||
}
|
||||
|
||||
@@ -380,9 +362,6 @@ trait RenderPartialViews
|
||||
Log::error(sprintf('Could not render: %s', $e->getMessage()));
|
||||
$view = 'Firefly III could not render the view. Please see the log files.';
|
||||
}
|
||||
|
||||
|
||||
|
||||
return $view;
|
||||
}
|
||||
|
||||
@@ -400,9 +379,6 @@ trait RenderPartialViews
|
||||
Log::error(sprintf('Cannot render reports.options.no-options: %s', $e->getMessage()));
|
||||
$result = 'Could not render view.';
|
||||
}
|
||||
|
||||
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
@@ -424,9 +400,6 @@ trait RenderPartialViews
|
||||
Log::error(sprintf('Cannot render reports.options.tag: %s', $e->getMessage()));
|
||||
$result = 'Could not render view.';
|
||||
}
|
||||
|
||||
|
||||
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
|
@@ -34,15 +34,16 @@ use Log;
|
||||
trait ConvertsDataTypes
|
||||
{
|
||||
/**
|
||||
* Remove weird chars from strings.
|
||||
* @param string|null $string
|
||||
* @param bool $keepNewlines
|
||||
*
|
||||
* @param string $string
|
||||
* @param bool $keepNewlines
|
||||
*
|
||||
* @return string
|
||||
* @return string|null
|
||||
*/
|
||||
public function clearString(string $string, bool $keepNewlines = true): string
|
||||
public function clearString(?string $string, bool $keepNewlines = true): ?string
|
||||
{
|
||||
if(null === $string) {
|
||||
return null;
|
||||
}
|
||||
$search = [
|
||||
"\u{0001}", // start of heading
|
||||
"\u{0002}", // start of text
|
||||
|
Reference in New Issue
Block a user