diff --git a/Contabilidad/LibroDiario.aspx.vb b/Contabilidad/LibroDiario.aspx.vb index d3507a095..fd61a89cf 100644 --- a/Contabilidad/LibroDiario.aspx.vb +++ b/Contabilidad/LibroDiario.aspx.vb @@ -51,11 +51,12 @@ Partial Class Contabilidad_LibroDiario InicializaValores() - If UsuarioActual.Empresa.UsaAC Then - BtnConsultar.Enabled = True - Else - Alert("La empresa no usa Armonización Contable", TipoMensaje.MsgError) - End If + BtnConsultar.Enabled = True + 'If UsuarioActual.Empresa.UsaAC Then + ' BtnConsultar.Enabled = True + 'Else + ' Alert("La empresa no usa Armonización Contable", TipoMensaje.MsgError) + 'End If End If End Sub @@ -212,7 +213,6 @@ Partial Class Contabilidad_LibroDiario #Region " IMPRIMIR " -#End Region Protected Sub Imprimir_click(sender As Object, e As EventArgs) Handles Imprimir.Click 'FechaInicio = If(TxtFechaDel.Text = "" Or TxtFechaDel.Text = "__/__/____", Date.Now, TxtFechaDel.Text.ToDate) 'FechaFin = If(TxtFechaAl.Text = "" Or TxtFechaAl.Text = "__/__/____", Date.Now, TxtFechaAl.Text.ToDate) @@ -245,5 +245,6 @@ Partial Class Contabilidad_LibroDiario ImprimirbytesPDF(ImprimirPDFCrystal(Server.MapPath("~/Empresas/Grales/Formatos/LibroDiario.rpt"), DtDatos, lista, "LibroDiario", Formato), "LibroDiario", Formato) End Sub +#End Region End Class diff --git a/Contabilidad2/RepLibroDiario.aspx b/Contabilidad2/RepLibroDiario.aspx index 4224c2fa5..33fb505ac 100644 --- a/Contabilidad2/RepLibroDiario.aspx +++ b/Contabilidad2/RepLibroDiario.aspx @@ -83,8 +83,8 @@ - - + + diff --git a/Contabilidad2/RepLibroDiario.aspx.vb b/Contabilidad2/RepLibroDiario.aspx.vb index 3f01252dc..5eb60c12e 100644 --- a/Contabilidad2/RepLibroDiario.aspx.vb +++ b/Contabilidad2/RepLibroDiario.aspx.vb @@ -90,20 +90,19 @@ Partial Class Contabilidad2_RepLibroDiario Protected Sub GvDatos_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvDatos.RowDataBound If e.Row.RowType = DataControlRowType.DataRow Then - - ''CABECERA - 'If e.Row.DBCampo("TipoRenglon").ToString.ToEntero = 1 Then - ' e.Row.Font.Bold = True - ' e.Row.Cells(4).Text = "" - ' e.Row.Cells(5).Text = "" - ' e.Row.Cells(6).Text = "" - ' e.Row.Cells(7).Text = "" - ' e.Row.Cells(8).Text = "" - ' e.Row.CssClass = "SubTotales" ' - 'End If + 'CABECERA + If e.Row.DBCampo("TipoRenglon").ToString.ToEntero = 1 Then + e.Row.Font.Bold = True + e.Row.Cells(4).Text = "" + e.Row.Cells(5).Text = "" + e.Row.Cells(6).Text = "" + e.Row.Cells(7).Text = "" + e.Row.Cells(8).Text = "" + e.Row.CssClass = "SubTotales" ' + End If 'DETALLE - If e.Row.DBCampo("Codigo") <> "" Then + If e.Row.DBCampo("TipoRenglon").ToString.ToEntero = 2 Then e.Row.Cells(0).Text = "" e.Row.Cells(1).Text = "" e.Row.Cells(2).Text = "" @@ -111,7 +110,7 @@ Partial Class Contabilidad2_RepLibroDiario End If 'SUBTOTAL - If e.Row.DBCampo("Codigo") = "" Then + If e.Row.DBCampo("TipoRenglon").ToString.ToEntero = 3 Then e.Row.Font.Bold = True e.Row.Cells(0).Text = "" e.Row.Cells(1).Text = "" @@ -141,4 +140,39 @@ Partial Class Contabilidad2_RepLibroDiario End If End Sub +#Region " IMPRIMIR " + + Protected Sub Imprimir_click(sender As Object, e As EventArgs) Handles Imprimir.Click + 'FechaInicio = If(TxtFechaDel.Text = "" Or TxtFechaDel.Text = "__/__/____", Date.Now, TxtFechaDel.Text.ToDate) + 'FechaFin = If(TxtFechaAl.Text = "" Or TxtFechaAl.Text = "__/__/____", Date.Now, TxtFechaAl.Text.ToDate) + 'DtDatos = DtDatos + ImprimirReporte() + End Sub + + Protected Sub ImgExcel_Click(sender As Object, e As EventArgs) Handles ImgExcel.Click + 'FechaInicio = If(TxtFechaDel.Text = "" Or TxtFechaDel.Text = "__/__/____", Date.Now, TxtFechaDel.Text.ToDate) + 'FechaFin = If(TxtFechaAl.Text = "" Or TxtFechaAl.Text = "__/__/____", Date.Now, TxtFechaAl.Text.ToDate) + 'DtDatos = DtDatos + ImprimirReporte("EXCEL") + End Sub + + Private Sub ImprimirReporte(Optional Formato As String = "PDF") + Dim Imagen As New System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta)) + Dim logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa) + + Dim lista = New List(Of CrystalParametro) + lista.Add(New CrystalParametro("Empresa", UsuarioActual.Empresa.Empresa)) + lista.Add(New CrystalParametro("FechaInicio", FechaInicio.ToString("dd/MM/yyyy"))) + lista.Add(New CrystalParametro("FechaFin", FechaFin.ToString("dd/MM/yyyy"))) + lista.Add(New CrystalParametro("UsuarioImprimio", UsuarioActual.Nombre)) + + If Imagen.Exists Then + lista.Add(New CrystalParametro("LogoPath", logouri)) + Else + lista.Add(New CrystalParametro("LogoPath", "")) + End If + + ImprimirbytesPDF(ImprimirPDFCrystal(Server.MapPath("~/Empresas/Grales/Formatos/LibroDiario.rpt"), DtDatos, lista, "LibroDiario", Formato), "LibroDiario", Formato) + End Sub +#End Region End Class