diff --git a/App_Code/ClsMovimientos.vb b/App_Code/ClsMovimientos.vb index c096aa61b..e187c77a7 100644 --- a/App_Code/ClsMovimientos.vb +++ b/App_Code/ClsMovimientos.vb @@ -1911,14 +1911,15 @@ Public Class ClsMovimientos Return Retorno End Function - Public Function GetRemisionesCobranza(CveEmpresa As Integer, CveSubProyecto As Integer, FechaInicio As Date, FechaFin As Date) As Boolean + Public Function GetRemisionesCobranza(CveEmpresa As Integer, CveSubProyecto As Integer, FechaInicio As Date, FechaFin As Date, CveUsuario As Integer) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Vta_RemisionesCobranza") With SqlAdapter.SelectCommand.Parameters .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto .Add("@FechaInicio", SqlDbType.Date).Value = FechaInicio - .Add("@FechaFin", SqlDbType.Date).Value = FechaFin + .Add("@FechaFin", SqlDbType.Date).Value = FechaFin + .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario End With Try SqlAdapter.Fill(Data) diff --git a/Bancos/DepositosCaja.aspx.vb b/Bancos/DepositosCaja.aspx.vb index d0ab743c1..a564399a9 100644 --- a/Bancos/DepositosCaja.aspx.vb +++ b/Bancos/DepositosCaja.aspx.vb @@ -511,7 +511,7 @@ Partial Class Bancos_DepositosCaja FechaI = If(IsDate(txtFechaI.Text.Trim()), txtFechaI.Text.Trim().ToDate, MinFecha) FechaF = If(IsDate(txtFechaF.Text.Trim()), txtFechaF.Text.Trim().ToDate, MaxFecha).AddDays(1) - If ObjMovtos.GetRemisionesCobranza(UsuarioActual.CveEmpresa, DdlSubProyectos.SelectedValue.ToEntero, FechaI, FechaF) Then + If ObjMovtos.GetRemisionesCobranza(UsuarioActual.CveEmpresa, DdlSubProyectos.SelectedValue.ToEntero, FechaI, FechaF, UsuarioActual.CveUsuario) Then Dim dtt As DataTable = ObjMovtos.DtResultados.FiltraParametros($"CveVenta > 0 AND (CveUsuarioCobranza IS NULL OR CveUsuarioCobranza = {UsuarioActual.CveUsuario}) AND TipoDocto IN ('Ing','Rem') AND RemisionEspecial = 0") 'Dim Dtta As DataTable = dtt.FiltraParametros($"CveUsuarioCobranza = {UsuarioActual.CveUsuario} ") 'If Dtta IsNot Nothing AndAlso Dtta.Rows.Count > 0 Then dtt = Dtta diff --git a/Ventas/PVCobranza.aspx.vb b/Ventas/PVCobranza.aspx.vb index f44faf8d6..c1ca7bf15 100644 --- a/Ventas/PVCobranza.aspx.vb +++ b/Ventas/PVCobranza.aspx.vb @@ -101,6 +101,8 @@ Partial Class Ventas_PVCobranza CargaFiltros() CargaDdlPagos() + If UsuarioActual.CveSubProyecto > 0 Then DdlSubProyecto.SelectedValueExist(UsuarioActual.CveSubProyecto) + If UsuarioActual.TienePermisoProceso(371) Then CargaCorteCaja() End If @@ -292,7 +294,7 @@ Partial Class Ventas_PVCobranza Dim FechaI, FechaF As Date FechaI = If(IsDate(txtFechaI.Text.Trim()), txtFechaI.Text.Trim().ToDate, MinFecha) FechaF = If(IsDate(txtFechaF.Text.Trim()), txtFechaF.Text.Trim().ToDate, MaxFecha).AddDays(1) - If ObjMovtos.GetRemisionesCobranza(UsuarioActual.CveEmpresa, DdlSubProyecto.SelectedValue.ToEntero, FechaI, FechaF) Then + If ObjMovtos.GetRemisionesCobranza(UsuarioActual.CveEmpresa, DdlSubProyecto.SelectedValue.ToEntero, FechaI, FechaF, UsuarioActual.CveUsuario) Then Dim dtt As DataTable = ObjMovtos.DtResultados.FiltraParametros($"CveVenta > 0 AND (CveUsuarioCobranza IS NULL OR CveUsuarioCobranza = {UsuarioActual.CveUsuario})") 'si hay ya asignado, solo la mostrarĂ¡ @@ -1233,7 +1235,7 @@ Partial Class Ventas_PVCobranza FechaI = If(IsDate(txtFechaI.Text.Trim()), txtFechaI.Text.Trim().ToDate, MinFecha) FechaF = If(IsDate(txtFechaF.Text.Trim()), txtFechaF.Text.Trim().ToDate, MaxFecha).AddDays(1) - If ObjMovtos.GetRemisionesCobranza(UsuarioActual.CveEmpresa, DdlSubProyecto.SelectedValue.ToEntero(), FechaI, FechaF) Then + If ObjMovtos.GetRemisionesCobranza(UsuarioActual.CveEmpresa, DdlSubProyecto.SelectedValue.ToEntero(), FechaI, FechaF, UsuarioActual.CveUsuario) Then Dim dtt As DataTable = ObjMovtos.DtResultados.FiltraParametros($"CveVenta > 0 AND (CveUsuarioCobranza IS NULL OR CveUsuarioCobranza = {UsuarioActual.CveUsuario}) AND TipoDocto IN ('Ing','Rem') AND RemisionEspecial = 0") 'Dim Dtta As DataTable = dtt.FiltraParametros($"CveUsuarioCobranza = {UsuarioActual.CveUsuario} ") 'If Dtta IsNot Nothing AndAlso Dtta.Rows.Count > 0 Then dtt = Dtta @@ -1614,7 +1616,7 @@ Partial Class Ventas_PVCobranza FechaI = If(IsDate(txtFechaI.Text.Trim()), txtFechaI.Text.Trim().ToDate, MinFecha) FechaF = If(IsDate(txtFechaF.Text.Trim()), txtFechaF.Text.Trim().ToDate, MaxFecha).AddDays(1) - If ObjMovtos.GetRemisionesCobranza(UsuarioActual.CveEmpresa, DdlSubProyecto.SelectedValue.ToEntero, FechaI, FechaF) Then + If ObjMovtos.GetRemisionesCobranza(UsuarioActual.CveEmpresa, DdlSubProyecto.SelectedValue.ToEntero, FechaI, FechaF, UsuarioActual.CveUsuario) Then Dim dtt As DataTable = ObjMovtos.DtResultados.FiltraParametros($"CveVenta > 0 AND CveUsuarioCobranza > 0 ") GvModalCobrosEnTranscurso.DataSource = dtt