(a) At any time before the forfeiture of their undertaking, or deposit by a third person, the bail or the depositor may surrender the defendant in their exoneration, or he may surrender himself, to the officer to whose custody he was committed at the time of giving bail, in the following manner:
(1) A certified copy of the undertaking of the bail, a certified copy of the certificate of deposit where a deposit is made, or an affidavit given by the bail licensee or surety company listing all that specific information that would be included on a certified copy of an undertaking of bail, must be delivered to the officer who must detain the defendant in his custody thereon as upon a commitment, and by a certificate in writing acknowledge the surrender.
(2) The bail or depositor, upon surrendering the defendant, shall make reasonable effort to give notice to the defendant’s last attorney of record, if any, of such surrender.
(3) The officer to whom the defendant is surrendered shall, within 48 hours of the surrender, bring the defendant before the court in which the defendant is next to appear on the case for which he has been surrendered. The court shall advise the defendant of his right to move the court for an order permitting the withdrawal of any previous waiver of time and shall advise him of the authority of the court, as provided in subdivision (b), to order return of the premium paid by the defendant or other person, or any part of it.
(4) Upon the undertaking, or certificate of deposit, and the certificate of the officer, the court in which the action or appeal is pending may, upon notice of five days to the district attorney of the county, with a copy of the undertaking, or certificate of deposit, and the certificate of the officer, order that the bail or deposit be exonerated. However, if the defendant is released on his own recognizance or on another bond before the issuance of such an order, the court shall order that the bail or deposit be exonerated without prejudice to the court’s authority under subdivision (b). On filing the order and papers used on the application, they are exonerated accordingly.
(b) Notwithstanding subdivision (a), if the court determines that good cause does not exist for the surrender of a defendant who has not failed to appear or has not violated any order of the court, it may, in its discretion, order the bail or the depositor to return to the defendant or other person who has paid the premium or any part of it, all of the money so paid or any part of it.
(Amended by Stats. 1998, Ch. 223, Sec. 1. Effective January 1, 1999. Repealed pursuant to Section 1320.6 if and when that section takes effect.)