(A)(1)(a) In all criminal cases, including violations of ordinances, the judge or magistrate shall include in the sentence the costs of prosecution, including any costs under section 2947.231 of the Revised Code, and render a judgment against the defendant for such costs. If the judge or magistrate imposes a community control sanction or other nonresidential sanction, the judge or magistrate, when imposing the sanction, shall notify the defendant of both of the following: (i) If the defendant fails to pay that judgment or fails to timely make payments towards that judgment under a payment schedule approved by the court, the court may order the defendant to perform community service until the judgment is paid or until the court is satisfied that the defendant is in compliance with the approved payment schedule.