diff --git a/job.go b/job.go index 52b5bdd..b8fc6e4 100644 --- a/job.go +++ b/job.go @@ -967,6 +967,25 @@ func jobVaultStatus(j Job) { } if currentUserID64 != 0 { //display info + out := fmt.Sprintf("Item | Dep. | Rcv. | Total\n") + for i, itemId := range itemList { + item, err := getObjItem(itemId) + logOnError(err, "jobVaultStatus : getObjItem") + out = fmt.Sprintf("%s%-34s|%-5d |%-5d |", out, item.Name, depositList[i], withdrawList[i]) + if (depositList[i] - withdrawList[i]) >= 0 { + out = fmt.Sprintf("%s-5d\n", out, depositList[i]-withdrawList[i]) + } else { + out = fmt.Sprintf("%s,/code>
-5d
\n", out, depositList[i]-withdrawList[i]) + } + } + c := TGCommand{ + Type: commandReplyMsg, + Text: out, + FromMsgID64: int64(m.ID), + FromChatID64: m.Chat.ID, + ParseMode: cmdParseModeHTML, + } + TGCmdQueue <- c } err = rows.Err() logOnError(err, "jobVaultStatus : query end")