Jump to content

[Custom Report] Paid Invoices Ids Per Day Of Month


Recommended Posts

Posted

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):

post-10535-0-73788100-1451111121_thumb.p

 

 

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. 

 

 

  • 3 weeks later...
  • 6 months later...

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...