4. The years or parts of a year of service redeemed, other than those redeemed, if any, on the occasion of a transfer of service mentioned in sections 6, 7 and 8, are credited proportionately to the amounts paid in capital for their payment out of the total capital amount. Those years or parts of a year are deemed to be credited for the period of the marriage or civil union to the extent that they were paid during that period.