1
I’m developing software for a Home Care company. The software is being created exclusively for a particular client so it works according to her head. No wonder the operation.
This company has its patients, who pay a fixed monthly amount. Often the patient dispenses with the services for a period and then comes back. I need to do something very simple that is subtract from the monthly fee of each client the costs that the company had with him in a given month and thus reach the net profit.
So far so good, I can do.
But I also have to add up the net profit that all patients generated and so know the total net profit of the month.
You can’t do it @paciente.lucro_liquido = @paciente.valor_do_contrato - @paciente.custo_1 - @paciente.custo_2
because in the following month the contract value and costs change and this would change the values of the previous months.
What is the best way to resolve this? How can I separate information month by month?