ledger balances helpers like Sub, Sum, Invert
This commit is contained in:
@@ -4,7 +4,6 @@ import (
|
||||
"flag"
|
||||
"fmt"
|
||||
"io"
|
||||
"maps"
|
||||
"os"
|
||||
"slices"
|
||||
|
||||
@@ -101,14 +100,7 @@ func Main() {
|
||||
for _, date := range register.Dates() {
|
||||
balances := register[date]
|
||||
|
||||
newBalances := make(ledger.Balances)
|
||||
for k, v := range balances {
|
||||
if got := prev[k]; !maps.Equal(v, got) {
|
||||
newBalances[k] = v
|
||||
}
|
||||
}
|
||||
|
||||
if len(newBalances) > 0 {
|
||||
if newBalances := balances.Sub(prev).Nonzero(); len(newBalances) > 0 {
|
||||
fmt.Println(date)
|
||||
FPrintBalances(os.Stdout, newBalances)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user