Humayd bin Abd al-Rahman (may Allah have mercy on him) said that Abd al-Rahman bin Abd al-Qari (may Allah have mercy on him) was in charge of the treasury of Sayyiduna Umar (may Allah be pleased with him). He said: People used to take zakah from debts, in this way: when the stipends were issued, the overseers ('urafa') held back people's debts for them, and on whatever remained in their hands the zakah was taken out before they received it. Then, after that, people extended loans that went bad, so they did not take zakah from a debt except what was realised in cash; but when they received the debt, they paid its zakah for the time that had passed.
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الزكاة / 7625