If the total money is static:
If enemies drop money there can't be a total money unless you pre-plan how many mobs there are and how much each are carrying. You could alternatively just stop dropping money when the cap is reached I suppose.
Shopkeepers money should be included.
If the total money is dynamic:
It should increase as money is dropped or money should stop dropping once the accumulated amount is the total money, (which should always include the shopkeepers money)
I personally loved this idea, perhaps making the shops prices not only dependent on item value but the amount of wealth the shopkeeper has compared to the world total wealth. This would cause the items to decrease or increase in price so that if the shopkeeper knew that he had almost all the money, he still needed to sell some items so would decrease prices by a certain percentage. There is a flaw with this however where it could be taken advantage of, a player giving all the money to one shopkeeper in result reducing the prices more and more the amount he purchases from him. This can be alleviated by capping the percentage of total price that could be reduced, or even allow it to have diminishing returns from the very beginning.
Certainly none of that is necessary. If he doesn't have money... well it's a RL, that's how the dice rolls.
---
T: Total Money
K: Shopkeepers Total Money
A: Amount of Money Available (T-K)
N: Number of Items
D: Quality of Item (1.5 = great, 1= normal, .5=horrible)
S: Standard Item Value (T/N)
C: Current Item Value (D * S) (D*[T/N])
I: Item Price Modifier= 1.2 > 1 - (A/T) > .8
{Don't allow item price to exceed 120% of it's normal value, or less than 80% of it.}
Current Item Price= I*C
I'm not going to spend too much time on this and make it too complicated but this is some fun stuff.