--FIX depositos e impresiones en cortes

This commit is contained in:
2024-06-28 12:15:53 -07:00
parent 00529511cd
commit 5347e98235
3 changed files with 17 additions and 22 deletions

View File

@@ -3597,13 +3597,15 @@ Public Class ClsVentas
' Return Retorno ' Return Retorno
'End Function 'End Function
Public Function GetVta_MovimientosCajas(CveCorte As Integer, TipoMovimiento As Integer) As Boolean Public Function GetVta_MovimientosCajas(CveCorte As Integer, TipoMovimiento As Integer, Optional CveSubProyecto As Integer = -1, Optional FechaConsulta As Date = ModExtensiones.MaxFecha) As Boolean
Dim Retorno As Boolean = False Dim Retorno As Boolean = False
DataAdapter("PA_Vta_MovimientosCajasGet") DataAdapter("PA_Vta_MovimientosCajasGet")
With SqlAdapter.SelectCommand.Parameters With SqlAdapter.SelectCommand.Parameters
.Add("@CveCorte", SqlDbType.Int).Value = CveCorte .Add("@CveCorte", SqlDbType.Int).Value = CveCorte
.Add("@TipoMovimiento", SqlDbType.Int).Value = TipoMovimiento .Add("@TipoMovimiento", SqlDbType.Int).Value = TipoMovimiento
.Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto
.Add("@FechaConsulta", SqlDbType.Date).Value = FechaConsulta
End With End With
Try Try
@@ -3616,13 +3618,15 @@ Public Class ClsVentas
Return Retorno Return Retorno
End Function End Function
Public Function GetVta_MovimientosCajasReporte(CveCorte As Integer, TipoMovimiento As Integer) As Boolean Public Function GetVta_MovimientosCajasReporte(CveCorte As Integer, TipoMovimiento As Integer, Optional CveSubProyecto As Integer = -1, Optional FechaConsulta As Date = ModExtensiones.MaxFecha) As Boolean
Dim Retorno As Boolean = False Dim Retorno As Boolean = False
DataAdapter("PA_Vta_MovimientosCajasRepGet") DataAdapter("PA_Vta_MovimientosCajasRepGet")
With SqlAdapter.SelectCommand.Parameters With SqlAdapter.SelectCommand.Parameters
.Add("@CveCorte", SqlDbType.Int).Value = CveCorte .Add("@CveCorte", SqlDbType.Int).Value = CveCorte
.Add("@TipoMovimiento", SqlDbType.Int).Value = TipoMovimiento .Add("@TipoMovimiento", SqlDbType.Int).Value = TipoMovimiento
.Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto
.Add("@FechaConsulta", SqlDbType.Date).Value = FechaConsulta
End With End With
Try Try
@@ -3658,7 +3662,7 @@ Public Class ClsVentas
' Return Retorno ' Return Retorno
'End Function 'End Function
Public Function GetCortesDetalleDepositosCaja(CveCorte As Integer, CveSubProyecto As Integer, CveEmpresa As Integer) As Boolean Public Function GetCortesDetalleDepositosCaja(CveCorte As Integer, CveSubProyecto As Integer, CveEmpresa As Integer, Optional FechaConsulta As Date = ModExtensiones.MaxFecha) As Boolean
Dim Retorno As Boolean = False Dim Retorno As Boolean = False
DataAdapter("PA_Vta_CortesDetalleDepositosCajaGet") DataAdapter("PA_Vta_CortesDetalleDepositosCajaGet")
@@ -3667,6 +3671,7 @@ Public Class ClsVentas
.Add("@CveCorte", SqlDbType.Int).Value = CveCorte .Add("@CveCorte", SqlDbType.Int).Value = CveCorte
.Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
.Add("@FechaConsulta", SqlDbType.Date).Value = FechaConsulta
End With End With
Try Try

View File

@@ -253,12 +253,12 @@ Partial Class Bancos_RepCortes
End If End If
If CveCorte > 0 Then If CveCorte > 0 Then
If ObjVentas.GetVta_MovimientosCajasReporte(CveCorte, -1) Then If ObjVentas.GetVta_MovimientosCajasReporte(CveCorte, -1, CveSubProyecto:=DdlSubProyectos.SelectedValue.ToEntero(), FechaConsulta:=FechaConsulta) Then
GvIngresosRetiros.DataSource = ObjVentas.DtResultados.Copy() GvIngresosRetiros.DataSource = ObjVentas.DtResultados.Copy()
End If End If
End If End If
If Not UsuarioActual.CveEmpresa.Contiene(140, 141) AndAlso ObjVentas.GetCortesDetalleDepositosCaja(CveCorte, DdlSubProyectos.SelectedValue.ToEntero, UsuarioActual.CveEmpresa) Then If Not UsuarioActual.CveEmpresa.Contiene(140, 141) AndAlso ObjVentas.GetCortesDetalleDepositosCaja(CveCorte, DdlSubProyectos.SelectedValue.ToEntero(), UsuarioActual.CveEmpresa, FechaConsulta:=FechaConsulta) Then
GvDep.DataSource = ObjVentas.DtResultados GvDep.DataSource = ObjVentas.DtResultados
If ObjVentas.DtResultados.Rows.Count > 0 Then If ObjVentas.DtResultados.Rows.Count > 0 Then
DivDep.Visible = True DivDep.Visible = True

