title: Custom Group and SUM Condition
body: <p>I have a invoice journal table like <a href="http://i.stack.imgur.com/bHQrc.jpg" rel="nofollow">This</a> And I want the result to look like <a href="http://i.stack.imgur.com/Zuhzr.jpg" rel="nofollow">This</a> .What query should I use to retrieve the result like the example. I was trying to use group query and sum condition query but it still doesn't do what I want.</p>
  
  <p>Thanks for help.</p>