This commit is contained in:
shoopea 2019-10-11 16:08:26 +08:00
parent dba99bdb92
commit d3720fa7ac

10
job.go
View File

@ -973,17 +973,13 @@ func jobVaultStatus(j Job) {
} }
if currentUserID64 != 0 { if currentUserID64 != 0 {
//display info //display info
out := fmt.Sprintf("<pre>%-28s | Dep. | Rcv. | Total\n-------------------------------------------------</pre>\n") out := fmt.Sprintf("<pre>%-28s | Dep. | Rcv. | Total\n-------------------------------------------------\n", `Item`)
for i, itemId := range itemList { for i, itemId := range itemList {
item, err := getObjItem(itemId) item, err := getObjItem(itemId)
logOnError(err, "jobVaultStatus : getObjItem") logOnError(err, "jobVaultStatus : getObjItem")
out = fmt.Sprintf("%s<pre>%-28s |%-5d |%-5d |", out, item.Name, depositList[i], withdrawList[i]) out = fmt.Sprintf("%s%-28s |%-5d |%-5d |%-5d\n", out, item.Name, depositList[i], withdrawList[i], depositList[i]-withdrawList[i])
if (depositList[i] - withdrawList[i]) >= 0 {
out = fmt.Sprintf("%s%-5d</pre>\n", out, depositList[i]-withdrawList[i])
} else {
out = fmt.Sprintf("%s</pre><code>%-5d</code>\n", out, depositList[i]-withdrawList[i])
}
} }
out = fmt.Sprintf("%s</pre>", out)
log.Printf("Vault Status :\n%s", out) log.Printf("Vault Status :\n%s", out)
c := TGCommand{ c := TGCommand{
Type: commandReplyMsg, Type: commandReplyMsg,