Over the years, I've developed a bunch of re-usable code which I recently bundled up into a web application framework. Not only did I incorporate many open source solutions (smarty templating system, tinymce editor, prototype-scriptaculous libraries), but I also added my own custom-built features like CMS generation tools, social networking tools, blogging system, discussion forums etc...
I find that it takes me less time to build something new with my own framework than to study the plugins of another framework which may or may not do things "EXACTLY" the way the customer wants. I've been burnt in the past when I tried to integrate phpbb + wordpress + joomla into one seamless application. So instead, I've built my own framework which has plugins to the "essential" features of each of the mentioned platforms.
There are a lot of people out there who say "you should not re-invent the wheel". I generally agree. But the birth of my own framework is at odds with this rule, even though it's been extremely valuable to me in my freelance work.
What would you have done if a customer asks, "I want a website that has blog, discussion forum, paypal integration, social networking, newsletter mail outs, rating local restaurants on 5 star scale, regional business search and A LOT OF CUSTOMIZATION"? My own web application framework is in a better position to deliver such an application (because I built it and understand its capabilities) than wordpress or joomla.
So the question is, when should you re-invent the wheel?