Brokerage for Order splitting

I have a major doubt. Suppose, at the time of entry I execute my trade with 500 quantities. At the time of exit, i partially exit half of those quantities and the other 250 at different prices. So will I be charged an additional 20 rupees brokerage instead of 40? or 60?

Yes.

20Rs is per order.
In your case, there are three orders - 500 quantity buy, 250 quantity sell and 250 quantity sell.
So total brokerage is Rs 60 + taxes.

It should be 40 overall

20 for buy and 20 for sell

Cost will be based on order not modification