Accountant

Accountant

465k Downloads

Option to not show warbank deposits as loss

FlesHBoX opened this issue · 21 comments

commented

I use the warband miser addon, which automatically deposits/withdraws money from the warband bank in order to maintain a consistent amount of gold on each character.

As a result, since Accountant shows deposits into the warband bank as a loss, it throws off my running profit. Would it be possible to add an option to alter this behavior and show deposits to the warband as a neutral transfer, rather than a loss?

commented

Coming here just to add, I would also like this feature. Should not count as a loss depositing money into my own bank.

commented

I also would like to have the option to not treat this as money loss/gain while depositing/withdrawing money from bank.

commented

I am trying various solution to make it display better but there is various items which are causing an issue with it currently.

  1. the way warband banks work, been able to add/remove money on any character on your account,
  2. There doesn't seem to be a specific in-game event that is triggered when money is deposited or withdrawn. the only 2 events that fire can fire at other times as well and there isnt really an event for buying new warband bank tabs as well which further complicates it.
  3. the way accountant stores it data, on a per character and server basis
commented

@FlesHBoX @garrettv1 @Asag321 I might of just figured it out to a place where I'm happy with it but it will need testing for unintended consequences, and all the scenarios.

There is a branch called warbankbank_balance that has the updated file in if you want to test it you'll need to copy the contents of Accountant.lua over the one that is currently install, it should then not count deposits or withdraws from the warband bank. I will see if i can get a beta/alpha version uploaded to curse for easier installing

commented

a beta version for 11.0.3 should appear on curseforge shortly that can be installed.

commented

Hey, sorry I missed your comment asking for testing. I was at a friend's yesterday. I'll grab the beta on curseforge and give it a go! Much thanks!

commented

Don't worry, I assumed it would take a few days at least for you and the other to see my comment

commented

Quick testing, I tried withdrawing money from the warbank, and re-depositing it as well, and that's not showing any positive or negative, So that seems to be working perfectly.

However, I also had an auction sell and that seemed to be working, showing as only revenue, even after opening the bank and the money auto-depositing, but a moment later after I left the bank it updated, showing the deposit as an expenditure. I was actually in the process of typing this out, that everything was working perfectly, when it happened.
image

commented

thanks managed to replicate it, and think i've got a fix for it

Basically looks like i forgot to reset something back to what it was before it updates spending for the bank.

in Accountant.lua there is an If statement on line 1893... which needs to be updated to this

    if not SC.warbandbankaction then
	    local tmpMode = SC.mode;
	    SC.mode = "BANK"
	    SC.UpdateLog();
	    SC.mode = tmpMode
    end
commented

No that isnt working, will let you know when its fixed

commented

@FlesHBoX Ok, think I have it now.. there will be a new beta version on curse shortly called 11.0.3.1-beta

commented

Just grabbed the new beta and will check it out.

commented

It does appear to be working though. But not sure if it's actually working, or if the error is preventing it from continuing and just looks like it's working.

commented

Just ran and turned in a quest on an alt to get a little extra gold, then headed to the bacnk and got this error when closing the bank.

Message: Interface/AddOns/Accountant/Accountant.lua:2287: attempt to index field '?' (a nil value)
Time: Sun Sep  8 18:39:47 2024
Count: 1
Stack: Interface/AddOns/Accountant/Accountant.lua:2287: attempt to index field '?' (a nil value)
[string "@Interface/AddOns/Accountant/Accountant.lua"]:2287: in function `UpdateLog'
[string "@Interface/AddOns/Accountant/Accountant.lua"]:1896: in function `OnEvent'
[string "*Accountant.xml:595_OnEvent"]:1: in function <[string "*Accountant.xml:595_OnEvent"]:1>

Locals: mode = "IGNORE"
(for state) = <table> {
 1 = "Session"
 2 = "Day"
 3 = "Week"
 4 = "Total"
}
(for control) = 1
key = 1
logmode = "Session"
(*temporary) = nil
(*temporary) = ""
(*temporary) = nil
(*temporary) = nil
(*temporary) = "attempt to index field '?' (a nil value)"
SC = <table> {
 artwork_path = "Interface\AddOns\Accountant\Artwork\"
 show_toons = "All Chars"
 repair_cost = 0
 modules = <table> {
 }
 current_money = 100000000
 current_tab = 1
 bankwarbandcash = 59164073177
 AllDropdown = "All Chars"
 bankcash = 100234000
 Realm = "Wyrmrest Accord"
 ShowAlliance = true
 data = <table> {
 }
 got_name = true
 could_repair = false
 db = <table> {
 }
 DIVIDER = "-"
 AUTHOR = "tfmonk "
 defaultModuleState = true
 baseName = "Accountant"
 bankwarbandcashafter = 59164307177
 GREEN_COLOR = ""
 Toons = <table> {
 }
 player = "Wyrmrest Accord-Kreêbs"
 log_modes = <table> {
 }
 GOLD_COLOR = ""
 can_repair = ""
 DEV = true
 repair_money = 0
 ShowHorde = true
 bankopened = true
 enabledState = true
 verbose = false
 show_setup = false
 Char = "Kreêbs"
 Version = "11.0.3"
 AllCharsMaxRows = 60
 warbandbankaction = true
 log_modes_short = <table> {
 }
 last_money = 100000000
 defaultModuleLibraries = <table> {
 }
 refund_mode = ""
 MaxRows = 15
 name = "Accountant"
 Faction = "Alliance"
 orderedModules = <table> {
 }
 CREDAUTHOR = "Urnati & Dajin & Thorismud"
 show_mode = false
 AllToons = <table> {
 }
 sender = ""
 mode = "IGNORE"
 LDBIcon = <table> {
 }
 TITLE = "Accountant"
 show_events = false
 bankcashafter = 100000000
}

