CRM-12385

Fix query to accomodate new structure of payment processor tables