summaryrefslogtreecommitdiff
path: root/interact.go
diff options
context:
space:
mode:
authorNikolaus Gotsche <n@softwarefools.com>2018-10-08 21:44:05 +0200
committerNikolaus Gotsche <n@softwarefools.com>2018-10-08 21:44:05 +0200
commit3ad0c5806b34c508152a23de87f084faddd32e53 (patch)
tree8f761ddc3bb37caea35ec62e9b628c06289493c6 /interact.go
parente9bad489128dd526b44b08cc3bed6cce1cb731da (diff)
Checking Bills as Paid
Diffstat (limited to 'interact.go')
-rw-r--r--interact.go24
1 files changed, 24 insertions, 0 deletions
diff --git a/interact.go b/interact.go
index 67e7f15..24f4e34 100644
--- a/interact.go
+++ b/interact.go
@@ -112,6 +112,30 @@ func interact() {
})
shell.AddCmd(&ishell.Cmd{
+ Name: "checkbill",
+ Help: "<id> check a Bill with the following id as paid",
+ LongHelp: ` Usage: checkbill <id>
+ Check the bill of the set <id> as paid on the current date`,
+ 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{
+ checkBill(argi)
+ //stdOut()
+ }else{
+ c.Println(boldRed(arg,"is not a valid id!"))
+ }
+ }else{
+ c.Println(boldRed("checkbill <id> - Please enter an id"))
+ showLastBills(0)
+ }
+ c.Println(promptcol("______________________"))
+ },
+ })
+
+ shell.AddCmd(&ishell.Cmd{
Name: "deletebill",
Help: "<id> Delete a Bill with the following id",
LongHelp: ` Usage: deletebill <id>