 category tablas descripciu8c3b3n descripciu8c3b3n descripciu8c3b3n container delu800 detalle deu800 productos deu800 presupuestos. seu800 relaciona alu800 resto deu800 lasu800 tablas deu800 registraciones deu800 presupuestos deu800 lau800 siguiente manera file esquemau82etablasu82epresupuestou82ejpgu800 200px siendo losu800 atributos deu800 relaciu8c3b3n conu800 elu800 nivel superior conu800 vidquoteid mientras queu800 hacia elu800 nivel inferior conu800 vidquoteid vidquoteitem vidquoteprodid composiciu8c3b3n composiciu8c3b3n composiciu8c3b3n #triggers sqlu800 sqlu800 sqlu800 delimiter create table vidquoten2 vidquoteid intu800 11u800 notu800 null vidquotelpre intu800 1u800 default null vidquoteitem intu800 11u800 notu800 null auto_increment vidquotepredid char 8u800 default null vidquoteprodid char 8u800 default null vidquoteprodcantidad intu800 5u800 default null vidquoteancho intu800 5u800 default null vidquotealto intu800 5u800 default null vidquoteprecio decimal 10u800 2u800 default null vidquotedetalle varchar 100u800 default null primary keyu800 vidquoteid vidquoteitem engine myisam auto_increment 6u800 default charset latin1 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 triggers triggers triggers delete trig vidquoten2u82ebaja_item_presupuesto bitu8c3a1cora bitu8c3a1cora bitu8c3a1cora usou800 form presupuesto urlu800 urlu800 urlu800 