Product prices, stock values, and sales prices

Hi.
I have been using Dolibarr for several years, and now after doing some research in to an issue I have over pricing.
I see that the average cost price is just that. It is an average price of any stock purchased. This figure does not give an accurate account of stock held price, as it does not loose the value/quantities of any products sold, (only changing its figures on purchasing) Hence, over a couple of years is completely irrelevant for any kind of management of accurate pricing.
Is there any module that tracks prices with stock and quantities down to an individual purchase or sale figure of price/qty.
If an average figure is to be used, it should realistically be done on a first in first out basis.
This pricing method I am also assuming is carried over to any stock values, As far as I can see, there is no reliable way currently of pulling figures from an export of stock and product prices, to give an accurate reflection of true purchase cost. This being especially true considering prices pretty much only ever go up.
Can anyone tell me if the database does track products on an individual price point level, or purely on an average cost level.
Is there a 3rd party module that accurately follows actual cost pricing of purchased stock, and the potential change of price with the sales or consumption of some of that stock.
It appears that the only way the system can genuinely be (almost) correct in working out margins and sales prices, is to manually add the cost price on each line item purchased. Average purchase price is absolutely not the way forward in its current form for working out cost/prices.

Any help or advice most appreciated.
rob
V20.0.3

Dolibarr’s default stock valuation uses an average cost method, which doesn’t reflect actual purchase prices over time and can lead to inaccurate margins. The system doesn’t track inventory costs per individual purchase (like FIFO or LIFO); it just updates the average price with each stock entry.

There aren’t built-in tools for detailed cost tracking by purchase batch, though some third-party modules or custom solutions might exist. Many users handle this by manually entering purchase prices per line, but that’s not ideal.

For accurate FIFO costing, you’d likely need a custom module or external calculations. Hopefully, the community or future updates will address this.