diff --git a/Compras/Proveedores.aspx.vb b/Compras/Proveedores.aspx.vb index 25346b21c..09f67a4e8 100644 --- a/Compras/Proveedores.aspx.vb +++ b/Compras/Proveedores.aspx.vb @@ -1457,7 +1457,8 @@ Partial Class Compras_Proveedores #Region "LL E N A R - C O M B O S" Private Sub CargaResponsable() - DdlCveUsuarioResponsable.DataSource = GlobalDTUsuarioResponsable.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa) + 'DdlCveUsuarioResponsable.DataSource = GlobalDTUsuarioResponsable.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa, DistinctColumns:={"CveUsuario", "Nombre"}) + DdlCveUsuarioResponsable.DataSource = GlobalDTUsuarios(-1, UsuarioActual.CveEmpresa).FiltraParametros("", DistinctColumns:={"CveUsuario", "Nombre"}) DdlCveUsuarioResponsable.DataBind() End Sub Private Sub CargaClasificacionProveedor() diff --git a/Inventarios/ResguardoMaterial.aspx.vb b/Inventarios/ResguardoMaterial.aspx.vb index ee8ee8694..42f088a0d 100644 --- a/Inventarios/ResguardoMaterial.aspx.vb +++ b/Inventarios/ResguardoMaterial.aspx.vb @@ -377,6 +377,11 @@ Partial Class Inventarios_ResguardoMaterial 'End If 'dtt.Dispose() End If + Else + ThSeccion.Visible = False + TrSeccion.Visible = False + DdlSeccionAlmacen.Items.Clear() + End If 'activa lote If CBool(drp("AplicaLote")) Then @@ -453,11 +458,11 @@ Partial Class Inventarios_ResguardoMaterial Dim Valido As Boolean = True Dim cantidadd As Double = txtCantidad.Text.ToDouble Dim Existencia As Double = GetExistencias(PSSelected, DdlUnidad.SelectedValue.ToEntero, UsuarioActual.CveEmpresa, DdlAlmacen.SelectedValue.ToEntero, If(TxtnSerie.Visible, TxtnSerie.Text, "-1").ToString) - If Existencia - txtCantidad.Text.ToDouble < 0 Then + If Existencia - txtCantidad.Text.ToDouble - DtMovimientos.SUM("Cantidad", $"CvePS = {PSSelected} ") < 0 Then If Existencia <= 0 Then Alert("No hay existencia del producto", TipoMensaje.MsgAdvertencia) Else - Alert(String.Format("Solo hay en existencia: {0}", Existencia), TipoMensaje.MsgAdvertencia) + Alert(String.Format("Solo hay en existencia: {0}", Existencia - DtMovimientos.SUM("Cantidad", $"CvePS = {PSSelected} ")), TipoMensaje.MsgAdvertencia) If Not UsuarioActual.TienePermisoProceso(114) Then cantidadd = Existencia End If @@ -496,6 +501,22 @@ Partial Class Inventarios_ResguardoMaterial DdlClasificacion.SelectedValue = "-1" txtCantidad.Text = "" TxtObservacionesdetalle.Text = "" + + ThCaducidad.Visible = False + TrCaducidad.Visible = False + TxtCaducidad.Text = "" + ThLote.Visible = False + TrLote.Visible = False + TxtLote.Text = "" + ThSerie.Visible = False + TrSerie.Visible = False + TxtnSerie.Visible = False + TxtnSerie.Text = "" + + ThSeccion.Visible = False + TrSeccion.Visible = False + DdlSeccionAlmacen.Items.Clear() + End Sub #End Region diff --git a/Inventarios/TrasladoSolicitud.aspx.vb b/Inventarios/TrasladoSolicitud.aspx.vb index ae6200ef3..ef5af71e2 100644 --- a/Inventarios/TrasladoSolicitud.aspx.vb +++ b/Inventarios/TrasladoSolicitud.aspx.vb @@ -382,8 +382,8 @@ Partial Class Inventarios_TrasladoSolicitud UpDatos.Update() RegistraScript(String.Format("$('#{0}').modal();", "ModalPS")) End Sub - Private Sub BtnAgregarPS_Click(sender As Object, e As EventArgs) Handles BtnAgregarPS.Click - Dim Existencia As Boolean + Private Sub BtnAgregarPS_Click(sender As Object, e As EventArgs) Handles BtnAgregarPS.Click + If Not DdlProductoServicio.SelectedValue.ToEntero > 0 Then Alert("Tiene que seleccionar un producto.", TipoMensaje.MsgAdvertencia) Exit Sub @@ -419,8 +419,8 @@ Partial Class Inventarios_TrasladoSolicitud End Sub Private Function AddPSTemporal() As Boolean Dim Row As DataRow = TempDT.NewRow() - Dim Lote As String - Dim FechaCaducidad As Date + Dim Lote As String = "-1" + Dim FechaCaducidad As Date = MinFecha Row("Cantidad") = TxtCantidad.Text.Trim.ToDouble Row("CvePS") = DdlProductoServicio.SelectedValue.ToEntero Row("CodigoPS") = DdlProductoServicio.SelectedText @@ -465,7 +465,7 @@ Partial Class Inventarios_TrasladoSolicitud If Existencia = 0 Then Alert("No hay existencia del producto", TipoMensaje.MsgAdvertencia) Else - Alert($"No hay existencia suficiente del producto. Solo hay en existencia: {Existencia}", TipoMensaje.MsgAdvertencia) + Alert($"No hay existencia suficiente del producto. Solo hay en existencia: {Existencia - TempDT.SUM("Cantidad", $"CvePS = {DdlProductoServicio.SelectedValue.ToEntero} AND CveUM = {DdlUM.SelectedValue.ToEntero}")}", TipoMensaje.MsgAdvertencia) End If Return False End If @@ -580,8 +580,10 @@ Partial Class Inventarios_TrasladoSolicitud RowTemp("CveUM") = row.DataKey("CveUM").ToEntero RowTemp("UnidadMedida") = row.DataKey("UM") RowTemp("Observaciones") = "" - 'RowTemp("CveDireccionEnvio") = DdlDireccionEnvio.SelectedValue - 'RowTemp("DireccionEnvio") = IIf(DdlDireccionEnvio.SelectedValue = "-1", "", DdlDireccionEnvio.SelectedItem) + RowTemp("Lote") = "-1" + RowTemp("FechaCaducidad") = MinFecha + 'RowTemp("CveDireccionEnvio") = DdlDireccionEnvio.SelectedValue + 'RowTemp("DireccionEnvio") = IIf(DdlDireccionEnvio.SelectedValue = "-1", "", DdlDireccionEnvio.SelectedItem) RowTemp("CveContratoDetalle") = row.DataKey("CveContratoDetalle") CodigoPS = RowTemp("CodigoPS").ToString @@ -1005,7 +1007,7 @@ Partial Class Inventarios_TrasladoSolicitud If Existencia = 0 Then Alert($"No hay existencia del producto: {CodigoPS}", TipoMensaje.MsgAdvertencia) Else - Alert($"No hay existencia suficiente del producto: {CodigoPS}, Solo hay en existencia: {Existencia}", TipoMensaje.MsgAdvertencia) + Alert($"No hay existencia suficiente del producto: {CodigoPS}, Solo hay en existencia: {Existencia - TempDT.SUM("Cantidad", $"CvePS = {RowTemp("CvePS").ToString.ToEntero} AND CveUM = {RowTemp("CveUM").ToString.ToEntero}")}", TipoMensaje.MsgAdvertencia) End If End If TempDT.Rows.Add(RowTemp) diff --git a/Sistemas/CatSesiones.aspx b/Sistemas/CatSesiones.aspx index 7b5ce4727..4f55c1a69 100644 --- a/Sistemas/CatSesiones.aspx +++ b/Sistemas/CatSesiones.aspx @@ -14,6 +14,7 @@ + diff --git a/Sistemas/CatSesiones.aspx.vb b/Sistemas/CatSesiones.aspx.vb index 9e6d1ed9b..e06cf9d67 100644 --- a/Sistemas/CatSesiones.aspx.vb +++ b/Sistemas/CatSesiones.aspx.vb @@ -7,7 +7,9 @@ Partial Class Sistemas_CatSesiones Protected Sub BtnCargar_Click(sender As Object, e As EventArgs) Handles BtnCargar.Click If DdlVariable.SelectedItem.Value = "GlobalDTUsuarios" Then - CargaUsuarios() + CargaUsuarios() + ElseIf DdlVariable.SelectedItem.Value = "GlobalDTUsuarioResponsable" Then + CargaUsuariosResponsable() ElseIf DdlVariable.SelectedItem.Value = "GlobalDTAlmacenUsuarios" Then CargaAlmacenUsuarios() ElseIf DdlVariable.SelectedItem.Value = "GlobalDTCliente" Then @@ -287,6 +289,19 @@ Partial Class Sistemas_CatSesiones 'Fin Carga Usuarios End Sub + Private Sub CargaUsuariosResponsable() + 'Carga Usuarios + Dim ObjUsuarios As New ClsSisUsuarios + If ObjUsuarios.GetUsuariosEmpresas(-1) Then + Alert(ObjUsuarios.DtResultados.Rows.Count.ToString) + Application("GlobalDTUsuarioResponsable") = ObjUsuarios.DtResultados + Else + Application("GlobalDTUsuarioResponsable") = Nothing + End If + ObjUsuarios.Dispose() + 'Fin Carga Usuarios + End Sub + Private Sub CargaEmpresas() 'Carga Empresas