Irreversible thermodynamics of thermoelectric devices: from local framework to global description