I have a simple system to register the payment of the invoices of my clients, but then there is a problem with one of my main customers.
--> I send my products to my customer.
-> Once every two months I see a deposit in my bank account with my client's name, but not knowing the invoices.
--> I must -using only the amounts- figure out wich invoices they paid me.. This is "easy" because the invoices are generally of very different amounts. and there is -almost every time- only one combination of invoices that will result in the complete ammount of the payment. For the exceptions, I can treat them like they are.. exceptions.
-->That takes me about 2 hours. some times more.
--> Then every 4 or 6 months I go to a meeting with my client to reconcile our accounts. to see which invoices he hasn't payed yet.
So I just can't use a LILO process. (pay with the money the 1st N invoices, until its full)
So ... I need a function with these parameters: array(or RS) of inovices and the amounts of each one, and the amount of the payment...
and the function must return an array or rs telling me wich of the invoices are the ones that have been covered by the payment. if there are more than one combination is not a problem, just having the first match.
And this one "little" problem has me working for over than 1 week.
--> I send my products to my customer.
-> Once every two months I see a deposit in my bank account with my client's name, but not knowing the invoices.
--> I must -using only the amounts- figure out wich invoices they paid me.. This is "easy" because the invoices are generally of very different amounts. and there is -almost every time- only one combination of invoices that will result in the complete ammount of the payment. For the exceptions, I can treat them like they are.. exceptions.
-->That takes me about 2 hours. some times more.
--> Then every 4 or 6 months I go to a meeting with my client to reconcile our accounts. to see which invoices he hasn't payed yet.
So I just can't use a LILO process. (pay with the money the 1st N invoices, until its full)
So ... I need a function with these parameters: array(or RS) of inovices and the amounts of each one, and the amount of the payment...
and the function must return an array or rs telling me wich of the invoices are the ones that have been covered by the payment. if there are more than one combination is not a problem, just having the first match.
And this one "little" problem has me working for over than 1 week.