mirror of
https://github.com/maybe-finance/maybe.git
synced 2025-08-02 20:15:22 +02:00
Auto naming of Transfer Transaction (#1393)
* Remove Description field * Auto naming of tranfer transaction * Fix transfer test * Improve Transfer entries names
This commit is contained in:
parent
2b61821336
commit
47288a1629
5 changed files with 4 additions and 9 deletions
|
@ -43,12 +43,12 @@ class Account::Transfer < ApplicationRecord
|
|||
end
|
||||
|
||||
class << self
|
||||
def build_from_accounts(from_account, to_account, date:, amount:, currency:, name:)
|
||||
def build_from_accounts(from_account, to_account, date:, amount:, currency:)
|
||||
outflow = from_account.entries.build \
|
||||
amount: amount.abs,
|
||||
currency: from_account.currency,
|
||||
date: date,
|
||||
name: name,
|
||||
name: "Transfer to #{to_account.name}",
|
||||
marked_as_transfer: true,
|
||||
entryable: Account::Transaction.new
|
||||
|
||||
|
@ -56,7 +56,7 @@ class Account::Transfer < ApplicationRecord
|
|||
amount: amount.abs * -1,
|
||||
currency: from_account.currency,
|
||||
date: date,
|
||||
name: name,
|
||||
name: "Transfer from #{from_account.name}",
|
||||
marked_as_transfer: true,
|
||||
entryable: Account::Transaction.new
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue