The traditional production model development assumed that all products are perfect quality and did not
consider maintenance, which is far from reality. In practice, the production process may shift randomly from
an in-control state to an out-of-control state during a production run, i.e. process deterioration. This paper
considers both preventive maintenance and corrective maintenance which are used to increase the system
reliability. The objective of this paper is to determine the optimal production run time and maintenance
frequency while minimising the total cost under process deterioration and trade credit. This paper develops a
theorem and an algorithm to solve the problem described, provides numerical analysis to illustrate the
proposed solution procedure, and discusses the impact of various system parameters. A real case of hi-tech
manufacturer is used to verify the model. It predicts a 10.36% decrease in total cost if the preventive
maintenance decision is considered.