if @PagoDesc = 'CA' set @Total_PAGOEFECTIVO = @Total_PAGOEFECTIVO + @montotemp if @PagoDesc = 'CC' set @Total_PAGOCREDITO = @Total_PAGOCREDITO + @montotemp ...