Salary based on the Joining date in salary slip

how to do this?
if an employee joins in mid-June and was an intern before that.i want to calculate the salary based on the joining date also the leave should calculate based on the joining date also