It shall be the duty of all courts of record, at each term thereof, to settle with the sheriffs or marshals for all moneys by them received, or which they ought to have collected, for the use of their respective counties, and have not before accounted for. They shall cause their clerks to make out a list of all sums chargeable to said sheriffs or marshals and payable to the counties, specifying on what account, and cause the same to be certified under the seal of the court, which certificate shall be immediately transmitted to the clerks of the county commissions of the counties to which such moneys are payable who shall charge the same accordingly.