Remove the local keyword from
Lua Code:
local function Accountant_DetectAhMail()
There's another problem. You can't check on MAIL_SHOW as this event is triggered if the inbox is opened. There won't be any data at this point as the client needs a moment to query the mail data from the server.
Use MAIL_INBOX_UPDATE instead:
Lua Code:
elseif event == "MAIL_INBOX_UPDATE" then
Accountant_DetectAhMail();
and add
Lua Code:
self:RegisterEvent("MAIL_INBOX_UPDATE");
to Accountant_RegisterEvents(self)