When rate of Gross Profit is given, it is always on sales. In the present question Gross Margin is 20% of sales which means 25% on costs, how:
Let the sales be = 100
Gross Margin = 20
Cost price = 80
Gross Margin on Cost Price = 20/80X100 = 25%
Opening Inventory = 9500
Add Purchases =22000
Total =31500
Less Closing Inventory = 17500
Cost of goods sold = 14000
Add G.P@25% = 3500
Total sales = 17500
Less Cash Sales = 6600
Credit Sales = 10900
Put the values obtain above in Trading A/c and you will get the balancing figure of Rs.10900