I was once told that for a consultant the company must always come first, no matter what. I disagreed.
When I'm working in a customer project my priorities are clear: first comes the customer, next my team and then the company. These three are not mutually exclusive, in fact it is just the opposite: these three can, and indeed must be inclusive. It's a triangle of a mutual interaction.
Please stand-by for the obvious.
The customer must come first because without the customer there is no project. The custome is the one who controls the project funding and most importantly the project's core purpose is to benefit the customer. The consultant must look after and protect the customer's interests: the consultant must earn the customer's trust and respect since simply being cheap/expensive expert on the field is not enough to establish a good working relationship.
Always do right by your customer; the "used cars salesman" attitude ~ i.e. bleed the customer dry by making them to pay premium for everything whenever possible while trying to maximise the company profits by using cheapest available people and resources ~ should in my opinion be avoided, but then again I'm not a business/sales manager. Idealistic thinking or not, but I believe that a mutual win-win arrangement over a longer time peried tends to benefit all parties more than the instant gratification like the one that came from killing the goose that laid golden eggs.
Take care of the team because their practical work effort directly determines whether or not the project is ultimately a succesful one. If the team members are overworked, burned out, pissed off, unmotived, untrained and/or under-appreciated it will show in so many ways: their overall morale and attitude towards the customer, each other and other members of the company, the quality and pace of their work, ability to deal with unexpected change and hardship, ability to solve problems, willingness to support team mates, and generally speaking their mental ability to take pride in the results of their work, just to mention few.
On the other hand, a well-motivated team with a good morale and up-to-date training that knows the value of their work, that isn't crumbling under unreasonable workload, that are in control of their own work, and that are all-and-all happy to come to work in most mornings, can really get the job done and do it well. Personally, given a choice I would take a small team of motivated professionals over a larger team of tired techies on any given day.
What about the company, then? A simple if not simplistic logic suggests that a happy customer and a happy team should make a happy company: team has work, company gets paid and customer gets money's worth, which tends to place the company and the team high on the customer's short list the next time customer needs to get a job done. This is not say that the company's role ~ including all the other people directly or indirectly involved with the various phases of the project ~ as a mediator and an enabler isn't vitally important for the outcome of the project.
The point of all this? I don't know... that a business could benefit from a touch of ethics and humanity over selfish shareholder greed? That mutually beneficial long term business relationships are preferrable over short-term rip-offs, low quality work and use-and-toss-away approach to employee management? Or perhaps it is that in the end we are all just people trying to work together instead of resources waiting to be exploited? Might be all of the above, or it could just be some wistful rambling of an idealist.
The flip side? Of course it has to be said that not everything depends on how the team and company performs during a customer project as the customer has a key role to play too. While the company would like to maximise the profits, the customer would like to minimise the expenses, which is all perfectly understandable and part of good business. However, this often leads to a situation where the budget is unreasonably tight allowing not enough time, people nor resources to get the job done right. Sometimes customers hire consultants because they think they need their expert knowledge and then choose to ignore the given expert advice with predictable consequances. It is an unthankful moment to be a consultant saying to the customer "I told you so".
No project is a one-way street; a project success depends on co-operation and mutual respect of all involved parties (a healthy dose of common sense and willingnes to compromise often helps, too) among other things.