|
Posted by Bob Bedford on 04/25/06 16:40
Hello all,
I'm creating an invoice process for my website.
I'm trying to show the invoice processing on a simple way. Let's explain
how:
I'm creating a table with the first column having the client's name. The
second column has the article description.
Now for every article, there is an invoice sent or to be sent (if the client
ordered an item I can't send an invoice since he didn't get the article).
Now for every sent invoice there can be one or more payments.
Since I'm getting invoice status, I don't want to see invoice that are
completely paid. I only want to get the "current" payement shown on the
grid. So I've a table called invoice and an other called payment. My table
should show the invoice and all the relative payment until the total of the
payment reach the invoice total.
So I may have this:
client X invoice 1 500$
invoice1 payment 250$
invoice1 payment 200$
My query, in pseudocode, is: select invoice,payement from the tables for
client X where TotalPayment < totalinvoice
How to create such query ? I can't find even in google. I'm not english so
probably I don't try the corret search string in google
(have tried mysql addition, mysql total)
Bob
Navigation:
[Reply to this message]
|