As long as you are employed in the ‘qualifying week’, then you are still entitled to receive Statutory Maternity Pay (SMP provided you meet all of the other conditions outlined above. It does not matter if you are off sick or on holiday in the qualifying week.
Once you have qualified for SMP you are entitled to receive it for the full 39 weeks and this is the case even if you are made redundant, you leave your job, or a fixed term contract comes to an end at any time after the 15th week before you baby is due or during your maternity leave.
You must remember that you do not have to pay SMP back if you are not returning to work after your leave period. Your employer can claim back all or most of it from the Inland Revenue. However, if your employer offers maternity pay, which is better than SMP, then you should check your staff handbook because you may have to pay some of that back if you do not return to work.
Some employers offer enhanced packages to women, for example a lump sum of money once they return to work after maternity leave for a period of time. This is not an ideal situation for mothers, as they often need the money when they are on the leave, not once they have returned to work, but it is legal.