@@ -35,21 +35,25 @@ func printStats(generalLedger []*ledger.Transaction) {
35
35
endDate := generalLedger [len (generalLedger )- 1 ].Date
36
36
37
37
payees := make (map [string ]struct {})
38
+ cipayees := make (map [string ]struct {})
38
39
accounts := make (map [string ]struct {})
39
40
40
41
var postings int64
41
42
for _ , trans := range generalLedger {
42
- payees [strings . ToLower ( strings . TrimSpace ( trans .Payee )) ] = struct {}{}
43
+ payees [trans .Payee ] = struct {}{}
43
44
for _ , account := range trans .AccountChanges {
44
45
postings ++
45
46
accounts [account .Name ] = struct {}{}
46
47
}
47
48
}
49
+ for p := range payees {
50
+ cipayees [strings .ToLower (strings .TrimSpace (p ))] = struct {}{}
51
+ }
48
52
49
53
days := math .Floor (endDate .Sub (startDate ).Hours () / 24 )
50
54
51
55
fmt .Printf ("%-25s : %s to %s (%s)\n " , "Time period" , startDate .Format (time .DateOnly ), endDate .Format (time .DateOnly ), durafmt .Parse (endDate .Sub (startDate )).String ())
52
- fmt .Printf ("%-25s : %d\n " , "Unique payees" , len (payees ))
56
+ fmt .Printf ("%-25s : %d\n " , "Unique payees" , len (cipayees ))
53
57
fmt .Printf ("%-25s : %d\n " , "Unique accounts" , len (accounts ))
54
58
fmt .Printf ("%-25s : %d (%.1f per day)\n " , "Number of transactions" , len (generalLedger ), float64 (len (generalLedger ))/ days )
55
59
fmt .Printf ("%-25s : %d (%.1f per day)\n " , "Number of postings" , postings , float64 (postings )/ days )
0 commit comments