(1)Whenever a court-martial imposes a fine as a punishment, the court may when passing judgment order the whole or any part of the fine recovered to be applied,—(a)in the payment to any person aggrieved as compensation for any loss or injury caused by the offence;(b)When any person is convicted of any civil offence which includes theft, criminal misappropriation, criminal breach of trust or cheating or of having dishonestly received or retained or of having voluntarily assisted in disposing of stolen property knowing or having reason to believe the same to be stolen property, in compensating any bona fide purchaser of the property for the loss of the same if such property is restored to the possession of the person entitled thereto.