No good deeds will be accepted from one who does not pray – no zakaah, no fasting, no Hajj or anything else.
Al-Bukhaari (520) narrated that Buraydah said: The Messenger of Allaah (peace and blessings of Allaah be upon him) said:
“Whoever does not pray ‘Asr, his good deeds will be annulled.”
What is meant by “his good deeds will be annulled” is that they will be rendered invalid and will be of no benefit to him. This hadeeth indicates that Allaah will not accept any good deed from one who does not pray, so the one who does not pray will not benefit at all from his good deeds and no good deed of his will be taken up to Allaah.
It seems from the hadeeth that there are two types of those who do not pray: those who do not pray at all, which annuls all their good deeds, and those who do not offer a particular prayer on a particular day, which annuls the good deeds of that day. So annulment of all good deeds happens to those who forsake all the prayers, and annulment of the good deeds of a particular day happens to the one who omits a particular prayer.