mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-01-03 12:47:17 -06:00
Simplified account name for cash accounts.
This commit is contained in:
parent
04164500c8
commit
14934367d8
@ -159,20 +159,12 @@ class TransactionController extends Controller
|
||||
|
||||
if ($journal->transactionType->type == 'Withdrawal') {
|
||||
$preFilled['account_id'] = $journal->source_account->id;
|
||||
$preFilled['expense_account'] = $journal->destination_account->name;
|
||||
$preFilled['expense_account'] = $journal->destination_account->name_for_editform;
|
||||
} else {
|
||||
$preFilled['account_id'] = $journal->destination_account->id;
|
||||
$preFilled['revenue_account'] = $journal->source_account->name;
|
||||
$preFilled['revenue_account'] = $journal->source_account->name_for_editform;
|
||||
}
|
||||
|
||||
if ($journal->destination_account->accountType->type == 'Cash account') {
|
||||
$preFilled['expense_account'] = '';
|
||||
}
|
||||
if ($journal->source_account->accountType->type == 'Cash account') {
|
||||
$preFilled['revenue_account'] = '';
|
||||
}
|
||||
|
||||
|
||||
$preFilled['account_from_id'] = $journal->source_account->id;
|
||||
$preFilled['account_to_id'] = $journal->destination_account->id;
|
||||
|
||||
|
@ -180,6 +180,20 @@ class Account extends Model
|
||||
return $value;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getNameForEditformAttribute()
|
||||
{
|
||||
$name = $this->name;
|
||||
if ($this->accountType->type == 'Cash account') {
|
||||
$name = '';
|
||||
}
|
||||
|
||||
return $name;
|
||||
}
|
||||
|
||||
/**
|
||||
* @codeCoverageIgnore
|
||||
* @return \Illuminate\Database\Eloquent\Relations\HasMany
|
||||
|
Loading…
Reference in New Issue
Block a user