Questions regarding maternity leave and resignation...

I am on my maternity leave + vacation (local) leave... the company told me that they will pay me for my vacation leave but for maternity leave, after i will come back to work...
Is the maternity leave pay will be paid before or after the vacation?
My contract will expire a week after i come back to work (August 21) then my visa will expire after a month (Sept 21). I am not sure if my company will give me an NOC.
When is the right time to inform the company that i will resign as we want to transfer my visa to my husband's sponsorship? I still want also to get my benefits before i resign (maternity pay, ticket and gratuity)...
Could somebody give me an advice...
Tnx in advance...