text:
'-------------------------------------------------------------------------------------------'
' Inicio del codigo
'-------------------------------------------------------------------------------------------'
' Importando librerias
'-------------------------------------------------------------------------------------------'
Imports System.Data
Imports cusAplicacion

'-------------------------------------------------------------------------------------------'
' Inicio de clase "rLibro_Compras_GrupoAlegria"
'-------------------------------------------------------------------------------------------'
Partial Class rLibro_Compras_GrupoAlegria
    Inherits vis2formularios.frmReporte

	Dim loObjetoReporte As CrystalDecisions.CrystalReports.Engine.ReportDocument

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

	Try

			Dim lcParametro0Desde As String = goServicios.mObtenerCampoFormatoSQL(cusAplicacion.goReportes.paParametrosIniciales(0),goServicios.enuOpcionesRedondeo.KN_FechaInicioDelDia)
			Dim lcParametro0Hasta As String = goServicios.mObtenerCampoFormatoSQL(cusAplicacion.goReportes.paParametrosFinales(0),goServicios.enuOpcionesRedondeo.KN_FechaFinDelDia)
			Dim lcParametro1Desde As String = goServicios.mObtenerCampoFormatoSQL(cusAplicacion.goReportes.paParametrosIniciales(1))
			Dim lcParametro1Hasta As String = goServicios.mObtenerCampoFormatoSQL(cusAplicacion.goReportes.paParametrosFinales(1))
			Dim lcParametro2Desde As String = goServicios.mObtenerCampoFormatoSQL(cusAplicacion.goReportes.paParametrosIniciales(2))
			Dim lcParametro2Hasta As String = goServicios.mObtenerCampoFormatoSQL(cusAplicacion.goReportes.paParametrosFinales(2))
			Dim lcParametro3Desde As String = goServicios.mObtenerCampoFormatoSQL(cusAplicacion.goReportes.paParametrosIniciales(3))
			Dim lcParametro3Hasta As String = goServicios.mObtenerCampoFormatoSQL(cusAplicacion.goReportes.paParametrosFinales(3))
			Dim lcParametro4Desde As String = goServicios.mObtenerCampoFormatoSQL(cusAplicacion.goReportes.paParametrosIniciales(4))
			Dim lcParametro4Hasta As String = goServicios.mObtenerCampoFormatoSQL(cusAplicacion.goReportes.paParametrosFinales(4))
			Dim lcParametro5Desde As String = cusAplicacion.goReportes.paParametrosFinales(5)
			Dim lcParametro6Desde As String = cusAplicacion.goReportes.paParametrosFinales(6)
			Dim lcParametro7Desde As String = cusAplicacion.goReportes.paParametrosFinales(7)
			Dim lcParametro8Desde As String = goServicios.mObtenerListaFormatoSQL(cusAplicacion.goReportes.paParametrosIniciales(8))
            Dim lcParametro9Desde As String = goServicios.mObtenerCampoFormatoSQL(cusAplicacion.goReportes.paParametrosIniciales(9))
            Dim lcParametro9Hasta As String = goServicios.mObtenerCampoFormatoSQL(cusAplicacion.goReportes.paParametrosFinales(9))

			Dim lcOrdenamiento As String = cusAplicacion.goReportes.pcOrden
			Dim loComandoSeleccionar As New StringBuilder()
			loComandoSeleccionar.AppendLine("DECLARE @lnCero AS DECIMAL(28, 10)" )
			loComandoSeleccionar.AppendLine("SET @lnCero = CAST(0 AS DECIMAL(28, 10));" )
			loComandoSeleccionar.AppendLine("DECLARE @lcVacio AS NVARCHAR(30)" )
			loComandoSeleccionar.AppendLine("SET @lcVacio = N''" )

			loComandoSeleccionar.AppendLine("SELECT		" )
			loComandoSeleccionar.AppendLine("			'Compras'															AS Tabla, 		" )
			loComandoSeleccionar.AppendLine("			CASE Cuentas_Pagar.Cod_Tip															" )
			loComandoSeleccionar.AppendLine("			 	WHEN 'FACT' 	THEN 'Factura'													" )
			loComandoSeleccionar.AppendLine("			 	WHEN 'N/CR' 	THEN 'Nota de Credito'											" )
			loComandoSeleccionar.AppendLine("			 	WHEN 'N/DB' 	THEN 'Nota de Debito'											" )
			loComandoSeleccionar.AppendLine("			 	WHEN 'RETIVA'	THEN 'Retensión de I.V.A.'										" )
			loComandoSeleccionar.AppendLine("			END																	AS Cod_Tip,		" )
			loComandoSeleccionar.AppendLine("			Cuentas_Pagar.Cod_Tip												AS Codigo_Tipo,	" )
			loComandoSeleccionar.AppendLine("			CAST(Cuentas_Pagar.Documento AS CHAR(30))							AS Documento, 	" )
			loComandoSeleccionar.AppendLine("			Cuentas_Pagar.Control												AS Control, 	" )
			loComandoSeleccionar.AppendLine("			Cuentas_Pagar.Referencia											AS Referencia,	" )
			loComandoSeleccionar.AppendLine("			Cuentas_Pagar.Factura												AS Factura, 	" )
			loComandoSeleccionar.AppendLine("			Cuentas_Pagar.Status												AS Status, 		" )
			loComandoSeleccionar.AppendLine("			Cuentas_Pagar.Doc_Ori												AS Doc_Ori, 	" )
			loComandoSeleccionar.AppendLine("			@lcVacio															AS Documento_Afectado, 	" )
			loComandoSeleccionar.AppendLine("			Cuentas_Pagar.Cod_Pro												AS Cod_Pro, 	" )
			loComandoSeleccionar.AppendLine("			Cuentas_Pagar.Fec_Ini												AS Fec_Ini, 	" )
			loComandoSeleccionar.AppendLine("			Cuentas_Pagar.Tip_Doc												AS Tip_Doc, 	" )
			loComandoSeleccionar.AppendLine("			CASE WHEN Cuentas_Pagar.Tip_Doc = 'Credito' 										" )
			loComandoSeleccionar.AppendLine("				THEN Cuentas_Pagar.Mon_Bru * -1 												" )
			loComandoSeleccionar.AppendLine("				ELSE Cuentas_Pagar.Mon_Bru 														" )
			loComandoSeleccionar.AppendLine("			END																	AS Mon_Bru,  	" )
			loComandoSeleccionar.AppendLine("			CASE WHEN Cuentas_Pagar.Tip_Doc = 'Credito' 										" )
			loComandoSeleccionar.AppendLine("				THEN Cuentas_Pagar.Mon_Net * -1 												" )
			loComandoSeleccionar.AppendLine("				ELSE Cuentas_Pagar.Mon_Net 														" )
			loComandoSeleccionar.AppendLine("			END																	AS Mon_Net,  	" )
			loComandoSeleccionar.AppendLine("			Cuentas_Pagar.Dis_Imp												AS Dis_Imp, 	" )
			loComandoSeleccionar.AppendLine("			CASE WHEN Cuentas_Pagar.Tip_Doc = 'Credito' 										" )
			loComandoSeleccionar.AppendLine("				THEN Cuentas_Pagar.Mon_Des * -1 												" )
			loComandoSeleccionar.AppendLine("				ELSE Cuentas_Pagar.Mon_Des 														" )
			loComandoSeleccionar.AppendLine("			END																	AS Mon_Des,  	" )
			loComandoSeleccionar.AppendLine("			Cuentas_Pagar.Mon_Rec												AS Mon_Rec, 	" )
			loComandoSeleccionar.AppendLine("			Cuentas_Pagar.Por_Des												AS Por_Des, 	" )
			loComandoSeleccionar.AppendLine("			Cuentas_Pagar.Por_Rec												AS Por_Rec, 	" )
			loComandoSeleccionar.AppendLine("			CASE WHEN Cuentas_Pagar.Tip_Doc = 'Credito' 										" )
			loComandoSeleccionar.AppendLine("				THEN Cuentas_Pagar.Mon_Otr1 * -1 												" )
			loComandoSeleccionar.AppendLine("				ELSE Cuentas_Pagar.Mon_Otr1 													" )
			loComandoSeleccionar.AppendLine("			END																	AS Mon_Otr1,  	" )
			loComandoSeleccionar.AppendLine("			CASE WHEN Cuentas_Pagar.Tip_Doc = 'Credito' 										" )
			loComandoSeleccionar.AppendLine("				THEN Cuentas_Pagar.Mon_Otr2 * -1 												" )
			loComandoSeleccionar.AppendLine("				ELSE Cuentas_Pagar.Mon_Otr2 													" )
			loComandoSeleccionar.AppendLine("			END																	AS Mon_Otr2,  	" )
			loComandoSeleccionar.AppendLine("			CASE WHEN Cuentas_Pagar.Tip_Doc = 'Credito' 										" )
			loComandoSeleccionar.AppendLine("				THEN Cuentas_Pagar.Mon_Otr3 * -1 												" )
			loComandoSeleccionar.AppendLine("				ELSE Cuentas_Pagar.Mon_Otr3 													" )
			loComandoSeleccionar.AppendLine("			END																	AS Mon_Otr3,  	" )
			loComandoSeleccionar.AppendLine("			@lcVacio															AS Cod_Imp1, 	" )
			loComandoSeleccionar.AppendLine("			@lcVacio															AS Cod_Imp2, 	" )
			loComandoSeleccionar.AppendLine("			@lcVacio															AS Cod_Imp3, 	" )
			loComandoSeleccionar.AppendLine("			@lnCero 															AS mon_ret, 	" )
			loComandoSeleccionar.AppendLine("			@lnCero 															AS mon_imp1, 	" )
			loComandoSeleccionar.AppendLine("			@lnCero 															AS mon_bas1, 	" )
			loComandoSeleccionar.AppendLine("			@lnCero 															AS por_imp1, 	" )
			loComandoSeleccionar.AppendLine("			@lnCero 															AS mon_exe1, 	" )
			loComandoSeleccionar.AppendLine("			@lnCero 															AS mon_imp2, 	" )
			loComandoSeleccionar.AppendLine("			@lnCero 															AS mon_bas2, 	" )
			loComandoSeleccionar.AppendLine("			@lnCero 															AS por_imp2, 	" )
			loComandoSeleccionar.AppendLine("			@lnCero 															AS mon_exe2, 	" )
			loComandoSeleccionar.AppendLine("           @lnCero 															AS mon_imp3,	" )
            loComandoSeleccionar.AppendLine("           @lnCero 															AS mon_bas3,	" )
            loComandoSeleccionar.AppendLine("           @lnCero 															AS por_imp3,	" )
            loComandoSeleccionar.AppendLine("           @lnCero 															AS mon_exe3,	" )
            loComandoSeleccionar.AppendLine("			@lnCero 															AS subt_exe,	" )
			loComandoSeleccionar.AppendLine("			@lnCero 															AS subt_bas,	" )
			loComandoSeleccionar.AppendLine("			@lnCero 															AS subt_imp,	" )
			loComandoSeleccionar.AppendLine("			@lnCero 															AS Exonerado, 	" )
			loComandoSeleccionar.AppendLine("			@lnCero 															AS No_Sujeto, 	" )
			loComandoSeleccionar.AppendLine("			@lnCero 															AS Sin_Derecho_CF,	" )
			loComandoSeleccionar.AppendLine("			(CASE WHEN (Proveedores.Generico = 0 AND Cuentas_Pagar.Nom_Pro = '') 				" )
			loComandoSeleccionar.AppendLine("				THEN Proveedores.Nom_Pro 														" )
			loComandoSeleccionar.AppendLine("				ELSE (CASE WHEN (Cuentas_Pagar.Nom_Pro = '') 									" )
			loComandoSeleccionar.AppendLine("					THEN Proveedores.Nom_Pro 													" )
			loComandoSeleccionar.AppendLine("					ELSE Cuentas_Pagar.Nom_Pro 													" )
			loComandoSeleccionar.AppendLine("				END) 																			" )
			loComandoSeleccionar.AppendLine("			END)																AS Nom_Pro, 	" )
			loComandoSeleccionar.AppendLine("			(CASE WHEN (Proveedores.Generico = 0 AND Cuentas_Pagar.Nom_Pro = '') 				" )
			loComandoSeleccionar.AppendLine("				THEN Proveedores.Rif ELSE 														" )
			loComandoSeleccionar.AppendLine("			    (CASE WHEN (Cuentas_Pagar.Rif = '')												" )
			loComandoSeleccionar.AppendLine("					THEN Proveedores.Rif 														" )
			loComandoSeleccionar.AppendLine("					ELSE Cuentas_Pagar.Rif 														" )
			loComandoSeleccionar.AppendLine("			    END) 																			" )
			loComandoSeleccionar.AppendLine("			 END)																AS Rif,			" )
			loComandoSeleccionar.AppendLine("			Proveedores.Tip_Pro 												AS Tip_Pro,		" )
			loComandoSeleccionar.AppendLine("			(CASE WHEN Cuentas_Pagar.Status = 'Anulado' 										" )
			loComandoSeleccionar.AppendLine("				THEN '03-ANU' 																	" )
			loComandoSeleccionar.AppendLine("				ELSE '01-REG' 																	" )
			loComandoSeleccionar.AppendLine("			END)																AS Transaccion	" )
			loComandoSeleccionar.AppendLine("INTO		#tempCxP " )
			loComandoSeleccionar.AppendLine("FROM		Cuentas_Pagar " )
			loComandoSeleccionar.AppendLine("	JOIN	Proveedores ON Cuentas_Pagar.Cod_Pro = Proveedores.Cod_Pro" )
			loComandoSeleccionar.AppendLine("WHERE		Cuentas_Pagar.Fec_Ini BETWEEN " & lcParametro0Desde )
			loComandoSeleccionar.AppendLine(" 			AND " & lcParametro0Hasta )
			loComandoSeleccionar.AppendLine(" 			AND Cuentas_Pagar.Documento BETWEEN " & lcParametro1Desde )
			loComandoSeleccionar.AppendLine(" 			AND " & lcParametro1Hasta )
			loComandoSeleccionar.AppendLine(" 			AND Cuentas_Pagar.cod_pro BETWEEN " & lcParametro2Desde )
			loComandoSeleccionar.AppendLine(" 			AND " & lcParametro2Hasta)
			loComandoSeleccionar.AppendLine(" 			AND Cuentas_Pagar.Cod_Suc BETWEEN " & lcParametro3Desde)
			loComandoSeleccionar.AppendLine(" 			AND " & lcParametro3Hasta)
			loComandoSeleccionar.AppendLine("			AND Cuentas_Pagar.Status        IN ( " & lcParametro8Desde & " ) ")
			If lcParametro5Desde = "Igual" Then
                loComandoSeleccionar.AppendLine(" 		AND Cuentas_Pagar.Cod_Rev BETWEEN " & lcParametro4Desde)
            Else
                loComandoSeleccionar.AppendLine(" 		AND Cuentas_Pagar.Cod_Rev NOT BETWEEN " & lcParametro4Desde)
            End If
			loComandoSeleccionar.AppendLine(" 			AND " & lcParametro4Hasta)
			loComandoSeleccionar.AppendLine("			AND (										")
			loComandoSeleccionar.AppendLine("						Cuentas_Pagar.Cod_Tip IN ('FACT', 'N/DB', 'RETIVA')")
			loComandoSeleccionar.AppendLine("					OR	(Cuentas_Pagar.Cod_Tip = 'N/CR' AND Cuentas_Pagar.Automatico = 1 AND Cuentas_Pagar.Tip_Ori = 'Devoluciones_Proveedores')")
			loComandoSeleccionar.AppendLine("					OR	(Cuentas_Pagar.Cod_Tip = 'N/CR' AND Cuentas_Pagar.Automatico = 0 AND Cuentas_Pagar.Cod_Rev IN ('DEVCOM', 'REBAJA') )")
			loComandoSeleccionar.AppendLine("				)										")
			loComandoSeleccionar.AppendLine(" 			AND Cuentas_Pagar.cod_tip IN ('FACT', 'N/CR', 'N/DB', 'RETIVA')")
			loComandoSeleccionar.AppendLine("           AND Cuentas_Pagar.Cod_Tip      BETWEEN " & lcParametro9Desde)
            loComandoSeleccionar.AppendLine("           AND " & lcParametro9Hasta)
			loComandoSeleccionar.AppendLine("")
			loComandoSeleccionar.AppendLine("")
			loComandoSeleccionar.AppendLine("")

			Dim lcStatus AS String = "Pendiente,Confirmado,Procesado,Pagado,Cerrado,Afectado,Serializado,Contabilizado,Iniciado,Conciliado,Otro,Anulado"

			If	(cusAplicacion.goReportes.paParametrosIniciales(8).Equals(lcStatus))	OrElse _
				(cusAplicacion.goReportes.paParametrosIniciales(8).Equals("Anulado"))	Then

					loComandoSeleccionar.AppendLine("UNION ALL")

			End If

			loComandoSeleccionar.AppendLine("")
			loComandoSeleccionar.AppendLine("")
			loComandoSeleccionar.AppendLine("")
			''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
			''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
			''''''''''''''''Obtencion de las Facturas de Compra Anuladas '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
			''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
			''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
			loComandoSeleccionar.AppendLine("SELECT	" )
            loComandoSeleccionar.AppendLine("		'Facturas'													AS Tabla,		" )
			loComandoSeleccionar.AppendLine("		'Factura'													AS cod_tip,		" )
			loComandoSeleccionar.AppendLine("		@lcVacio													AS Codigo_Tipo,	" )
			loComandoSeleccionar.AppendLine("		CAST(Compras.Documento AS CHAR(30))							AS Documento,	" )
			loComandoSeleccionar.AppendLine("		Compras.Control												AS Control,		" )
			loComandoSeleccionar.AppendLine("		@lcVacio													AS Referencia,	" )
			loComandoSeleccionar.AppendLine("		Compras.Factura												AS Factura,		" )
			loComandoSeleccionar.AppendLine("		Compras.Status												AS Status,		" )
			loComandoSeleccionar.AppendLine("		@lcVacio													AS Doc_Ori, 	" )
			loComandoSeleccionar.AppendLine("		@lcVacio													AS Documento_Afectado, 	" )
			loComandoSeleccionar.AppendLine("		Compras.Cod_Pro												AS Cod_Pro, 	" )
			loComandoSeleccionar.AppendLine("		Compras.Fec_Ini												AS Fec_Ini, 	" )
			loComandoSeleccionar.AppendLine("		@lcVacio													AS Tip_Doc, 	" )
			loComandoSeleccionar.AppendLine("		Compras.Mon_Bru												AS Mon_Bru,		" )
			loComandoSeleccionar.AppendLine("		Compras.Mon_Net												AS Mon_Net,		" )
			loComandoSeleccionar.AppendLine("		Compras.Dis_imp												AS Dis_imp, 	" )
			loComandoSeleccionar.AppendLine("		Compras.Mon_Des1											AS Mon_Des, 	" )
			loComandoSeleccionar.AppendLine("		Compras.Mon_Rec1											AS Mon_Rec, 	" )
			loComandoSeleccionar.AppendLine("		Compras.Por_Des1											AS Por_Des, 	" )
			loComandoSeleccionar.AppendLine("		Compras.Por_Rec1											AS Por_Rec, 	" )
            loComandoSeleccionar.AppendLine("		Compras.Mon_Otr1											AS Mon_Otr1, 	" )
			loComandoSeleccionar.AppendLine("		Compras.Mon_Otr2											AS Mon_Otr2, 	" )
			loComandoSeleccionar.AppendLine("		Compras.Mon_Otr3											AS Mon_Otr3, 	" )
			loComandoSeleccionar.AppendLine("		@lcVacio													AS Cod_Imp1, 	" )
			loComandoSeleccionar.AppendLine("		@lcVacio													AS Cod_Imp2, 	" )
			loComandoSeleccionar.AppendLine("		@lcVacio													AS Cod_Imp3, 	" )
			loComandoSeleccionar.AppendLine("		@lnCero 													AS mon_ret,		" )
			loComandoSeleccionar.AppendLine("		@lnCero 													AS mon_imp1, 	" )
			loComandoSeleccionar.AppendLine("		@lnCero 													AS mon_bas1, 	" )
			loComandoSeleccionar.AppendLine("		@lnCero 													AS por_imp1, 	" )
			loComandoSeleccionar.AppendLine("		@lnCero 													AS mon_exe1, 	" )
			loComandoSeleccionar.AppendLine("		@lnCero 													AS mon_imp2, 	" )
			loComandoSeleccionar.AppendLine("		@lnCero 													AS mon_bas2, 	" )
			loComandoSeleccionar.AppendLine("		@lnCero 													AS por_imp2, 	" )
			loComandoSeleccionar.AppendLine("		@lnCero 													AS mon_exe2, 	" )
			loComandoSeleccionar.AppendLine("		@lnCero 													AS mon_imp3, 	" )
			loComandoSeleccionar.AppendLine("		@lnCero 													AS mon_bas3, 	" )
			loComandoSeleccionar.AppendLine("		@lnCero 													AS por_imp3, 	" )
			loComandoSeleccionar.AppendLine("		@lnCero 													AS mon_exe3, 	" )
            loComandoSeleccionar.AppendLine("		@lnCero 													AS subt_exe, 	" )
			loComandoSeleccionar.AppendLine("		@lnCero 													AS subt_bas, 	" )
			loComandoSeleccionar.AppendLine("		@lnCero 													AS subt_imp, 	" )
			loComandoSeleccionar.AppendLine("		@lnCero 													AS Exonerado, 	" )
			loComandoSeleccionar.AppendLine("		@lnCero 													AS No_Sujeto, 	" )
			loComandoSeleccionar.AppendLine("		@lnCero 													AS Sin_Derecho_CF,	" )
			loComandoSeleccionar.AppendLine("		(CASE WHEN (Proveedores.Generico = 0 AND Compras.Nom_Pro = '')				" )
			loComandoSeleccionar.AppendLine("			THEN Proveedores.Nom_Pro												" )
			loComandoSeleccionar.AppendLine("			ELSE (CASE WHEN (Compras.Nom_Pro = '')									" )
			loComandoSeleccionar.AppendLine("				THEN Proveedores.Nom_Pro											" )
			loComandoSeleccionar.AppendLine("				ELSE Compras.Nom_Pro												" )
			loComandoSeleccionar.AppendLine("			END)																	" )
			loComandoSeleccionar.AppendLine("		END)														AS  Nom_Pro,	" )
			loComandoSeleccionar.AppendLine("		(CASE WHEN (Proveedores.Generico = 0 AND Compras.Nom_Pro = '')				" )
			loComandoSeleccionar.AppendLine("			THEN Proveedores.Rif													" )
			loComandoSeleccionar.AppendLine("			ELSE (CASE WHEN (Compras.Rif = '')										" )
			loComandoSeleccionar.AppendLine("				THEN Proveedores.Rif												" )
			loComandoSeleccionar.AppendLine("				ELSE Compras.Rif													" )
			loComandoSeleccionar.AppendLine("			END)																	" )
            loComandoSeleccionar.AppendLine("		END)															AS  Rif,	" )
			loComandoSeleccionar.AppendLine("		Proveedores.Tip_Pro												AS Tip_Pro,	" )
			loComandoSeleccionar.AppendLine("		(CASE WHEN Compras.Status = 'Anulado'										" )
			loComandoSeleccionar.AppendLine("			THEN '03-ANU' 															" )
			loComandoSeleccionar.AppendLine("			ELSE '01-REG' 															" )
			loComandoSeleccionar.AppendLine("		END)														AS Transaccion	" )
			loComandoSeleccionar.AppendLine("FROM		Compras " )
			loComandoSeleccionar.AppendLine("	JOIN	Proveedores ON Compras.Cod_Pro = Proveedores.Cod_Pro " )
			loComandoSeleccionar.AppendLine("WHERE		Compras.Fec_Ini BETWEEN " & lcParametro0Desde )
			loComandoSeleccionar.AppendLine(" 			AND " & lcParametro0Hasta )
			loComandoSeleccionar.AppendLine(" 			AND Compras.Documento BETWEEN " & lcParametro1Desde )
			loComandoSeleccionar.AppendLine(" 			AND " & lcParametro1Hasta )
			loComandoSeleccionar.AppendLine(" 			AND Compras.cod_pro BETWEEN " & lcParametro2Desde )
			loComandoSeleccionar.AppendLine(" 			AND " & lcParametro2Hasta)
			loComandoSeleccionar.AppendLine(" 			AND Compras.Cod_Suc BETWEEN " & lcParametro3Desde)
			loComandoSeleccionar.AppendLine(" 			AND " & lcParametro3Hasta)
			loComandoSeleccionar.AppendLine("			AND Compras.Status  = 'Anulado'")
			If lcParametro5Desde = "Igual" Then
                loComandoSeleccionar.AppendLine(" 		AND Compras.Cod_Rev BETWEEN " & lcParametro4Desde)
            Else
                loComandoSeleccionar.AppendLine(" 		AND Compras.Cod_Rev NOT BETWEEN " & lcParametro4Desde)
            End If
			loComandoSeleccionar.AppendLine(" 			AND " & lcParametro4Hasta)
            loComandoSeleccionar.AppendLine("")

			''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
			''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
			''''''''''''''''Obtencion de las Ordenes de pago '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
			''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
			''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

			loComandoSeleccionar.AppendLine(" SELECT	" )
            loComandoSeleccionar.AppendLine("			'Orden_Pago'													AS Tabla,		" )
			loComandoSeleccionar.AppendLine("			'Orden de Pago' 												AS cod_tip,		" )
			loComandoSeleccionar.AppendLine("			@lcVacio														AS Codigo_Tipo,	" )
			loComandoSeleccionar.AppendLine("			CAST(Ordenes_Pagos.Documento AS CHAR(30))	 					AS Documento,	" )
			loComandoSeleccionar.AppendLine("			Ordenes_Pagos.Control	 										AS Control,		" )
			loComandoSeleccionar.AppendLine("			@lcVacio														AS Referencia,	" )
			loComandoSeleccionar.AppendLine("			Ordenes_Pagos.Factura	 										AS Factura,		" )
			loComandoSeleccionar.AppendLine("			Ordenes_Pagos.Status	 										AS Status,		" )
			loComandoSeleccionar.AppendLine("			@lcVacio														AS Doc_Ori, 	" )
			loComandoSeleccionar.AppendLine("			@lcVacio														AS Documento_Afectado, 	" )
			loComandoSeleccionar.AppendLine("			Ordenes_Pagos.Cod_Pro	 										AS Cod_Pro, 	" )
			loComandoSeleccionar.AppendLine("			Ordenes_Pagos.Fec_Ini	 										AS Fec_Ini, 	" )
			loComandoSeleccionar.AppendLine("			'debito'														As Tip_Doc, 	" )
			loComandoSeleccionar.AppendLine("			Ordenes_Pagos.Mon_Bru	 										AS Mon_Bru, 	" )
			loComandoSeleccionar.AppendLine("			Ordenes_Pagos.Mon_Net	 										AS Mon_Net, 	" )
			loComandoSeleccionar.AppendLine("			Ordenes_Pagos.Dis_Imp	 										AS Dis_Imp, 	" )
			loComandoSeleccionar.AppendLine("			@lnCero    				                                        AS Mon_Des, 	" )
            loComandoSeleccionar.AppendLine("			@lnCero    				                                        AS Mon_Rec, 	" )
			loComandoSeleccionar.AppendLine("			@lnCero															AS Por_Des, 	" )
			loComandoSeleccionar.AppendLine("			@lnCero															AS Por_Rec, 	" )
			loComandoSeleccionar.AppendLine("			@lnCero    				                                        AS Mon_Otr1, 	" )
			loComandoSeleccionar.AppendLine("			@lnCero    				                                        AS Mon_Otr2, 	" )
			loComandoSeleccionar.AppendLine("			@lnCero    														AS Mon_Otr3, 	" )
			loComandoSeleccionar.AppendLine("			@lcVacio														AS Cod_Imp1, 	" )
			loComandoSeleccionar.AppendLine("			@lcVacio														AS Cod_Imp2, 	" )
			loComandoSeleccionar.AppendLine("			@lcVacio														AS Cod_Imp3, 	" )
			loComandoSeleccionar.AppendLine("			Ordenes_Pagos.Mon_Ret											AS Mon_Ret,		" )
			loComandoSeleccionar.AppendLine("			@lnCero															AS mon_imp1,	" )
			loComandoSeleccionar.AppendLine("			@lnCero															AS mon_bas1,	" )
			loComandoSeleccionar.AppendLine("			@lnCero															AS por_imp1,	" )
			loComandoSeleccionar.AppendLine("			@lnCero															AS mon_exe1,	" )
			loComandoSeleccionar.AppendLine("			@lnCero															AS mon_imp2,	" )
			loComandoSeleccionar.AppendLine("			@lnCero															AS mon_bas2,	" )
			loComandoSeleccionar.AppendLine("			@lnCero															AS por_imp2,	" )
			loComandoSeleccionar.AppendLine("			@lnCero															AS mon_exe2,	" )
			loComandoSeleccionar.AppendLine("			@lnCero															AS mon_imp3,	" )
			loComandoSeleccionar.AppendLine("			@lnCero															AS mon_bas3,	" )
            loComandoSeleccionar.AppendLine("			@lnCero															AS por_imp3,	" )
			loComandoSeleccionar.AppendLine("			@lnCero															AS mon_exe3,	" )
			loComandoSeleccionar.AppendLine("			@lnCero															AS subt_exe,	" )
			loComandoSeleccionar.AppendLine("			@lnCero															AS subt_bas,	" )
			loComandoSeleccionar.AppendLine("			@lnCero															AS subt_imp,	" )
			loComandoSeleccionar.AppendLine("			@lnCero 														AS Exonerado,	" )
			loComandoSeleccionar.AppendLine("			@lnCero 														AS No_Sujeto,	" )
			loComandoSeleccionar.AppendLine("			@lnCero 														AS Sin_Derecho_CF,	" )
			loComandoSeleccionar.AppendLine("			(CASE WHEN (Proveedores.Generico = 0 AND Ordenes_Pagos.Nom_Pro = '')			" )
			loComandoSeleccionar.AppendLine("				THEN Proveedores.Nom_Pro													" )
			loComandoSeleccionar.AppendLine("				ELSE (CASE WHEN (Ordenes_Pagos.Nom_Pro = '')								" )
			loComandoSeleccionar.AppendLine("					THEN Proveedores.Nom_Pro												" )
			loComandoSeleccionar.AppendLine("					ELSE Ordenes_Pagos.Nom_Pro												" )
			loComandoSeleccionar.AppendLine("				END)																		" )
			loComandoSeleccionar.AppendLine("			END)															AS Nom_Pro, 	" )
			loComandoSeleccionar.AppendLine("			(CASE WHEN (Proveedores.Generico = 0 AND Ordenes_Pagos.Nom_Pro = '')			" )
			loComandoSeleccionar.AppendLine("				THEN Proveedores.Rif														" )
			loComandoSeleccionar.AppendLine("				ELSE (CASE WHEN (Ordenes_Pagos.Rif = '')									" )
            loComandoSeleccionar.AppendLine("					THEN Proveedores.Rif													" )
			loComandoSeleccionar.AppendLine("					ELSE Ordenes_Pagos.Rif													" )
			loComandoSeleccionar.AppendLine("				END)																		" )
			loComandoSeleccionar.AppendLine("			END)															AS Rif,			" )
			loComandoSeleccionar.AppendLine("			Proveedores.Tip_Pro												AS Tip_Pro,		" )
			loComandoSeleccionar.AppendLine("			(CASE WHEN Ordenes_Pagos.Status = 'Anulado'										" )
			loComandoSeleccionar.AppendLine("				THEN '03-ANU' 																" )
			loComandoSeleccionar.AppendLine("				ELSE '01-REG' 																" )
			loComandoSeleccionar.AppendLine("			END)															AS Transaccion	" )
			loComandoSeleccionar.AppendLine("			" )
			loComandoSeleccionar.AppendLine("			" )
			loComandoSeleccionar.AppendLine("			" )
			loComandoSeleccionar.AppendLine("INTO		#tempOrdenes_Pago " )
			loComandoSeleccionar.AppendLine("FROM		Ordenes_Pagos " )
			loComandoSeleccionar.AppendLine("	JOIN	Proveedores ON Ordenes_Pagos.Cod_Pro = Proveedores.Cod_Pro" )
			loComandoSeleccionar.AppendLine("WHERE		Ordenes_Pagos.Ipos = 0")
			loComandoSeleccionar.AppendLine(" 			AND Ordenes_Pagos.Fec_Ini BETWEEN " & lcParametro0Desde )
			loComandoSeleccionar.AppendLine(" 			AND " & lcParametro0Hasta )
			loComandoSeleccionar.AppendLine(" 			AND Ordenes_Pagos.Documento BETWEEN " & lcParametro1Desde )
			loComandoSeleccionar.AppendLine(" 			AND " & lcParametro1Hasta )
			loComandoSeleccionar.AppendLine(" 			AND Ordenes_Pagos.cod_pro BETWEEN " & lcParametro2Desde )
			loComandoSeleccionar.AppendLine(" 			AND " & lcParametro2Hasta)
			loComandoSeleccionar.AppendLine(" 			AND Ordenes_Pagos.Cod_Suc BETWEEN " & lcParametro3Desde)
			loComandoSeleccionar.AppendLine(" 			AND " & lcParametro3Hasta)
			loComandoSeleccionar.AppendLine(" 			AND Ordenes_Pagos.Status = 'Confirmado'" )

			If lcParametro7Desde.ToUpper = "NO" Then
				loComandoSeleccionar.AppendLine(" 		AND Ordenes_Pagos.Mon_Imp <> 0" )
			End If

			If lcParametro5Desde = "Igual" Then
                loComandoSeleccionar.AppendLine(" 		AND Ordenes_Pagos.Cod_Rev BETWEEN " & lcParametro4Desde)
            Else
                loComandoSeleccionar.AppendLine(" 		AND Ordenes_Pagos.Cod_Rev NOT BETWEEN " & lcParametro4Desde)
            End If

            loComandoSeleccionar.AppendLine(" 			AND " & lcParametro4Hasta)
            loComandoSeleccionar.AppendLine("")

		'************************************************************************************************************************
		' Busca el documento de origen de las N/CR que provienen de devoluciones.												*
		'************************************************************************************************************************
            loComandoSeleccionar.AppendLine("UPDATE		#tempCxP	")
            loComandoSeleccionar.AppendLine("SET		Documento_Afectado = CASE WHEN (Compras.Factura<>'') THEN Compras.Factura ELSE Compras.Documento END")
            loComandoSeleccionar.AppendLine("FROM		Cuentas_Pagar")
            loComandoSeleccionar.AppendLine("	JOIN	Renglones_dProveedores AS RDP")
            loComandoSeleccionar.AppendLine("		ON	RDP.Documento = Cuentas_Pagar.Doc_Ori")
            loComandoSeleccionar.AppendLine("		AND Cuentas_Pagar.Tip_Ori = 'Devoluciones_Proveedores'")
            loComandoSeleccionar.AppendLine("	JOIN	Compras ON Compras.Documento = RDP.Doc_Ori")
            loComandoSeleccionar.AppendLine("WHERE		Cuentas_Pagar.Cod_Tip = 'N/CR'")
            loComandoSeleccionar.AppendLine("	AND		#tempCxP.Cod_Tip = 'Nota de Credito'")
            loComandoSeleccionar.AppendLine("	AND		Cuentas_Pagar.Documento = #tempCxP.Documento ")
			loComandoSeleccionar.AppendLine("")
			loComandoSeleccionar.AppendLine("UPDATE		#tempCxP	")
			loComandoSeleccionar.AppendLine("SET		Documento_Afectado = Referencia")
			loComandoSeleccionar.AppendLine("WHERE		#tempCxP.Codigo_Tipo = 'N/CR'")
			loComandoSeleccionar.AppendLine("	AND		#tempCxP.Documento_Afectado = ''")
			loComandoSeleccionar.AppendLine("")
            loComandoSeleccionar.AppendLine("UPDATE		#tempCxP	")
            loComandoSeleccionar.AppendLine("SET			Documento = R.Num_Com,")
            loComandoSeleccionar.AppendLine("			Documento_Afectado = CASE WHEN (FC.Factura<>'') THEN FC.Factura ELSE FC.Documento END")
            loComandoSeleccionar.AppendLine("FROM		#tempCxP")
            loComandoSeleccionar.AppendLine("	JOIN	Retenciones_Documentos AS R")
            loComandoSeleccionar.AppendLine("		ON	R.Doc_Des = #tempCxP.Documento						")
            loComandoSeleccionar.AppendLine("		AND	R.Cla_Des = 'RETIVA'								")
            loComandoSeleccionar.AppendLine("		AND R.Tip_Des = 'Cuentas_Pagar'						")
            loComandoSeleccionar.AppendLine("	JOIN	Cuentas_Pagar AS FC")
            loComandoSeleccionar.AppendLine("		ON	R.Doc_Ori = FC.Documento						")
            loComandoSeleccionar.AppendLine("		AND	R.Cla_Ori = 'FACT'								")
            loComandoSeleccionar.AppendLine("		AND	FC.Cod_Tip = 'FACT'								")
            loComandoSeleccionar.AppendLine("		AND R.Tip_Ori = 'Cuentas_Pagar'						")
            loComandoSeleccionar.AppendLine("WHERE		#tempCxP.Codigo_Tipo = 'RETIVA'")
            loComandoSeleccionar.AppendLine("	AND		R.Num_Com <> ''")
            loComandoSeleccionar.AppendLine("")
            loComandoSeleccionar.AppendLine("")
            loComandoSeleccionar.AppendLine("")

			If lcParametro6Desde.ToUpper() = "SI" then

				loComandoSeleccionar.AppendLine("SELECT * FROM #tempCxP	")
				loComandoSeleccionar.AppendLine("UNION ALL	")
				loComandoSeleccionar.AppendLine("SELECT * FROM #tempOrdenes_Pago	")
				loComandoSeleccionar.AppendLine("ORDER BY " & lcOrdenamiento.Replace("Cuentas_Pagar.", " "))

			Else

				loComandoSeleccionar.AppendLine("SELECT * FROM #tempCxP ")
				loComandoSeleccionar.AppendLine("ORDER BY " & lcOrdenamiento.Replace("Cuentas_Pagar.", " "))

			End If

			'Me.mEscribirConsulta(loComandoSeleccionar.ToString())

	        Dim loServicios As New cusDatos.goDatos

			Dim laDatosReporte As DataSet = loServicios.mObtenerTodosSinEsquema(loComandoSeleccionar.ToString(), "curReportes")

			Dim loDistribucion	As System.Xml.XmlDocument
			Dim laImpuestos		As system.Xml.XmlNodeList
			Dim loTabla			As New DataTable()

			If lcParametro6Desde.ToUpper() = "SI" then

					If	(cusAplicacion.goReportes.paParametrosIniciales(8).Equals(lcStatus))	OR	 _
						(cusAplicacion.goReportes.paParametrosIniciales(8).Equals("Anulado"))	Then

							loTabla = laDatosReporte.Tables(0)

					Else
							loTabla = laDatosReporte.Tables(1)

					End If

			Else
					If	(cusAplicacion.goReportes.paParametrosIniciales(8).Equals(lcStatus))	OR	 _
						(cusAplicacion.goReportes.paParametrosIniciales(8).Equals("Anulado"))	Then

							loTabla = laDatosReporte.Tables(0)

					Else
							loTabla = laDatosReporte.Tables(1)

					End If

			End If

			For Each loFila As DataRow In loTabla.Rows

				If Not String.IsNullOrEmpty(Trim(loFila.Item("dis_imp"))) Then

						loDistribucion = New System.Xml.XmlDocument()
					Try

						loDistribucion.LoadXml(Trim(loFila.Item("dis_imp")))

					Catch ex As Exception

						Continue For

					End Try

					laImpuestos = loDistribucion.SelectNodes("impuestos/impuesto")

						If (loFila.Item("Cod_Tip").Equals("Orden de Pago")) Then

								If laImpuestos.Count >= 1 Then
									If Trim(loFila.Item("Tip_Doc")).ToLower = "credito" Then
										loFila.Item("por_imp1") = CDec(laImpuestos(0).SelectSingleNode("porcentaje").InnerText)
										loFila.Item("cod_imp1") = Trim(laImpuestos(0).SelectSingleNode("codigo").InnerText)
										loFila.Item("mon_bas1") = CDec(laImpuestos(0).SelectSingleNode("base").InnerText) * -1
										loFila.Item("mon_exe1") = CDec(laImpuestos(0).SelectSingleNode("exento").InnerText) * -1
										loFila.Item("mon_imp1")	= CDec(laImpuestos(0).SelectSingleNode("monto").InnerText) * -1
									Else
										loFila.Item("por_imp1") = CDec(laImpuestos(0).SelectSingleNode("porcentaje").InnerText)
										loFila.Item("cod_imp1") = Trim(laImpuestos(0).SelectSingleNode("codigo").InnerText)
										loFila.Item("mon_bas1") = CDec(laImpuestos(0).SelectSingleNode("base").InnerText)
										loFila.Item("mon_exe1") = CDec(laImpuestos(0).SelectSingleNode("exento").InnerText)
										loFila.Item("mon_imp1")	= CDec(laImpuestos(0).SelectSingleNode("monto").InnerText)
									End If
								End If

								If laImpuestos.Count >= 2 Then
									If Trim(loFila.Item("Tip_Doc")).ToLower = "credito" Then
										loFila.Item("por_imp2") = CDec(laImpuestos(1).SelectSingleNode("porcentaje").InnerText)
										loFila.Item("cod_imp2") = Trim(laImpuestos(1).SelectSingleNode("codigo").InnerText)
										loFila.Item("mon_bas2") = CDec(laImpuestos(1).SelectSingleNode("base").InnerText) * -1
										loFila.Item("mon_exe2") = CDec(laImpuestos(1).SelectSingleNode("exento").InnerText) * -1
										loFila.Item("mon_imp2")	= CDec(laImpuestos(1).SelectSingleNode("monto").InnerText) * -1
									Else
										loFila.Item("por_imp2") = CDec(laImpuestos(1).SelectSingleNode("porcentaje").InnerText)
										loFila.Item("cod_imp2") = Trim(laImpuestos(1).SelectSingleNode("codigo").InnerText)
										loFila.Item("mon_bas2") = CDec(laImpuestos(1).SelectSingleNode("base").InnerText)
										loFila.Item("mon_exe2") = CDec(laImpuestos(1).SelectSingleNode("exento").InnerText)
										loFila.Item("mon_imp2")	= CDec(laImpuestos(1).SelectSingleNode("monto").InnerText)
									End If
								End If

								If laImpuestos.Count >= 3 Then
									If Trim(loFila.Item("Tip_Doc")).ToLower = "credito" Then
										loFila.Item("por_imp3") = CDec(laImpuestos(2).SelectSingleNode("porcentaje").InnerText)
										loFila.Item("cod_imp3") = Trim(laImpuestos(2).SelectSingleNode("codigo").InnerText)
										loFila.Item("mon_bas3") = CDec(laImpuestos(2).SelectSingleNode("base").InnerText) * -1
										loFila.Item("mon_exe3") = CDec(laImpuestos(2).SelectSingleNode("exento").InnerText) * -1
										loFila.Item("mon_imp3")	= CDec(laImpuestos(2).SelectSingleNode("monto").InnerText) * -1
									Else
										loFila.Item("por_imp3") = CDec(laImpuestos(2).SelectSingleNode("porcentaje").InnerText)
										loFila.Item("cod_imp3") = Trim(laImpuestos(2).SelectSingleNode("codigo").InnerText)
										loFila.Item("mon_bas3") = CDec(laImpuestos(2).SelectSingleNode("base").InnerText)
										loFila.Item("mon_exe3") = CDec(laImpuestos(2).SelectSingleNode("exento").InnerText)
										loFila.Item("mon_imp3")	= CDec(laImpuestos(2).SelectSingleNode("monto").InnerText)
									End If
								End If

						Else
							   If laImpuestos.Count >= 1 Then
									If Trim(loFila.Item("Tip_Doc")).ToLower = "credito" Then
										loFila.Item("por_imp1") = CDec(laImpuestos(0).SelectSingleNode("porcentaje").InnerText)
										loFila.Item("cod_imp1") = Trim(laImpuestos(0).SelectSingleNode("codigo").InnerText)
										loFila.Item("mon_bas1") = CDec(laImpuestos(0).SelectSingleNode("base").InnerText) * -1
										loFila.Item("mon_exe1") = CDec(laImpuestos(0).SelectSingleNode("exento").InnerText) * -1
										loFila.Item("mon_imp1")	= CDec(laImpuestos(0).SelectSingleNode("monto").InnerText) * -1
									Else
										loFila.Item("por_imp1") = CDec(laImpuestos(0).SelectSingleNode("porcentaje").InnerText)
										loFila.Item("cod_imp1") = Trim(laImpuestos(0).SelectSingleNode("codigo").InnerText)
										loFila.Item("mon_bas1") = CDec(laImpuestos(0).SelectSingleNode("base").InnerText)
										loFila.Item("mon_exe1") = CDec(laImpuestos(0).SelectSingleNode("exento").InnerText)
										loFila.Item("mon_imp1")	= CDec(laImpuestos(0).SelectSingleNode("monto").InnerText)
									End If
								End If

								If laImpuestos.Count >= 2 Then
									If Trim(loFila.Item("Tip_Doc")).ToLower = "credito" Then
										loFila.Item("por_imp2") = CDec(laImpuestos(1).SelectSingleNode("porcentaje").InnerText)
										loFila.Item("cod_imp2") = Trim(laImpuestos(1).SelectSingleNode("codigo").InnerText)
										loFila.Item("mon_bas2") = CDec(laImpuestos(1).SelectSingleNode("base").InnerText) * -1
										loFila.Item("mon_exe2") = CDec(laImpuestos(1).SelectSingleNode("exento").InnerText) * -1
										loFila.Item("mon_imp2")	= CDec(laImpuestos(1).SelectSingleNode("monto").InnerText) * -1
									Else
										loFila.Item("por_imp2") = CDec(laImpuestos(1).SelectSingleNode("porcentaje").InnerText)
										loFila.Item("cod_imp2") = Trim(laImpuestos(1).SelectSingleNode("codigo").InnerText)
										loFila.Item("mon_bas2") = CDec(laImpuestos(1).SelectSingleNode("base").InnerText)
										loFila.Item("mon_exe2") = CDec(laImpuestos(1).SelectSingleNode("exento").InnerText)
										loFila.Item("mon_imp2")	= CDec(laImpuestos(1).SelectSingleNode("monto").InnerText)
									End If
								End If

								If laImpuestos.Count >= 3 Then
									If Trim(loFila.Item("Tip_Doc")).ToLower = "credito" Then
										loFila.Item("por_imp3") = CDec(laImpuestos(2).SelectSingleNode("porcentaje").InnerText)
										loFila.Item("cod_imp3") = Trim(laImpuestos(2).SelectSingleNode("codigo").InnerText)
										loFila.Item("mon_bas3") = CDec(laImpuestos(2).SelectSingleNode("base").InnerText) * -1
										loFila.Item("mon_exe3") = CDec(laImpuestos(2).SelectSingleNode("exento").InnerText) * -1
										loFila.Item("mon_imp3")	= CDec(laImpuestos(2).SelectSingleNode("monto").InnerText) * -1
									Else
										loFila.Item("por_imp3") = CDec(laImpuestos(2).SelectSingleNode("porcentaje").InnerText)
										loFila.Item("cod_imp3") = Trim(laImpuestos(2).SelectSingleNode("codigo").InnerText)
										loFila.Item("mon_bas3") = CDec(laImpuestos(2).SelectSingleNode("base").InnerText)
										loFila.Item("mon_exe3") = CDec(laImpuestos(2).SelectSingleNode("exento").InnerText)
										loFila.Item("mon_imp3")	= CDec(laImpuestos(2).SelectSingleNode("monto").InnerText)
									End If
								End If

						End If

						loFila.Item("subt_imp") = CDec(loFila.Item("mon_imp3")) + CDec(loFila.Item("mon_imp2")) + CDec(loFila.Item("mon_imp1"))
						loFila.Item("subt_exe") = CDec(loFila.Item("mon_exe1")) + CDec(loFila.Item("mon_exe2")) + CDec(loFila.Item("mon_exe3"))
						loFila.Item("subt_bas") = CDec(loFila.Item("mon_bas1")) + CDec(loFila.Item("mon_bas2")) + CDec(loFila.Item("mon_bas3"))

				End If

			Next lofila

			loTabla.AcceptChanges()

            '-------------------------------------------------------------------------------------------------------
            ' Verificando si el select (tabla nº0) trae registros
            '-------------------------------------------------------------------------------------------------------

            If (loTabla.Rows.Count <= 0) Then
                Me.WbcAdministradorMensajeModal.mMostrarMensajeModal("Información", _
                                          "No se Encontraron Registros para los Parámetros Especificados. ", _
                                           vis3Controles.wbcAdministradorMensajeModal.enumTipoMensaje.KN_Informacion, _
                                           "350px", _
                                           "200px")
            End If

			Dim laDatosReporte2 AS New DataSet()
			Dim loTabla2 AS New DataTable()

			loTabla2= loTabla.Copy()
			loTabla.Dispose()
			loTabla = Nothing
			laDatosReporte.Dispose()
			laDatosReporte = Nothing

			laDatosReporte2.Tables.Add(loTabla2)

			laDatosReporte2.AcceptChanges()

            loObjetoReporte = cusAplicacion.goReportes.mCargarReporte("rLibro_Compras_GrupoAlegria", laDatosReporte2)

            Me.mTraducirReporte(loObjetoReporte)

            Me.mFormatearCamposReporte(loObjetoReporte)

			Me.crvrLibro_Compras2_Alegria.ReportSource = loObjetoReporte

        Catch loExcepcion As Exception

            Me.WbcAdministradorMensajeModal.mMostrarMensajeModal("Error", _
                          "No se pudo Completar el Proceso: " & loExcepcion.Message, _
                           vis3Controles.wbcAdministradorMensajeModal.enumTipoMensaje.KN_Error, _
                           "auto", _
                           "auto")

        End Try

    End Sub

	Protected Sub Page_Unload(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Unload

		Try

			 loObjetoReporte.Close()

		Catch loExcepcion As Exception

		End Try

	End Sub

End Class
'-------------------------------------------------------------------------------------------'
' Fin del codigo																			'
'-------------------------------------------------------------------------------------------'
' MAT: 03/05/11: Codigo inicial																'
'-------------------------------------------------------------------------------------------'
' MAT: 12/05/11: Modificación de la Base imponible (Solo en los Totales)					'
'-------------------------------------------------------------------------------------------'
' MAT: 12/05/11: Ajuste para que muestre Sección de Facturas Anuladas						'
'-------------------------------------------------------------------------------------------'
' RJG: 25/10/11: Ajuste en presentación de Montos Otros (se consideran Exentos). Aplicación '
'				 de criterio para obtener número de documento fiscal y número de factura	'
'				 asociada en el caso de las N/CR. Filtradas las N/CR para mostrar solo las	'
'				 que sean de Devolución de Compras.											'
'-------------------------------------------------------------------------------------------'
' RJG: 02/11/11: Agregado filtro para no incluir las Ordenes de Pago generadas desde Punto	'
'				 de Venta. 																	'
'-------------------------------------------------------------------------------------------'


text:
arthritis health center/arthritis a-z list/scleroderma center /scleroderma article
Facts you should know about scleroderma
What is scleroderma?
What causes scleroderma?
What are risk factors for developing scleroderma?
How do health care professionals classify scleroderma?
What are scleroderma symptoms and signs?
How do health care professionals make a diagnosis of scleroderma?
What are medical treatments for scleroderma?
What is the prognosis for patients with scleroderma?
Is it possible to prevent scleroderma?
Medical Author: William C. Shiel Jr., MD, FACP, FACR
Medical Editor: Charles Patrick Davis, MD, PhD
Scleroderma Center
Patient Comments: Scleroderma - Describe Your Experience
Patient Comments: Scleroderma - Symptoms and Signs
Patient Comments: Scleroderma - Treatment
Patient Comments: Scleroderma - Types
Find a local Rheumatologist in your town
Scleroderma is a skin disease of the connective tissue featuring thickened skin that can involve scarring, blood vessel problems, varying degrees of inflammation and pain, and is associated with an overactive immune system.
CREST syndrome is a limited form of scleroderma.
Patients with scleroderma can have specific antibodies (ANA, anticentromere, or anti-topoisomerase) in their blood that suggest autoimmunity.
Treatment of scleroderma is primarily directed toward the particular individual's symptoms.
Readers Comments 36
Scleroderma is an autoimmune condition of the connective tissue characterized by skin thickening, spontaneous scarring, blood vessel disease, and varying degrees of inflammation, associated with an overactive immune system. Autoimmune diseases are illnesses that occur when the body's tissues are attacked by its own immune system. Scleroderma is characterized by the formation of scar tissue (fibrosis) in the skin. This leads to thickness and firmness of involved skin. This may also occur in internal organs such as the kidney.
Scleroderma is classified as localized or widespread (systemic scleroderma with a tendency to affect internal organs). Systemic scleroderma is further divided into limited and diffuse based upon the extent of cutaneous involvement.
Scleroderma Diagnostic Tests
Antinuclear Antibody Test
We normally have antibodies in our blood that repel invaders in our bodies, such as virus and bacteria microbes. Antinuclear antibodies (ANAs) are unusual antibodies, detectable in the blood, that have the capability of binding to certain structures within the nucleus of the cells. The nucleus is the innermost core within the body's cells and contains the DNA, the primary genetic material. ANAs are found in patients whose immune system may be predisposed to cause inflammation against their own body tissues. Antibodies that are directed against one's own tissues are referred to as autoantibodies. The propensity for the immune system to work against its own body is referred to as autoimmunity. ANAs suggest the possible presence of autoimmunity. Therefore, when they are detected in a patient's blood (referred to as a "positive" result), doctors will consider the possibility that an autoimmune illness exists in that patient.
Read more about the antinuclear antibody test »
The cause of scleroderma is not known. Researchers have found some evidence that certain genes are important hereditary factors, but the environment seems to also play a role. The result is activation of the immune system in a susceptible individual, causing damage to the inner lining of tiny blood vessels and injury to tissues that result in scar tissue formation and the accumulation of excess collagen.
The fact that genes seem to cause a predisposition to developing scleroderma means that inheritance at least plays a partial role. It is not unusual to find other autoimmune diseases in families of scleroderma patients. Some evidence for the role genes may play in leading to the development of scleroderma comes from the study of Choctaw Native Americans who are the group with the highest reported prevalence of the disease. The condition is more frequent in females than in males.
Because of the known association of certain genes with scleroderma, it may be that combinations of exposures to environmental factors and possibly certain viruses may trigger the development of scleroderma in genetically susceptible people. The precise interplay of pathology leading to blood vessel damage, scar and collagen accumulation, and autoimmunity is unclear.
Arthritis: Causes and Treatment for Joint Stiffness and Pain See Slideshow
Readers Comments 1
Scleroderma can be classified in terms of the degree and location of the skin and organ involvement. Accordingly, scleroderma has been categorized into two major groups, localized scleroderma and systemic sclerosis. Systemic sclerosis is further subdivided into either diffuse or limited forms based on the location and extent of cutaneous involvement.
Localized scleroderma skin changes are in isolated areas, either as morphea patches or linear scleroderma. Morphea is scleroderma that is localized to a patchy area of the skin that becomes hardened and slightly pigmented. Sometimes morphea can cause multiple oval-shaped lesions in the skin. Morphea is not associated with disease elsewhere within the body, only in the involved skin areas. Linear scleroderma is scleroderma that is localized usually to a lower extremity, frequently presenting as a strip of hardening skin down the leg of a child. Linear scleroderma in children can stunt bone growth of the affected limb. Sometimes linear scleroderma is associated with a "satellite" area of a patch of localized scleroderma skin, such as on the abdomen.
The widespread type of scleroderma involves internal organs in addition to the skin. This type, called systemic sclerosis, is subcategorized by the extent of skin involvement as either diffuse or limited. The diffuse form of scleroderma (diffuse systemic sclerosis) involves symmetric thickening of skin of the extremities, face, and trunk (chest, back, abdomen, or flanks) that can rapidly progress to hardening after an early inflammatory phase. Organ disease can occur early on and be serious and significantly decrease life expectancy. Organs affected include the esophagus, bowels, and scarring (fibrosis) of the lungs, heart, and kidneys. High blood pressure can be troublesome and can lead to kidney failure (renal crisis).
The limited form of scleroderma tends to have far less skin involvement with skin thickening confined to the skin of the fingers, hands, and face. The skin changes and other features of disease tend to occur more slowly than in the diffuse form. Because characteristic clinical features can occur in patients with the limited form of scleroderma, this form has taken another name that is composed of the first initials of the common components. Thus, this form is also called the "CREST" variant of scleroderma. CREST syndrome represents the following features:
C...Calcinosis refers to the formation of tiny calcium deposits in the skin. This is seen as hard whitish areas in the superficial skin, commonly overlying the elbows, knees, or fingers. These firm deposits can be tender, can become infected, and can fall off spontaneously or require surgical removal. This is the least common of the CREST scleroderma variant features.
R...Raynaud's phenomenon refers to the spasm of the tiny arterial vessels supplying blood to the fingers, toes, nose, tongue, or ears. These areas turn white, then blue, then red after exposure to extremes of cold, or even sometimes with extremes of heat or emotional upset. This can lead to tiny areas of damage to the tips of the fingers (digital ulcers) or larger areas of dead skin on the ends of the fingers.
E...Esophagus disease in scleroderma is characterized by dysmotility (poorly functioning muscle of the lower two-thirds of the esophagus, the swallowing tube through which food passes from the mouth to the stomach). This can lead to an abnormally wide esophagus that allows stomach acid to backflow into the esophagus to cause heartburn, inflammation, and potentially scarring that narrows the esophagus. This can eventually lead to difficulty in passing food from the mouth through the esophagus into the stomach. Symptoms of heartburn are treated aggressively in patients with scleroderma in order to prevent injury to the esophagus.
S...Sclerodactyly is the localized thickening and tightness of the skin of the fingers or toes. This can give them a "shiny" and slightly puffy appearance. The tightness can cause severe limitation of motion of the fingers and toes. These skin changes generally progress much slower than those of patients with the diffuse form of scleroderma.
T...Telangiectasias are tiny red areas, frequently on the face, hands, and in the mouth behind the lips. These areas blanch when they are pressed upon and represent widened (dilated) capillaries.
Patients with limited systemic sclerosis can have variations of CREST with differing manifestations, for example, CRST, REST, or ST. Occasionally, patients can have initial illness with features of CREST that evolve into the diffuse form of scleroderma. Some patients have "overlaps" of scleroderma and other connective tissue diseases, such as rheumatoid arthritis, systemic lupus erythematosus, and polymyositis. When features of scleroderma are present along with features of polymyositis, systemic lupus erythematosus, and certain abnormal blood tests, the condition is referred to as mixed connective tissue disease (MCTD).
Latest Arthritis News
Night in the Hospital After Hip, Knee Replacement
How Safe Is a Holiday From Bone-Strengthening Meds
A Better Way to Correct Severe Scoliosis in Kids?
Cortisone Injections Arthritic Knees
Even T. Rex Had Bone Trouble
The symptoms of scleroderma depend on the type of scleroderma present and the extent of external and internal involvement in the individual affected. Because scleroderma can involve the skin, esophagus, blood vessels, kidneys, lungs, blood pressure, and bowels, the symptoms it causes can affect many areas of the body.
Scleroderma affects the skin to cause local or widespread signs of inflammation (redness, swelling, tenderness, itching, and pain) that can lead to skin tightness or hardening and a mask-like face. These skin changes can be widespread, but it's most common for them to affect the fingers, feet, face, and neck. This can lead to decreased range of motion of the fingers, toes, and jaw. Tiny areas of calcification (calcinosis), while not common, can sometimes be noticed as hard nodules at the tips of the elbows, knees, in the fingers, or over joints.
Scleroderma commonly affects the esophagus leading to heartburn. This is directly a result of stomach acid flowing back up into the esophagus. Sometimes this can lead to scarring of the esophagus, resulting in narrowing with difficulty swallowing food and/or localized pain in the central chest.
Blood vessels that can be affected include the tiny arterioles of the finger tips, toes, and elsewhere. These vessels can have a tendency to spasm when the areas are exposed to cold, leading to whiteness, blueness, and redness of involved fingers, toes, and sometimes nose or ears. These color changes are referred to as Raynaud's phenomenon. This may precede the development of other features of scleroderma by years. It should be noted that Raynaud's phenomenon can be an isolated disease without any other disease such as scleroderma developing. Raynaud's phenomenon can cause inadequate supply of oxygen to the involved tips of fingers or toes, causing tiny ulcers or blackened (dead) skin. Sometimes Raynaud's phenomenon is also associated with tingling. Other blood vessels that can be involved in scleroderma are the tiny capillaries of the face, lips, mouth, and fingers. These capillaries widen (dilate), forming tiny, red blanching spots, called telangiectasias. Rarely, telangiectasias in the stomach (called "watermelon stomach" because of its appearance) can present a serious risk of bleeding and require close monitoring by gastroenterologists.
Elevated blood pressure is potentially serious and can lead to kidney damage (renal crisis). Symptoms include headache, fatigue, and in severe cases, stroke. Blood pressure monitoring and control is essential.
Inflammation of the lungs in scleroderma can cause scarring, resulting in shortness of breath, especially with physical exertion. Elevated pressure in the arteries to the lungs (pulmonary hypertension) can also cause shortness of breath and difficulty getting an adequate breath with activity.
Scleroderma involvement in the heart can lead to damage to heart muscle, irregular heart rhythms, abnormal electrical activity of the heart, and inflammation around the heart (pericarditis).
Scleroderma affecting the large bowel (colon) most often causes constipation but can also lead to cramping and diarrhea. When this is severe, complete stool blockage (fecal impaction) can result.
Lupus is an infection. See Answer
The diagnosis of the scleroderma syndrome is based on the detection of the clinical features of the illness. In addition, nearly all patients with scleroderma have blood tests that suggest autoimmunity and antinuclear antibodies (ANAs) are usually detectable. A particular antibody, the anticentromere antibody, is found almost exclusively in the limited, or CREST, form of systemic sclerosis. Anti-Scl 70 antibody (antitopoisomerase I antibody) is most often seen in patients with the diffuse form of systemic sclerosis.
Other tests are used to evaluate the presence or extent of any internal disease. These may include upper and lower gastrointestinal tests to evaluate the stomach and bowels, chest X-rays, lung function testing (pulmonary function test), and CAT scanning to examine the lungs, EKG and echocardiograms, and sometimes heart catheterization to evaluate the pressure in the arteries of the heart and lungs for pulmonary hypertension.
Subscribe to MedicineNet's General Health Newsletter
By clicking Submit, I agree to the MedicineNet's Terms & Conditions & Privacy Policy and understand that I may opt out of MedicineNet's subscriptions at any time.
Treatment of scleroderma is directed toward the individual features affecting different areas of the body.
Aggressive treatments of elevations in blood pressure have been extremely important in preventing kidney failure. Blood pressure medications, particularly the angiotensin converting enzyme (ACE) inhibitor class of drugs, such as lisinopril, are frequently used.
Some research indicates that colchicine can be helpful in decreasing the inflammation and tenderness that periodically accompanies the calcinosis nodules in the skin. Skin itching can be relieved with lotions (emollients) such as Eucerin, Lubriderm, and Curel.
Mild Raynaud's phenomenon may require only hand warming and protection. Low-dose aspirin is often added to prevent tiny blood clots in the fingers, especially in patients with a history of fingertip ulcerations. Moderate Raynaud's phenomenon can be helped by medications that open up the arteries, such as nifedipine (Procardia, Adalat), nicardipine (Cardene), and diltiazem (Cardizem), or with topical nitroglycerin applied to the most affected digit (most effective on the sides of the digit where the arteries are). Gently applied finger splinting can protect tender tissues. (It is important to not constrict the tiny arteries on the sides of the fingers when protecting them with splints, braces, or band aid materials.) A class of medications that is typically used for depression, called serotonin reuptake inhibitors, such as fluoxetine (Prozac), can sometimes improve the circulation of the affected digit. Drugs that constrict blood vessels, such as pseudoephedrine (Sudafed decongestant), should be avoided. Severe Raynaud's phenomenon can require surgical procedures, such as those to interrupt the nerves of the finger that stimulate constriction of the blood vessels (digital sympathectomy). Ulcerations of the fingers can require topical or oral antibiotics.
Esophagus irritation and heartburn can be relieved with omeprazole (Prilosec), esomeprazole (Nexium), or lansoprazole (Prevacid). Antacids can also be helpful. Elevating the head of the bed can reduce the back flow of acid into the esophagus that causes inflammation and heartburn. Avoiding caffeine and cigarette smoking also helps. Of note, there is an increased risk of developing lung cancer in people with scleroderma. This cancer risk is even greater in those who smoke.
Constipation, cramping, and diarrhea are sometimes caused by bacteria that can be treated with tetracycline (Sumycin), erythromycin (E-Mycin, Eryc, Ery-Tab, Pce, Pediazole, Ilosone), ciprofloxacin (Cipro), or metronidazole (Flagyl). Increased fluid intake and fiber intake are good general measures to take to reduce these symptoms. A variety of medications that promote movement of the bowels are available.
Irritated, itchy dry skin can be helped by emollients such as Lubriderm, Eucerin, or Curel.
Telangiectasias, such as those on the face, can be treated with local laser therapy. Sun exposure should be minimized as it can worsen telangiectasias. Telangiectasias from watermelon stomach can require laser treatments to the stomach.
Approximately 10% of patients with the CREST variant develop elevated pressures in the blood vessels to the lungs (pulmonary hypertension). Abnormally elevated blood pressure of the arteries supplying the lungs is often treated with calcium antagonist medications, such as nifedipine (Procardia), and blood-thinning drugs (anticoagulation). More severe pulmonary hypertension can be helped by continuous intravenous infusion or inhalation of prostacyclin (Iloprost). Taken by mouth, bosentan (Tracleer) is used to treat pulmonary hypertension. In addition, sildenafil (Revatio) and tadalafil (Cialis) are approved to treat pulmonary hypertension.
Additionally, medicines are used to suppress the overly active immune system that seems to be spontaneously causing the disease in organs. Immunosuppressants used for this purpose include D-penicillamine, azathioprine (Imuran, Azasan), and methotrexate (Rheumatrex, Trexall). Serious inflammation of the lungs (alveolitis) can require immune suppression with cyclophosphamide (Cytoxan) along with prednisone (Deltasone, Liquid Pred). The optimal treatment of scleroderma lung disease is an area of active research. Stem-cell transplantation is being explored as a possible option.
No medicine has been found to be universally effective for patients with scleroderma. In an individual patient, the illness may be mild and not require treatments. In some, the disease is ravaging, relentless, and can lead to death. Because blood vessel damage is a primary part of the pathology of scleroderma, patients with this condition must not smoke.
Autoimmune Disease Resources
Rheumatoid Arthritis Future Treatment
What Makes Your Psoriasis Severe?
Psoriatic Disease Symptoms Often Missed
A patient's prognosis is optimized with close monitoring of overall health status and treatment of complications, especially elevated blood pressure. This can involve medical subspecialists, including rheumatologists, pulmonologists, gastroenterologists, nephrologists, and cardiologists. Research indicates that the critical period of organ risk is generally within the first three years of skin involvement. This means that patients can be reassured that their risk of life-threatening organ complications is significantly less after three years of having skin symptoms and not having internal organ problems.
Patients with diffuse skin involvement tend to do worse than those with limited skin involvement. Those with limited disease of the skin can develop serious lung scarring (interstitial lung disease) and pulmonary artery hypertension even after a decade of disease. Lung disease is the leading cause of death. Those with poor pulmonary function tests can have worse outcomes.
Scleroderma continues to challenge medical scientists. Researchers are evaluating the effectiveness of thalidomide (Thalomid) for the treatment of scleroderma. More sensitive tests to detect early lung disease of scleroderma are also being evaluated. Ongoing research into new medications for pulmonary hypertension are in clinical trials. Researchers are also evaluating the possible role of stem-cell transplantation for certain serious forms of scleroderma.
Many researchers are investigating the roles of various cell messengers, called cytokines, in causing scleroderma. Researchers are also currently studying a hormone of pregnancy, called relaxin, for the treatment of scleroderma. Preliminary results suggest that it may improve scleroderma. Relaxin normally loosens the ligaments of the pelvis and ripens the womb for childbirth. How it might work in scleroderma is unclear.
It is clear that our understanding of the effects of the immune system in scleroderma is greatly improving. Many clinical research trials are under way to evaluate potential treatments for various aspects of the disease to improve the prognosis for patients with scleroderma. Further research supported by the Scleroderma Foundation, Arthritis Foundation, and the National Institutes of Health will lead to better understanding the illness and more optimal care for patients with scleroderma.
There is no prevention method or diet to avoid or decrease the risk of scleroderma.
American College of Rheumatology. "Scleroderma." <https://www.rheumatology.org/I-Am-A/Patient-Caregiver/Diseases-Conditions/Scleroderma>.
Arnett, F. C., et al. "Increased prevalence of systemic sclerosis in a Native American tribe in Oklahoma. Association with an Amerindian HLA haplotype." Arthritis and Rheumatism 39.8 (1996): 1362-1370.
Chaisson, N.F., and P.M. Hassoun. "Systemic sclerosis-associated pulmonary arterial hypertension." Chest 144.4 Oct. 2013: 1346-1356. doi: 10.1378/chest.12-2396.
Cutolo, M., and M. Matucci Cerinic. "Nailfold capillaroscopy and classification criteria for systemic sclerosis." Clinical and Experimental Rheumatology 25 (2007): 663-665.
Klippel, J. H., et al. Primer on the Rheumatic Diseases, 13th Edition. Springer, 2008.
Kowal-Bielecka O, Fransen J, Avouac J, Becker M, Kulak A, Allanore Y, Distler O, Clements P, Cutolo M, Czirjak L, Damjanov N, Del Galdo F, Denton CP, Distler JHW, Foeldvari I, Figelstone K, Frerix M, Furst DE, Guiducci S, Hunzelmann N, Khanna D, Matucci-Cerinic M, Herrick AL, van den Hoogen F, van Laar JM, Riemekasten G, Silver R, Smith V, Sulli A, Tarner I, Tyndall A, Welling J, Wigley F, Valentini G, Walker UA, Zulian F, Müller-Ladner U; EUSTAR Coauthors. "Update of EULAR recommendations for the treatment of systemic sclerosis." Ann Rheum Dis 76.8 Aug. 2017: 1327-1339. doi: 10.1136/annrheumdis-2016-209909.
Lazzaroni, Maria-Grazia, et al. "Malignancies in Patients with Anti-RNA Polymerase III Antibodies and Systemic Sclerosis: Analysis of the EULAR Scleroderma Trials and Research Cohort and Possible Recommendations for Screening." The Journal of Rheumatology January 2017.
Nevares, Alana M., and Robert Larner. "Systemic Sclerosis." MerckManuals.com. <https://www.merckmanuals.com/home/bone,-joint,-and-muscle-disorders/autoimmune-disorders-of-connective-tissue/systemic-sclerosis>.
"Preliminary criteria for the classification of systemic sclerosis (scleroderma). Subcommittee for scleroderma criteria of the American Rheumatism Association Diagnostic and Therapeutic Criteria Committee." Arthritis Rheum 23.5 May 1980: 581-590.
United States. National Institute of Arthritis and Musculoskeletal and Skin Diseases. "Scleroderma." Aug. 2016. "lt;https://www.niams.nih.gov/health-topics/scleroderma>.
United States. National Institutes of Health. Genetics Home Reference. "Systemic Scleroderma." Jan. 29, 2019. <https://ghr.nlm.nih.gov/condition/systemic-scleroderma>.
Top Scleroderma Related Articles
CT Scan (Computerized Tomography)
A CT scan is an X-ray procedure that combines many X-ray images with the aid of a computer to generate cross-sectional and three-dimensional images of internal organs and structures of the body. A CT scan is a low-risk procedure. Contrast material may be injected into a vein or the spinal fluid to enhance the scan.
Chest X-Ray
Chest X-Ray is a type of X-Ray commonly used to detect abnormalities in the lungs. A chest X-ray can also detect some abnormalities in the heart, aorta, and the bones of the thoracic area. A chest X-ray can be used to define abnormalities of the lungs such as excessive fluid (fluid overload or pulmonary edema), fluid around the lung (pleural effusion), pneumonia, bronchitis, asthma, cysts, and cancers. Normal chest X-ray shows normal size and shape of the chest wall and the main structures in the chest
Constipation is defined medically as fewer than three stools per week and severe constipation as less than one stool per week. Constipation usually is caused by the slow movement of stool through the colon. There are many causes of constipation including medications, poor bowel habits, low-fiber diets, laxative abuse, and hormonal disorders, and diseases primarily of other parts of the body that also affect the colon.
Electrocardiogram (ECG or EKG)
An electrocardiogram is known by the acronyms "ECG" or "EKG" more commonly used for this noninvasive procedure to record the electrical activity of the heart. An EKG generally is performed as part of a routine physical exam, part of a cardiac exercise stress test, or part of the evaluation of symptoms. Symptoms evaluated include palpitations, fainting, shortness of breath, dizziness, fainting, or chest pain.
Endoscopy (EGD) Procedure
Endoscopy is a broad term used to described examining the inside of the body using an lighted, flexible instrument called an endoscope. Endoscopy procedure is performed on a patient to examine the esophagus, stomach, and duodenum; and look for causes of symptoms such as abdominal pain, nausea, vomiting, difficulty swallowing, or intestinal bleeding.
Eosinophilic Fasciitis (Shulman's Syndrome)
Eosinophilic fasciitis is a skin disease that causes thickening and inflammation of the skin and fascia. Symptoms include redness, warmth, and hardening of the skin, as well as occasional tissue and joint pain. Treatment for eosinophilic fasciitis aims to eliminate inflammation through the use of aspirin, NSAIDs, and cortisone. Aggressive forms of eosinophilic fasciitis may require the use of immune-suppression medications.
High blood pressure (hypertension) is a disease in which pressure within the arteries of the body is elevated. About 75 million people in the US have hypertension (1 in 3 adults), and only half of them are able to manage it. Many people do not know that they have high blood pressure because it often has no has no warning signs or symptoms.
Systolic and diastolic are the two readings in which blood pressure is measured. The American College of Cardiology released new guidelines for high blood pressure in 2017. The guidelines now state that blood normal blood pressure is 120/80 mmHg. If either one of those numbers is higher, you have high blood pressure.
The American Academy of Cardiology defines high blood pressure slightly differently. The AAC considers 130/80 mm Hg. or greater (either number) stage 1 hypertension. Stage 2 hypertension is considered 140/90 mm Hg. or greater.
If you have high blood pressure you are at risk of developing life threatening diseases like stroke and heart attack.
REFERENCE: CDC. High Blood Pressure. Updated: Nov 13, 2017.
Mixed Connective Tissue Disease (MCTD)
Connective tissue diseases are disorders featuring abnormalities involving the collagen and elastin. Connective tissue diseases that are strictly inheritable include Marfan syndrome and Ehlers-Danlos syndrome. The classic immune-related connective tissue diseases include systemic lupus erythematosus, rheumatoid arthritis, scleroderma, polymyositis, and dermatomyositis. Treatment is often directed at suppressing the inflammation present in the tissues by using anti-inflammatory and immunosuppressive medications.
Polymyositis and Dermatomyositis
Polymyositis is a disease of the muscle featuring inflammation of the muscle fibers. It results in weakness of the muscles which can be severe and when associated with skin rash, is referred to as dermatomyositis. Although the cause of this disease is unknown, diagnosis includes physical examination of muscle strength, blood tests for muscle enzymes, electrical tests of muscle and nerves, and conformation by a muscle biopsy. Treatment of polymyositis and dermatomyositis includes high doses of cortisone-related medications, immune suppression, and physical therapy.
Skin Picture
The skin is the largest organ of the body, with a total area of about 20 square feet. See a picture of the Skin and learn more about the health topic.
Upper GI Series (Barium Swallow)
An upper gastrointestinal GI series, or barium swallow is a test used in assisting in the diagnosis of upper gastrointestinal diseases or conditions such as ulcers, tumors, hiatal hernias, scarring, blockages, and abnormalities of the muscular wall of the GI tract.

redpajama_set_name: RedPajamaCommonCrawl


As a rather surprising turn of events, Gaming Minds Studios have moved on from the Americas and delivered a DLC for Railway Empire which I've been eagerly awaiting since playing the game almost 12 months ago – Railway Empire: Great Britain & Ireland! Being from the UK myself, I always become hyped and excited when a game I love sets part of their game over here rather than in a fictional land (or America).
As previously stated, this pack instantly became more relatable and sought after by myself simply for the location alone – having the ability to plan the railway systems around my own country of residence is rather delightful and entertaining. However, that's not the main reason why I can 100% say that this is the best DLC pack so far. That award goes to the whole package including the new map, locomotives, assets and music which has been provided.
The single scenario takes you from 1830-1850 as part of the transport revolution. See the birth of the first steam engines as you set up new connections between the major cities and rural resources in order to supply the demand of new goods from all over the country (and Ireland) to people who didn't have access before. Sure, it sounds like what we've done in previous scenarios – only this time it's in jolly England as you face off against three rather aggressive stock-buying CPU opponents.
Great Britain & Ireland may be priced approx 50% higher than the previous DLC packs but in my opinion, it's worth every penny. Not only is the map the biggest new addition yet, with 45 new cities and a map literally covering all of Great Britain & Ireland, but the game seems to be using some new assets and textures. That's right, the UK didn't have the same history as the USA and our buildings were never wooden saloon-type establishments. As such, the developers have provided new assets for the buildings as well as perfectly capturing what our landscape looked like with its green farming lands and snowy Scottish mountains.
Also, if you've played Railway Empire previously, you'll know that the awesome soundtrack sounds like a western in most cases as that's around the time period the game goes for – the Great Britain & Ireland DLC introduces more fitting music for the new locale and setting. Not only that, but it also introduces yet another 13 manufacturable and tradable goods such as whisky and cider (not that us British do nothing but drink…).
However, the biggest new addition comes in the form of its locomotives – as we're embarking on a journey around the start of the first ever Steam Engines, there are a whopping ten new locomotives for you to unlock and use within the scenario! The previous DLCs have all given us two new locos at a time, having ten new ones is very generous and perfectly fitting for the new country we're in.
Yup, all because of us. Also… ManBearPig?!?
Now, the main reason I love the Great Britain & Ireland DLC is because of its difficulty – it's spot on for me. I loaded it up the other day and around six hours later I had achieved all but one of the trophies assigned to this new pack. Was it an easy scenario? Not really – but you did have plenty of time to meet your goals, no un-realistic goals to try and achieve, and no surprise "have 20 express trains running within 12 months" thrown at you.
The whole experience was great – it was around the same difficulty as the base game and even offered a decent amount of challenge as the CPU characters woke up and started to join in with the auctions and expansions (they don't become active until about 10 years into the scenario). This did lead to one issue for me – the CPU characters get very hungry and begin to buy up stock left, right and centre. This resulted in my company being fully owned by a CPU character for the first time ever! Thus, ending my game. Thankfully, this happened post-scenario when I was just messing about after achieving full marks for my performance.
Due to it's more relaxing take on the game and more accessible and straightforward missions, I'd highly recommend the Great Britain & Ireland DLC pack above all the others if you could only buy one of them. Don't forget, the full Great Britain & Ireland map also becomes usable in the pre-built scenario, Free Game and Sandbox modes as well, so easily adding a bunch of hours of entertainment for you to work through.
I see Virgin have a new locomotive on the tracks!
As I've advised in my previous reviews, the game technically is the same as it was upon launch, which you can see the review of HERE. However, mechanically there have been numerous patches since launch which have added new features and altered existing processes (which can all be read HERE). Once again though, the console version still doesn't have a camera mode! Other than that, I have no issues or flaws with both the visual and audio aspects of Railway Empire.
Railway Empire: Great Britain & Ireland is by far my favourite DLC for Railway empire to date. Not only do I get to play around with trains in my home territory, but we also got a bunch of new locomotives and region-specific goods to transport. I love the fact that the most recent PC update (which will come to consoles soon supposedly) has changed the in-game currency to GBP (£) and it's more prone to rain (just like in real life!). However, I'm yet to see if they literally change the $ sign into the £, or if they adjust the prices accordingly as £1 in 1800 is worth around £100 today.
I found this DLC to be the most fun in terms of completing the tasks and expanding. I know all the scenarios are very similar and involve expanding, transporting certain things to set places, overtaking your competitors, and then becoming the monopoly, but this scenario literally had me hooked from beginning to end. I honestly can't wait to see where the developers will take us next – Asia would be interesting, or Europe with the inclusion of the Orient Express!
Railway Empire: Great Britain & Ireland is the best DLC to pick up in my opinion. Not only are we introduced to a brand new country, but we also have ten new locomotives, 45 cities, new city assets and new music to match the locale. The overall experience also feels more accessible and achievable with no curveball tasks which surprise you as you juggle your limited time available.
Those looking to expand upon the core gameplay of the base game will find it within the Railway Empire: Great Britain & Ireland DLC pack. Those looking for more challenge and a ramped up difficulty should grab the previous DLC packs.
- Upcoming update to adjust the currency to GBP and increase the likelihood of rain!


text:
Vishy Anand: World Chess Champion
chessbibliophile
Tags: anand, anand - carlsen, aronian, chess world, chess world championship,
Chessbibliophile reviews the definitive collection of games by the World Champion.
Don't miss annotations to Carlsen – Anand 2008 and the video
by GM Vishy Anand
& GM John Nunn
Gambit Publications. 2012
Softcover, 544 pages
Way back in 1998 a new book by the rising Indian star, Viswanathan Anand hit the stands. It was an instant success and deservedly won the BCF Award for The Book of The Year. Two years later after he became the FIDE World Champion it also saw the second edition (Gambit.2001). A decade later last year the third edition appeared on the eve of the Anand-Gelfand World Championship Match. As of now this is the latest edition.
So what is new? Thirty games (for the period 2001-2011) have been selected by Anand himself and annotated by John Nunn to bring this book up to date.
Anand has chosen not to revise his annotations to the games in the previous editions. He has also refrained from commenting on his games for the last decade. It's left to John Nunn. In short there is nothing in the book that would have offered the slightest hint of the world champion's current arsenal to any of his rivals. Very shrewd of Vishy.
This brings me to the contents of the book. The title is a bit of misnomer. There is little about his life here that qualifies it to be a biography. Instead we are offered games interspersed with a brief personal narrative.
As the Bard once put it, the play's the thing. There are as many as 87 games covering the period 1986-2011.
What could one say about these games? Over the years Vishy has evolved as a player with universal style. He can play any kind of position with ease. His best efforts are reminiscent of Capablanca and Smyslov. There is the same kind of elegance and harmony found in the work of these great masters.
Unfortunately, in the last decade this style has come under great strain with mounting challenge from younger talents like Aronian
and Carlsen.
As Vishy himself would acknowledge, his play in recent years has left much to be desired. However, his fans believe, he would return to form in the coming world championship with Carlsen. I would have loved to see more games in this book .But then it's already 500 pages long.
For our readers I have chosen the following game (download pgn):
Magnus Carlsen-Viswanathan Anand
Wijk-aan-Zee 2008
A battle royal! Don't forget that Carlsen was only 18-years-old at the time.
There are several such games in the book. In terms of analysis it is the definitive collection of games by the world champion.
Recommended. Get the book Vishy Anand: World Chess Champion
1) The images of William Shakespeare and Vishy Anand are taken from Wikipedia.
2)The image of Anand-Carlsen meeting is from ChessPro.ru
Thanks Art, as always!
3)The image of Anand-Aronian encounter is from NorwayChess.com
We owe it to you, Mr.Jøran Aulin-Jansson!
1)The earlier version of this review appeared at Chessville.com (now defunct)
2) For more information on the book, see Gambit Publications site. There is also a pdf sample featuring a game from the recent period.
3) I have refrained from commenting on the essay at the end of the book. There are several issues with this kind of writing. Among other things the author does not seem to be familiar with Anand's early career or the chess scene in India during this formative period.
4) Carlsen-Anand, Wijk-aan-Zee 2008:
Some analysis here is taken from the ChessBase DVD set on Anand by way of comparison. The annotations to a few games in this book offer a radical revision of assessment in the DVDs. However, the DVD set is not without merit here.
4 Things We Can All Learn from the Candidates Tournament 2018
7 Best Players for Studying Strategy
What is New in Theory? (October – November 2014)
Sorry for the belated response.
Now don't take offence if I differ a little.
1)Contrary to common perception Anand was not terrified of Kasparov. He maintained, there was no point in playing with Garry if one was scared of him. There are both chess and non-chess reasons for the lopsided score between them. But fear was not one of them. I suppose you have seen this video. He's full of confidence:
http://www.youtube.com/watch?v=DxbMzZ5a2Zg
2)As for Aronian, Vishy is doing better. Here is a recent classic:
http://en.chessbase.com/post/kavalek-in-huffington-amazing-che-brilliancy-of-vishy-anand
3)Selected games from the Anand-Carlsen Match would be presented on our site.
For now there are two interviews:
http://www.thehindu.com/sport/i-didnt-get-a-grip-on-carlsens-style-anand/article5415037.ece
https://chessbase.com/post/anand-i-was-outplayed-by-carlsen
Maettados
Anand is the best! But he also had difficult opponents. He was terrified of Kasparov, so he lost many games for no reason. Aronian is a not an easy opponent for him as well, he does pretty badly against him. And now, most importantly, he speaks out of Carlsen as about the guy who wins everything, everywhere. Anand should fight his fears and play good chess in the upcoming Matach!


