--Impresion en reporte de cortes
This commit is contained in:
@@ -1381,12 +1381,17 @@ Partial Class PopUpVerFactura
|
||||
|
||||
|
||||
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) OrElse UsuarioActual.Empresa.Funcionalidad(382) = "1" Then
|
||||
Dim CveSubProyecto As Integer = -1
|
||||
Dim FechaConsulta As Date = ModExtensiones.MaxFecha
|
||||
|
||||
If UrlParametros("CVESUBPROYECTO") IsNot Nothing Then
|
||||
CveSubProyecto = UrlParametros("CVESUBPROYECTO").ToString.ToEntero
|
||||
End If
|
||||
ImprimeCorte(UrlParametros("CVECORTE").ToString.ToEntero, UrlParametros("FORMATO").ToString, CveSubProyecto)
|
||||
If UrlParametros("FECHA") IsNot Nothing Then
|
||||
FechaConsulta = UrlParametros("FECHA").ToString.ToDate()
|
||||
End If
|
||||
ImprimeCorte(UrlParametros("CVECORTE").ToString.ToEntero, UrlParametros("FORMATO").ToString, CveSubProyecto, FechaConsulta)
|
||||
End If
|
||||
End If
|
||||
|
||||
@@ -1554,7 +1559,7 @@ Partial Class PopUpVerFactura
|
||||
|
||||
#Region "OP = CORT - IMPRIMIR CORTE"
|
||||
|
||||
Private Sub ImprimeCorte(CveCorte As Integer, Formato As String, Optional CveSubProyecto As Integer = -1)
|
||||
Private Sub ImprimeCorte(CveCorte As Integer, Formato As String, Optional CveSubProyecto As Integer = -1, Optional FechaConsulta As Date = ModExtensiones.MaxFecha)
|
||||
Dim DtCortesVentasResumen As DataTable = Nothing
|
||||
Dim DtCortesVentas As DataTable = Nothing
|
||||
Dim DtReporteCorte As DataTable = Nothing
|
||||
@@ -1565,9 +1570,15 @@ Partial Class PopUpVerFactura
|
||||
Dim OpcionDetallado As Integer = 1
|
||||
If UsuarioActual.Empresa.Funcionalidad(109) = "1" OrElse UsuarioActual.CveEmpresa = 197 Then OpcionDetallado = 2
|
||||
|
||||
Dim ConsultaPorSucursal As Boolean = UsuarioActual.Empresa.Funcionalidad(382) = "1"
|
||||
|
||||
If ConsultaPorSucursal Then
|
||||
CveCorte = -1
|
||||
End If
|
||||
|
||||
Dim ObjVenta As New ClsVentas
|
||||
|
||||
If ObjVenta.GetVta_ReporteCortesDetalle(CveCorte, CveSubProyecto, UsuarioActual.CveEmpresa, 2) Then
|
||||
If ObjVenta.GetVta_ReporteCortesDetalle(CveCorte, CveSubProyecto, UsuarioActual.CveEmpresa, 2, ConsultaIVA:=UsuarioActual.CveEmpresa.Contiene(190, 192), FechaConsulta:=FechaConsulta) Then
|
||||
Dim DsDatos = ObjVenta.DataSetResultados.Copy()
|
||||
If DsDatos IsNot Nothing Then
|
||||
DtCortesVentas = DsDatos.Tables(0)
|
||||
@@ -1600,9 +1611,14 @@ Partial Class PopUpVerFactura
|
||||
End If
|
||||
|
||||
If UsuarioActual.Empresa.Funcionalidad(109) = "1" OrElse UsuarioActual.CveEmpresa = 197 Then
|
||||
If ObjVenta.GetVta_ReporteCortes(UsuarioActual.CveEmpresa, MinFecha, MaxFecha, CveSubProyecto, CveCorte:=CveCorte) Then
|
||||
DtReporteCorte = ObjVenta.DtResultados.FiltraParametros("CveCorte > 0")
|
||||
Fecha = DtReporteCorte.FiltroPrimeroValor("FechaInicial", "")
|
||||
If ObjVenta.GetVta_ReporteCortes(UsuarioActual.CveEmpresa, FechaConsulta, FechaConsulta, CveSubProyecto, CveCorte:=CveCorte) Then
|
||||
If ConsultaPorSucursal Then
|
||||
DtReporteCorte = ObjVenta.DtResultados.FiltraParametros("FechaInicial IS NOT NULL")
|
||||
Fecha = FechaConsulta.ToString("dd/MM/yyyy")
|
||||
Else
|
||||
DtReporteCorte = ObjVenta.DtResultados.FiltraParametros("CveCorte > 0")
|
||||
Fecha = DtReporteCorte.FiltroPrimeroValor("FechaInicial", "")
|
||||
End If
|
||||
End If
|
||||
|
||||
If ObjVenta.GetVta_MovimientosCajas(CveCorte, -1) Then
|
||||
@@ -1618,6 +1634,10 @@ Partial Class PopUpVerFactura
|
||||
|
||||
|
||||
Dim FechaCorte As String = $" <b>Fecha fin</b> {Fecha}"
|
||||
If ConsultaPorSucursal Then
|
||||
FechaCorte = $" <b>Fecha: </b> {Fecha}"
|
||||
End If
|
||||
|
||||
Dim Usuario As String = $" <b>Usuario</b> {Nombre}"
|
||||
If DtCortesVentas.Rows.Count > 0 Or DtCortesVentasResumen.Rows.Count > 0 Then
|
||||
Dim lrds As New List(Of ReportDataSource)
|
||||
|
||||
Reference in New Issue
Block a user