The impoverishment ascertained on the day of the expenditure, and the enrichment as it remains on the day of the claim, are valued on the day of the judgment. In the event of bad faith on the part of the enriched party, the compensation due is equal to the higher of these two values.