From 83410ee498d56f18ccab0abb9c69f112f4d9f008 Mon Sep 17 00:00:00 2001 From: Nikolaus Gotsche Date: Fri, 17 May 2019 23:55:24 +0200 Subject: show Payment --- interact.go | 32 +++++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) (limited to 'interact.go') diff --git a/interact.go b/interact.go index 71e40a3..d849eca 100644 --- a/interact.go +++ b/interact.go @@ -699,7 +699,7 @@ func interact(fulldb bool) { showcmd.AddCmd(&ishell.Cmd{ Name: "project", Help: " - Show details of the project with given id.", - LongHelp: ` Usage: show invoice + LongHelp: ` Usage: show project Show detailed information of Project with given id. If no is specified a selection screen is shown.`, Func: func(c *ishell.Context) { arg := "none" @@ -724,6 +724,36 @@ func interact(fulldb bool) { c.Println(promptcol("______________________")) }, }) + showcmd.AddCmd(&ishell.Cmd{ + Name: "payment", + Help: " - Show details of the payment with given id.", + LongHelp: ` Usage: show invoice + Show detailed information of payment with given id. If no is specified a selection screen is shown.`, + Func: func(c *ishell.Context) { + arg := "none" + if len(c.Args) > 0 { + arg = strings.Join(c.Args, " ") + argi, err := strconv.Atoi(arg) + if err == nil { + ShowPayment(argi) + //fmt.Println("COMING SOON") + //ShowProjectStatus(argi) + //allProjects() + //stdOut() + } else { + c.Println(boldRed(arg, "is not a valid id!")) + } + } else { + //pids := GetProjectIds() + selids, lids := GetPaymentList() + choice := c.MultiChoice(lids, "Select a Payment to Show") + if choice > -1 { + ShowPayment(selids[choice]) + } + } + c.Println(promptcol("______________________")) + }, + }) shell.AddCmd(showcmd) } /* -- cgit v1.2.3