From: hackbard Date: Sat, 11 Oct 2014 22:08:32 +0000 (+0200) Subject: more checking X-Git-Url: https://hackdaworld.org/gitweb/?a=commitdiff_plain;h=4544e30fc6f21f9f1563cd44a64a4d8c8df25df3;p=outofuni%2Fgocash.git more checking --- diff --git a/gocash.go b/gocash.go index 88b84d9..0ca0fdf 100644 --- a/gocash.go +++ b/gocash.go @@ -71,12 +71,28 @@ func main() { // // hardcoded account ids we have to look at // + // --- buy // wareneingang 19% and 7% pid_buy_n := string("8e3b7c42e3173ed85f3d4736e82afb4d") pid_buy_s := string("0cfd2ceb45fff89b9d1b7ce3af66cdf3") + pid_misc := string("e3acc2865dbf931e41cf2b90240de5c2") + pid_rep := string("b1d04ad157cac569f4299d4ddf94ed6f") + pid_room := string("4394ed4ffa7266f8f8731080926a7a61") + pid_cap := string("4196ee026d1bdb785df2c975fca91ae0") // abziehbare vst 19% and 7% aid_vst_n := string("7c449e13125d6b93043f963628106db2") aid_vst_s := string("006643c1c0a91f2b40614c75a49c6295") + // --- sales + // receipts +/* + aid_rec_n := string("f3e905732b729ba096a50dab60559ce7") + aid_rec_s := string("66c1b04bd897766cb2be538094e1db6a") + aid_tip := string("1d20024badc11a99a8e1cf3a9a64a501") + aid_dep := string("9772f4e231f6f5e3100132cc53eb3447") +*/ + // ust + aid_ust_n := string("e4bd6ff52408be8076f24aeb105893d9") + aid_ust_s := string("38bf40d16529f2a1e611c073c6c1dc9c") // account maps type amap struct { @@ -97,24 +113,43 @@ func main() { } tmp := accnt[aid] switch { - case pid == pid_buy_n: + // ---- buy + // -- goods + case pid == pid_buy_n || pid == pid_misc || pid == pid_rep || pid == pid_room || pid == pid_cap: tmp.taxval=19 tmp.buy=true accnt[aid]=tmp - //accnt[aid].taxval=19 - //accnt[aid].buy=true case pid == pid_buy_s: - //accnt[aid].tax=7 - //accnt[aid].buy=true + tmp.taxval=7 + tmp.buy=true + accnt[aid]=tmp + // mathc pid: verschiedene kosten, reparatur/instandhaltung + // raumkosten + anlage/kapitalkonten + // -> buy, 19, notax + // + // -- tax case aid == aid_vst_n: - //accnt[aid].taxval=19 - //accnt[aid].buy=true - //accnt[aid].tax=true + tmp.taxval=19 + tmp.buy=true + tmp.tax=true + accnt[aid]=tmp case aid == aid_vst_s: - //accnt[aid].tax=7 - //accnt[aid].buy=true - //accnt[aid].tax=true - // there will be more assignments later on! + tmp.taxval=7 + tmp.buy=true + tmp.tax=true + accnt[aid]=tmp + // ---- sales ---- + // -- receipts + // match pid: erloeskonten + // -- tax + case aid == aid_ust_n: + tmp.taxval=19 + tmp.tax=true + accnt[aid]=tmp + case aid == aid_ust_s: + tmp.taxval=7 + tmp.tax=true + accnt[aid]=tmp } } @@ -133,7 +168,7 @@ func main() { } anum := accnt[aid].num if ret == false { - fmt.Println("Problem:", data.Accnt[anum].Name) + fmt.Println("Problem:", data.Accnt[anum].Name,data.Trn[tc].Date) } } }