Fines imposed by a military court may be paid to it or to an officer executing its process. The amount of such a fine may be noted upon any state roll or account for pay of the delinquent and deducted from any pay or allowance due or thereafter to become due the person, until the fine is liquidated. Any sum so deducted shall be turned in to the military court which imposed the fine. Notwithstanding any other law, the officer collecting a fine or penalty imposed by a military court upon an officer or enlisted person shall pay it within thirty days to the state treasurer. Such a fine becomes a part of, is credited to, and may be spent from, the military fund of the organization or detachment to which the officer or enlisted person who paid the fine belonged. The treasurer of the state shall then report the amount thereof designating the organization or detachment to which it belongs, to the adjutant general of the state, and shall pay it over to the organization or detachment on request of its commanding officer.