jdcallejas
Registered User.
- Local time
- Today, 08:09
- Joined
- Jul 1, 2008
- Messages
- 108
Hello,
I am creating a small database to keep track of invoices and payments for my small Internet Service Providing business. I now got into something that I need some help from you.
I have created invoices, products, clients, and one I call payments. I want to be able to create a code that will look up the clients invoices and apply payments from the payment database by filtering that clients id.
Lets say that the client has 5 invoices with a total of $100 each, but he only pays $375, when I apply the payment I want it to go through the recordset of invoices look at the total due on the invoice and apply whats is due and mark as paid. Then deduct from the original payment and continue with the next invoice, once it gets to the point that there is not enough money left on the payment to cover the invoice, just apply what's left from the payment and leave the new amount due for next time the client makes a payment.
I think I need to do a for next loop, but I am not up to date on how to do this.
I have uploaded the database, I have created a yes/no field on tblFacturas "Invoices" and on the tblPagos "Payments" so it will only filter unpaid invoices and only use new payments once the payment amount has been totally used.
If there is another way I greatly appreciate the fix.
Thanks,
Daniel
I am creating a small database to keep track of invoices and payments for my small Internet Service Providing business. I now got into something that I need some help from you.
I have created invoices, products, clients, and one I call payments. I want to be able to create a code that will look up the clients invoices and apply payments from the payment database by filtering that clients id.
Lets say that the client has 5 invoices with a total of $100 each, but he only pays $375, when I apply the payment I want it to go through the recordset of invoices look at the total due on the invoice and apply whats is due and mark as paid. Then deduct from the original payment and continue with the next invoice, once it gets to the point that there is not enough money left on the payment to cover the invoice, just apply what's left from the payment and leave the new amount due for next time the client makes a payment.
I think I need to do a for next loop, but I am not up to date on how to do this.
I have uploaded the database, I have created a yes/no field on tblFacturas "Invoices" and on the tblPagos "Payments" so it will only filter unpaid invoices and only use new payments once the payment amount has been totally used.
If there is another way I greatly appreciate the fix.
Thanks,
Daniel