Bonus shares will always show as a discrepant quantity in your Holdings - as in the system will not be aware of your buy average price for these bonus shares.
You’ll have to manually enter your buy avg price of Rs.0 for these bonus shares from your Q backoffice. The steps for this are mentioned here
After this is done, your bonus shares will reflect in your tradebook as shares bought at Rs.0.
You can segregate all Rs.0 trades from your tradebook as shares received from bonuses.