In MySQL I have two tables:
-
CLIENTS
| codigo-cliente | nome | grupo | valor | |----------------|------|-------|-------|
-
FINANCIAL
| codigo-cliente | codigo-boleto | grupo | valor | |----------------|---------------|-------|-------|
On the generate tickets page, I have a field where I select which group of customers I want to generate the tickets for.
When clicking to generate, I need the system to generate in the FINANCIAL table a ticket for each customer of the CLIENT table that is part of the selected group.
Example:
I selected group 10 and had it generated
CLIENTS Table
| codigo-cliente | nome | grupo | valor |
|----------------|--------|-------|-------|
| 1 | teste1 | 10 | 100 |
| 2 | teste2 | 12 | 60 |
| 3 | teste3 | 10 | 30 |
In the FINANCIAL table you will register a ticket for each customer that is in group 10.
FINANCIAL Table
| codigo-cliente | codigo-boleto | grupo | valor |
|----------------|---------------|-------|-------|
| 1 | 200 | 10 | 100 |
| 3 | 201 | 10 | 30 |