Buenos Dias please, if you can guide me. I have a table called pago
where the client is and another detalle
where are the payments that the client must make.
I would like to know if the customer has in the table detalle
4 payments worth 500,000 and he pays 300,000 as I do so that he goes to each individual payment and discounted from each detail payment until the value he paid is over.