Fix:  [ bug #698 ] Bad calculation of totals of associated documents