Having been in this situation quite a few times I would be very carefull in fixing the car. Especially when hit in the rear.
Since I do not know what the damage is or what the car is worth I will say the following.
This only works out when the difference in damage to price is still very close. Because they will only give you the value of the car - not cost to fix -- and you still must buy the car from them!
Say you have a car that is in great shape and it gets hit in the front -- worth 4k and the fix is around the same -- often with this amount of work in the front you are not working on the structure of the car -- new bumpers/ condensor/ rad/ fans/ lights -- ends up with little body work and the car is improved with some new parts. Even better if you can get them off a wreck - or fix it yourself.
In a rear hit you quickly get into structure - and it is usually not worth it.
Normally you end up paying more than you figured it would cost and you spend lots of time -- money and time better spent on finding a new used one.
I have seen this work out when a body shops will buy a late model heavy rear hit from an insurance co -- on the cheap. They will then find the more common major late model front hit and splice the two together. This works out $$ wise.