Does consuming that which is acquired by haraam means spoil the fast?
Question

I have been working with grapes that are grown to make wine for two years, but in the first year I did not know that this work is haraam. This year, however, I became certain that it is haraam to do this, even though I am still working there, and I am afraid that all my good deeds and fasting in this month will be rendered worthless. I hope that you can advise me. I am a young man, and I am hoping for clarification.
Praise be to Allah.Firstly:
Ruling on helping in that which is haraam
It is not permissible to work with grapes from which wine is made, whether the work involves selling them, preparing them or anything else, because this is helping with the mother of evils, and the wealth earned through this work is haraam.
Allah, may He be exalted, says (interpretation of the meaning):
{And cooperate in righteousness and piety, but do not cooperate in sin and transgression. And fear Allah; indeed, Allah is severe in penalty} [al-Maa’idah 5:2].
According to the hadith of Anas ibn Maalik (may Allah be pleased with him), the Messenger of Allah (blessings and peace of Allah be upon him) cursed ten with regard to khamr (intoxicants): the one who presses [the grapes, etc], the one for whom it is pressed, the one who drinks it, the one who carries it, the one to whom it is carried, the one who pours it, the one who sells it, the one who consumes its price, the one who buys it, and the one for whom it is bought. Narrated by at-Tirmidhi (1259) and Abu Dawood (3674).
Secondly:
Does deliberately committing sin spoil the fast?
The fuqaha’ differed regarding deliberately committing sin in Ramadan: does it spoil the fast or not?
The majority are of the view that fasting is only invalidated by the things that are known to break the fast, such as eating, drinking and having intercourse, and it is not spoiled by other sins, such as backbiting, lying and doing haraam work. But they said: that detracts from the reward of fasting and may prevent it from being accepted.
Ibn Hazm was of the view that the fast is invalidated by that, and quoted as evidence the report narrated by al-Bukhaari (6057) from Abu Hurayrah (may Allah be pleased with him), who said: The Messenger of Allah (blessings and peace of Allah be upon him) said: “Whoever does not give up false speech, acting upon it and ignorance, Allah has no need of his giving up his food and drink.
Ahmad (8856) narrated that Abu Hurayrah said: The Messenger of Allah (blessings and peace of Allah be upon him) said: “Perhaps all a fasting person gets from his fast is hunger and thirst, and perhaps all one who prays qiyaam gets from his qiyaam is a sleepless night.” Shu‘ayb al-Arna’oot said in Tahqeeq al-Musnad: Its isnad is jayyid.
See also: al-Muhalla (4/304).
For more information, please see the answers to questions no. 37877 and 50063 .
The correct view is that of the majority, but there is the fear that the fasting, supplication and prayer of the one whose food and drink are bought with wealth earned in a haraam way may not be accepted, because the Prophet (blessings and peace of Allah be upon him) said: “O people, Allah is Good and does not accept anything but that which is good. Allah has enjoined upon the believers that which He has enjoined upon the Messengers. He says: {O messengers, eat from the good foods and work righteousness. Indeed I, of what you do, am Knowing} [al-Mu’minoon 23:51], and He says: {O you who have believed, eat from the good [i.e., lawful] things which We have provided for you} [al-Baqarah 2:172]. Then he mentioned a man who has undertaken a lengthy journey and is dishevelled and dusty, raising his hands towards heaven and saying, ‘O Lord, O Lord!’ but his food is haraam, his drink is haraam, his clothing is haraam, he is nourished with haraam so how can he receive a response?” Narrated by Muslim (1015).
Ibn Rajab (may Allah have mercy on him) said: This hadith indicates that a good deed cannot be accepted or be pure unless one eats and consumes that which is acquired by halaal means, and that eating and consuming that which is acquired by haraam means spoils good deeds and prevents them from being accepted. After affirming that Allah does not accept anything except that which is good, he said: Allah has enjoined upon the believers that which He enjoined upon the messengers, as Allah, may He be exalted, says (interpretation of the meaning): {O messengers, eat from the good foods and work righteousness. Indeed I, of what you do, am Knowing} [al-Mu’minoon 23:51], and He says: {O you who have believed, eat from the good [i.e., lawful] things which We have provided for you} [al-Baqarah 2:172].
What is meant here is that the Messengers and their nations were enjoined to eat that which is good, which means that which is halaal and acquired by halaal means, and they were enjoined to do righteous deeds. Therefore so long as the food is halaal and acquired by halaal means, then the righteous deeds will be accepted, but if the food is not halaal and not acquired by halaal means, how can the righteous deeds be accepted?
What is mentioned after that about supplication, and how can it be accepted when one’s earnings are from haraam sources, is an example to highlight how unlikely it is that any righteous deeds will be accepted when a person is nourished with that which is haraam." (Jaami‘ al-‘Uloom wa’l-Hukam 1/260).
There are many texts which warn against consuming what is earned by haraam means, such as the words of the Prophet (blessings and peace of Allah be upon him): “Every body that is nourished by haraam, the Fire is more befitting for it.” Narrated by at-Tabaraani from Abu Bakr; classed as saheeh by al-Albaani in Saheeh al-Jaami‘ (4519).
Also narrated by at-Tirmidhi (614) from Ka‘b ibn ‘Ujrah, as follows: “No flesh grows that is nourished by haraam, but the Fire is more befitting for it.” Classed as saheeh by al-Albaani in Saheeh at-Tirmidhi.
So hasten to repent, and give up this job immediately, and understand that the sources of provision are many, and whoever gives up something for the sake of Allah, He will compensate him with something better than it.
And Allah knows best.