a:1:{i:0;a:7:{s:7:"cod_prj";s:7:"Veratex";s:6:"versao";s:1:"1";s:7:"cod_apl";s:33:"utilities.potemp.update.inventory";s:4:"nome";s:9:"onExecute";s:4:"tipo";s:1:"E";s:5:"parms";s:0:"";s:6:"codigo";s:324:"//needs scase wrapper

UPDATE potemp
SET potemp.lbs_warped = 
(
  SELECT 
    sum(pyalloc.lbs_warped) 
  FROM pyalloc 
  WHERE 
    potemp.p_o_number = pyalloc.yarn_order
)
    inventory = COALESCE(lbs_shippe,0)-COALESCE(lbs_warped,0)-COALESCE(lbs_retd,0)-COALESCE(waste,0)
    tv = inventory*COALESCE(cost_lb,0)";}}