This commit is contained in:
JORGE LUIS CAUDILLO ESPARZA
2022-04-23 09:45:54 -07:00
5 changed files with 177 additions and 152 deletions

View File

@@ -33,7 +33,7 @@ Partial Class PopUpVerFactura
End Property
Public Property DtDetalle() As DataTable
Get
Return CType(ViewState("DtDetalle"), DataTable)
Return DirectCast(IfNull(ViewState("DtDetalle"), New DataTable, ViewState("DtDetalle")), DataTable)
End Get
Set(value As DataTable)
ViewState("DtDetalle") = value
@@ -834,7 +834,11 @@ Partial Class PopUpVerFactura
If UrlParametros("OP").ToString = "CORT" 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
@@ -980,25 +984,27 @@ Partial Class PopUpVerFactura
#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 ObjPuntoVenta As New ClsPuntoVenta
Dim DtCortesVentasResumen As DataTable = Nothing
Dim DtCortesVentas As DataTable = Nothing
Dim Fecha = "", Nombre = ""
If ObjVenta.GetCortesDetalleVentasResumen(CveCorte, UsuarioActual.CveEmpresa) Then
If ObjVenta.GetCortesDetalleVentasResumen(CveCorte, CveSubProyecto, UsuarioActual.CveEmpresa) Then
DtCortesVentasResumen = ObjVenta.DtResultados
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
' Nombre = RowInfo("Nombre").ToString
' End If
'End If
If ObjPuntoVenta.GetCortesDetalleVentas(CveCorte, CveSubProyecto, UsuarioActual.CveEmpresa) Then
DtCortesVentas = ObjPuntoVenta.DtResultados
If DtCortesVentas.Rows.Count > 0 Then
Dim RowInfo As DataRow = DtCortesVentas.FiltroPrimero("CveVenta > 0")
Fecha = RowInfo("FechaInicial").ToString
Nombre = RowInfo("Nombre").ToString
End If
End If
ObjVenta.Dispose()
ObjPuntoVenta.Dispose()
Dim FechaCorte As String = $"&emsp;<b>Fecha fin:</b> {Fecha}"