If pests have begun to attack a field on Ḥol Ha-mo’ed and are likely to cause significant damage, one may spray them. However, if he knew before the start of the festival that the field needed to be sprayed, but he was negligent and delayed spraying in order to do it on Ḥol Ha-mo’ed, he may not do so. Since he planned to do this work on Ḥol Ha-mo’ed, he is forbidden to do so. This is the general principle: anyone who intentionally plans to do work on Ḥol Ha-mo’ed is forbidden to do that work, even if refraining from doing so will result in his suffering a loss. The permissibility of davar ha-aved applies only when there are pressing circumstances, when a person has no choice but to do melakha on Ḥol Ha-mo’ed in order to prevent loss and anguish. It is not applicable to one who planned to work on Ḥol Ha-mo’ed (SA 537:16; 538:1). This holds true even if the work could be done by a non-Jew and is not difficult (MB 538:11; SA 543:1), and even if the person was unaware of the prohibition of planning work for Ḥol Ha-mo’ed (SSK 66:39; 67:5, 18).
If one planned to work on Ḥol Ha-mo’ed and transgressed by doing so, he may not get any benefit from whatever profits he derived from this work (AHS 538:7; Shevilei David). When rabbinic courts had the power, they would destroy whatever was produced on Ḥol Ha-mo’ed. However, if the person who did the work died, they did not penalize his heirs (SA 538:6).
Let us say that someone accepted a job with a deadline, and he agreed to a provision stating that if he does not meet the deadline, he will be liable to a heavy fine. He now realizes that in order to meet the deadline and avoid the fine, he will have to work on Ḥol Ha-mo’ed. May he do so? If he was certain when he accepted the job that he would be able to finish on time without working on Ḥol Ha-mo’ed, but in the course of the job there was an unanticipated setback which led to his needing to work on Ḥol Ha-mo’ed in order to finish on time, then he may work on Ḥol Ha-mo’ed. In contrast, if he knew from the start that even with diligence, there was a good chance that he would not be able to finish the project without working on Ḥol Ha-mo’ed, then he is considered to have planned to work on Ḥol Ha-mo’ed, and is thus prohibited from working.
It is important to be aware that in general, permission to work on Ḥol Ha-mo’ed is limited to special circumstances which, by definition, can happen only occasionally. Therefore, a business owner who asks for permission to work every festival because of davar ha-aved should generally not be granted permission to do so. What is at stake isn’t avoiding a loss, but rather missing out on profit. Alternatively, it is a poorly run business, in which case staying open on Ḥol Ha-mo’ed will not fix the underlying problem.