jdcallejas
Registered User.
- Local time
- Today, 05:19
- Joined
- Jul 1, 2008
- Messages
- 108
Hello Everyone,
Ok, this is going to be long, I am going to try to explain what I want to do, here it goes;
I have a table invoices and a table payments, what I want to do is somehow take the payment amount of client and if the payment amount is larger than the client invoice amount, update invoice cancel to yes and subtract the invoice amount from the payment amount, goto next invoice and do the same.
Once it goes through all records, if there is not enough money to pay the last invoice than it will only pay what is available and leave that invoiced not cancel. Next time the client makes a payment it would start where it left off, finish paying that invoice and goto the next one.
I know that it has to be like an if statement with an EOF loop… But I have no idea how to begin to do this or in this case since is code I am lost, so I come to you for help…
Ok, this is going to be long, I am going to try to explain what I want to do, here it goes;
I have a table invoices and a table payments, what I want to do is somehow take the payment amount of client and if the payment amount is larger than the client invoice amount, update invoice cancel to yes and subtract the invoice amount from the payment amount, goto next invoice and do the same.
Once it goes through all records, if there is not enough money to pay the last invoice than it will only pay what is available and leave that invoiced not cancel. Next time the client makes a payment it would start where it left off, finish paying that invoice and goto the next one.
I know that it has to be like an if statement with an EOF loop… But I have no idea how to begin to do this or in this case since is code I am lost, so I come to you for help…