1
I need to create a PHP report in which information will be searched in Mysql.
In Mysql I have a list of billets issued, in which most were paid. In this table(Historico) has the following fields:
- Code_boleto
- Code_client
- Payment date
- Valor_pago
- Financial group
I would like the report to display all the data, but separating the companies by group and calculating the subtotal collected from each group(There are several groups).
Example:
GRUPO-1
1. Cliente1 | 26/02/2018 | 100,00 | Grupo1
2. Cliente7 | 22/02/2018 | 50,00 | Grupo1
3. Cliente8 | 10/02/2018 | 50,00 | Grupo1
Subtotal = 200,00
GRUPO-2
1. Cliente3 | 01/02/2018 | 120,00 | Grupo2
2. Cliente5 | 01/02/2018 | 40,00 | Grupo2
3. Cliente9 | 11/02/2018 | 50,00 | Grupo2
Subtotal = 210,00
Total Final = 410,00
I’m not finding the ideal logic to geara automatically this way. Could you help me?
What have you done? you want SQL to bring everything ready or it can be formatted in PHP?
– Costamilam
Gulherme, I have done all the graphical part of the report, but the main one (PHP and Mysql) not yet. I’m using Codeigniter, but I won’t stick to the detail of the framework.... I want to do it in a way that will burden the server less, that is, in the most correct way possible.
– crishenrique1986
I don’t use any PHP framework, but I would do (without Codeigniter) an SQL search taking all the data without
WHERE
, sorting by group and client, would divide the screen into several tables (1 per group), total and subtotal I would let the JS calculate– Costamilam
Yes, but my question is how to separate by group. I don’t want to print everything together understood? And it would be too heavy to do a while for each group...
– crishenrique1986