diff options
Diffstat (limited to 'sqlite.go')
| -rw-r--r-- | sqlite.go | 16 |
1 files changed, 11 insertions, 5 deletions
@@ -87,8 +87,10 @@ func (t Task) Duration() float64 { dur := t.Stop.Sub(t.Start) return dur.Hours() } - - +func (t Task) Money() float64 { + _,cu := GetProject(t.Projectid) + return t.Duration()*cu.Satz +} // Global Variables @@ -1565,8 +1567,12 @@ func AddPayment(dat string) { if len(selids)>0{ break }else{ + // TODO allow no bills and ask fmt.Println(boldRed("At least one Bill should Correspont to a payment!")) - getInterInput("<continue>") + if isInterSure(sli+"Do you want to continue without a selection?") { + //getInterInput("<continue>") + break + } } } mybills := loadBills(selids) @@ -1578,7 +1584,7 @@ func AddPayment(dat string) { } fmt.Println(frame(boldGreen("New Payment"),true)) - fmt.Println(nli," Amount:",amtfl) + fmt.Println(nli," Amount:",amtfl,"[€]") fmt.Println(nli," Date:",date.Format("2006-01-02")) fmt.Println(nli,"Customer:",getCustomerName(icust)) fmt.Println(sub("Invoices")) @@ -1590,7 +1596,7 @@ func AddPayment(dat string) { hsum += it.Hours } fmt.Printf("%s %s : %s (%s) %.1f[h] %.2f[€]\n",nli,bi.identity,bi.projectname,bi.date.Format("2006-01-02 15:04"),hsum,bsum) - sum += bsum + //sum += bsum } if amtfl != sum { fmt.Println(sli,boldRed(" The sum of the bills (",sum,"€) does not match Payment amount!")) |
