to Name
This commit is contained in:
@@ -10,16 +10,16 @@ const (
|
||||
|
||||
type Delta struct {
|
||||
Date string
|
||||
Account string
|
||||
Name string
|
||||
Value float64
|
||||
Currency Currency
|
||||
Description string
|
||||
}
|
||||
|
||||
func newDelta(d, desc, acc string, v float64, c string) Delta {
|
||||
func newDelta(d, desc, name string, v float64, c string) Delta {
|
||||
return Delta{
|
||||
Date: d,
|
||||
Account: acc,
|
||||
Name: name,
|
||||
Value: v,
|
||||
Currency: Currency(c),
|
||||
Description: desc,
|
||||
@@ -29,12 +29,12 @@ func newDelta(d, desc, acc string, v float64, c string) Delta {
|
||||
func (delta Delta) Plus(other Delta) Delta {
|
||||
return Delta{
|
||||
Date: other.Date,
|
||||
Account: delta.Account,
|
||||
Name: delta.Name,
|
||||
Value: delta.Value + other.Value,
|
||||
Currency: other.Currency,
|
||||
}
|
||||
}
|
||||
|
||||
func (delta Delta) Debug() string {
|
||||
return fmt.Sprintf("{@%s %s:\"%s\" %.2f %s}", delta.Date, delta.Account, delta.Description, delta.Value, delta.Currency)
|
||||
return fmt.Sprintf("{@%s %s:\"%s\" %.2f %s}", delta.Date, delta.Name, delta.Description, delta.Value, delta.Currency)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user