View File

@@ -1586,19 +1586,7 @@ Partial Class PopUpVerFactura
DtCortesVentasResumen = DsDatos.Tables(1) DtCortesVentasResumen = DsDatos.Tables(1)
End If End If
End If End If
' If ObjVenta.GetCortesDetalleVentasResumen(CveCorte, CveSubProyecto, UsuarioActual.CveEmpresa) Then
' DtCortesVentasResumen = ObjVenta.DtResultados.Copy()
'End If
'If ObjPuntoVenta.GetCortesDetalleVentas(CveCorte, CveSubProyecto, UsuarioActual.CveEmpresa, OpcionDetallado) Then
' DtCortesVentas = ObjPuntoVenta.DtResultados.Copy()
' 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 DtCortesVentas.Rows.Count > 0 Then If DtCortesVentas.Rows.Count > 0 Then
Dim RowInfo As DataRow = DtCortesVentas.FiltroPrimero("CveVenta > 0") Dim RowInfo As DataRow = DtCortesVentas.FiltroPrimero("CveVenta > 0")
@@ -1611,21 +1599,23 @@ Partial Class PopUpVerFactura
End If End If
If UsuarioActual.Empresa.Funcionalidad(109) = "1" OrElse UsuarioActual.CveEmpresa = 197 Then If UsuarioActual.Empresa.Funcionalidad(109) = "1" OrElse UsuarioActual.CveEmpresa = 197 Then
If ObjVenta.GetVta_ReporteCortes(UsuarioActual.CveEmpresa, FechaConsulta, FechaConsulta, CveSubProyecto, CveCorte:=CveCorte) Then If ConsultaPorSucursal Then
If ConsultaPorSucursal Then If ObjVenta.GetVta_ReporteCortes(UsuarioActual.CveEmpresa, FechaConsulta, FechaConsulta, CveSubProyecto) Then
DtReporteCorte = ObjVenta.DtResultados.FiltraParametros("FechaInicial IS NOT NULL") DtReporteCorte = ObjVenta.DtResultados.FiltraParametros("FechaInicial IS NOT NULL")
Fecha = FechaConsulta.ToString("dd/MM/yyyy") Fecha = FechaConsulta.ToString("dd/MM/yyyy")
Else End If
Else
If ObjVenta.GetVta_ReporteCortes(UsuarioActual.CveEmpresa, MinFecha, MaxFecha, CveSubProyecto, CveCorte:=CveCorte) Then
DtReporteCorte = ObjVenta.DtResultados.FiltraParametros("CveCorte > 0") DtReporteCorte = ObjVenta.DtResultados.FiltraParametros("CveCorte > 0")
Fecha = DtReporteCorte.FiltroPrimeroValor("FechaInicial", "") Fecha = DtReporteCorte.FiltroPrimeroValor("FechaInicial", "")
End If End If
End If End If
If ObjVenta.GetVta_MovimientosCajas(CveCorte, -1) Then If ObjVenta.GetVta_MovimientosCajas(CveCorte, -1, CveSubProyecto:=CveSubProyecto, FechaConsulta:=FechaConsulta) Then
DtIngresosRetiros = ObjVenta.DtResultados.Copy() DtIngresosRetiros = ObjVenta.DtResultados.Copy()
End If End If
If Not UsuarioActual.CveEmpresa.Contiene(140, 141) AndAlso ObjVenta.GetCortesDetalleDepositosCaja(CveCorte, CveSubProyecto, UsuarioActual.CveEmpresa) Then If Not UsuarioActual.CveEmpresa.Contiene(140, 141) AndAlso ObjVenta.GetCortesDetalleDepositosCaja(CveCorte, CveSubProyecto, UsuarioActual.CveEmpresa, FechaConsulta:=FechaConsulta) Then
DtDepositos = ObjVenta.DtResultados.Copy() DtDepositos = ObjVenta.DtResultados.Copy()
End If End If
End If End If