Mandar subproyecto al imprimir formato de corte

This commit is contained in:
2022-04-21 21:06:48 -07:00
parent 9c15bb4fa1
commit 52d30468c7
2 changed files with 29 additions and 23 deletions

View File

@@ -163,8 +163,8 @@ Partial Class Bancos_RepCortes
If DtCortesVentasResumen.Rows.Count > 0 Or DtCortesVentas.Rows.Count > 0 Then If DtCortesVentasResumen.Rows.Count > 0 Or DtCortesVentas.Rows.Count > 0 Then
HplDownPDF.Visible = True HplDownPDF.Visible = True
HplDownEXCEL.Visible = True HplDownEXCEL.Visible = True
HplDownPDF.NavigateUrl = String.Format("/Compras/PopUpVerFactura.aspx?P={0}", Encripta(String.Format("OP=CORT&CVECORTE={0}&FORMATO={1}", CveCorte, "PDF"))) HplDownPDF.NavigateUrl = String.Format("/Compras/PopUpVerFactura.aspx?P={0}", Encripta(String.Format("OP=CORT&CVECORTE={0}&FORMATO={1}&CVESUBPROYECTO={2}", CveCorte, "PDF", DdlSubProyectos.SelectedValue.ToEntero)))
HplDownEXCEL.NavigateUrl = String.Format("/Compras/PopUpVerFactura.aspx?P={0}", Encripta(String.Format("OP=CORT&CVECORTE={0}&FORMATO={1}", CveCorte, "EXCEL"))) HplDownEXCEL.NavigateUrl = String.Format("/Compras/PopUpVerFactura.aspx?P={0}", Encripta(String.Format("OP=CORT&CVECORTE={0}&FORMATO={1}&CVESUBPROYECTO={2}", CveCorte, "EXCEL", DdlSubProyectos.SelectedValue.ToEntero)))
Else Else
HplDownPDF.Visible = False HplDownPDF.Visible = False
HplDownEXCEL.Visible = False HplDownEXCEL.Visible = False

View File

@@ -33,7 +33,7 @@ Partial Class PopUpVerFactura
End Property End Property
Public Property DtDetalle() As DataTable Public Property DtDetalle() As DataTable
Get Get
Return CType(ViewState("DtDetalle"), DataTable) Return DirectCast(IfNull(ViewState("DtDetalle"), New DataTable, ViewState("DtDetalle")), DataTable)
End Get End Get
Set(value As DataTable) Set(value As DataTable)
ViewState("DtDetalle") = value ViewState("DtDetalle") = value
@@ -683,7 +683,11 @@ Partial Class PopUpVerFactura
If UrlParametros("OP").ToString = "CORT" Then If UrlParametros("OP").ToString = "CORT" Then
If UrlParametros("CVECORTE") IsNot Nothing AndAlso UrlParametros("CVECORTE").ToString.ToEntero > 0 Then If UrlParametros("CVECORTE") IsNot Nothing AndAlso UrlParametros("CVECORTE").ToString.ToEntero > 0 Then
ImprimeCorte(UrlParametros("CVECORTE").ToString.ToEntero, UrlParametros("FORMATO").ToString) Dim CveSubProyecto As Integer = -1
If UrlParametros("CVESUBPROYECTO") IsNot Nothing Then
CveSubProyecto = UrlParametros("CVESUBPROYECTO").ToString.ToEntero
End If
ImprimeCorte(UrlParametros("CVECORTE").ToString.ToEntero, UrlParametros("FORMATO").ToString, CveSubProyecto)
End If End If
End If End If
@@ -829,25 +833,27 @@ Partial Class PopUpVerFactura
#Region "OP = CORT - IMPRIMIR CORTE" #Region "OP = CORT - IMPRIMIR CORTE"
Private Sub ImprimeCorte(CveCorte As Integer, Formato As String) Private Sub ImprimeCorte(CveCorte As Integer, Formato As String, Optional CveSubProyecto As Integer = -1)
Dim ObjVenta As New ClsVentas Dim ObjVenta As New ClsVentas
Dim ObjPuntoVenta As New ClsPuntoVenta Dim ObjPuntoVenta As New ClsPuntoVenta
Dim DtCortesVentasResumen As DataTable = Nothing Dim DtCortesVentasResumen As DataTable = Nothing
Dim DtCortesVentas As DataTable = Nothing Dim DtCortesVentas As DataTable = Nothing
Dim Fecha = "", Nombre = "" Dim Fecha = "", Nombre = ""
If ObjVenta.GetCortesDetalleVentasResumen(CveCorte, UsuarioActual.CveEmpresa) Then If ObjVenta.GetCortesDetalleVentasResumen(CveCorte, CveSubProyecto, UsuarioActual.CveEmpresa) Then
DtCortesVentasResumen = ObjVenta.DtResultados DtCortesVentasResumen = ObjVenta.DtResultados
End If End If
'If ObjPuntoVenta.GetCortesDetalleVentas(CveCorte, UsuarioActual.CveEmpresa) Then
' DtCortesVentas = ObjPuntoVenta.DtResultados
' If DtCortesVentas.Rows.Count > 0 Then
' Dim RowInfo As DataRow = DtCortesVentas.FiltroPrimero("CveVenta > 0")
' Fecha = RowInfo("FechaInicial").ToString If ObjPuntoVenta.GetCortesDetalleVentas(CveCorte, CveSubProyecto, UsuarioActual.CveEmpresa) Then
' Nombre = RowInfo("Nombre").ToString DtCortesVentas = ObjPuntoVenta.DtResultados
' End If If DtCortesVentas.Rows.Count > 0 Then
'End If Dim RowInfo As DataRow = DtCortesVentas.FiltroPrimero("CveVenta > 0")
Fecha = RowInfo("FechaInicial").ToString
Nombre = RowInfo("Nombre").ToString
End If
End If
ObjVenta.Dispose() ObjVenta.Dispose()
ObjPuntoVenta.Dispose() ObjPuntoVenta.Dispose()
Dim FechaCorte As String = $"&emsp;<b>Fecha fin:</b> {Fecha}" Dim FechaCorte As String = $"&emsp;<b>Fecha fin:</b> {Fecha}"