I need to create a report in PHP in which the information will be searched in MySQL.
In MySQL I have a boleto list issued, in which the majority has been removed. In this table (Historico) it has the following fields:
- Bold_Code
- CustomerID
- Date_Payment
- Paid_value
- 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.
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 automatically geara this way. Could you help me?