As with many other things, I have thought about something like this for a long time just never got around to making it work. The key to this is traits, and only trying to tie the money to an army with a general.
Create a new trait with several levels, maybe 10, and call it Warchest.
Then set some financials for each level.
level 1 = 1000
level 2 = 2000
etc.
Then move each generals traits up and down according to circumstances. You cant count units, but you CAN track unit types by percentage. And you can also detect when a general is in enemy lands or is in a settlement or whatever.
If a general is near home, he wont have a very big chest because his supply lines are short and getting money is easy. When he moves into enemy lands he will need to carry more money with him, but the longer he stays in enemy lands and his warchest will start going down.
Then check the trait at PostBattle. If trait = 1 then transfer x money, if 2 then transfer y money, etc.