To create the Pay Head for Gratuity computation,
Go to Gateway of Tally > Payroll Info. > Pay Head > Create
Enter the Name of the Pay Head
Select Gratuity from the List of Pay Head Types
Enter the Slab Rate details for Gratuity Calculation in the sub-screen as shown:

Select Provisions as Group from the List of Groups in the field Under
Set Set Alter Income Details to Yes
In the Income Tax Details screen,
Income Tax Component is defaulted to Gratuity while creating the Gratuity Pay Head
Tax Calculation Basis is defaulted to On Actual Value as Gratuity is paid only while leaving the organisation or retiring

Deduct TDS Across Period(s) is defaulted to No as the tax has to be deducted in the same month when Gratuity is paid
Select the Rounding Method from the list if applicable

Accept to save the Pay Head
Note: To use the Earning Pay Head for Gratuity calculation, set Use for Gratuity? field to Yes in the ledger creation screen (for Pay Heads such as Basic Salary, DA, and so on, created under Indirect Expenses).