diff options
| -rw-r--r-- | config.go | 20 | ||||
| -rw-r--r-- | importexport.go | 7 | ||||
| -rw-r--r-- | interact.go | 4 | ||||
| -rw-r--r--[-rwxr-xr-x] | outtex/logo.png | bin | 79867 -> 79867 bytes | |||
| -rw-r--r-- | sqlite.go | 115 | ||||
| -rw-r--r-- | templates/_data.tex | 3 | ||||
| -rw-r--r-- | templates/_main.tex | 9 | ||||
| -rw-r--r-- | texify.go | 9 |
8 files changed, 115 insertions, 52 deletions
@@ -5,7 +5,7 @@ import ( "fmt" //"os" "io/ioutil" - //"strconv" + "strconv" "github.com/BurntSushi/toml" "github.com/atrox/homedir" "github.com/fatih/color" @@ -25,11 +25,13 @@ type Config struct { Mail string //`toml:"mail"` Url string //`toml:"url"` Taxid string //`toml:"taxid"` + Uid string //`toml:"uid"` Bankacc string //`toml:"bankacc"` Banklz string //`toml:"banklz"` Bankname string //`toml:"bankname"` Iban string //`toml:"iban"` Bic string //`toml:"bic"` + Ust float64 //`toml:"ust"` } var conffile string @@ -87,7 +89,7 @@ func makeNewTOML(gibts bool) { n := "" file, err := homedir.Expand("~/.mywork.db") checkErr(err) - config = Config{file, n, n, n, n, n, n, n, n, n, n, n, n, n, n, n, n, n} + config = Config{file, n, n, n, n, n, n, n, n, n, n, n, n, n, n, n, n, n, n,0.0} } //fmt.Println("Whats Your Namecount\n") database := getNewInterInput("DB File Path: ", config.Database, nli) @@ -103,13 +105,25 @@ func makeNewTOML(gibts bool) { mail := getNewInterInput("Email: ", config.Mail, nli) url := getNewInterInput("URL: ", config.Url, nli) taxid := getNewInterInput("Tax ID: ", config.Taxid, nli) + uid := getNewInterInput("UID: ", config.Uid, nli) + var ust float64 + for{ + uststr := getNewInterInput("USt %: ", fmt.Sprint(config.Ust), nli) + ust, err = strconv.ParseFloat(uststr, 64) + if err != nil { + //fmt.Println(nli,uststr, boldRed("can not be Parsed as a Float."), "Try a sh ape of X.X") + fmt.Println(nli,uststr, "can not be Parsed as a Float.", "Try a sh ape of X.X") + } else { + break + } + } bankname := getNewInterInput("Bank Name: ", config.Bankname, nli) bankacc := getNewInterInput("Bank Account: ", config.Bankacc, nli) banklz := getNewInterInput("BLZ: ", config.Banklz, nli) iban := getNewInterInput("IBAN: ", config.Iban, nli) bic := getNewInterInput("BIC: ", config.Bic, nli) - conf := Config{database, folder, prefix, name, street, zip, city, country, telefon, mobile, mail, url, taxid, bankacc, banklz, bankname, iban, bic} + conf := Config{database, folder, prefix, name, street, zip, city, country, telefon, mobile, mail, url, taxid, uid, bankacc, banklz, bankname, iban, bic, ust} buf := new(bytes.Buffer) err = toml.NewEncoder(buf).Encode(conf) diff --git a/importexport.go b/importexport.go index dde6026..b5da755 100644 --- a/importexport.go +++ b/importexport.go @@ -98,7 +98,7 @@ func ExportCustomers(in []Customer) { defer w.Flush() for _,i := range in { //str := []string{Sint(i.Id),i.Company,i.Name,i.Address,Sflo(i.Satz),i.Lastbill.Format(time.RFC3339)} - str := []string{Sint(i.Id),i.Company,i.Name,i.Address,Sflo(i.Satz),i.Lastbill.Format(timeform)} + str := []string{Sint(i.Id),i.Company,i.Name,i.Address,i.Uid,Sflo(i.Satz),i.Lastbill.Format(timeform)} w.Write(str) //w.WriteStruct(i) } @@ -249,15 +249,16 @@ func ImportCustomers() ([]Customer) { for _, line := range lines { id, err := strconv.Atoi(line[0]) checkErr(err) - sat,err := strconv.ParseFloat(line[4],64) + sat,err := strconv.ParseFloat(line[5],64) checkErr(err) - tim,err := time.Parse(timeform,line[5]) + tim,err := time.Parse(timeform,line[6]) checkErr(err) data := Customer{ Id: id, Company: line[1], Name: line[2], Address: line[3], + Uid: line[4], Satz: sat, Lastbill: tim, } diff --git a/interact.go b/interact.go index b8e5903..119534f 100644 --- a/interact.go +++ b/interact.go @@ -1139,12 +1139,12 @@ func interact(fulldb bool) { //c.ShowPrompt(true) } } - halfbill := bill{0, "None", dur, proj.Id, proj.Name, time.Time{}, time.Time{}, allitems, 0} + halfbill := bill{0, "None", dur, proj.Id, proj.Name, time.Time{}, time.Time{}, allitems, 0, 0} ShowBill(halfbill,false) if isInterSure("Is this bill Correct?") { billid, billident := newBill(billprojid) //c.Println(green("Bill Completed")) - fullbill := bill{billid, billident, dur, proj.Id, proj.Name, time.Time{}, time.Time{}, allitems, 0} + fullbill := bill{billid, billident, dur, proj.Id, proj.Name, time.Time{}, time.Time{}, allitems, 0, config.Ust} saveBill(fullbill) checkTasks(selids, billid) c.ProgressBar().Indeterminate(true) diff --git a/outtex/logo.png b/outtex/logo.png Binary files differindex 84b4f18..84b4f18 100755..100644 --- a/outtex/logo.png +++ b/outtex/logo.png @@ -43,6 +43,7 @@ type Customer struct { Company string Name string Address string + Uid string Satz float64 Lastbill time.Time // Last time a bill was paid } @@ -73,6 +74,7 @@ type bill struct { paid time.Time items []billitem paymentid int + ust float64 } // Useful to Map some old ids to New ones @@ -133,7 +135,8 @@ func initDB(filename string) { name VARCHAR(240), address VARCHAR(240) DEFAULT 'None', satz REAL DEFAULT 1, - lastbill TIMESTAMP DEFAULT '1791-09-30 19:07' ); + lastbill TIMESTAMP DEFAULT '1791-09-30 19:07', + uid VARCHAR(240) DEFAULT 'None'); CREATE TABLE bills( id INTEGER PRIMARY KEY AUTOINCREMENT, identity VARCHAR(240), @@ -145,7 +148,8 @@ func initDB(filename string) { moneys VARCHAR(240), paid TIMESTAMP DEFAULT '1791-09-30 19:07', date TIMESTAMP DEFAULT '1791-09-30 19:07', - paymentid INTEGER DEFAULT 0); + paymentid INTEGER DEFAULT 0, + ust REAL DEFAULT 0); CREATE TABLE payments( id INTEGER PRIMARY KEY AUTOINCREMENT, customerid INTEGER DEFAULT NULL, @@ -384,9 +388,9 @@ func newBill(proj int) (int, string) { showLastBills(5) fmt.Println(frame(boldGreen("Creating New Bill"),true)) invno := getInterInput(sli+"Invoice Number: ") - stmt, err := db.Prepare("INSERT INTO bills (identity, project, date) values(?, ?, datetime('now'))") + stmt, err := db.Prepare("INSERT INTO bills (identity, project, ust, date) values(?, ?, ?, datetime('now'))") checkErr(err) - answ, err := stmt.Exec(invno, proj) + answ, err := stmt.Exec(invno, proj, config.Ust) checkErr(err) lid, _ := answ.LastInsertId() //fmt.Println(frame("Bill "+ invno+" Created with ID "+lid),false) @@ -398,9 +402,9 @@ func saveBill(in bill) { boldGreen := color.New(color.FgGreen, color.Bold).SprintFunc() tasks, times, hours, moneys := items2strings(in.items) fmt.Println(nli+boldGreen("Saving Bill"), in.id) - stmt, err := db.Prepare("UPDATE bills SET identity = ?, timerange = ?, tasks = ?, times = ?, hours = ?, moneys = ? WHERE id = ?") + stmt, err := db.Prepare("UPDATE bills SET identity = ?, timerange = ?, tasks = ?, times = ?, hours = ?, moneys = ?, ust = ? WHERE id = ?") checkErr(err) - _, err = stmt.Exec(in.identity, in.timerange, tasks, times, hours, moneys, in.id) + _, err = stmt.Exec(in.identity, in.timerange, tasks, times, hours, moneys, in.ust, in.id) checkErr(err) fmt.Println(frame(posR(),false)) } @@ -424,6 +428,7 @@ func showLastBills(count int) { var ident, timerange string var date, paid time.Time var taskstr, timestr, hourstr, moneystr string + var ust float64 defer rows.Close() //fmt.Println("___Open Task________________") @@ -437,12 +442,17 @@ func showLastBills(count int) { i := 0 for rows.Next() { i++ - err = rows.Scan(&id, &ident, &timerange, &proj, &taskstr, ×tr, &hourstr, &moneystr, &paid, &date, &payid) + err = rows.Scan(&id, &ident, &timerange, &proj, &taskstr, ×tr, &hourstr, &moneystr, &paid, &date, &payid, &ust) checkErr(err) prn, _ := getProjectName(proj) hsum := sumFloatArray(string2FloatArray(hourstr, ";")) msum := sumFloatArray(string2FloatArray(moneystr, ";")) - fmt.Printf("%s %v:%s - %s (%v) %.1f[h]: %.2f[€] - ",nli, id, ident, prn, date.Local().Format("2006.01.02"), hsum, msum) + tx := msum * ust / 100 + if (ust == 0) { + fmt.Printf("%s %v:%s - %s (%v) %.1f[h]: %.2f[€] - ",nli, id, ident, prn, date.Local().Format("2006.01.02"), hsum, msum) + }else{ + fmt.Printf("%s %v:%s - %s (%v) %.1f[h]: %.2f[€] (excl. %.2f[€] USt) - ",nli, id, ident, prn, date.Local().Format("2006.01.02"), hsum, msum, tx) + } //p := fmt.Sprintf("%v", paid.Local().Format("2006.01.02")) //fmt.Println(p) //if p == "1791.09.30" { @@ -510,14 +520,15 @@ func loadBills(in []int) (out []bill) { var ident, timerange string var date, paid time.Time var taskstr, timestr, hourstr, moneystr string + var ust float64 defer rows.Close() for rows.Next() { - err = rows.Scan(&id, &ident, &timerange, &proj, &taskstr, ×tr, &hourstr, &moneystr, &paid, &date, &payid) + err = rows.Scan(&id, &ident, &timerange, &proj, &taskstr, ×tr, &hourstr, &moneystr, &paid, &date, &payid, &ust) checkErr(err) itms := strings2items(taskstr, timestr, hourstr, moneystr) prname, _ := getProjectName(proj) - bi := bill{id, ident, timerange, proj, prname, date, paid, itms, payid} + bi := bill{id, ident, timerange, proj, prname, date, paid, itms, payid, ust} out = append(out, bi) } return @@ -527,9 +538,9 @@ func loadBills(in []int) (out []bill) { func SaveCustomer(in Customer) (int) { //tila := in.Lastbill.Local().Format("2006-01-02 15:04 MST") tila := in.Lastbill.Local().Format("2006-01-02 15:04") - stmt, err := db.Prepare("INSERT INTO customers (company, name ,address ,satz ,lastbill) values(?, ?, ?, ?, ?)") + stmt, err := db.Prepare("INSERT INTO customers (company, name ,address ,uid ,satz ,lastbill) values(?, ?, ?, ?, ?)") checkErr(err) - res, err := stmt.Exec(in.Company,in.Name,in.Address,in.Satz,tila) + res, err := stmt.Exec(in.Company,in.Name,in.Address,in.Uid,in.Satz,tila) checkErr(err) newid, err := res.LastInsertId() checkErr(err) @@ -585,9 +596,9 @@ func SaveBill(in bill) (int) { tidat := in.date.Local().Format("2006-01-02 15:04") tipai := in.paid.Local().Format("2006-01-02 15:04") tsks,dats,tims,mos := items2strings(in.items) - stmt, err := db.Prepare("INSERT INTO bills (identity, timerange, project, tasks, times, hours, moneys, paid, date, paymentid) values(?, ?, ?,?, ?, ?, ?, datetime(?,'utc'), datetime(?,'utc'), ?)") + stmt, err := db.Prepare("INSERT INTO bills (identity, timerange, project, tasks, times, hours, moneys, paid, date, paymentid, ust) values(?, ?, ?,?, ?, ?, ?, datetime(?,'utc'), datetime(?,'utc'), ?, ?)") checkErr(err) - res, err := stmt.Exec(in.identity, in.timerange, in.project, tsks, dats, tims,mos, tidat, tipai,in.paymentid) + res, err := stmt.Exec(in.identity, in.timerange, in.project, tsks, dats, tims,mos, tidat, tipai,in.paymentid, in.ust) checkErr(err) newid, err := res.LastInsertId() checkErr(err) @@ -1085,17 +1096,18 @@ func GetProject(id int) (outpr Project, outcu Customer) { row, err := db.Query("SELECT * FROM customers WHERE id = ?", customer) checkErr(err) var cid int - var comp, cuname, addy string + var comp, cuname, addy, uid string var satz float64 var lastb time.Time for row.Next() { - err = row.Scan(&cid, &comp, &cuname, &addy, &satz, &lastb) + err = row.Scan(&cid, &comp, &cuname, &addy, &satz, &lastb, &uid) checkErr(err) outcu.Id = cid outcu.Company = comp outcu.Name = cuname outcu.Address = addy + outcu.Uid = uid outcu.Satz = satz outcu.Lastbill = lastb } @@ -1111,12 +1123,12 @@ func GetSelectedCustomers(in []int) (out []Customer) { var id int var rat float64 var last time.Time - var nam, com, add string + var nam, com, add, uid string defer rows.Close() for rows.Next() { - err = rows.Scan(&id, &com, &nam, &add, &rat, &last) - out = append(out, Customer{id,com,nam,add,rat,last}) + err = rows.Scan(&id, &com, &nam, &add, &rat, &last, &uid) + out = append(out, Customer{id,com,nam,add,uid,rat,last}) } return } @@ -1374,14 +1386,15 @@ func GetAllBills() (out []bill) { var dat,pai time.Time var itms []billitem var tsks,tims,hrs,mos string + var ust float64 defer rows.Close() for rows.Next() { - err = rows.Scan(&id,&ide,&trg,&prj,&tsks,&tims,&hrs,&mos,&pai,&dat,&payid) + err = rows.Scan(&id,&ide,&trg,&prj,&tsks,&tims,&hrs,&mos,&pai,&dat,&payid,&ust) checkErr(err) prn,_ = getProjectName(id) itms = strings2items(tsks,tims,hrs,mos) - out = append(out, bill{id,ide,trg,prj,prn,dat,pai,itms,payid}) + out = append(out, bill{id,ide,trg,prj,prn,dat,pai,itms,payid,ust}) } return } @@ -1664,6 +1677,7 @@ func addCustomer() { com := getInterInput(sli+"Enter Customer Company: ") nam := getInterInput(sli+"Enter Customer Name: ") add := getInterInput(sli+"Enter Address (separate lines by ; [Street;Zip;City;Country]): ") + uid := getInterInput(sli+"Enter Customers UID: ") sat := 0.0 for { satstr := getInterInput(sli+"Hourly Rate: ") @@ -1676,11 +1690,11 @@ func addCustomer() { } } - stmt, err := db.Prepare("INSERT INTO customers(company, name, address, satz) values(?, ?, ?, ?)") + stmt, err := db.Prepare("INSERT INTO customers(company, name, address, uid, satz) values(?, ?, ?, ?, ?)") checkErr(err) - _, err = stmt.Exec(com, nam, add, sat) + _, err = stmt.Exec(com, nam, add, uid, sat) checkErr(err) - fmt.Println(nli,boldGreen(" Customer Successfully Added:"), com, nam, add, sat) + fmt.Println(nli,boldGreen(" Customer Successfully Added:"), com, nam, add,uid, sat) fmt.Println(frame(posR(),false)) } @@ -1945,6 +1959,7 @@ func allCustomers(inline bool) { var comp string var name string var addr string + var cuid string var satz float64 var last time.Time @@ -1957,7 +1972,7 @@ func allCustomers(inline bool) { cnt := 0 for rows.Next() { cnt++ - err = rows.Scan(&uid, &comp, &name, &addr, &satz, &last) + err = rows.Scan(&uid, &comp, &name, &addr, &cuid, &satz, &last) checkErr(err) lstr := last.Local().Format("2006-01-02 15:04 MST") if lstr == "1791-09-30 20:12 LMT" { @@ -1989,10 +2004,11 @@ func allProjects() { var com string var nam string var adr string + var uid string var sat float64 var lst time.Time for rows3.Next() { - err = rows3.Scan(&cid, &com, &nam, &adr, &sat, &lst) + err = rows3.Scan(&cid, &com, &nam, &adr, &uid, &sat, &lst) checkErr(err) rows, err := db.Query("SELECT * FROM projects WHERE customer = $1", cid) @@ -2095,6 +2111,7 @@ func DeletePayment(id int) { _, err = stmt.Exec(id) checkErr(err) fmt.Println(nli,boldGreen("Payment ", id, " deleted successfully!")) + //TODO Remove Bill Paed?!? } }else{ fmt.Println(nli,boldRed("There is no Payment "),id) @@ -2280,6 +2297,7 @@ func EditPayment(id int) { var mybills []bill bsum := 0.0 hsum := 0.0 + tsum := 0.0 if len(billstr)>0 { biids = String2IntArray(billstr,";") @@ -2357,6 +2375,7 @@ func EditPayment(id int) { hsum = 0.0 bsum = 0.0 + tsum = 0.0 for _,bi := range mybills{ bisum := 0.0 for _,it := range bi.items { @@ -2365,15 +2384,17 @@ func EditPayment(id int) { } fmt.Printf("%s %s : %s (%s) %.1f[h] %.2f[€]\n",nli,bi.identity,bi.projectname,bi.date.Format("2006-01-02 15:04"),hsum,bisum) bsum += bisum + tsum += bisum * bi.ust / 100 } - if amount != bsum { + + if amount != (bsum + tsum) { fmt.Println(sub("")) - fmt.Println(nli,boldRed(" The sum of the bills (",bsum,"€ for",hsum,"h) does not match Payment amount!")) - if amount > bsum { - fmt.Printf("%s %.2f € Overpaid\n",nli,(amount-bsum) ) + fmt.Println(nli,boldRed(" The sum of the bills (",bsum,"€ +",tsum,"€ Tax for",hsum,"h) does not match Payment amount!")) + if amount > (bsum + tsum) { + fmt.Printf("%s %.2f € Overpaid\n",nli,(amount-bsum-tsum) ) } - if amount < bsum { - fmt.Printf("%s %.2f € Underpaid\n",nli,(amount-bsum) ) + if amount < (bsum + tsum) { + fmt.Printf("%s %.2f € Underpaid\n",nli,(amount-bsum-tsum) ) } } @@ -2385,12 +2406,12 @@ func editCustomer(id int) { boldGreen := color.New(color.FgGreen, color.Bold).SprintFunc() boldRed := color.New(color.FgRed, color.Bold).SprintFunc() fmt.Println(frame(boldGreen("Editing Customer ", id),true)) - var comp, name, addr string + var comp, name, addr, uid string var satz float64 - rows, err := db.Query("SELECT company, name, address, satz FROM customers WHERE id = $1", id) + rows, err := db.Query("SELECT company, name, address, uid, satz FROM customers WHERE id = $1", id) checkErr(err) if rows.Next() { - err = rows.Scan(&comp, &name, &addr, &satz) + err = rows.Scan(&comp, &name, &addr, &uid, &satz) checkErr(err) } else { fmt.Println(nli+boldRed("There Is No Customer"), id) @@ -2402,6 +2423,7 @@ func editCustomer(id int) { comp = getNewInterInput("New Company Name: ", comp, nli) name = getNewInterInput("New Customer Name: ", name, nli) addr = getNewInterInput("New Adress: ", addr, nli) + uid = getNewInterInput("New UID: ", uid, nli) for { satzstr := getNewInterInput("New Hourly Rate: ", fmt.Sprintf("%.2f", satz), nli) satz, err = strconv.ParseFloat(satzstr, 64) @@ -2411,9 +2433,9 @@ func editCustomer(id int) { break } } - stmt, err := db.Prepare("UPDATE customers SET company = ?, name = ?, address = ?, satz = ? WHERE id = ?") + stmt, err := db.Prepare("UPDATE customers SET company = ?, name = ?, address = ?, uid = ?, satz = ? WHERE id = ?") checkErr(err) - _, err = stmt.Exec(comp, name, addr, satz, id) + _, err = stmt.Exec(comp, name, addr, uid, satz, id) checkErr(err) fmt.Println(nli,"...Customer", id, "Updated") fmt.Println(frame("",false)) @@ -2426,10 +2448,11 @@ func editBill(id int) { var prj int var dat, pai time.Time var ident,timran, taskstr, timesstr, hoursstr, moneysstr, datstr, paistr string - rows, err := db.Query("SELECT identity, timerange, project, tasks, times, hours, moneys, paid, date FROM bills WHERE id = $1", id) + var ust float64 + rows, err := db.Query("SELECT identity, timerange, project, tasks, times, hours, moneys, paid, date, ust FROM bills WHERE id = $1", id) checkErr(err) if rows.Next() { - err = rows.Scan(&ident, &timran, &prj, &taskstr, ×str, &hoursstr, &moneysstr, &pai, & dat) + err = rows.Scan(&ident, &timran, &prj, &taskstr, ×str, &hoursstr, &moneysstr, &pai, &dat, &ust) } else { fmt.Println(nli,boldRed("There Is No Bill"), id) return @@ -2477,6 +2500,16 @@ func editBill(id int) { break } } + for { + uststr := getNewInterInput("New USt in %: ",fmt.Sprint(ust), nli) + ust, err = strconv.ParseFloat(uststr, 64) + //checkErr(err) + if err != nil { + fmt.Println(nli,uststr, boldRed("can not be Parsed as a Float."), "Try a sh ape of X.X") + } else { + break + } + } fmt.Println(sli,"Current Items:") itms := strings2items(taskstr,timesstr,hoursstr,moneysstr) fmt.Println(StrLines(ShowItems(itms),nli)) @@ -2506,9 +2539,9 @@ func editBill(id int) { } } taskstr,timesstr,hoursstr,moneysstr = items2strings(itms) - stmt, err := db.Prepare("UPDATE bills SET identity = ?, timerange = ?, project = ?, tasks = ?, times = ?, hours = ?, moneys = ?, paid = datetime(?,'utc'), date = datetime(?,'utc') WHERE id = ?") + stmt, err := db.Prepare("UPDATE bills SET identity = ?, timerange = ?, project = ?, tasks = ?, times = ?, hours = ?, moneys = ?, paid = datetime(?,'utc'), date = datetime(?,'utc'), ust = ? WHERE id = ?") checkErr(err) - _, err = stmt.Exec(ident,timran, prj, taskstr, timesstr, hoursstr, moneysstr, paistr, datstr, id) + _, err = stmt.Exec(ident,timran, prj, taskstr, timesstr, hoursstr, moneysstr, paistr, datstr, ust, id) checkErr(err) fmt.Println(nli,"...Bill", id, "Updated") fmt.Println(frame("",false)) diff --git a/templates/_data.tex b/templates/_data.tex index 15128fc..9326359 100644 --- a/templates/_data.tex +++ b/templates/_data.tex @@ -19,6 +19,7 @@ unter Angabe der Rechnungsnummer (\invoiceReference), umgehend auf das angegeben \newcommand{\customerStreet}{[[.CustStr]]} % Straße \newcommand{\customerZIP}{[[.CustZip]]} % Postleitzahl \newcommand{\customerCity}{[[.CustCity]]} % Ort +\newcommand{\customerUST}{[[.CustUid]]} % Uid nummer % ################## Customer DATA ################## @@ -27,6 +28,8 @@ unter Angabe der Rechnungsnummer (\invoiceReference), umgehend auf das angegeben % ################## Personal DATA ################## % START INVOICE DATA \newcommand{\taxID}{[[.TaxID]]} +\newcommand{\ustID}{[[.UID]]} +\newcommand{\myUST}{[[.Ust]]} % END INVOICE DATA % START SENDERS DATA \newcommand{\senderName}{[[.MyName]]} diff --git a/templates/_main.tex b/templates/_main.tex index 4395ac6..fdffaba 100644 --- a/templates/_main.tex +++ b/templates/_main.tex @@ -21,6 +21,7 @@ \setkomavar{fromname}{\senderName} \setkomavar{fromaddress}{\senderStreet \\ \senderZIP \ \senderCity} \setkomavar{place}{\senderCity} +\setkomavar{ustid}{\ustID} \setkomavar{date}{\invoiceDate} \setkomavar{fromphone}{\senderTelephone} \setkomavar{frommobilephone}{\senderMobilephone} @@ -49,6 +50,7 @@ Webseite & {\normalfont\ttfamily \senderWeb } \\ \\ Steuernummer & \taxID \\ + UID & \ustID \\ \\ Institut & \accountBankName \\ IBAN & \accountIBAN \\ @@ -67,7 +69,8 @@ \begin{document} \AddToShipoutPicture{\headerpic} \begin{letter}{\customerCompany \\ \customerName \\ - \customerStreet \\ \customerZIP \ \customerCity} + \customerStreet \\ \customerZIP \ \customerCity \\ + \customerUST} \opening{\invoiceSalutation} \invoiceText @@ -76,10 +79,10 @@ %\fcolorbox{lightgray}{lightgray}{\large{Projekt: \textbf{\invoiceTitle}}} \fcolorbox{lightgray}{lightgray}{\parbox{\textwidth}{\large{Projekt: \textbf{\invoiceTitle}}}} - \begin{invoice}{Euro}{0} + \begin{invoice}{Euro}{\myUST} \input{[[.Invoice]]} \end{invoice} - \ps Im ausgewiesenen Betrag ist gemäß § 6 Abs UStG keine Umsatzsteuer auf grund der Kleinunternehmerregelung enthalten. + %\ps Im ausgewiesenen Betrag ist gemäß § 6 Abs UStG keine Umsatzsteuer auf grund der Kleinunternehmerregelung enthalten. \closing{\invoiceClosing} \invoiceEnclosures @@ -33,8 +33,11 @@ type Data struct { CustZip string CustCity string CustCountry string + CustUid string TaxID string + UID string + Ust float64 MyName string MyStr string MyZip string @@ -81,8 +84,11 @@ func billTemplate(billdata bill, cust Customer) Filenames { cuzip, cucity, cucou, + cust.Uid, config.Taxid, + config.Uid, + billdata.ust, config.Name, config.Street, config.Zip, @@ -175,7 +181,10 @@ func tmpltest() { "6996", "Busenhausen", "Tittania", + "USt:12345", "6575-6544", + "Mei Ust:282828", + 20.0, "Meinam Sauluschtig", "Saubastrasse 86", "1111", |
