Quality has an important role in manufacturing, and on the other hand, machine condition has a significant effect on quality. Based on this fact, all manufacturers integrate the production scheduling with maintenance activities to keep the machines in perfect conditions. In this paper, we propose a mixed integer nonlinear model to optimise the quality cost, maintenance cost, earliness-tardiness cost and interruption cost simultaneously. We assume that if machines work in undesirable conditions, their quality is reduced, resulting in quality cost. On the other hand, if the machines are repaired to decrease the quality cost, maintenance cost and other cost such as earliness-tardiness cost and interruption cost are imposed to the manufacturer. Several numerical instances are implemented by the proposed model to show the model effectiveness to obtain the best maintenance and production scheduling with minimum quality cost.