If you're arriving to Bayahibe via any of the three closest airports (La Romana, Punta Cana or Santo Domingo) and staying at one of the All Inclusive resorts in Bayahibe / Dominicus area, your vacation package might include airport transfers. If not, continue reading.
If you're taking the independent route, you can rent a car at either airport at the car rental place or you can take a taxi (highly suggested if it's your first visit to Dominican republic). You can use the public transportation to travel around the island, but to get out of any airport in this country you have to use either a taxi or a car.
Punta Cana Airport is about 40 minute drive on a nice highway, very fast and comfortable, so even after a long travel time it's not as bad as in the past when it took two hours or even more.
Santo Domingo airport is the furthest one, but after the opening of the new highway it takes only about 55 minutes.
You can rent a car, either by pre-booking from home like at any other vacation destination in the world, or you can rent a car at the airport. The cost is from 45 USD per day plus, depending on the vehicle of course. Make sure you have a full insurance coverage, but if you booked online pay for the insurance here. Even if you rent from a well known rental company, they might not accept your insurance and you will end up paying for it twice!
This is the budget friendly way to travel around, but usually the longest way to get places. If traveling from La Romana airport or Punta Cana airport, you'll have to find one bus or guagua going to La Romana first, then need to transfer to another one for Bayahibe (ask the driver to drop you off at the "parada para Bayahibe").
Driving from Punta Cana / Bavaro area or any point east of Bayahibe – get to the new Coral highway, it will take you about 30 minutes to see a sign Bayahibe. Take off and keep on driving Bayahibe direction for the next 3 – 4 miles. You will pass Dreams La Romana resorts on the right and also a police station also on the right. Continue driving to a Y shaped intersection, there will be a PropaGas gas station on the left. Just across that is the road going to Bayahibe (1/2 mile), so go right to get to the village or keep going straight for additional mile and 1/2 to get to Dominicus.
Driving from Santo Domingo or other points west of Bayahibe – take highway #3 east towards San Pedro de Macoris and Punta Cana direction. Do not take off the highway when you see La Romana, you will end up going through the city, which can add extra 30 minutes or so. Continue driving on the highway until you see the sign Bayahibe, take off there and continue as per directions above.


