A company encashing leaves is always based on Basic + DA, which fulfills the legal provisions laid down by law. Any company that encashes leaves based on the gross salary is doing so as a matter of their own policy, as they are meeting the minimum requirements of the law. This is done for employee benefit and to earn loyalty as well. The Factories Act states that 30 leaves can be carried forward at max, and the rest can be encashed. However, if the company is forwarding more than that, there is no harm in the same as this is also a kind of benefit being extended, as later the employee will get its encashment on the current salary.
Hope I have answered your query.