Query for searching on "Total" function field seems erroneous (sum should be done on amount and tax_amount before union)