The clerk of each municipal court, or other person designated to receive fines and costs, shall at the end of each month pay into the Regional Jail and Correctional Facility Authority fund in the State Treasury an amount equal to $40 of the costs collected in each proceeding involving a traffic offense constituting a moving violation, regardless of whether the penalty for the violation provides for a period of incarceration, or any other offense for which the ordinance prescribing the offense provides for a period of incarceration: Provided, That in a case where a defendant has failed to pay all costs assessed against him or her, no payment may be made to the Regional Jail and Correctional Facility Authority fund until the defendant has paid all costs which, when paid, are available for the use and benefit of the municipality.