 descripciu8c3b3n trigger delu800 evento before update deu800 tabla vidquoten2 composiciu8c3b3n composiciu8c3b3n composiciu8c3b3n tabla vidquoten1 tabla vidquoten3 vista acomerciales vista clientes proc altaitempresupuesto proc actualizaitempresupuesto cu8c3b3digo cu8c3b3digo cu8c3b3digo create definer sas_admin trigger fzggestion . actualiza_item_presupuesto before update onu800 fzggestion . vidquoten2 foru800 each rowu800 begin -- -------------------------------------------------------- -- changes onu800 price change previous other attributes -- -------------------------------------------------------- ifu800 oldu800u82evidquoteprecio newu800u82evidquoteprecio then select vidquotecliente vidquoteacom into cliente acomercial from vidquoten1 where vidquoten1u82evidquoteid oldu800u82evidquoteid; select coeficienteac into coeficienteac from acomerciales where acomercialesu82eabreviatura acomercial; select coeficienteac listaprecio into coeficientecl lista from clientes where clientesu82eclienteid cliente; case when newu800u82evidquoteprodid oldu800u82evidquoteprodid then -- -------------------------------------------------------- -- changes onu800 prodid change previous other attributes -- -------------------------------------------------------- delete from vidquoten3 where vidquoten3u82evidquoteid oldu800u82evidquoteid andu800 vidquoten3u82evidquoteitem oldu800u82evidquoteitem; call altaitempresupuesto oldu800u82evidquoteid lista oldu800u82evidquoteitem newu800u82evidquoteprodid newu800u82evidquoteprodcantidad newu800u82evidquoteancho newu800u82evidquotealto coeficientecl coeficienteac ; when newu800u82evidquoteprodcantidad oldu800u82evidquoteprodcantidad oru800 newu800u82evidquoteancho oldu800u82evidquoteancho oru800 newu800u82evidquotealto oldu800u82evidquotealto then -- -------------------------------------------------------- -- suppose changes other attributes -- -------------------------------------------------------- call actualizaitempresupuesto oldu800u82evidquoteid oldu800u82evidquoteitem newu800u82evidquoteprodcantidad newu800u82evidquoteancho newu800u82evidquotealto lista coeficientecl coeficienteac ; else setu800 flyu800 null; endu800 case; setu800 newu800u82evidquoteprecio select sumu800 vidquotepreciop asu800 vidquotepreciop from vidquoten3 where vidquoten3u82evidquoteid oldu800u82evidquoteid andu800 vidquoten3u82evidquoteitem oldu800u82evidquoteitem group byu800 vidquoteid vidquoteitem ; endu800 ifu800; endu800 bitu8c3a1cora bitu8c3a1cora bitu8c3a1cora 20120925 lanzamiento debido au800 nuevo diseu8c3b1o deu800 form presupuesto. usou800 usou800 usou800 form presupuesto 