From bf2f5a033ea8bb882343d0cb98a23d6ff89529c8 Mon Sep 17 00:00:00 2001 From: hackbard Date: Tue, 14 Oct 2014 21:36:54 +0200 Subject: [PATCH] applied filters --- gocash.go | 28 +++++++++++++++++++++++----- 1 file changed, 23 insertions(+), 5 deletions(-) diff --git a/gocash.go b/gocash.go index 2549164..2d0416b 100644 --- a/gocash.go +++ b/gocash.go @@ -5,6 +5,7 @@ import ( "fmt" "io/ioutil" "os" + "strings" ) // @@ -169,8 +170,10 @@ func main() { aid := data.Trn[tc].Spl[tsc].AccountId if check_trn(&data.Trn[tc],accnt,aid) == false { ac := accnt[aid].num - fmt.Println("P:",data.Accnt[ac].Name,"at",data.Trn[tc].Date) - + fmt.Println("") + fmt.Println(data.Trn[tc].Date) + fmt.Println(" ",data.Trn[tc].Description) + fmt.Println(" ",data.Accnt[ac].Name) } } } @@ -200,9 +203,24 @@ func check_trn(ta *Transaction,accnt map[string]amap,aid string) bool { //fmt.Println(data.Accnt[accnt[oaid].num].Name) } } - // exceptions - //if !ok { - //} + + // some exceptions + wordlist := []string{ + "GEMA", + "Deutsche Post", + "gesetz IHK", + "Gesundheitsbelehrung", + "Gewerbezentralregister", + "Entgeltabrechnung siehe Anlage", + "ENTGELT SPK", + "ttenrecht und F", + } + for wc := range wordlist { + if strings.Contains(ta.Description,wordlist[wc]){ + return true + } + } + return false } -- 2.39.2