Are you looking for Apartments Near Moncton Hospital? How does Townhouse Living in one of Moncton's most sought after neighborhoods sound?
These old neighborhoods have mature trees and lots of character. They attract young families, professionals, and anyone who wants to be close to Downtown but not live in Downtown.
Want a quiet townhouse near the Trinity Power Center? Check out Anne Street!
Maybe you'd prefer to be a bit closer to Downtown? Then Edgett Avenue is the place for you.
These two buildings offer multi-floor living, with basement storage space and a variety of room, including separate dinning rooms and living rooms. Our Townhouse units are independent of each other, so you even have your own address.
The best thing: everything is included!
Welcome to the Anne Street Townhouses! This unique townhouse complex is located in one of the most desirable neighborhoods in ..
Welcome to our Edgett Avenue Townhouses! These amazing 2-storey townhouses are amazingly spacious and are located near some amazing amenities. ..
Beautiful Apartments for Rent in Moncton! The 14 and 16 Everett Street buildings are a hidden gem. They're located in ..


Gideon Lester is Professor of Theater and Performance; Director, Theater Programs at Bard College. He Previously taught at Harvard, where he was a Fulbright and Frank Knox Scholar; and Columbia University School of the Arts, where he founded the Arts Collaboration Lab in association with Performance Space 122. Cocurator of Crossing the Line, a transdisciplinary arts festival in New York City, he has also served as acting artistic director, associate artistic director, and resident dramaturg at the American Repertory Theater (A.R.T.) in Cambridge, Massachusetts, and as director of A.R.T.'s graduate program in dramaturgy at the A.R.T./Moscow Art Theater Institute for Advanced Theater Training at Harvard. He has worked with leading American and international artists, including Anne Bogart '74, Chen Shi-Zheng, Peter Sellars, Anna Deavere Smith, Robert Woodruff, and Anne Washburn. Translations for the stage include plays by Marivaux, Büchner, and Brecht; stage adaptations include Kafka's Amerika and Wim Wenders's Wings of Desire. At Bard, he is director of the undergraduate Theater and Performance Program and curator of the professional Fisher Center and SummerScape theater and dance offerings.


