0
In the Mysql have two tables:
- CUSTOMERS - | codigo-cliente | nome | grupo | valor | |----------------|------|-------|-------|
- FINANCIAL - | codigo-cliente | codigo-boleto | grupo | valor | |----------------|---------------|-------|-------|
On the page generate boletos, I have a field where I select for which group of customers I want to generate the boletos.
When clicking to generate, I need the system to generate in the FINANCIAL table a ticket for each client of the CLIENT table that is part of the selected group.
Example:
I selected group 10 and had it generated
CLIENT TABLE
| codigo-cliente | nome   | grupo | valor |
|----------------|--------|-------|-------|
| 1              | teste1 | 10    | 100   |
| 2              | teste2 | 12    | 60    |
| 3              | teste3 | 10    | 30    |
In the FINANCIAL table will register a ticket for each client who is in group 10.
FINANCIAL SCHEDULE
| codigo-cliente | codigo-boleto | grupo | valor |
|----------------|---------------|-------|-------|
| 1              | 200           | 10    | 100   |
| 3              | 201           | 10    | 30    |
If possible post the code you have tried.
– Valdeir Psr
You did not inform where the information comes from for the "code-billet"
– Pagotti
Pagotti, the "codigo-boleto" is automatically generated by Mysql.
– crishenrique1986
Valdeir Psr, I couldn’t find the right logic, so I don’t have the code.
– crishenrique1986