As the total work on the system equals the change in kinetic energy:
$$W_{Friction}+W_{Potential} = \Delta K$$

Taking: $$v_{i}=v_{f}=0$$
we can write 

$$W_{Friction}+W_{Potential} = 0$$
$$W_{Friction}+\Delta V = 0$$
$$W_{Friction}-V_{i} + V_{f} = 0$$
$$W_{Friction} + V_{f}= V_{i}$$
$$E_{i} = W_{Friction} + E_{f}$$
-----------------------------------------------------------------------------------------
##obs:##
Work by definition is $$\int \vec{F}.d\vec{s}$$
from this equation one can derive my statement about the work of gravitational force is equal to the potential energy variation and the total work system equals the change in kinetic energy