This commit is contained in:
bel
2023-10-24 21:09:02 -06:00
parent 21fed9437f
commit 5d0e7c9a3d
9 changed files with 42 additions and 40 deletions

View File

@@ -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)
}