Acknowledgments:
An old thread onthat OP posed the question on how to calculate inventory on a FIFO basis. The OP included a sample database written by a 3rd party (unknown) which is very good workHTML Code:here
@Orange - you helped the OP and have worked on this file before in 2013. You updated the sample db with additions to the OP's code were very helpful to fix two bugs and properly comment on the code.
Request for help
I am looking to be able to calculate the profit on a sale of inventory spanning two or more purchase batches with different costs. I am writing a database to track personal money investments.
Can anyone on here help to update this database with this new functionality
Example scenario
Let's say I buy Microsoft shares as follows
PURCHASE ORDER
Invoice Transaction Date Quantity Purchase Price 1 Jan 20 1000 $1 2 Feb 21 500 $2 3 Jun 22 500 $3
SALES ORDER
Invoice Transaction Date Quantity Sale Price 100 Jan 23 500 $5 200 Feb 23 1000 $7
GOOD NEWS
The attached demo db works really well to calculate the consumption of inventory over batch quantities. It shows the amount of inventory left from each batch consuming the first purchased stock first. This is the hardest bit. Now I need to calculate the cost of the sold items.
BUT HOW CAN I CALCULATE THE COST ASSOCIATED WITH THE SALE
- Looking at Sales Invoice 200, comprising 1000 shares sold at $7.
- This transaction will be selling 500 shares with a cost of $1. And 500 shares with a cost of $2.
- So an average purchase cost for that transaction of $1.50 and therefore a total cost of $1500.
- This would mean the profit on the transaction can be calculated at $7,000 - $1,500
- I would also know that the remaining holding of 500 shares would have a cost value of $3.
SCREEN SHOT OF THE ABOVE SCENARIO
Ideally the Yellow highlight below will show the associated cost for that sale and the profit
I know this is a tough challenge so I am really grateful in advance for any help here.