From: hackbard Date: Tue, 14 Oct 2014 19:36:54 +0000 (+0200) Subject: applied filters X-Git-Url: https://hackdaworld.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bf2f5a033ea8bb882343d0cb98a23d6ff89529c8;p=outofuni%2Fgocash.git applied filters --- 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 }