Any member of the Police Department shall appear as witness whenever this is necessary in a prosecution for a violation of this code or of any state or federal law. No such member shall retain any witness fee for service as witness in any action or suit to which the city is a party; and fees paid for those services shall be turned over to the Chief of Police, who shall deposit the same with the City Treasurer.