This paper proposes a model to find optimal ordering and replacement policies for a deteriorating system. Assume that the life time of system has a gamma distribution, and it has two failures types, type I failure is repairable, whereas type II failure is catastrophic which leads to replacement. A replacement policy N is adopted by which the system will be replaced by an identical new one if available at the time following the N th type I failure or the 1st type II failure whichever occurs first. Furthermore, it considers an ordering policy M(0≤M展开▼