I've try to search this, but I haven't found it yet.
I have a case of payment online system.
Let's say I have an item named "A"
"A" stocks is 30
but, from the "A" stocks..
I buy 20 of "A" for $10 each from supplier
and the rest 10 of "A", I buy $15 each from supplier
and then I sell "A" $20 each
Now, How do I design the item table in the database for "A" so I able to count
the exact profit for "A"
am I have to input 2 row in "item" table which contain
"A.1" for $10 of capital and
"A.2" for $15 of capital
If that's the conclusion, that means..
When a customer buy "A" 25 pieces.
Then I have to decrease A.1 stock to 0
and A.2 to 5
Are you guys have a better solution from me ?
Sorry for my bad English and knowledge.