(1) Any person who admits that he or she has committed crimes in the county in which he or she is in custody and also in another county in this state may apply to the district attorney of the county in which he or she is in custody to be charged with those crimes so that the person may plead guilty and be sentenced for them in the county of custody. The application shall contain a description of all admitted crimes and the name of the county in which each was committed.(2) Upon receipt of the application the district attorney shall prepare an information charging all the admitted crimes and naming in each count the county where each was committed. The district attorney shall send a copy of the information to the district attorney of each other county in which the defendant admits he or she committed crimes, together with a statement that the defendant has applied to plead guilty in the county of custody. Upon receipt of the information and statement, the district attorney of the other county may execute a consent in writing allowing the defendant to enter a plea of guilty in the county of custody, to the crime charged in the information and committed in the other county, and send it to the district attorney who prepared the information.(3) The district attorney shall file the information in any court of the district attorney’s county having jurisdiction to try or accept a plea of guilty to the most serious crime alleged therein as to which, if alleged to have been committed in another county, the district attorney of that county has executed a consent as provided in sub. (2). The defendant then may enter a plea of guilty to all offenses alleged to have been committed in the county where the court is located and to all offenses alleged to have been committed in other counties as to which the district attorney has executed a consent under sub. (2). Before entering a plea of guilty, the defendant shall waive in writing any right to be tried in the county where the crime was committed. The district attorney of the county where the crime was committed need not be present when the plea is made but the district attorney’s written consent shall be filed with the court.(4) Thereupon the court shall enter such judgment, the same as though all the crimes charged were alleged to have been committed in the county where the court is located, whether or not the court has jurisdiction to try all those crimes to which the defendant has pleaded guilty under this section.(5) The county where the plea is made shall pay the costs of prosecution if the defendant does not pay them, and is entitled to retain fees for receiving and paying to the state any fine which may be paid by the defendant. The clerk where the plea is made shall file a copy of the judgment of conviction with the clerk in each county where a crime covered by the plea was committed. The district attorney shall then move to dismiss any charges covered by the plea of guilty, which are pending against the defendant in the district attorney’s county, and the same shall thereupon be dismissed.