The gratuity for employees can be configured by navigating to Configuration>Salary Component>Deductions
Now you can configure the gratuity as per requirement. You can select whether it is to be included on the payslip or not. You can also put the formula for its calculation or let it be a flat amount. All the configuration of the gratuity can be performed here.