No compensation shall be allowed or paid the collector of any county of the first class not having a charter form of government or of any county of the second class, his deputies or assistants, except that and to those expressly provided for, and no amount shall be charged to the county or drawn out of the treasury for the services of any deputy or assistant which is not the exact amount due such deputy or assistant. The county collector and all his employees are forbidden, under penalty of forfeiture of office, to collect, charge or retain, directly or indirectly, any compensation other than that allowed by law.