The friend is expecting your dd to replace the money in the lost purse. The replacement of which is the friend's responsibility.
Anyone who turns up for a night out with no money is either a) a freeloader or b) has been promised by another party that the other party will pay for their drinks.
For the sake of not confusing myself anyone, I'm Christening the other friend 'Barbara'.
So I think your dd needs to work out if her friend was paying for Barbara's drinks, as Barbara had chosen to show up cashless. Or was Barbara expecting to sit and drink nothing at all whilst dd and friend drank?
In your dd's position I would say to the friend "You and Barbara owe me £20. Pay me back the total £40 and I'll give you the £30 back that I owe you.'
It's not fair to expect the £30 back when, in effect, it's been paid back early. I know the friend said she didn't want the £30 early, but she got it as your dd kindly offered to pay for the evening's drinks. For all of them. Frankly, beggars can't be choosers and if the friend can't budget such that she can possibly accept £30 early, then tough. She's expecting your dd to subsidise her until she can afford to find the £40.
This gets a bit more complicated if dd's friend isn't willing to cover the cost of Barbara's drinks, because then actually your dd owes her friend £10 and Barbara owes your dd £20.
I think the friend is being really cheeky in taking money from your dd but declaring it not the owed money. The mistake is in your dd accepting this but I expect she was in a very difficult position and was thinking of her poor pal who'd lost her purse, so she was only being kind really. But her friend is being very unfair.