summaryrefslogtreecommitdiff
path: root/sqlite.go
diff options
context:
space:
mode:
authorNikolaus Gotsche <n@softwarefools.com>2019-05-10 01:08:05 +0200
committerNikolaus Gotsche <n@softwarefools.com>2019-05-10 01:08:05 +0200
commitbf7dfda3e67f67687109290209c8b09576a417fd (patch)
treef19288849c4b839f2b751302668bb3a835ce1c83 /sqlite.go
parenteeca61f9137ef70f53e03cf0df8e0c2cda4bb9ce (diff)
Minor beautifications
Diffstat (limited to 'sqlite.go')
-rw-r--r--sqlite.go16
1 files changed, 11 insertions, 5 deletions
diff --git a/sqlite.go b/sqlite.go
index 1c92a17..bacb21b 100644
--- a/sqlite.go
+++ b/sqlite.go
@@ -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!"))