title: How to handle differnet purched price and quantity in same product
body: <p>I'm developing a automobile parts inventory system using PHP and Mysql. This system have purchase module to add/update/increase quantity of parts &amp; sale module to decrease/out the quantity of parts. my query have 2 section</p>
  
  <p>A. Storing data</p>
  
  <ol>
  <li>Suppose we have PARTS A1 in our stock with quantity 30 and the price of PARTS A1 was $20 when we purchase it.</li>
  <li>Now we want to stock this parts more for example we want to buy 50 more items of PARTS A1 but now new price of PARTS A1 is $24.</li>
  </ol>
  
  <p>What is best way/logic to make these items separate to know how much parts are purchased with price $20 and new price $24 on sale page.</p>
  
  <pre><code>1. Store same parts more then once in database
  2. Normalize Database: parts HasMany partTransctions with purchased price and quantity
  </code></pre>
  
  <p>B. Retrieving Data</p>
  
  <ol>
  <li>what will be the decrease method when sale (suppose 60 unit in above example) A1 parts</li>
  <li>also I want to calculate the the profit of the sale</li>
  </ol>
  
  <p>How to handle all of those situation. Thanks in advance</p>