Inventory System Data Design Issue So I have been trying to design a inventory management system for a Car Showroom. The problem with this design is that I can get a purchase but on selling the product I can't link it to my purchase. The idea I've came with up is add a Batch_ID to my Inventory_Details table but I can only link that Batch_ID in my details table not in my inventory table. Any suggestions will be helpful.
In a traditional Inventory Warehouse System or Warehouse Management System (WMS) whenever a new Item is put on hand (i.e. created or purchased, and therefore added to Stock) a unique identifier must be created, usually a serial number, before you can enter it into Inventory and adjust your quantity on hand. In the context of a Car Showroom, I would imagine this would the be the VIN instead. (I'm not an expert on cars but I believe that's a unique identifier.)
Even when an item is received in batch quantities, that many unique identifiers need to be added to your Inventory before you can add the quantity to your quantity on hand. Therefore if your Purchase table has a one-to-many relationship with how many cars a Purchase can buy, because of batches, then you can't directly relate it to your Inventory table (yet). Rather you should have a separate table such as PurchaseLines which is many-to-one with your Purchase table, and has a row with the unique VIN for each car that was purchased. (This is even a simplification, as a real WMS actually normalizes this further into at least 2 more tables for ledger purposes, but I think that's outside the scope here, and this should be sufficient to what you need.) Your InventoryDetails table would then contain the VIN as well and directly relate back to the PurchaseLine it came from.
Additionally you should have just an Items table that defines the criteria of your cars, so you can generically refer to your quantity on hand by Item. As I'm sure you don't want to track the individual quantity of a VIN which will always be 1 (since my changes above will result in that). Instead if you have an Items table with fields like Model, Description, Color, MFYear, etc then your InventoryDetails table becomes more normalized and only stores an ItemId field instead (one-to-one with the Items table). Then your Inventory table can now track quantity for an ItemId instead which would be the relationship between InventoryDetails.
Finally, the concept of an ItemId becomes universal throughout the Warehouse Management System. It is like your core unit of measure. It should be part of your Purchases (in PurchaseLines) and your Sales (in an equivalent SalesLines table as well), and is a way to establish what item was transacted on.

Additional Resources:

Example ER Diagram of an Inventory Management System