diff --git a/Compras/Compras.aspx.vb b/Compras/Compras.aspx.vb index e7b61a367..1cd6c0683 100644 --- a/Compras/Compras.aspx.vb +++ b/Compras/Compras.aspx.vb @@ -4527,21 +4527,33 @@ Partial Class Compras_Compras End If ValidaFechaDeAlamacen() Else + 'GvInv.Rows(x).FCDropDownList("ddlEAlmacen").SelectedValue.ToEntero 'Charlie Dim x As Integer = 0 For Each Dr As GridViewRow In GvInv.Rows If Dr.FCCheckBox("cbInv").Checked Then + + If Not Dr.FCDropDownList("ddlEAlmacen").SelectedValue.ToEntero > 0 Then + Alert("Favor de seleccionar almacen en la pestaña de almacén.", TipoMensaje.MsgAdvertencia) + Exit Sub + End If + x = x + 1 End If + Next + If Not (CveCompraRefacturacion > 0 AndAlso ChkRefacturacionConAlmacen.Checked) Then If x = 0 AndAlso GvInv.Rows.Count > 0 Then - Alert("Favor de seleccionar un producto en la pestaña de almacen", TipoMensaje.MsgAdvertencia) + Alert("Favor de seleccionar un producto en la pestaña de almacén", TipoMensaje.MsgAdvertencia) Exit Sub End If End If + End If End If + + If UsuarioActual.Empresa.Funcionalidad(538) = "1" Then If TmpDT.MIN("CvePS").ToEntero <= 0 Then Alert("Todos los Productos/Servicios deben estar registrados o aliados a un productos ya registrado.", TipoMensaje.MsgAdvertencia) diff --git a/Inventarios/TrasladoSolicitud.aspx b/Inventarios/TrasladoSolicitud.aspx index 8966a44b3..fbb09ad01 100644 --- a/Inventarios/TrasladoSolicitud.aspx +++ b/Inventarios/TrasladoSolicitud.aspx @@ -359,7 +359,7 @@ $chk.prop('checked', true); } else if (valorTxt > cantidad) { $chk.prop('checked', true); - $txt.val(cantidad); + //$txt.val(cantidad); } } } diff --git a/Inventarios/TrasladoSolicitud.aspx.vb b/Inventarios/TrasladoSolicitud.aspx.vb index ed604b6ed..bcd68055d 100644 --- a/Inventarios/TrasladoSolicitud.aspx.vb +++ b/Inventarios/TrasladoSolicitud.aspx.vb @@ -270,7 +270,7 @@ Partial Class Inventarios_TrasladoSolicitud 'CodigoPS = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=Row.DataKey("CvePS").ToEntero).FiltroPrimeroValor("PSCodigo", "") Existencia = ObjInventarios.GetExistenciasPS(DdlProductoServicio.SelectedValue.ToEntero, CveUnidadMedida, UsuarioActual.CveEmpresa, DdlAlmacenOrigen.SelectedValue.ToEntero, FechaMovto:=NowADS.ToString("yyyy/MM/dd 23:59")) - If Existencia - (TempDT.SUM("Cantidad", $"CvePS = {DdlProductoServicio.SelectedValue.ToEntero} AND CveUM = {CveUnidadMedida}") + TxtCantidad.Text.Trim.ToDecimal) <= 0 Then + If Existencia - (TempDT.SUM("Cantidad", $"CvePS = {DdlProductoServicio.SelectedValue.ToEntero} AND CveUM = {CveUnidadMedida}") + TxtCantidad.Text.Trim.ToDecimal) < 0 Then MensajeExistencia.AppendFormat("
- {0}. Existencia: {1}", DdlProductoServicio.SelectedText, Existencia) TieneErrorExistencia = True End If @@ -752,9 +752,12 @@ Partial Class Inventarios_TrasladoSolicitud Protected Sub GvSolicitudes_RowDataBound(sender As Object, e As GridViewRowEventArgs) If e.Row.RowType = DataControlRowType.DataRow Then + Dim Cantidad As Decimal = e.Row.DataKey("Cantidad").ToDecimal + e.Row.FCCheckBox("chk").Attributes.Add("onclick", $"validaCantidadSolicitud({Cantidad},'{e.Row.FCTextBox("TxtCantidad").ClientID}','{e.Row.FCCheckBox("Chk").ClientID}',1);") e.Row.FCTextBox("TxtCantidad").Attributes.Add("onkeyup", $"validaCantidadSolicitud({Cantidad},'{e.Row.FCTextBox("TxtCantidad").ClientID}','{e.Row.FCCheckBox("Chk").ClientID}',2);") + End If End Sub