1

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.

1 Answer 1

0

I would suggest a change to the structure. Change this table to:

Charges  --------  ID | Customer ID |Invoice ID |  Item ID | Qty 

Then add a related table for pricing with data as so

ChargesPriceDetails  --------  ID | Charge ID |PriceType| Charge
                                1   1          Price      12.25
                                2   1          Tax1         .25
                                3   1          Tax2         .10
                                4   1          Discount   -1.00

Insert all but total charge to the Charges table and then insert the price details Create view to show easily the sum of all charges.

1
  • Thanks HLGEM for the comment I like it but the major problem is that these charges will be picked by the invoice and we could have invoice level taxes for example compound tax on the subtotal then again i need to store the tax information which was applied in the invoice. if the customer returns partial item then the apply credit by calculate charges and invoice taxes. Feb 17, 2012 at 4:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.