Mysql : SUM() function with group by

MySQL SUM() function retrieves the sum value of an expression which has undergone a grouping operation by GROUP BY clause.

 SELECT
   name,
   SUM(CASE WHEN quantity < 0 THEN (quantity * -1) ELSE 0 END) Total_REQ,
   SUM(CASE WHEN quantity > 0 THEN (quantity * -1) ELSE 0 END) Total_RET,
   SUM(quantity * -1)  Total
  FROM `goodsmovement`
  WHERE sapnetwork = 'WON200303360'  AND contractor_id IS NULL
  GROUP BY name
  ORDER BY name ASC