From ad7b23c17dbe05e7e6a4ad3ea023f692f832a938 Mon Sep 17 00:00:00 2001 From: Nikolaus Gotsche Date: Wed, 29 Aug 2018 04:27:16 +0200 Subject: LaTeX templating and bills begin --- interact.go | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) (limited to 'interact.go') diff --git a/interact.go b/interact.go index 8e25c97..55dcabb 100644 --- a/interact.go +++ b/interact.go @@ -157,6 +157,30 @@ func interact() { }, }) + shell.AddCmd(&ishell.Cmd{ + Name: "editcustomer", + Help: " 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 - Please enter an id")) + allCustomers() + } + }, + }) + shell.AddCmd(&ishell.Cmd{ Name: "start", Help: " - Start Task at a specific Time 'YYYY-MM-DD HH:MM' Or 'HH:MM'", @@ -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 -- cgit v1.2.3