Get POS Profile Payment Method For Report

So we’re using a pos profile with 3 payment methods for our sales invoices. When I try querying the Sales Invoice Payment table I see that the mode of payment is the same as the POS profile name. How do I get the payment method used for that sales invoice for my report? I am trying to get a report that sums up the amount of every payment mode. This is a part of the query I used

SELECT DISTINCT  mode_of_payment
    FROM `tabSales Invoice Payment`
SELECT 
`tabSales Invoice`.`name` as "No INV:Link/Sales Invoice",
`tabSales Invoice`.`posting_date` as "Date :Date/Date",
MAX(CASE WHEN `tabSales Invoice Payment`.`mode_of_payment` = "CASH" THEN `tabSales Invoice Payment`.`amount` - `tabSales Invoice`.`change_amount` END) "CASH :Currency/Currency",
MAX(CASE WHEN `tabSales Invoice Payment`.`mode_of_payment` = "PAYMENT_METHOD_2" THEN `tabSales Invoice Payment`.`amount` - `tabSales Invoice`.`change_amount` END) "PAYMENT_METHOD_2:Currency/Currency"
FROM `tabSales Invoice`,  `tabSales Invoice Payment`
WHERE `tabSales Invoice`.`name` = `tabSales Invoice Payment`.`parent` 
and   
`tabSales Invoice`.`docstatus` = '1' 

May you can achive it with this query…