From a2a9adcb56650555ce2d2b1e47f4d13bec96f73e Mon Sep 17 00:00:00 2001 From: Nikolaus Gotsche Date: Sat, 15 Sep 2018 17:21:35 +0200 Subject: Fixed Billing Bugs, and Missing Libs in Makefile --- interact.go | 11 ++++++++++- makefile | 2 ++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/interact.go b/interact.go index 765c3c3..fd6c576 100644 --- a/interact.go +++ b/interact.go @@ -396,7 +396,10 @@ func interact() { selids := out() //bids,str2 := getTaskList(selids,false) //c.Println(bids,str2) - c.Println(len(out()),"Tasks Selected") + c.Println(len(selids),"Tasks Selected") + if len(selids) == 0 { + return + } multicust, multiproj,projids := checkCustomerProjects(selids) // CHECK IF ONLY ONE CUSTOMER billprojid := 0 @@ -413,11 +416,17 @@ func interact() { }else{ billprojid = projids[0] } + seltasks := getSelectedTasks(selids) count,hours,dur := analyzeTasks(seltasks) //c.Printf("%v Tasks Selected. Totaling %.2f (h) - Dates: %s\n",count,hours,dur) proj,cust := getProject(billprojid) + if cust.id == 0 { + c.Println(boldRed("Customer ",cust.name," Cannot be billed. Please move ",proj.name," to a valid Customer")) + return + } + billid,billident := newBill(billprojid) //prs,cus := getProjectName(billprojid) //c.Println("For",cust.company,"-",cust.name) diff --git a/makefile b/makefile index 2ea7bdc..fa35690 100755 --- a/makefile +++ b/makefile @@ -22,6 +22,8 @@ fetch_stuff: @go get github.com/fatih/color @go get github.com/mattn/go-sqlite3 @go get github.com/abiosoft/ishell + @go get github.com/BurntSushi/toml + @go get github.com/atrox/homedir @mkdir -p outpdf @mkdir -p outtex @echo "All nessecary libaries installed" -- cgit v1.2.3