What takes from the inventory quantity

What takes from the inventory quantity

There are several options SaleOrders, PurchaseOrders, Invoices... which ones disminish the Inventory quantity of the product? Does the change occurs online?