Thermodynamics of shape-memory alloys under electric current