summaryrefslogtreecommitdiff
path: root/interact.go
diff options
context:
space:
mode:
authorNikolaus Gotsche <n@softwarefools.com>2019-04-30 01:54:21 +0200
committerNikolaus Gotsche <n@softwarefools.com>2019-04-30 01:54:21 +0200
commit64b47d83073893b1442fd250005775f25ba4403e (patch)
tree3447627c7da0e85f59e332171695fec41b12e2dd /interact.go
parentb5bc66a01b24b5a10c04de584c1681898308124b (diff)
EditPayment
Diffstat (limited to 'interact.go')
-rw-r--r--interact.go34
1 files changed, 33 insertions, 1 deletions
diff --git a/interact.go b/interact.go
index e3135d3..44f8971 100644
--- a/interact.go
+++ b/interact.go
@@ -315,7 +315,7 @@ func interact(fulldb bool) {
{
editcmd := &ishell.Cmd{
Name: "edit",
- Help: " customer / project / task",
+ Help: " customer / payment / project / task",
LongHelp: ` Usage: edit <command>`,
/* customer <id> - Edit Customer of given id.
project <id> - Edit Project of given id.
@@ -387,6 +387,38 @@ func interact(fulldb bool) {
},
})
editcmd.AddCmd(&ishell.Cmd{
+ Name: "payment",
+ Help: "<id> Edit the Payment of the following id",
+ LongHelp: ` Usage: edit payment <id>
+ Edit Payment of the set <id>.
+ Press <Enter> on empty line to keep the old entry`,
+ 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 {
+ EditPayment(argi)
+ } else {
+ c.Println(boldRed(arg, "is not a valid id!"))
+ }
+ } else {
+ /* pids := GetProjectIds()
+ selids, lids := getProjectList(pids)
+ choice := c.MultiChoice(lids, "Select a Project to Edit")
+ //c.Println(pids)
+ //c.Println(selids)
+ if choice > -1 {
+ editProject(selids[choice])
+ //c.Println(choice,selids[choice])
+ }
+ //c.Println(boldRed("editproject <id> - Please enter an id"))
+ */
+ }
+ c.Println(promptcol("______________________"))
+ },
+ })
+ editcmd.AddCmd(&ishell.Cmd{
Name: "customer",
Help: "<id> Edit the Customer of the following id",
LongHelp: ` Usage: edit customer <id>