summaryrefslogtreecommitdiff
path: root/interact.go
diff options
context:
space:
mode:
authorNikolaus Gotsche <n@softwarefools.com>2018-08-29 04:27:16 +0200
committerNikolaus Gotsche <n@softwarefools.com>2018-08-29 04:27:16 +0200
commitad7b23c17dbe05e7e6a4ad3ea023f692f832a938 (patch)
tree0832c6fa8e8be7a66a59e371222aab19c3a2bf5d /interact.go
parented43a6d9c450483914281e5fc3b6877116fc6ad0 (diff)
LaTeX templating and bills begin
Diffstat (limited to 'interact.go')
-rw-r--r--interact.go43
1 files changed, 43 insertions, 0 deletions
diff --git a/interact.go b/interact.go
index 8e25c97..55dcabb 100644
--- a/interact.go
+++ b/interact.go
@@ -158,6 +158,30 @@ func interact() {
})
shell.AddCmd(&ishell.Cmd{
+ Name: "editcustomer",
+ Help: "<id> Edit the Customer of the following id",
+ Func: func(c *ishell.Context) {
+ //c.Print("\033[H\033[2J")
+ arg := "none"
+ if len(c.Args) > 0 {
+ arg = strings.Join(c.Args, " ")
+ argi,err := strconv.Atoi(arg)
+ if err == nil{
+ //c.Println(boldGreen("Edit Project",argi))
+ editCustomer(argi)
+ allCustomers()
+ //stdOut()
+ }else{
+ c.Println(boldRed(arg,"is not a valid id!"))
+ }
+ }else{
+ c.Println(boldRed("editcustomer <id> - Please enter an id"))
+ allCustomers()
+ }
+ },
+ })
+
+ shell.AddCmd(&ishell.Cmd{
Name: "start",
Help: "<DateTime> - Start Task at a specific Time 'YYYY-MM-DD HH:MM' Or 'HH:MM'",
Func: func(c *ishell.Context) {
@@ -252,6 +276,25 @@ func interact() {
},
})
+// Gather Tasks For Bills
+ shell.AddCmd(&ishell.Cmd{
+ Name: "bill",
+ Help: "Select Tasks to be billed",
+ Func: func(c *ishell.Context) {
+ ids,str := getUnfinishedList()
+ choices := c.Checklist(str,
+ "What Tasks do you want to bill ?",
+ nil)
+ out := func() (c []int) {
+ for _, v := range choices {
+ c = append(c, ids[v])
+ }
+ return
+ }
+ c.Println("Your choices are",out() )
+ },
+ })
+
shell.Run()
// teardown