A good body shop should be able to color match that paint so you can't tell it's been in an accident. You have every right to take it to such a body shop.
The dealer will deduct from the already lowball trade value they will give you for the car, the retail cost of making the repair. In other words, for a significant amount of damage they will get an estimate on bringing the car back to 'excellent' condition and deduct that from the trade value.
Of course, they're already making money on that trade value, since they will sell the car for significantly more. And, they will get the car repaired for wholesale prices so they'll make some more money on you there as well.
Get it fixed before you take it to the dealer for a trade. Better yet, get it fixed and sell it yourself. You have tremendously more bargaining power at a dealer when you bring money instead of a trade.