Write a complex SQL query using multiple INNER JOIN and LEFT JOIN statements to retrieve distributor transaction history across three separate tables.