Newbies mastang13 Posted April 17, 2007 Newbies Posted April 17, 2007 Your help would be greatly appreciated! I have a typical invoice db (CUSTOMER,INVOICE,INVENTORY,LINEITEM,PAYMENT and CONTACTS db's)and all is well except i need to track over paid invoices. So if a customers invoice total is $500.00 and the customer pays $1,000 I need to be able to apply the remaining $500 towards next purchase. I tried but just can get it to work. If anybody can give me a sample db structure or ideas that would be great! Thanks
David McQueen Posted April 18, 2007 Posted April 18, 2007 You probably have to go to a model based on transactions instead of just purchases (Invoice Line Items). Then there is a record for each purchase ( Money Owed) and a record for each payment (Money Received). The balance then includes all payments and all purchases. HTH Dave McQueen
Newbies mastang13 Posted April 20, 2007 Author Newbies Posted April 20, 2007 David, This is an entity chart of what I have, what am i missing? ||- = many to one -|| = one to many Contacts||-Customers-||Invoices-||Lineietms||-Inventory Invoices-||Payments So when a customer makes a payment greater that total of invoice I need to track the difference and apply it towards the next purchase for this customer. Not sure what you mean by transaction?
David McQueen Posted April 20, 2007 Posted April 20, 2007 The model I put forward probably won't handle payment assignments to multiple invoices as is. When I was saying go to a transaction model I was indicating separate records in the same table for invoice line items and for payments. Invoice line items would be positive and payments would be negative and this would allow you to have an instant balance on the account at any time. It does not however assign any particular payment to any particuar line item in the child table or to any particular invoice in the parent table. Hence the model as it stands is deficient for your purposes. I am not sure what the best approach here would be. It does appear that to some extent you ware going to have to build a double entry book keeping system. I am sure that there are those on the list here who have done it and could chime in. Dave McQueen
Recommended Posts
This topic is 6426 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now