Praise be to Allah.
Whoever possesses wealth must give zakaah on it, even if he owes a debt, because zakaah is obligatory upon him, and the debt makes no difference. This is the view of Imam ash-Shaafa‘i (may Allah have mercy on him), because of the general meaning of the evidence which indicates that zakaah is obligatory upon the one who possesses wealth that meets the minimum threshold (nisaab), and because the Prophet (blessings and peace of Allah be upon him) used to send his workers to collect the zakaah and he did not instruct them to enquire as to whether the owners of wealth had debts or not. Moreover, zakaah has to do with the wealth itself, whereas debts have to do with the individual, and neither cancels out the other.
Shaykh Ibn Baaz (may Allah have mercy on him) said: With regard to debts that a person owes, they do not cancel out zakaah according to the soundest scholarly view.
End quote from Majmoo‘ Fataawa ash-Shaykh Ibn Baaz (14/189).
Shaykh Ibn ‘Uthaymeen (may Allah have mercy on him) said: What I believe is most likely to be correct is that zakaah is obligatory in all cases, even if a person owes debts that takes his wealth below the minimum threshold (nisaab), except a debt that becomes due before zakaah becomes due, in which case he must pay it, then give zakaah on what remains after that.
End quote from ash-Sharh al-Mumti‘ (6/39).
See also: al-Majmoo‘ (5/317); Nihaayat al-Muhtaaj (3/133); al-Mawsoo‘ah al-Fiqhiyyah (23/247).
With regard to debts that are owed to a person by other people, the matter is subject to further discussion according to the fuqaha’:
If the debt is owed by a rich person who is able to pay it off and it is possible for him to pay off the debt when asked to do so, then zakaah must be paid on it every year, but it is permissible to delay paying the zakaah until the money is received, then when it is received, zakaah must be paid on it for all past years.
If the debt is owed by one who is poor, or one who denies that he owes anything and there is no proof to confirm it, then no zakaah is due on it, but to be on the safe side, the owner of the money should pay zakaah on it for one year when he receives it. This is the view of the Maalikis.
See: al-Mughni (2/345); al-Mawsoo‘ah al-Fiqhiyyah (23/238).
If someone buys something with the intention of trading in it, then one full year passes, and it reaches the minimum threshold either by itself or when added to other cash, then he must pay the zakaah on trade goods. So he should work out its value at the end of the year, based on the market price, then give one quarter of one tenth (2.5%) of its value.
See the answers to questions no. 26236 and 42072.
Conclusion: You should look at what you have in your hand of wealth, and what your friend owes you, and work out the value of the equipment you have for sale, then give zakaah on the total – if the conditions mentioned above are met – regardless of the debt that you owe.
We ask Allah, may He be exalted, to help you to pay off your debt, to compensate you with something better, to bestow more of His bounty upon you, and to help you to worship and obey Him.
And Allah knows best.