Ver Mensaje Individual
  #4  
Antiguo 28-10-2008
Avatar de sierraja
sierraja sierraja is offline
Miembro
 
Registrado: sep 2004
Posts: 281
Reputación: 20
sierraja Va por buen camino
Ok!, me falto indicarles que estas instrucciones las mando a ejecutar desde un procedimiento almacenado, y en realidad no generar ningun error, solo que no actualiza nada. Tambien voya a colocarleslos mas ordenado y con unos caracteres que se me fueron demas.:



Código SQL [-]
update facturacion set monto_iva=(cloaca*alicuota_iva)/100
where (tipo_factura='Consumo') and (Tipo_tarifa='Residencial' or tipo_tarifa='Especial' or tipo_tarifa='Gobierno') and (cloaca<>0) and (alicuota_iva<>0);
 
update facturacion set sub_total=consumo_agua+cloaca
where (tipo_factura='Consumo') and (tipo_tarifa='Residencial' or tipo_tarifa='Especial');
 
update facturacion set sub_total=consumo_agua+cloaca+cargo_variable+cargo_fijo+cargo_exceso_consumo
where (tipo_factura='Consumo') and (tipo_tarifa='Comercial');
 
update facturacion set sub_total=consumo_agua+cloaca+cargo_variable+cargo_fijo+cargo_exceso_consumo
where (tipo_factura='Consumo') and (tipo_tarifa='Industrial A');
 
update facturacion set sub_total=consumo_agua+cloaca+cargo_variable+cargo_fijo+cargo_exceso_consumo
where (tipo_factura='Consumo') and (tipo_tarifa='Industrial B');
 
update facturacion set monto_iva=(sub_total*alicuota_iva)/100
where (tipo_factura='Consumo') and (Tipo_tarifa='Comercial') and (alicuota_iva<>0);
 
update facturacion set monto_iva=(sub_total*alicuota_iva)/100
where (tipo_factura='Consumo') and (tipo_tarifa='Industrial A') and (alicuota_iva<>0);
 
update facturacion set monto_iva=(sub_total*alicuota_iva)/100
where (tipo_factura='Consumo') and (tipo_tarifa='Industrial B') and (alicuota_iva<>0);


Gracias por su atencion...
Responder Con Cita