Do you ever read books about professional acting? You know, the ones full of advice on how to get an agent or what to look for in a headshot artist? If you're anything like me, you're downright addicted to them. Reading different people's perspectives on the business is like crack for me. Seriously.
And they're right, aren't they? I dunno about you, but the struggles of life as a "starving artist" have been drilled into my head by parents, teachers, and mentors alike since I first expressed interest in acting as a career.
So, assuming we're not here to become rich and famous, we have to ask ourselves a simple question at some point: Why the heck do I want to be an actor?
In theatre, someone hands us a script and says, "I have these words. These words need a voice to speak. They need a body to move. They need a heart to come to life." As actors, we have been gifted the unique ability to hear the human voice where there is nothing but ink and paper; To discover the physical presence of the human body in mere words; To allow them to infuse us with unbridled joy, bitter sadness, and the entire spectrum of human emotion. And then we get on stage and invite an audience to listen with us. To watch with us. To live with us. We say, "I have experienced something so beautiful, and I want to share it with you." That, to me, is absolute magic.
Notice, there's nothing in there about agents, networks, unions. That kind of stuff stuff isn't why I act, it's how I act. For me, there's a pretty important difference between the two. Lately I've been so caught up in the business side of acting that I've felt myself losing sight of the joy of acting itself.
So what's your point, Joe?
I recently auditioned for a role with Devil's Thumb Productions. They're doing a production of Dog Sees God: Confessions of a Teenage Blockhead, and I wound up booking the lead role, CB. Awesome, right?!
Here's the thing: Devil's Thumb is based in Boulder, Colorado. The role will require me to be out West from April 26th until the end of May. This would be the biggest role I'd have played since high school, and one that I would most definitely love to have on my resume. The character would be a delightful challenge fo me (and I'm a huge masochist when it comes to acting challenges). On top of that, It would give me a chance to spend some quality time in my hometown.
Naturally, with such a convincing list of "pros," I eagerly accepted the role.
I thought hard about the answers. After all, it's not a paying gig, so it's certainly not for the money. It's a non-union show, so there are no AEA points in it for me (not that going Equity is something I'm interested in at this point). It doesn't directly promote my brand in the Chicago market. So why do it?
Allow me to refer you back to that big, bold chunk of text above. That's why.
Yup, there's still a ton of work I need get to do in Chicago. And guess what! It'll still be here waiting for me in June!


