Hi,
As Cody suggested in my previous post about MySQL queries that might give you some insights about critical situations, now I'm making custom report to make it easy to use and export from Blesta admin interface.
Output Preview (CSV data):
Setup
1. Create a new custom report
2. Put the name you want to the report
3. Paste the following code in Query:
SELECT DATE(invoices.date_closed) Day, count(*) "Paid invoices", GROUP_CONCAT(invoices.id SEPARATOR ', ') "Invoices ID", SUM(invoices.paid) "Total Paid" from invoices where invoices.date_closed IS NOT NULL AND MONTH(invoices.date_closed) = MONTH(:chosen_date) AND YEAR(invoices.date_closed) = YEAR(:chosen_date) AND currency = ":currency" GROUP BY DAY(invoices.date_closed);
4. Add the following fields:
---
Label: Month
Name: chosen_date
Type: Date
Required: Yes
---
Label: Currency
Name: currency
Type: Text
Required: Yes
---
5. Click on Save and now it's ready to be used
You can also put the currency field as a Select field with the currency codes you use instead of having to write "USD" (or whatever you use) every time.
I'm using this query to get the invoices ID to look and generate e-invoices with a 3rd party API, which is required in my country.