(1) (a) Any person arrested and brought into custody on a warrant for failure to pay fines or costs, for failure to appear before a court or magistrate on the due date of such fines or costs, or for failure to comply with the terms of an order pursuant to sections 29-2206 and 29-2206.01, shall be entitled to a hearing on the first regularly scheduled court date following the date of arrest.
(b) If the court or magistrate determines that the person is financially able to pay the fines or costs and the person refuses to pay, the court or magistrate may: (i) Order the person to be confined in the jail of the proper county until the fines or costs are paid or secured to be paid or the person is otherwise discharged pursuant to subsection (4) of this section; or (ii) Enter an order pursuant to subdivision (1)(d) of this section discharging the person of such fines or costs and order the person to complete community service for a specified number of hours pursuant to sections 29-2277 to 29-2279;
(3) Nothing in this section shall authorize any person to be discharged from imprisonment before the expiration of the time for which he or she may be sentenced to be imprisoned as part of his or her punishment
(4) (a) Any person held in custody for nonpayment of fines or costs or for default on an installment shall be entitled to a credit on the fines, costs, or installment of one hundred fifty dollars for each day so held.
(b) In no case shall a person held in custody for nonpayment of fines or costs be held in such custody for more days than the maximum number to which he or she could have been sentenced if the penalty set by law includes the possibility of confinement.