update dbo.item set quantity = Q.Quantity 
FROM
(
SELECT I.id, I.quantity + (P.quantity * I.parentquantity) AS Quantity
FROM  dbo.item AS I
LEFT JOIN (SELECT id, quantity FROM dbo.item) AS P ON (I.parentitem = P.id)
) AS Q
WHERE dbo.item.id = Q.id and Q.Quantity is not null

update item set parentitem = 0 where supplierid = (select [ID] from supplier where code = 'MTDEPTOFREV')
update item set parentquantity = 0 where supplierid = (select [ID] from supplier where code = 'MTDEPTOFREV')
update item set quantity = '0' where itemlookupcode like '%-C%' and supplierid = (select [ID] from supplier where code = 'MTDEPTOFREV')
update item set inactive = '1' where itemlookupcode like '%-C%' and supplierid = (select [ID] from supplier where code = 'MTDEPTOFREV')