diff options
| author | Nikolaus Gotsche <n@softwarefools.com> | 2019-05-10 01:08:05 +0200 |
|---|---|---|
| committer | Nikolaus Gotsche <n@softwarefools.com> | 2019-05-10 01:08:05 +0200 |
| commit | bf7dfda3e67f67687109290209c8b09576a417fd (patch) | |
| tree | f19288849c4b839f2b751302668bb3a835ce1c83 /sqlite.go | |
| parent | eeca61f9137ef70f53e03cf0df8e0c2cda4bb9ce (diff) | |
Minor beautifications
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!")) |
