Fix help for transaction thing.

This commit is contained in:
James Cole 2019-08-07 18:51:35 +02:00
parent bdf76cf9b2
commit d81128d8c6
No known key found for this signature in database
GPG Key ID: C16961E655E74B5E
8 changed files with 90 additions and 35 deletions

View File

@ -63,12 +63,11 @@ class CreateController extends Controller
* *
* @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
*/ */
public function create() public function create(?string $objectType)
{ {
/** @var AccountRepositoryInterface $repository */ /** @var AccountRepositoryInterface $repository */
$repository = app(AccountRepositoryInterface::class); $repository = app(AccountRepositoryInterface::class);
$cash = $repository->getCashAccount(); $cash = $repository->getCashAccount();
$objectType = TransactionType::WITHDRAWAL;
$preFilled = session()->has('preFilled') ? session('preFilled') : []; $preFilled = session()->has('preFilled') ? session('preFilled') : [];
$subTitle = (string)trans('breadcrumbs.create_new_transaction'); $subTitle = (string)trans('breadcrumbs.create_new_transaction');
$subTitleIcon = 'fa-plus'; $subTitleIcon = 'fa-plus';

View File

@ -167,6 +167,8 @@ trait RequestInformation
$page = $this->getPageName(); $page = $this->getPageName();
$specificPage = $this->getSpecificPageName(); $specificPage = $this->getSpecificPageName();
// indicator if user has seen the help for this page ( + special page): // indicator if user has seen the help for this page ( + special page):
$key = sprintf('shown_demo_%s%s', $page, $specificPage); $key = sprintf('shown_demo_%s%s', $page, $specificPage);
// is there an intro for this route? // is there an intro for this route?

View File

@ -40,15 +40,30 @@ return [
'accounts_create' => [ 'accounts_create' => [
'iban' => ['element' => '#ffInput_iban'], 'iban' => ['element' => '#ffInput_iban'],
], ],
// transactions: create // transactions: create
'transactions_create' => [ 'transactions_create_withdrawal' => [
'source' => ['element' => 'input[name="source[]"]'], 'source' => ['element' => 'input[name="source[]"]'],
'destination' => ['element' => 'input[name="destination[]"]'],
'foreign_currency' => ['element' => 'select[name="foreign_currency[]"]'], 'foreign_currency' => ['element' => 'select[name="foreign_currency[]"]'],
'more_meta' => ['element' => 'input[name="category[]"]'], 'more_meta' => ['element' => 'input[name="category[]"]'],
'split_add' => ['element' => '.split_add_btn'], '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. // extra text for asset account creation.
'accounts_create_asset' => [ 'accounts_create_asset' => [

View File

@ -32,6 +32,27 @@ return [
'index_sidebar-toggle' => 'To create new transactions, accounts or other things, use the menu under this icon.', '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_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: // create account:
'accounts_create_iban' => 'Give your accounts a valid IBAN. This could make a data import very easy in the future.', '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_opening_balance' => 'Assets accounts may have an "opening balance", indicating the start of this account\'s history in Firefly III.',

View File

@ -81,7 +81,7 @@
<div class="btn-group" role="group" aria-label="..."> <div class="btn-group" role="group" aria-label="...">
<div class="btn-group" role="group"> <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> class="fa fa-plus fa-fw"></i> {{ 'create_new_transaction'|_ }}</a>
</div> </div>
<a class="btn btn-default" <a class="btn btn-default"

View File

@ -4,11 +4,29 @@
<h3 class="control-sidebar-heading">{{ 'create_new_stuff'|_ }}</h3> <h3 class="control-sidebar-heading">{{ 'create_new_stuff'|_ }}</h3>
<ul class='control-sidebar-menu'> <ul class='control-sidebar-menu'>
<li> <li>
<a href="{{ route('transactions.create') }}"> <a href="{{ route('transactions.create', 'withdrawal') }}">
<i class="menu-icon fa fa-long-arrow-left bg-red"></i> <i class="menu-icon fa fa-long-arrow-left bg-red"></i>
<div class="menu-info"> <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> </div>
</a> </a>
</li> </li>

View File

@ -24,7 +24,7 @@
</div> </div>
<div class="box-body no-padding"> <div class="box-body no-padding">
<div style="padding:8px;"> <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> </div>
{# actual list #} {# actual list #}
{% include 'list.groups' %} {% include 'list.groups' %}

View File

@ -874,7 +874,7 @@ Route::group(
); );
// create 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']); Route::post('store', ['uses' => 'Transaction\CreateController@store', 'as' => 'store']);
// edit group // edit group