This commit is contained in:
shoopea 2019-10-11 16:05:49 +08:00
parent dc939dbe60
commit dba99bdb92

9
job.go
View File

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