I think keep structure of delievery as it is. You may add one column in delivery that is order_id_reference. while creating delivery note you can show list of order and could be selected, which will copy all details of customerid, address and all that. You may also bring items and ordered quantity.
Here user may add/edit/modify details (delivery may not look same as order)
urtrivedi
Nearly a Posting Virtuoso
1,306 posts since Dec 2008
Reputation Points: 257
Solved Threads: 270
If you are doing for class project than its fine. You do not need to show order_id_reference. It may be used to track orders if required.
But in real case one delivery may consists of many orders. So in that case you will need order, delivery relation table, that is one delivery many orders.
You should keep total column, and store calculated values in it, it means we are showing in report what ever stored in database. Always avoid calculations in reports (this is my personal opinion).
urtrivedi
Nearly a Posting Virtuoso
1,306 posts since Dec 2008
Reputation Points: 257
Solved Threads: 270
1) also keep address part in deleiver and order, because all customers are not regular customer, may want delivery at another address
2 ) you may keep amount column in deliver(qty*price)
3) as discussed in previous posts, you may add order_id_reference in delelivery_note
urtrivedi
Nearly a Posting Virtuoso
1,306 posts since Dec 2008
Reputation Points: 257
Solved Threads: 270
1) look the sequence
customer is at A
he placed order 1
order 1 delivered to place A
customer changed address (you update master table) A->B
he place order 2
order 2 delivered to place B
now you look for order 1 in reports
it will show order was delivered to address B (is it true?)
2) This is delivery so you do not need to keep amount related things, only quantity is enough.
But in case of invoice, You must store and show qty, rate, discount, total_amout item wise.
urtrivedi
Nearly a Posting Virtuoso
1,306 posts since Dec 2008
Reputation Points: 257
Solved Threads: 270