The isCash() function has a bug which causes it to match both cash and non-cash transactions since it's matching the text "cash" which is in both. Changing that function as follows fixes the issue:
function isCash(r){ return !String(r[idx['IRS Donation Type Classification']] || '').toLowerCase().includes('non'); }