diff --git a/App_Code/ClsContabilidad.vb b/App_Code/ClsContabilidad.vb index fc35b6ae2..fab021c49 100644 --- a/App_Code/ClsContabilidad.vb +++ b/App_Code/ClsContabilidad.vb @@ -2048,13 +2048,14 @@ Public Class ClsContabilidad Return Retorno End Function - Public Function GetPrePolizasDetalleResumen(CvePrePoliza As Integer, CveEmpresa As Integer) As Boolean 'Editado por charlie + Public Function GetPrePolizasDetalleResumen(CvePrePoliza As Integer, CveEmpresa As Integer, Optional Opcion As Integer = 1) As Boolean 'Editado por charlie Dim Retorno As Boolean = False DataAdapter("PA_Conta_PrePolizasDetalleResumenGet") With SqlAdapter.SelectCommand.Parameters .Add("@CvePrePoliza", SqlDbType.Int).Value = CvePrePoliza .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + .Add("@Opcion", SqlDbType.Int).Value = Opcion End With Try diff --git a/Bancos/IE.aspx b/Bancos/IE.aspx index 08241247b..d332bef65 100644 --- a/Bancos/IE.aspx +++ b/Bancos/IE.aspx @@ -1059,7 +1059,7 @@
-
+
<%----%> @@ -1071,8 +1071,10 @@ Agregar
--%> -
- + + +
+
diff --git a/Bin/GoCfdi.dll b/Bin/GoCfdi.dll index d7ecf5043..7dbd0787b 100644 Binary files a/Bin/GoCfdi.dll and b/Bin/GoCfdi.dll differ diff --git a/Contabilidad/RegPrePolizaS.aspx b/Contabilidad/RegPrePolizaS.aspx index e6c8b6d2f..d509d224e 100644 --- a/Contabilidad/RegPrePolizaS.aspx +++ b/Contabilidad/RegPrePolizaS.aspx @@ -81,18 +81,25 @@ Imprimir Poliza - - -
  • - - Agregar Concepto + Imprimir PDF Resumen
  • - Crear a partir de + Imprimir Excel Resumen
  • -
    -
    + + + + +
  • + + Agregar Concepto +
  • +
  • + Crear a partir de +
  • +
    +
    diff --git a/Contabilidad/RegPrePolizaS.aspx.vb b/Contabilidad/RegPrePolizaS.aspx.vb index caad8d6b4..1d39150e5 100644 --- a/Contabilidad/RegPrePolizaS.aspx.vb +++ b/Contabilidad/RegPrePolizaS.aspx.vb @@ -1,5 +1,6 @@  Imports System.Data +Imports System.Net.NetworkInformation Imports Extensiones Imports GemBox.Spreadsheet Imports Microsoft.Reporting.WebForms @@ -249,6 +250,12 @@ Partial Class ContabilidadC_RegPrePolizaS Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load If Not Page.IsPostBack Then + + If UsuarioActual.Empresa.Funcionalidad(282).ToEntero > 0 Then + LnkImprimePDFResumen.Visible = True + LnkImprimeExcelResumen.Visible = True + End If + Tick = DateTime.Now.Ticks.ToString CveMoneda = 1 @@ -360,6 +367,8 @@ Partial Class ContabilidadC_RegPrePolizaS GvMov.Columns(5).Visible = False End If + + End If End Sub @@ -2717,25 +2726,15 @@ Partial Class ContabilidadC_RegPrePolizaS ImprimirPolizaPDF(IdPoliza) End Sub Private Function ImprimirPolizaPDF(IdPoliza As Integer) As String - Dim ObjConta As New ClsContabilidad + 'Dim ObjPoliza As New ClsContPAQi(UsuarioActual.Empresa) Dim Archivo As New System.IO.FileInfo(String.Format("{0}Formatos/Polizas.rdlc", UsuarioActual.Empresa.Ruta)) Dim params As New List(Of ReportParameter) Dim Bytes As Byte() = Nothing - Dim ImpresionPersonalizada As Integer = UsuarioActual.Empresa.Funcionalidad(282).ToEntero - - - If ImpresionPersonalizada = 0 Then - - ElseIf ImpresionPersonalizada.Contiene(1, 2) Then - - - End If - - + Dim ObjConta As New ClsContabilidad 'If ObjPoliza.GetPoliza(IdPoliza, -1, -1, -1, -1) AndAlso ObjPoliza.DtResultados.Rows.Count > 0 Then If ObjConta.GetPrePolizasDetalle(CvePrePoliza, UsuarioActual.CveEmpresa) AndAlso ObjConta.DtResultados.Rows.Count > 0 Then Dim dtVC As DataTable @@ -2755,8 +2754,7 @@ Partial Class ContabilidadC_RegPrePolizaS End If - 'params.Add(New ReportParameter("Nombre", dr("Cuenta").ToString)) - 'params.Add(New ReportParameter("Cuenta", dr("Codigo").ToString)) + params.Add(New ReportParameter("Numero", dr("FolioPoliza").ToString)) params.Add(New ReportParameter("Moneda", "")) params.Add(New ReportParameter("CodigoPostal", "")) @@ -2777,12 +2775,22 @@ Partial Class ContabilidadC_RegPrePolizaS End If + + + + + + + Return String.Format("{0}\{1}\{2}.pdf", AppDomain.CurrentDomain.BaseDirectory, Tick, IdPoliza.ToString) ObjConta.Dispose() End Function + + + #End Region #Region "Crear A Partier de" @@ -3211,5 +3219,78 @@ Partial Class ContabilidadC_RegPrePolizaS Private Sub TxtAbonoE_TextChanged(sender As Object, e As EventArgs) Handles TxtAbonoE.TextChanged If TxtAbonoE.Text.ToDecimal <> 0 Then CargaModalConceptoTipoTransaccion("Egs") End Sub + + + Private Sub ImprimePrePolizasDetalleResumen(Optional Tipo As String = "PDF") + + Dim Archivo As System.IO.FileInfo + Dim params As New List(Of ReportParameter) + Dim Bytes As Byte() = Nothing + + Dim ImpresionPersonalizada As Integer = UsuarioActual.Empresa.Funcionalidad(282).ToEntero + + + Archivo = New System.IO.FileInfo(String.Format("{0}Formatos/PolizasResumen.rdlc", UsuarioActual.Empresa.Ruta)) + Dim Logo As New System.IO.FileInfo(String.Format("{0}Logo.png", UsuarioActual.Empresa.Ruta)) + + + + + Dim ObjConta As New ClsContabilidad + 'If ObjPoliza.GetPoliza(IdPoliza, -1, -1, -1, -1) AndAlso ObjPoliza.DtResultados.Rows.Count > 0 Then + If ObjConta.GetPrePolizasDetalleResumen(CvePrePoliza, UsuarioActual.CveEmpresa, ImpresionPersonalizada) AndAlso ObjConta.DtResultados.Rows.Count > 0 Then + Dim dtVC As DataTable + Dim dr As DataRow + + dtVC = ObjConta.DtResultados '.FiltraParametros("Contabilizable = 1", "Orden") + dr = dtVC.Rows(0) + + params.Add(New ReportParameter("Empresa", UsuarioActual.Empresa.Empresa)) + params.Add(New ReportParameter("TipoPoliza", DdlTipoPoliza.SelectedItem.Text)) + params.Add(New ReportParameter("Finicio", TxtFechaDocumento.Text)) + params.Add(New ReportParameter("FFin", TxtFechaDocumento.Text)) + + params.Add(New ReportParameter("Fecha", TxtFechaDocumento.Text)) + + params.Add(New ReportParameter("Numero", TxtFolio.Text)) + params.Add(New ReportParameter("Moneda", If(CveMoneda = 2, "Dolar", "Peso Mexicano"))) + params.Add(New ReportParameter("CodigoPostal", "")) + + params.Add(New ReportParameter("UsuarioRegistro", TxtUsuarioElaboro.Text)) + + + If Logo.Exists Then + params.Add(New ReportParameter("pImg", $"file://{Logo.FullName}")) + Else + params.Add(New ReportParameter("pImg", "")) + End If + + + + + Dim RutaReprote As String + If Archivo.Exists Then + RutaReprote = Archivo.FullName + Else + RutaReprote = $"{DirectorioEmpresas}Grales\Formatos\PolizasResumen.rdlc" + End If + + ImprimirbytesPDF(StreamPDF(RutaReprote, dtVC, params, "PrePoliza", Formato:=Tipo), "PrePoliza", Formato:=Tipo, Descarga:=True) + + End If + ObjConta.Dispose() + + End Sub + + + Protected Sub LnkImprimePDFResumen_Click(sender As Object, e As EventArgs) + ImprimePrePolizasDetalleResumen("PDF") + End Sub + + Protected Sub LnkImprimeExcelResumen_Click(sender As Object, e As EventArgs) + ImprimePrePolizasDetalleResumen("Excel") + End Sub + + End Class