mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-02-25 18:45:27 -06:00
Implement #803
This commit is contained in:
parent
816b291ed3
commit
6b09466819
@ -21,6 +21,7 @@ use FireflyIII\Events\UpdatedTransactionJournal;
|
||||
use FireflyIII\Helpers\Attachments\AttachmentHelperInterface;
|
||||
use FireflyIII\Http\Controllers\Controller;
|
||||
use FireflyIII\Http\Requests\JournalFormRequest;
|
||||
use FireflyIII\Models\Account;
|
||||
use FireflyIII\Models\AccountType;
|
||||
use FireflyIII\Models\Transaction;
|
||||
use FireflyIII\Models\TransactionJournal;
|
||||
@ -143,7 +144,7 @@ class SingleController extends Controller
|
||||
{
|
||||
$what = strtolower($what);
|
||||
$uploadSize = min(Steam::phpBytes(ini_get('upload_max_filesize')), Steam::phpBytes(ini_get('post_max_size')));
|
||||
$assetAccounts = ExpandedForm::makeSelectList($this->accounts->getActiveAccountsByType([AccountType::DEFAULT, AccountType::ASSET]));
|
||||
$assetAccounts = $this->groupedAccountList();
|
||||
$budgets = ExpandedForm::makeSelectListWithEmpty($this->budgets->getActiveBudgets());
|
||||
$piggyBanks = $this->piggyBanks->getPiggyBanksWithAmount();
|
||||
$piggies = ExpandedForm::makeSelectListWithEmpty($piggyBanks);
|
||||
@ -239,7 +240,7 @@ class SingleController extends Controller
|
||||
}
|
||||
|
||||
$what = strtolower($journal->transactionTypeStr());
|
||||
$assetAccounts = ExpandedForm::makeSelectList($this->accounts->getAccountsByType([AccountType::DEFAULT, AccountType::ASSET]));
|
||||
$assetAccounts = $this->groupedAccountList();
|
||||
$budgetList = ExpandedForm::makeSelectListWithEmpty($this->budgets->getBudgets());
|
||||
|
||||
// view related code
|
||||
@ -409,6 +410,26 @@ class SingleController extends Controller
|
||||
return redirect($this->getPreviousUri('transactions.edit.uri'));
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
private function groupedAccountList(): array
|
||||
{
|
||||
$accounts = $this->accounts->getActiveAccountsByType([AccountType::DEFAULT, AccountType::ASSET]);
|
||||
$return = [];
|
||||
/** @var Account $account */
|
||||
foreach ($accounts as $account) {
|
||||
$type = $account->getMeta('accountRole');
|
||||
if (strlen($type) === 0) {
|
||||
$type = 'no_account_type';
|
||||
}
|
||||
$key = strval(trans('firefly.opt_group_' . $type));
|
||||
$return[$key][$account->id] = $account->name;
|
||||
}
|
||||
|
||||
return $return;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param TransactionJournal $journal
|
||||
*
|
||||
|
@ -37,6 +37,7 @@ $(document).ready(function () {
|
||||
|
||||
// when user selects different currency,
|
||||
$('.currency-option').on('click', selectsForeignCurrency);
|
||||
$('#ffInput_description').focus();
|
||||
});
|
||||
|
||||
/**
|
||||
@ -84,6 +85,7 @@ function updateDescription() {
|
||||
$.getJSON('json/transaction-journals/' + what).done(function (data) {
|
||||
$('input[name="description"]').typeahead('destroy').typeahead({source: data});
|
||||
});
|
||||
$('#ffInput_description').focus();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -624,6 +624,11 @@ return [
|
||||
'perm-delete-many' => 'Deleting many items in one go can be very disruptive. Please be cautious.',
|
||||
'mass_deleted_transactions_success' => 'Deleted :amount transaction(s).',
|
||||
'mass_edited_transactions_success' => 'Updated :amount transaction(s)',
|
||||
'opt_group_no_account_type' => '(no account type)',
|
||||
'opt_group_defaultAsset' => 'Default asset accounts',
|
||||
'opt_group_savingAsset' => 'Savings accounts',
|
||||
'opt_group_sharedAsset' => 'Shared asset accounts',
|
||||
'opt_group_ccAsset' => 'Credit cards',
|
||||
|
||||
|
||||
// new user:
|
||||
|
Loading…
Reference in New Issue
Block a user