How can someone pay zakah who is owed money, does business and owes debts?
Question

I owe a debt to the bank, for Islamic financing, which I took out for the purpose of doing business, but I lost three quarters of this money. The remaining quarter exists in the form of a debt that my friend owes me. I borrowed another sum of money from someone else, that I used for business (I bought some heavy machinery with the intention of selling it, but one full year has passed and it has not been sold). How much is the zakah that I must pay?
Praise be to Allah.Firstly:
Whoever possesses wealth must give zakah on it, even if he owes a debt, because zakah 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 zakah 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 zakah and he did not instruct them to enquire as to whether the owners of wealth had debts or not. Moreover, zakah has to do with the wealth itself, whereas debts have to do with the individual, and neither cancels out the other.
Shaykh Ibn Baz (may Allah have mercy on him) said: With regard to debts that a person owes, they do not cancel out zakah according to the soundest scholarly view."(Majmoo‘ Fataawa ash-Shaykh Ibn Baz 14/189).
Shaykh Ibn ‘Uthaymeen (may Allah have mercy on him) said: What I believe is most likely to be correct is that zakah 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 zakah becomes due, in which case he must pay it, then give zakah on what remains after that."(ash-Sharh al-Mumti‘  6/39).
See also: al-Majmoo‘ (5/317); Nihaayat al-Muhtaaj (3/133); al-Mawsoo‘ah al-Fiqhiyyah (23/247).
Secondly:
With regard to debts that are owed to a person by other people, the matter is subject to further discussion according to the fuqaha’:
a. 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 zakah must be paid on it every year, but it is permissible to delay paying the zakah until the money is received, then when it is received, zakah must be paid on it for all past years.
b. 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 zakah is due on it, but to be on the safe side, the owner of the money should pay zakah on it for one year when he receives it. This is the view of the Malikis.
See: al-Mughni (2/345); al-Mawsoo‘ah al-Fiqhiyyah (23/238).
Thirdly:
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 zakah 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 zakah 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.