I am having a hard time coming up with the ideal table structure for invoice history.
Currently i have:
invoice C 10
charge N 10,2
payment N 10,2
pdate D
EmpID C 10 (and other fields for tracking purposes)
Now
When a user creates an invoice the table will look like this:
Invoice Charge Payment PDate EmpID
---------------------------------------------
1000 1200.00 0.00 02/18/2004 JOHN
1001 500.00 0.00 02/20/2004 MIKE
Now, the user wishes to make a payment from the payment screen for invoice 1000 and only make 500.00 Payment
Thus:
Invoice Charge Payment PDate EmpID
---------------------------------------------
1000 1200.00 0.00 02/18/2004 JOHN
1001 500.00 0.00 02/20/2004 MIKE
1000 0.00 500.00 02/20/2004 MIKE
And So on...
But, my problem is:
It is hard for me, using this desgin, to figure out which invoices have a balance and so on. I have a small routin that does it, and it works OK. But, we use both system. The one I made along with QuickBooks. Andy many times, quickbooks pays invoices and my system pays other invoices. Even though we enter the same invoice number in both system and have the same amount and same dates.
How do you go about designing a table for such activity. To figure out Invoice balance, aging, and such...
Maybe I am thinking too hard, or maybe I am being very shallow. I don't konw.
your feedbck is greatly appreciated.
Ali Koumaiha
TeknoSoft Inc
Farmington Hills, Michigan
Currently i have:
invoice C 10
charge N 10,2
payment N 10,2
pdate D
EmpID C 10 (and other fields for tracking purposes)
Now
When a user creates an invoice the table will look like this:
Invoice Charge Payment PDate EmpID
---------------------------------------------
1000 1200.00 0.00 02/18/2004 JOHN
1001 500.00 0.00 02/20/2004 MIKE
Now, the user wishes to make a payment from the payment screen for invoice 1000 and only make 500.00 Payment
Thus:
Invoice Charge Payment PDate EmpID
---------------------------------------------
1000 1200.00 0.00 02/18/2004 JOHN
1001 500.00 0.00 02/20/2004 MIKE
1000 0.00 500.00 02/20/2004 MIKE
And So on...
But, my problem is:
It is hard for me, using this desgin, to figure out which invoices have a balance and so on. I have a small routin that does it, and it works OK. But, we use both system. The one I made along with QuickBooks. Andy many times, quickbooks pays invoices and my system pays other invoices. Even though we enter the same invoice number in both system and have the same amount and same dates.
How do you go about designing a table for such activity. To figure out Invoice balance, aging, and such...
Maybe I am thinking too hard, or maybe I am being very shallow. I don't konw.
your feedbck is greatly appreciated.
Ali Koumaiha
TeknoSoft Inc
Farmington Hills, Michigan