After that I did another quest and used the warband bank convergence spell just to test, and got a slightly different error (basically the same, but with a few extra lines

Message: Interface/AddOns/Accountant/Accountant.lua:2287: attempt to index field '?' (a nil value)
Time: Sun Sep  8 18:44:30 2024
Count: 1
Stack: Interface/AddOns/Accountant/Accountant.lua:2287: attempt to index field '?' (a nil value)
[string "@Interface/AddOns/Accountant/Accountant.lua"]:2287: in function `UpdateLog'
[string "@Interface/AddOns/Accountant/Accountant.lua"]:1896: in function `OnEvent'
[string "*Accountant.xml:595_OnEvent"]:1: in function <[string "*Accountant.xml:595_OnEvent"]:1>
[string "=[C]"]: in function `CloseBankFrame'
[string "@Interface/AddOns/Baganator/ItemViewCommon/BankView.lua"]:163: in function <...terface/AddOns/Baganator/ItemViewCommon/BankView.lua:161>
[string "=[C]"]: in function `Hide'
[string "@Interface/AddOns/Blizzard_UIParentPanelManager/Mainline/UIParentPanelManager.lua"]:901: in function `HideUIPanel'
[string "@Interface/AddOns/Blizzard_SharedXML/Mainline/SharedUIPanelTemplates.lua"]:154: in function <...izzard_SharedXML/Mainline/SharedUIPanelTemplates.lua:145>

Locals: mode = "IGNORE"
(for state) = <table> {
 1 = "Session"
 2 = "Day"
 3 = "Week"
 4 = "Total"
}
(for control) = 1
key = 1
logmode = "Session"
(*temporary) = nil
(*temporary) = ""
(*temporary) = nil
(*temporary) = nil
(*temporary) = "attempt to index field '?' (a nil value)"
SC = <table> {
 artwork_path = "Interface\AddOns\Accountant\Artwork\"
 show_toons = "All Chars"
 repair_cost = 0
 modules = <table> {
 }
 current_money = 100000000
 current_tab = 1
 bankwarbandcash = 59164307177
 AllDropdown = "All Chars"
 bankcash = 100023400
 Realm = "Wyrmrest Accord"
 ShowAlliance = true
 data = <table> {
 }
 got_name = true
 could_repair = false
 db = <table> {
 }
 DIVIDER = "-"
 AUTHOR = "tfmonk "
 defaultModuleState = true
 baseName = "Accountant"
 bankwarbandcashafter = 59164330577
 GREEN_COLOR = ""
 Toons = <table> {
 }
 player = "Wyrmrest Accord-Kreêbs"
 log_modes = <table> {
 }
 GOLD_COLOR = ""
 can_repair = ""
 DEV = true
 repair_money = 0
 ShowHorde = true
 bankopened = true
 enabledState = true
 verbose = false
 show_setup = false
 Char = "Kreêbs"
 Version = "11.0.3"
 AllCharsMaxRows = 60
 warbandbankaction = true
 log_modes_short = <table> {
 }
 last_money = 100000000
 defaultModuleLibraries = <table> {
 }
 refund_mode = ""
 MaxRows = 15
 name = "Accountant"
 Faction = "Alliance"
 orderedModules = <table> {
 }
 CREDAUTHOR = "Urnati & Dajin & Thorismud"
 show_mode = false
 AllToons = <table> {
 }
 sender = ""
 mode = "IGNORE"
 LDBIcon = <table> {
 }
 TITLE = "Accountant"
 show_events = false
 bankcashafter = 100000000
}
commented

Thanks I'll take a look will probably be Monday evening now for the next version but this is helpful

commented

@FlesHBoX it might be baginator actually causing the error from some bits I can see in the error but will need to look into it further

commented

It wasnt baginator causing the problems, looks like some of the errors also get caught by that...

11.0.3.3-beta should be available on curse shortly

commented

Sweet. I'll update and test it out after I get off work in a few hours and let you know.

commented

Just ran through and tested both being under the set balance for miser, and over, so that on one character, I spent gold, and got it back from the bank, and on another character gained gold from quest rewards and selling greys, and received no errors, and accountant is showing the correct Net Profit. Also tested using the warband bank convergence access and it also returns no errors and behaves as expected.

Much thanks for this!

commented

Awesome news, @FlesHBoX thanks as well for helping test it made it go a lot quicker, fixing it... i will give it a few days before pushing this live just to give it a little more testing as I did add a few extra bits into the version you just tested.

commented

Sounds good. And after a night of playing, hitting the bank several times on a few different characters, It is still going solid, no errors, and everything looks correct in accountant.