Transpose sales data to the inventory movement table

Hello, I’m creating an app to track sales, inventory, accounts payable and receivable, etc. I created a table called “Inventory”, to perform the entry and exit of products, however, made manually. In this table, the app is in “deck” format, shows me the list of products, with an indication of entry or exit.
I need that every time I launch a sale, the app moves the output to the stock table, applying the inputs directly to the other table.
My app has a “Sales” table and inside it, a “REF” table, (I think they call it a child), called “Sale_Items”.
Thank you very much if you can help me.
Thanks.