fix doublechange of stock

This commit is contained in:
Riley L. 2024-11-04 12:31:32 +01:00
parent 3922bb59f5
commit 8643a7a303

View file

@ -236,7 +236,7 @@ local function r_user_post(username)
math.abs(pcount), p_name) math.abs(pcount), p_name)
powner_comment = string.format("%s %d %s %s %s", powner_comment = string.format("%s %d %s %s %s",
pcount < 0 and "Sell" or "Restock", -- TOOD: look for name pcount < 0 and "Sell" or "Restock",
math.abs(pcount), p_name, math.abs(pcount), p_name,
pcount < 0 and "to" or "by", pcount < 0 and "to" or "by",
username) username)
@ -262,7 +262,8 @@ local function r_user_post(username)
log:write(string.format("%d,%s,%d,%s,%s,%s\n", time, username, amount, pcode or "", pcount or "", comment)) log:write(string.format("%d,%s,%d,%s,%s,%s\n", time, username, amount, pcode or "", pcount or "", comment))
-- add to owner -- add to owner
if powner then if powner then
log:write(string.format("%d,%s,%d,%s,%s,%s\n", time, powner, -amount, pcode or "", pcount or "", powner_comment)) -- count is always zero as doesn't affect stock
log:write(string.format("%d,%s,%d,%s,%s,%s\n", time, powner, -amount, pcode or "", "", powner_comment))
end end
log:flush() log:flush()
log:close() log:close()