Re: Product inventory table design
- From: Michael Wong <nospam@xxxxxxxxxx>
- Date: Wed, 22 Feb 2006 18:03:52 +1100
Hi Tina,
You are right. I need to make myself clearer, now I understand why developpers always have difficulties to understand their customers.
It also took me a long time to understand this case...
well, i'm afraid you lost me here. do you need to track *where* the product
is distributed, within a branch? as in, 10 coats in carton A, 12 coats in
carton B, etc - where the product you're counting is "coats"; in other
words, you aren't just tracking that you have 22 coats at Branch X?
Correct, when I'll need the total in Branch X, I'll just add them up. If it's my branch, I'll need the details so I can get to them quicker, but if it's on another branch, I'll just need to have their total (for placing the order for example)
The inventory in each branch is done by cycle counting (the table's name Inventory might not be appropriate).
What I have done is just shifting the foreign key ProductId in InventoryDetail to Inventory (note that I have changed the table's name):
Table Inventory:
InventoryId: PK
BranchId: FK // The combination BranchId and ProductId would be
ProductId: FK // unique
InventoryDate
Table InventoryDetail:
DetailId: PK
InventoryId: FK
Qty
Notes
The reason I put ProductId and BranchId in the same table is to easily get to the InventoryDetails for a given product in a given branch.
And now, the inventory details would be associated to the counting for the product in that specific branch.
Maybe an example would be a lot clearer:
Lady coat no 634:
Main branch: counted on 14/02/06
- 60 pcs, ctn 123
- 6 pcs, on the shelf (in the shop)
Second branch: counted on 16/02/06
- 3 pcs, on the shelf
Lady pant no 132:
Main branch: counted on 21/02/06
- 2 pcs, a customer has reserved these
No second branch inventory here, because this was a special
order for a customer.
Lady shoes no 852:
Main branch: counted on 22/02/06
- 12 pcs, in stock shelf no 3
- 12 pcs, waiting to be sent to branch 2
- 2 pcs, in the shop
Second branch: counted on 20/02/06
- 0 pcs, placed the order from Main branch already
.
- Follow-Ups:
- Re: Product inventory table design
- From: tina
- Re: Product inventory table design
- References:
- Product inventory table design
- From: Michael Wong
- Re: Product inventory table design
- From: tina
- Re: Product inventory table design
- From: Michael Wong
- Re: Product inventory table design
- From: tina
- Product inventory table design
- Prev by Date: Re: Product inventory table design
- Next by Date: Re: Which the best option ?
- Previous by thread: Re: Product inventory table design
- Next by thread: Re: Product inventory table design
- Index(es):
Relevant Pages
|