0.1.162: Brett: Nachnahme-Pruefung gegen eigenen Auftrag, Annahme auch bei offline Geber, Annahme-Fenster; Mail: Loeschen bei Nachnahme = zuruecksenden

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016onJCSHLwhs9udhC9ZLzk9
This commit is contained in:
Lacustat
2026-10-29 00:30:42 +01:00
co-authored by Claude Sonnet 5.5
parent 94d580ccd6
commit c861012b2e
4 changed files with 59 additions and 7 deletions
+19 -2
View File
@@ -356,7 +356,11 @@ local function BuildInbox(parent)
UI.AttachTooltip(d.ret, function() return T("MAIL_RETURN") end, function() return T("MAIL_RETURN_TIP") end)
d.delete = UI.CreateButton(d, T("MAIL_DELETE"), 80, 26, nil, "danger")
d.delete:SetPoint("BOTTOMRIGHT", d, "BOTTOMRIGHT", -12, 12)
UI.AttachTooltip(d.delete, function() return T("MAIL_DELETE") end, function() return T("MAIL_DELETE_TIP") end)
UI.AttachTooltip(d.delete, function() return T("MAIL_DELETE") end, function()
local c = f.current
if c and (c.cod or 0) > 0 then return T("MAIL_DELETE_COD_TIP") end
return T("MAIL_DELETE_TIP")
end)
f.detail = d
local function ShowError(why)
@@ -379,6 +383,19 @@ local function BuildInbox(parent)
d.delete:SetScript("OnClick", function()
local m = f.current
if not m then return end
-- Nachnahme: nie loeschen, sofort an den Absender zurueck (ohne Rueckfrage)
if (m.cod or 0) > 0 then
local rok, rwhy = Mail:ReturnMail(m)
if rok then
Mail.view, f.current, f.shownKey = nil, nil, nil
ShowError(nil)
if FW.Print then FW:Print(FW.L.MAIL_COD_RETURNED) end
else
ShowError(rwhy)
end
f.Refresh()
return
end
local ok, why = Mail:RemoveMail(m)
if ok then
Mail.view, f.current, f.shownKey = nil, nil, nil
@@ -522,7 +539,7 @@ local function BuildInbox(parent)
d.take:SetWidth(120)
end
d.take:SetButtonEnabled(canTake and not busy and Mail.open)
d.delete:SetButtonEnabled(Mail.Deletable(cur) and not busy and Mail.open)
d.delete:SetButtonEnabled(((cur.cod or 0) > 0 and Mail.Returnable(cur) or Mail.Deletable(cur)) and not busy and Mail.open)
d.reply:SetButtonEnabled(true)
d.ret:SetLabel(f.retConfirm == cur.key and T("MAIL_RETURN_CONFIRM") or T("MAIL_RETURN"))
d.ret:SetButtonEnabled(Mail.Returnable(cur) and not busy and Mail.open)