Based on "a theory in accountancy or commerce or economics studies," what you're talking about is related to the idea of supply and demand.
The more somebody needs something, the more they will be willing to pay for it. (And the more sellers will take advantage of the fact.)
For instance, you can charge $20 for a bottle of water and people who are in the middle of a heat wave are more likely to pay for it than those who are not hot or desperately thirsty.
In your scenario, the sellers who are closest to a needed commodity will charge more for it—because they know people will pay the higher price. (The convenience of having their air conditioning repaired at a location close to them is worth the extra price.)
A few idioms or expressions related to this are:
- What the market will bear.
From Business Economics: Theory and Application by Neil Harris:
In the business economist's perception of price determination is this phrase—what the market will bear. It means that a business should charge the highest price it can, consistent with not affecting demand for the products.
- Necessity knows no law.
From Proverb Hunter:
The proverb could be used to justify the behaviour of a man who steals food to keep his wife and family from starving. As Cervantes wrote in Don Quixote: ‘Necessity urges desperate measures.’
In this case, necessity urges paying a higher cost to get your air conditioning repaired as quickly as possible—even if patience and travel might cost less money.
A more general idiom is simply desperate times call for desperate measures (from the Definitions website). But I would say that is less applicable to a recurring economic theory than to a one-off emergency.