Values based on formula not changing dynamically while creating salary slip in HR module

I have HRA based on Basic. So if i am changing value in Basic while creating salary slip then HRA is not getting changed as per formula. How can we do that?