This commit is contained in:
shoopea 2020-08-08 12:21:30 +02:00
parent f153cc5c80
commit 9e9717151d

20
job.go
View File

@ -2752,15 +2752,17 @@ func jobVaultValOth(j Job) {
p.Val = make([]JobPayloadVaultValTab, 0) p.Val = make([]JobPayloadVaultValTab, 0)
for _, v := range p2.Vault { for _, v := range p2.Vault {
price, volume := getObjItemValDet(v.ItemID64, v.Quality, 14) price, volume := getObjItemValDet(v.ItemID64, v.Quality, 31)
t := JobPayloadVaultValTab{ if volume > 0 {
ItemID64: v.ItemID64, t := JobPayloadVaultValTab{
Quality: v.Quality, ItemID64: v.ItemID64,
Quantity: v.Quantity, Quality: v.Quality,
Volume: volume, Quantity: v.Quantity,
Price: price, Volume: volume,
Price: price,
}
p.Val = append(p.Val, t)
} }
p.Val = append(p.Val, t)
} }
sort.Slice(p.Val, func(i, j int) bool { return p.Val[i].Volume < p.Val[j].Volume }) sort.Slice(p.Val, func(i, j int) bool { return p.Val[i].Volume < p.Val[j].Volume })
@ -2768,7 +2770,7 @@ func jobVaultValOth(j Job) {
total := float64(0) total := float64(0)
for _, v := range p.Val { for _, v := range p.Val {
item, _ := getObjItem(v.ItemID64) item, _ := getObjItem(v.ItemID64)
log.Printf("jobVaultValOth : %s (%s) - %s => %d - %f\n", item.Code, v.Quality, item.Names[0], v.Volume, v.Price) log.Printf("jobVaultValOth : %s%s - %s => %d - %f\n", item.Code, v.Quality, item.Names[0], v.Volume, v.Price)
out = fmt.Sprintf("%s- %s (%s) : %d / %f\n", out, item.Code, v.Quality, v.Volume, v.Price) out = fmt.Sprintf("%s- %s (%s) : %d / %f\n", out, item.Code, v.Quality, v.Volume, v.Price)
total += float64(v.Quantity) * v.Price total += float64(v.Quantity) * v.Price
} }