(1)In determining what sentence to pass on an offender who has pleaded guilty to an offence in proceedings before that or another court a court shall take into account—
(a)the stage in the proceedings for the offence at which the offender indicated his intention to plead guilty, and
(b)the circumstances in which this indication was given.
(2)If, as a result of taking into account any matter referred to in subsection (1) above, the court imposes a punishment on the offender which is less severe than the punishment it would otherwise have imposed, it shall state in open court that it has done so.