]> hackdaworld.org Git - outofuni/gocash.git/commitdiff
applied filters
authorhackbard <hackbard@hackdaworld.org>
Tue, 14 Oct 2014 19:36:54 +0000 (21:36 +0200)
committerhackbard <hackbard@hackdaworld.org>
Tue, 14 Oct 2014 19:36:54 +0000 (21:36 +0200)
gocash.go

index 254916482789f82882be8203f903b5505c4a4a83..2d0416bd29a4d90381d1b77b6ae80258bc540223 100644 (file)
--- 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
 }