Thermoelectric materials have been a fascinating field of research ever since their first exploration. Due to their capability to convert excess heat into electrical energy in a clean and sustainable way they could be of great importance for future technologies. In order to build more efficient thermoelectric devices it is crucial to get a thorough understanding of the complex interplay of the different mechanisms within a thermoelectric material. Especially materials with large power producing capabilities can show transport coefficients which strongly depend on the temperature as well as on the position of the chemical potential. There have been several studies which include the temperature dependence explicitly but none including the chemical potential at the same level. In this work we solve the macroscopic transport equations with their full temperature and chemical potential dependences and discuss the impact of this extended treatment on the efficiency. For that reason we derive suitable equations and boundary conditions for junctions between different materials. We apply these equations to a full two-leg device consisting of two active regions with arbitrary materials connected by two metallic regions. We show that the equations which describe the different active regions can be decoupled which strongly reduces the complexity of the problem. We build a simulation that solves the remaining non-linear differential equations iteratively and determines the efficiency from the calculated temperature- and chemical potential distribution. As the program will be made available freely we also build a graphical user interface in order to improve the usability. We show simulation results for three materials i.e. Bi2Te3, SrTiO3 and FeSb2 and compare the simulated efficiencies with methods to analytically estimate the efficiency. We find that the chemical potential can be far away from its equilibrium value at the junctions due to the formation of Schottky contacts which, in some cases, dramatically decreases the efficiency. This effect has been neglected in thermoelectrics in the past which might have led to the discard of promising materials. Additionally we build a numerical routine which allows to calculate the optimum doping profile and we discuss how the efficiency can be increased with that procedure. We find for Bi2Te3 that the gain of differential doping compared to uniform doping is about 13\%.