Hi I need to create a report for my accountant that shows me the following details,
Invoice id, invoice_date, customer name, £ invoice_total, unpaid/paid
Is there already a report i'm missing or could someone please create me a mysql query to get this info.
Please Help!!
Thanks, Tim
Not sure how to add on the paid and unpaid bit but worked out the rest.
SELECT t1.index_id, t2.name, t1.DATE, t3.totals
FROM si_invoices AS t1
LEFT JOIN si_customers AS t2 ON t1.customer_id = t2.id
JOIN (SELECT invoice_id,SUM(total) AS totals FROM si_invoice_items GROUP BY invoice_id) AS t3 ON t1.id = t3.invoice_id
ORDER BY t1.index_id ;