From 3ad0c5806b34c508152a23de87f084faddd32e53 Mon Sep 17 00:00:00 2001 From: Nikolaus Gotsche Date: Mon, 8 Oct 2018 21:44:05 +0200 Subject: Checking Bills as Paid --- interact.go | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'interact.go') diff --git a/interact.go b/interact.go index 67e7f15..24f4e34 100644 --- a/interact.go +++ b/interact.go @@ -111,6 +111,30 @@ func interact() { }, }) + shell.AddCmd(&ishell.Cmd{ + Name: "checkbill", + Help: " check a Bill with the following id as paid", + LongHelp: ` Usage: checkbill + Check the bill of the set 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 - Please enter an id")) + showLastBills(0) + } + c.Println(promptcol("______________________")) + }, + }) + shell.AddCmd(&ishell.Cmd{ Name: "deletebill", Help: " Delete a Bill with the following id", -- cgit v1.2.3