Did the Buddha give any advice on how to manage economy? I was wondering if the Buddha did give any advice on how to manage personal economics?

I assume that the advice would be the middle way as applied to everything else in Buddhism. To stay away from the extremes meaning e.g. spending all of ones money on one thing and instead divide ones amount of money in an equal way.

I remember once reading something about dividing one portion of ones money to food, bills, medicin etc., then one portion to enjoyment, then one portion to charity, then one portion to savings. Unfortunately i have no idea where i read it or if its actually really advice that came from the Buddha.

Thank you for your time.

Lanka
There is good discussion in this article, this article and this article. You can read those for much advice.

For canonical advice:

The Sigalovada Sutta states:


  The wise endowed with virtue Shine forth like a burning fire,
  Gathering wealth as bees do honey And heaping it up like an ant hill.
  Once wealth is accumulated, Family and household life may follow. By
  dividing wealth into four parts, True friendships are bound; One part
  should be enjoyed; Two parts invested in business; And the fourth set
  aside Against future misfortunes."


The Dighajanu Sutta states:


  "And what does it mean to maintain one's livelihood in tune? There is
  the case where a lay person, knowing the income and outflow of his
  wealth, maintains a livelihood in tune, neither a spendthrift nor a
  penny-pincher, [thinking], 'Thus will my income exceed my outflow, and
  my outflow will not exceed my income.' Just as when a weigher or his
  apprentice, when holding the scales, knows, 'It has tipped down so
  much or has tipped up so much,' in the same way, the lay person,
  knowing the income and outflow of his wealth, maintains a livelihood
  in tune, neither a spendthrift nor a penny-pincher, [thinking], 'Thus
  will my income exceed my outflow, and my outflow will not exceed my
  income.'
  
  "These are the four drains on one's store of wealth: debauchery in
  sex; debauchery in drink; debauchery in gambling; and evil friendship,
  evil companionship, evil camaraderie. Just as if there were a great
  reservoir with four inlets and four drains, and a man were to close
  the inlets and open the drains, and the sky were not to pour down
  proper showers, the depletion of that great reservoir could be
  expected, not its increase.


The Adiya Sutta discusses the 5 benefits obtained from one's wealth. The fifth is charity.

And don't forget that income should come from Right Livelihood, as stated in the Vanijja Sutta:


  "Monks, a lay follower should not engage in five types of business.
  Which five? Business in weapons, business in human beings, business in
  meat, business in intoxicants, and business in poison.