IT professionals are frequently subject to working overtime, even knowing that excessive overtime has negative effects both on their lives and the software they produce. This contrast creates the need for overtime policies that attend to the demands of a project using as few overtime hours as possible. However, our knowledge about the dynamics of overtime work and the effects of distinct policies on a software project is limited. In this paper we introduce a formulation for the overtime planning problem which extends the state-of-art by considering both the positive effects of overtime on productivity and its negative effects on product quality. We use heuristic search to explore close to optimal overtime allocations under this formulation and report lessons learned by analyzing these allocations. We present an empirical study that compares our approach with practices from the industry and a similar formulation without negative effects. Evidence supports the industrial practice of concentrating overtime in the second half of a project's schedule. Results also show that ignoring the flip-side of the productivity gains brought by overtime may lead to wrong decisions. For instance, excessive overtime may lead a manager to underestimate project cost and duration by 5.9% and 9.2%, respectively.