Im doing a project for restaurant.so in it i need invoice tabel in database.in invoise there are multiple items like mango juice and fried rice, like wise.the amount of items are different for each bills.so how i create my in database.
Question posted in PhpMyAdmin
The official documentation can be found here.
The official documentation can be found here.
2
Answers
to answer your question, here is a simple database design:
You would have a table that stores all the products: Product that a customer can order using your app.
Then, you will have a table that stores all the orders: Order
You would then store all the ordered products in a table: OrderedProducts
Then you would have a table for storing invoices: Invoice. This will hold all the order ids.
ps: not posting the actual script because its better if the person does some research with this knowledge.
Here is sort of a generic table structure that might help get you started:
tblInvoice:
InvNum
InvDate
InvTime
InvRepNum
InvSubtotal
InvSalesTax
InvShipping
InvTotal
InvNotes
InvPaidDate
tblInvoiceDetail:
InvDetailNum
InvDetailInvNum
InvDetailProdNum
InvDetailProdDescr
InvDetailProdPrice
InvDetailQty
InvDetailLineTotal