8 Bedrooms property for sale in Saint-Lô - £203217 (Ref: AP2230271).
Spacious and versatile stone house which would lend itself to use as a B&B or for an extended family for sale in Normandy. This substantial stone house benefits from light and airy accommodation including downstairs bedroom and shower room and an annexe and a large well-stocked garden.
Kitchen/Breakfast Room 4.54 x 3.46m Glazed double doors and side panel and window to side elevation. Tiled floor. Range of matching base and wall units including display units. Tiled worktops and splash-backs. Sinks with mixer tap. 4 ring hob (3 gas and 1 electric) with extractor over. Built-in electric oven. Down-lighters. Vent. Radiator. Built-in fridge. Cupboard housing microwave.
Lounge 5.12 x 4.83m Radiator. Window and glazed door to front and rear elevations. Tiled floor. Fireplace with raised hearth and wood-burner.
Dining Room 5.15 x 2.84m Window to front and rear elevations. Tiled floor. Radiator.
Inner Hall Stairs to first floor. Window. Tiled floor.
En-Suite Bathroom 2.45 x 1.60m Partly tiled walls. Tiled floor. Bath with mixer tap/shower fitment. Pedestal basin. Radiator. Window to side elevation.
Cloakroom Tiled floor. WC. Vanity unit. Vent.
Lounge 5.87 x 5.00m Radiator. 2 windows to side elevation and glazed double doors to garden. Tiled floor.
Shower Room Window to side elevation. Partly tiled walls. Tiled floor. Pedestal basin. WC. Heated electric towel rail. Corner shower.
Bedroom 5.15 x 3.91m Window to 2 sides and glazed double doors to rear elevations. Tiled floor. Radiator.
Galleried Landing Laminate flooring. Hatch to loft. Radiator.
Bathroom Bath with tiled surround. Vanity unit with mirror and light over. Radiator.
Bedroom 3 5.35 x 4.94m Window to side elevation. Radiator.
Bathroom WC. Pedestal basin. Bath with mixer tap/shower fitment, screen and tiled surround. Radiator.
Bedroom 4 5.10 x 3.90m Window to side elevation. Radiator.
Bedroom 5 6.34 x 3.03m On two levels. 2 windows to front elevation. Radiator.
Landing 2 windows to rear elevation. Radiator. Sloping ceiling.
Bedroom 6 4.46 x 2.32m Sloping ceiling. Window to front elevation. Radiator. Hatch to loft.
Bedroom 7 6.30 x 3.80m Window to side and front elevations. Radiator. Hatch to loft.
Attached Garage 6.32 x 3.50m Sliding wooden door. Concrete floor. Power and light. Wall mounted boiler and hot water cylinder. Space and plumbing for washing machine.
Large gravel parking area. The garden is laid to lawn with mature hedges, shrubs, trees and flower borders. Rockery.
Terrace and gravel seating area. Decking seating area.
Large patio and seating area to the rear of the house.
Poly tunnel. Several wooden sheds and chicken run.
This property is situated between the major town of Saint-Lô in the Manche area of Normandy and Torigny-sur-Vire both of which have all amenities and within a 15 minute drive. The D-Day landing beaches are about 35 minutes away and the UNESCO heritage site of Mont-Saint-Michel is 1 hour away.
Mainline train services to Cherbourg and Paris run from Bayeux which is a 25 minute drive. The ferry ports at Caen Ouistreham and Cherbourg are both about an hour's drive.
This property listing (ref: MFH-NOR1036) is an advertisement supplied by My-French-House.com and does not constitute property particulars. While aplaceinthesun.com (APITS Ltd.) requests all advertisers supply correct details, it does not carry out checks on the information supplied and cannot be held responsible for any inaccuracies. Aplaceinthesun.com recommends seeking independent legal advice prior to any overseas property purchase.