I have a requirement in one of the application to implemented taxes and track return items.My database design as follows
Items
--------
ID | Name | Price | Taxable
Master data for the items. Each item can be taxable or not taxable.
Charges
--------
ID | Customer ID |Invoice ID | Item ID | Qty | Amount Each
Here our customer will add charges for their customer by selecting the item. -When customer create charges , the charge item tax to be stored if the item is taxable.
Invoice
--------
ID |Customer ID Stamp |Amount
Our customer will mapped all the charges in the invoice by the selecting the charges and add the invoice id to the charge table and total amount will be stored.
We could have invoice level taxable also.
Taxes
--------
ID | Name | Percent
My tax structure is as follows
A charges can have multiple tax on each item.Invoice can have multiple tax on the net amount. When customer return the items due to any reason i need to give credit the amount to the customer so at that time i need to check the item level tax on the item and also check the invoice level tax and give credit out. The credit table to need to store the track the item and its tax history.
sample data
-----------
item cost qty line total tax1(5%) tax2(8.5%) total
sample 9.99 2 19.98 0.999 1.6983 22.6773
sampe 100 2 200 10 0 210
Can any one suggest the propose table structure for the tax for the charges ,credit and invoice so that can handle taxes easily in the all the cases for example Charges item taxes can be maintained. Invoice taxes can be maintained. Credit taxes can be maintained.