Jump to content

[Custom Report] Paid Invoices Ids Per Day Of Month


Rodrigo

Recommended Posts

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. 

 

 

Link to comment
Share on other sites

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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...