From 5347e982353a3e06940785087ebf5b712ae899e9 Mon Sep 17 00:00:00 2001 From: Jonathan Alexis Perez Morales Date: Fri, 28 Jun 2024 12:15:53 -0700 Subject: [PATCH] --FIX depositos e impresiones en cortes --- App_Code/ClsVentas.vb | 11 ++++++++--- Bancos/RepCortes.aspx.vb | 4 ++-- Compras/PopUpVerFactura.aspx.vb | 24 +++++++----------------- 3 files changed, 17 insertions(+), 22 deletions(-) diff --git a/App_Code/ClsVentas.vb b/App_Code/ClsVentas.vb index 23f442f65..b3b8a15d1 100644 --- a/App_Code/ClsVentas.vb +++ b/App_Code/ClsVentas.vb @@ -3597,13 +3597,15 @@ Public Class ClsVentas ' Return Retorno '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 DataAdapter("PA_Vta_MovimientosCajasGet") With SqlAdapter.SelectCommand.Parameters .Add("@CveCorte", SqlDbType.Int).Value = CveCorte .Add("@TipoMovimiento", SqlDbType.Int).Value = TipoMovimiento + .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto + .Add("@FechaConsulta", SqlDbType.Date).Value = FechaConsulta End With Try @@ -3616,13 +3618,15 @@ Public Class ClsVentas Return Retorno 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 DataAdapter("PA_Vta_MovimientosCajasRepGet") With SqlAdapter.SelectCommand.Parameters .Add("@CveCorte", SqlDbType.Int).Value = CveCorte .Add("@TipoMovimiento", SqlDbType.Int).Value = TipoMovimiento + .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto + .Add("@FechaConsulta", SqlDbType.Date).Value = FechaConsulta End With Try @@ -3658,7 +3662,7 @@ Public Class ClsVentas ' Return Retorno '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 DataAdapter("PA_Vta_CortesDetalleDepositosCajaGet") @@ -3667,6 +3671,7 @@ Public Class ClsVentas .Add("@CveCorte", SqlDbType.Int).Value = CveCorte .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + .Add("@FechaConsulta", SqlDbType.Date).Value = FechaConsulta End With Try diff --git a/Bancos/RepCortes.aspx.vb b/Bancos/RepCortes.aspx.vb index b387fecd9..86d87a132 100644 --- a/Bancos/RepCortes.aspx.vb +++ b/Bancos/RepCortes.aspx.vb @@ -253,12 +253,12 @@ Partial Class Bancos_RepCortes End If 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() 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 If ObjVentas.DtResultados.Rows.Count > 0 Then DivDep.Visible = True diff --git a/Compras/PopUpVerFactura.aspx.vb b/Compras/PopUpVerFactura.aspx.vb index ba0dfeefc..691ebe226 100644 --- a/Compras/PopUpVerFactura.aspx.vb +++ b/Compras/PopUpVerFactura.aspx.vb @@ -1586,19 +1586,7 @@ Partial Class PopUpVerFactura DtCortesVentasResumen = DsDatos.Tables(1) 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 Dim RowInfo As DataRow = DtCortesVentas.FiltroPrimero("CveVenta > 0") @@ -1611,21 +1599,23 @@ Partial Class PopUpVerFactura End If 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") 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") Fecha = DtReporteCorte.FiltroPrimeroValor("FechaInicial", "") 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() 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() End If End If