The structure of your Profit and Loss Statement is entirely controlled by the structure of your chart of accounts. You can do most of what you show. Read the Guide: https://www.manager.io/guides/9181.
However, some of what you are suggesting under Cost of Goods Sold goes beyond the structure of profit and loss statements into movement summaries. Get that information from the General Ledger Summary report. Note particularly that what you call Cost of Goods Sold is, in Manager, the Inventory - cost account. Transactions appear there only as inventory items are sold and their average cost can be debited to this account. So the value of that account is not figured the way you are showing it, which is based on total values of inventory, not the average cost method.