multiple joins and calculations with mysql
this is my tables
products - productid, productname
             001         x
             002         y
             003         z
invoiceqty-productid, qty
             001       10
             001       20
             002       10
             002       05
grnqty-productid, qty
             001        50
             002        50
             003        50 
returninqty-productid, qty
             002        02
             002        03
returnoutqty-productid, qty
             001         01
             001         01
i need a query to view stock balance
like this!!!!!
productid qty
001        40
002        33
003        50
please help me!!!!!
multiple joins and calculations with mysql
===

this is my tables
products - productid, productname
             001         x
             002         y
             003         z
invoiceqty-productid, qty
             001       10
             001       20
             002       10
             002       05
grnqty-productid, qty
             001        50
             002        50
             003        50 
returninqty-productid, qty
             002        02
             002        03
returnoutqty-productid, qty
             001         01
             001         01
i need a query to view stock balance
like this!!!!!
productid qty
001        40
002        33
003        50
please help me!!!!!