Inactivate items

Hi All,  have a customer that carries repair parts that may be old but still could be sold, but they will never be re-ordered.  What they would like is for these items to have them automatically set to inactive once the on-hand reaches zero.   I could not think of how a script could be used in this case, so any suggestions would be appreciated.