All fines, forfeitures, and penalties recovered for the violation of any statute or ordinance to which the city is entitled by law shall be paid into the city treasury. Every court or officer receiving such moneys, shall make return thereof under oath in accordance with law, and be entitled to duplicate receipts for the amounts paid. One of the receipts shall be filed with the city clerk.