It was Voyager's "Dark Frontier" in which Tom Paris said that the "new world economy" took over in the late 22nd century, eliminating money. TOS referenced money in "Errand of Mercy" and "Trouble With Tribbles", then Kirk said they don't use money in Star Trek IV: The Voyage Home
, and then Scotty mentioned buying a boat in STVI: The Undiscovered Country
. Most recently, Kirk offered to pay for Uhura's drink in Star Trek
It's a little muddled, to say the least.