The settlement, announced on Friday, is the latest global opioid deal reached by a national pharmacy chain.