To do proper setup, 

1. Setup Parent Account as Direct Income

2. Create COGS/Cost of sales as Group a/c and keep the root as expense type 

3. Create the various cogs itsself (ie sub a/c) with parent as COGS and a/c type as cogs

4. Enable enable include in gross for the direct income and the cogs ledgers