Skip to content

Firefly III: a personal finances manager

Fix help for transaction thing.

James Coled81128d8c609
diff --git a/app/Http/Controllers/Transaction/CreateController.php b/app/Http/Controllers/Transaction/CreateController.php
index edf9c73db3..c91a82d9d8 100644
--- a/app/Http/Controllers/Transaction/CreateController.php
+++ b/app/Http/Controllers/Transaction/CreateController.php
@@ -63,12 +63,11 @@ class CreateController extends Controller
*
* @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
*/
- public function create()
+ public function create(?string $objectType)
{
/** @var AccountRepositoryInterface $repository */
$repository = app(AccountRepositoryInterface::class);
$cash = $repository->getCashAccount();
- $objectType = TransactionType::WITHDRAWAL;
$preFilled = session()->has('preFilled') ? session('preFilled') : [];
$subTitle = (string)trans('breadcrumbs.create_new_transaction');
$subTitleIcon = 'fa-plus';
diff --git a/app/Support/Http/Controllers/RequestInformation.php b/app/Support/Http/Controllers/RequestInformation.php
index 08cf1a05ce..419286429b 100644
--- a/app/Support/Http/Controllers/RequestInformation.php
+++ b/app/Support/Http/Controllers/RequestInformation.php
@@ -167,6 +167,8 @@ trait RequestInformation
$page = $this->getPageName();
$specificPage = $this->getSpecificPageName();
+
+
// indicator if user has seen the help for this page ( + special page):
$key = sprintf('shown_demo_%s%s', $page, $specificPage);
// is there an intro for this route?
diff --git a/config/intro.php b/config/intro.php
index f3f3999877..a18f7604b3 100644
--- a/config/intro.php
+++ b/config/intro.php
@@ -40,15 +40,30 @@ return [
'accounts_create' => [
'iban' => ['element' => '#ffInput_iban'],
],
-
// transactions: create
- 'transactions_create' => [
+ 'transactions_create_withdrawal' => [
+ 'source' => ['element' => 'input[name="source[]"]'],
+ 'destination' => ['element' => 'input[name="destination[]"]'],
+ 'foreign_currency' => ['element' => 'select[name="foreign_currency[]"]'],
+ 'more_meta' => ['element' => 'input[name="category[]"]'],
+ 'split_add' => ['element' => '.split_add_btn'],
+ ],
+
+ 'transactions_create_deposit' => [
'source' => ['element' => 'input[name="source[]"]'],
+ 'destination' => ['element' => 'input[name="destination[]"]'],
'foreign_currency' => ['element' => 'select[name="foreign_currency[]"]'],
'more_meta' => ['element' => 'input[name="category[]"]'],
'split_add' => ['element' => '.split_add_btn'],
],
+ 'transactions_create_transfer' => [
+ 'source' => ['element' => 'input[name="source[]"]'],
+ 'destination' => ['element' => 'input[name="destination[]"]'],
+ 'foreign_currency' => ['element' => 'select[name="foreign_currency[]"]'],
+ 'more_meta' => ['element' => 'input[name="category[]"]'],
+ 'split_add' => ['element' => '.split_add_btn'],
+ ],
// extra text for asset account creation.
'accounts_create_asset' => [
diff --git a/resources/lang/en_US/intro.php b/resources/lang/en_US/intro.php
index 7225fa59e4..c3451393f5 100644
--- a/resources/lang/en_US/intro.php
+++ b/resources/lang/en_US/intro.php
@@ -24,40 +24,61 @@ declare(strict_types=1);
return [
// index
- 'index_intro' => 'Welcome to the index page of Firefly III. Please take the time to walk through this intro to get a feeling of how Firefly III works.',
- 'index_accounts-chart' => 'This chart shows the current balance of your asset accounts. You can select the accounts visible here in your preferences.',
- 'index_box_out_holder' => 'This little box and the boxes next to this one will give you a quick overview of your financial situation.',
- 'index_help' => 'If you ever need help with a page or a form, press this button.',
- 'index_outro' => 'Most pages of Firefly III will start with a little tour like this one. Please contact me when you have questions or comments. Enjoy!',
- 'index_sidebar-toggle' => 'To create new transactions, accounts or other things, use the menu under this icon.',
- 'index_cash_account' => 'These are the accounts created so far. You can use the cash account to track cash expenses but it\'s not mandatory of course.',
+ 'index_intro' => 'Welcome to the index page of Firefly III. Please take the time to walk through this intro to get a feeling of how Firefly III works.',
+ 'index_accounts-chart' => 'This chart shows the current balance of your asset accounts. You can select the accounts visible here in your preferences.',
+ 'index_box_out_holder' => 'This little box and the boxes next to this one will give you a quick overview of your financial situation.',
+ 'index_help' => 'If you ever need help with a page or a form, press this button.',
+ 'index_outro' => 'Most pages of Firefly III will start with a little tour like this one. Please contact me when you have questions or comments. Enjoy!',
+ 'index_sidebar-toggle' => 'To create new transactions, accounts or other things, use the menu under this icon.',
+ 'index_cash_account' => 'These are the accounts created so far. You can use the cash account to track cash expenses but it\'s not mandatory of course.',
+
+ // transactions (withdrawal)
+ 'transactions_create_withdrawal_source' => 'Select your favorite asset account or liability from this dropdown.',
+ 'transactions_create_withdrawal_destination' => 'Select an expense account here. Leave it empty if you want to make a cash expense.',
+ 'transactions_create_withdrawal_foreign_currency' => 'Use this field to set a foreign currency and amount.',
+ 'transactions_create_withdrawal_more_meta' => 'Plenty of other meta data you set in these fields.',
+ 'transactions_create_withdrawal_split_add' => 'If you want to split a transaction, add more splits with this button',
+
+ // transactions (deposit)
+ 'transactions_create_deposit_source' => 'Select or type the payee in this auto-completing dropdown/textbox. Leave it empty if you want to make a cash deposit.',
+ 'transactions_create_deposit_destination' => 'Select an asset or liability account here.',
+ 'transactions_create_deposit_foreign_currency' => 'Use this field to set a foreign currency and amount.',
+ 'transactions_create_deposit_more_meta' => 'Plenty of other meta data you set in these fields.',
+ 'transactions_create_deposit_split_add' => 'If you want to split a transaction, add more splits with this button',
+
+ // transactions (transfer)
+ 'transactions_create_transfer_source' => 'Select the source asset account here.',
+ 'transactions_create_transfer_destination' => 'Select the destination asset account here.',
+ 'transactions_create_transfer_foreign_currency' => 'Use this field to set a foreign currency and amount.',
+ 'transactions_create_transfer_more_meta' => 'Plenty of other meta data you set in these fields.',
+ 'transactions_create_transfer_split_add' => 'If you want to split a transaction, add more splits with this button',
// create account:
- 'accounts_create_iban' => 'Give your accounts a valid IBAN. This could make a data import very easy in the future.',
- 'accounts_create_asset_opening_balance' => 'Assets accounts may have an "opening balance", indicating the start of this account\'s history in Firefly III.',
- 'accounts_create_asset_currency' => 'Firefly III supports multiple currencies. Asset accounts have one main currency, which you must set here.',
- 'accounts_create_asset_virtual' => 'It can sometimes help to give your account a virtual balance: an extra amount always added to or removed from the actual balance.',
+ 'accounts_create_iban' => 'Give your accounts a valid IBAN. This could make a data import very easy in the future.',
+ 'accounts_create_asset_opening_balance' => 'Assets accounts may have an "opening balance", indicating the start of this account\'s history in Firefly III.',
+ 'accounts_create_asset_currency' => 'Firefly III supports multiple currencies. Asset accounts have one main currency, which you must set here.',
+ 'accounts_create_asset_virtual' => 'It can sometimes help to give your account a virtual balance: an extra amount always added to or removed from the actual balance.',
// budgets index
- 'budgets_index_intro' => 'Budgets are used to manage your finances and form one of the core functions of Firefly III.',
- 'budgets_index_set_budget' => 'Set your total budget for every period so Firefly III can tell you if you have budgeted all available money.',
- 'budgets_index_see_expenses_bar' => 'Spending money will slowly fill this bar.',
- 'budgets_index_navigate_periods' => 'Navigate through periods to easily set budgets ahead of time.',
- 'budgets_index_new_budget' => 'Create new budgets as you see fit.',
- 'budgets_index_list_of_budgets' => 'Use this table to set the amounts for each budget and see how you are doing.',
- 'budgets_index_outro' => 'To learn more about budgeting, checkout the help icon in the top right corner.',
+ 'budgets_index_intro' => 'Budgets are used to manage your finances and form one of the core functions of Firefly III.',
+ 'budgets_index_set_budget' => 'Set your total budget for every period so Firefly III can tell you if you have budgeted all available money.',
+ 'budgets_index_see_expenses_bar' => 'Spending money will slowly fill this bar.',
+ 'budgets_index_navigate_periods' => 'Navigate through periods to easily set budgets ahead of time.',
+ 'budgets_index_new_budget' => 'Create new budgets as you see fit.',
+ 'budgets_index_list_of_budgets' => 'Use this table to set the amounts for each budget and see how you are doing.',
+ 'budgets_index_outro' => 'To learn more about budgeting, checkout the help icon in the top right corner.',
// reports (index)
- 'reports_index_intro' => 'Use these reports to get detailed insights in your finances.',
- 'reports_index_inputReportType' => 'Pick a report type. Check out the help pages to see what each report shows you.',
- 'reports_index_inputAccountsSelect' => 'You can exclude or include asset accounts as you see fit.',
- 'reports_index_inputDateRange' => 'The selected date range is entirely up to you: from one day to 10 years.',
- 'reports_index_extra-options-box' => 'Depending on the report you have selected, you can select extra filters and options here. Watch this box when you change report types.',
+ 'reports_index_intro' => 'Use these reports to get detailed insights in your finances.',
+ 'reports_index_inputReportType' => 'Pick a report type. Check out the help pages to see what each report shows you.',
+ 'reports_index_inputAccountsSelect' => 'You can exclude or include asset accounts as you see fit.',
+ 'reports_index_inputDateRange' => 'The selected date range is entirely up to you: from one day to 10 years.',
+ 'reports_index_extra-options-box' => 'Depending on the report you have selected, you can select extra filters and options here. Watch this box when you change report types.',
// reports (reports)
- 'reports_report_default_intro' => 'This report will give you a quick and comprehensive overview of your finances. If you wish to see anything else, please don\'t hestitate to contact me!',
- 'reports_report_audit_intro' => 'This report will give you detailed insights in your asset accounts.',
- 'reports_report_audit_optionsBox' => 'Use these check boxes to show or hide the columns you are interested in.',
+ 'reports_report_default_intro' => 'This report will give you a quick and comprehensive overview of your finances. If you wish to see anything else, please don\'t hestitate to contact me!',
+ 'reports_report_audit_intro' => 'This report will give you detailed insights in your asset accounts.',
+ 'reports_report_audit_optionsBox' => 'Use these check boxes to show or hide the columns you are interested in.',
'reports_report_category_intro' => 'This report will give you insight in one or multiple categories.',
'reports_report_category_pieCharts' => 'These charts will give you insight in expenses and income per category or per account.',
diff --git a/resources/views/v1/index.twig b/resources/views/v1/index.twig
index 59183fb423..673f4cd63d 100644
--- a/resources/views/v1/index.twig
+++ b/resources/views/v1/index.twig
@@ -81,7 +81,7 @@
<div class="btn-group" role="group" aria-label="...">
<div class="btn-group" role="group">
- <a href="{{ route('transactions.create') }}" class="btn btn-success"><i
+ <a href="{{ route('transactions.create', ['withdrawal']) }}" class="btn btn-success"><i
class="fa fa-plus fa-fw"></i> {{ 'create_new_transaction'|_ }}</a>
</div>
<a class="btn btn-default"
diff --git a/resources/views/v1/partials/control-bar.twig b/resources/views/v1/partials/control-bar.twig
index da883cb39e..40d25cbbe4 100644
--- a/resources/views/v1/partials/control-bar.twig
+++ b/resources/views/v1/partials/control-bar.twig
@@ -4,11 +4,29 @@
<h3 class="control-sidebar-heading">{{ 'create_new_stuff'|_ }}</h3>
<ul class='control-sidebar-menu'>
<li>
- <a href="{{ route('transactions.create') }}">
+ <a href="{{ route('transactions.create', 'withdrawal') }}">
<i class="menu-icon fa fa-long-arrow-left bg-red"></i>
<div class="menu-info">
- <h4 class="control-sidebar-subheading">{{ 'new_transaction'|_ }}</h4>
+ <h4 class="control-sidebar-subheading">{{ 'new_withdrawal'|_ }}</h4>
+ </div>
+ </a>
+ </li>
+ <li>
+ <a href="{{ route('transactions.create', 'deposit') }}">
+ <i class="menu-icon fa fa-long-arrow-right bg-green"></i>
+
+ <div class="menu-info">
+ <h4 class="control-sidebar-subheading">{{ 'new_deposit'|_ }}</h4>
+ </div>
+ </a>
+ </li>
+ <li>
+ <a href="{{ route('transactions.create', 'transfer') }}">
+ <i class="menu-icon fa fa-exchange bg-blue"></i>
+
+ <div class="menu-info">
+ <h4 class="control-sidebar-subheading">{{ 'new_transfer'|_ }}</h4>
</div>
</a>
</li>
diff --git a/resources/views/v1/transactions/index.twig b/resources/views/v1/transactions/index.twig
index 0de36274c5..878c4ef490 100644
--- a/resources/views/v1/transactions/index.twig
+++ b/resources/views/v1/transactions/index.twig
@@ -24,7 +24,7 @@
</div>
<div class="box-body no-padding">
<div style="padding:8px;">
- <a href="{{ route('transactions.create') }}" class="btn btn-success"><i class="fa fa-plus fa-fw"></i> {{ 'create_new_transaction'|_ }}</a>
+ <a href="{{ route('transactions.create', ['withdrawal']) }}" class="btn btn-success"><i class="fa fa-plus fa-fw"></i> {{ 'create_new_transaction'|_ }}</a>
</div>
{# actual list #}
{% include 'list.groups' %}
diff --git a/routes/web.php b/routes/web.php
index f1be50bc4e..174d7fb86d 100644
--- a/routes/web.php
+++ b/routes/web.php
@@ -874,7 +874,7 @@ Route::group(
);
// create group:
- Route::get('create', ['uses' => 'Transaction\CreateController@create', 'as' => 'create']);
+ Route::get('create/{objectType}', ['uses' => 'Transaction\CreateController@create', 'as' => 'create']);
Route::post('store', ['uses' => 'Transaction\CreateController@store', 'as' => 'store']);
// edit group