reg prints balance per xaction now
This commit is contained in:
@@ -41,6 +41,13 @@ func LikeNotName(pattern string) Like {
|
||||
}
|
||||
}
|
||||
|
||||
func NotLikeName(pattern string) Like {
|
||||
foo := LikeName(pattern)
|
||||
return func(d Delta) bool {
|
||||
return !foo(d)
|
||||
}
|
||||
}
|
||||
|
||||
func LikeName(pattern string) Like {
|
||||
return func(d Delta) bool {
|
||||
return like(pattern, d.Name)
|
||||
|
||||
@@ -42,6 +42,26 @@ func (deltas Deltas) Transactions() Transactions {
|
||||
return result
|
||||
}
|
||||
|
||||
func (transactions Transactions) NotLike(like ...Like) Transactions {
|
||||
result := make(Transactions, 0, len(transactions))
|
||||
for _, transaction := range transactions {
|
||||
if matching := (Deltas)(transaction).Like(like...); len(matching) == 0 {
|
||||
result = append(result, transaction)
|
||||
}
|
||||
}
|
||||
return result
|
||||
}
|
||||
|
||||
func (transactions Transactions) Like(like ...Like) Transactions {
|
||||
result := make(Transactions, 0, len(transactions))
|
||||
for _, transaction := range transactions {
|
||||
if matching := (Deltas)(transaction).Like(like...); len(matching) > 0 {
|
||||
result = append(result, transaction)
|
||||
}
|
||||
}
|
||||
return result
|
||||
}
|
||||
|
||||
func (transaction Transaction) Payee() string {
|
||||
balances := Deltas(transaction).Balances()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user