Sales/Accounts

I wonder if anybody can point me in the right direction. I’m trying to create an app that will allow me to track and manage stock for a small business but also handle the accounts. So I have managed to set up the stock tracking part, but am struggling with the accounts part.

My idea is the business will log onto the app and log a sale within a form on the app, in turn this will take off the appropriate amount of stock off of each product and then also fill out a sales table with the cost price, list price, quantity ordered, sub total and so on… for that specific sale. So then the business manager at the end of the month or year or whenever can download a sales file to see what they have sold. Another hurdle is that we need to be able to adjust the cost price and list price for products as that fluctuates without affecting previous sales within the sales table.

I hope this makes sense and I look forward to one of the geniuses on here who can point me in the right direction. If anybody needs any more information please don’t hesitate to ask.