In the book
Congruences for L-Functions by Urbanowicz, J. and Williams, Kenneth S.
in page 28 the authors state that for odd character $\chi$ modulo $M$ the sum
$$M^{-1}\sum_{a=1}^M\chi (a)a$$
after some manipulation can be rewritten as
$$\frac{1}{\bar{\chi}(2)-2}\sum_{1\leq a\leq M/2}\chi(a)$$
I can not prove it. Someone can help me?