From 8643a7a303b02d15d5205e98ae184d3f0c6bfd09 Mon Sep 17 00:00:00 2001 From: "Riley L." Date: Mon, 4 Nov 2024 12:31:32 +0100 Subject: [PATCH] fix doublechange of stock --- abrechenbarkeit.lua | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/abrechenbarkeit.lua b/abrechenbarkeit.lua index 5db7337..ba12b7a 100755 --- a/abrechenbarkeit.lua +++ b/abrechenbarkeit.lua @@ -236,7 +236,7 @@ local function r_user_post(username) math.abs(pcount), p_name) 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, pcount < 0 and "to" or "by", 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)) -- add to owner 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 log:flush() log:close()