diff --git a/Ventas/Ventas.aspx.vb b/Ventas/Ventas.aspx.vb index 65774ea22..813474049 100644 --- a/Ventas/Ventas.aspx.vb +++ b/Ventas/Ventas.aspx.vb @@ -20325,10 +20325,10 @@ Partial Class Ventas Dim Existencia As Decimal = 0D Using ObjInv2 As New ClsInventarios - If RBLTipoVenta.SelectedValue.ToEntero = 6 Then + If RBLTipoVenta.SelectedValue = "6" Then Existencia = ObjInv2.GetExistenciasPS(CvePS, CveUM, UsuarioActual.CveEmpresa, CveAlmacenFiltroDdl, FechaMovto:=DateTime.Today.AddDays(1).ToString("yyyy/MM/dd HH:mm"), CveSubProyecto:=-1, CveVendedor:=DdlVendedor.SelectedValue.ToEntero(), CveCliente:=If(UsuarioActual.Empresa.Funcionalidad(146) = "1", -1, CveCliente), ExcluyeAdelantado:=0, PendientePorSurtir:=1, - RestringirAlmacenes:=1, ExcluyeApartados:=-1, BuscarEnTabla:=BuscarEnTabla) + RestringirAlmacenes:=0, ExcluyeApartados:=-1, BuscarEnTabla:=BuscarEnTabla) Else Dim CveAlmacenConsulta As Integer = -1 @@ -40605,23 +40605,7 @@ Partial Class Ventas End If End If - For Each GvRow As GridViewRow In GvPSProced.Rows - Dim Cantidad As Decimal = GvRow.FCTextBox("TxtCantidad").Text.ToDecimal - Dim CveUnidadMedida As Integer = GvRow.DataKey("CveUnidadMedida").ToEntero - Dim Abreviatura As String = GvRow.DataKey("Abreviatura").ToString - Dim CveClasificacion As Integer = GvRow.DataKey("CveClasificacion").ToEntero - Dim Clasificacion As String = GvRow.DataKey("Clasificacion").ToString - Dim CvePS As Integer = GvRow.DataKey("CvePS").ToEntero - Dim CodigoPS As String = GvRow.DataKey("CodigoPS") - Dim PU As Decimal = GvRow.FCTextBox("TxtPrecio").Text.ToDecimal - If Cantidad > 0 Then - If Not ValidaAgregarPS(0, CvePS, CveUnidadMedida, PU, 2, CveClasificacion, DdlSubProyectoDatos.SelectedValue.ToEntero(), Nothing, CantidadModal:=Cantidad, PSValidarModal:=CodigoPS) Then - Alert("No hay existencia.", TipoMensaje.MsgAdvertencia) - Exit Sub - End If - End If - Next ChkRequiereTecnico.Checked = ChkRequiereTecnicoModal.Checked TxtFechaOS.Text = TxtFechaModal.Text @@ -40683,6 +40667,29 @@ Partial Class Ventas End If End If + If RBLTipoVenta.SelectedValue.Contiene("5", "6") Then ' 3.avista,4.consig,5.consig mat, 6. avista mat. + AsignaAlmacenWS() + 'CargaPS(-1, DdlPS) + End If + + For Each GvRow As GridViewRow In GvPSProced.Rows + Dim Cantidad As Decimal = GvRow.FCTextBox("TxtCantidad").Text.ToDecimal + Dim CveUnidadMedida As Integer = GvRow.DataKey("CveUnidadMedida").ToEntero + Dim Abreviatura As String = GvRow.DataKey("Abreviatura").ToString + Dim CveClasificacion As Integer = GvRow.DataKey("CveClasificacion").ToEntero + Dim Clasificacion As String = GvRow.DataKey("Clasificacion").ToString + Dim CvePS As Integer = GvRow.DataKey("CvePS").ToEntero + Dim CodigoPS As String = GvRow.DataKey("CodigoPS") + Dim PU As Decimal = GvRow.FCTextBox("TxtPrecio").Text.ToDecimal + + If Cantidad > 0 Then + If Not ValidaAgregarPS(0, CvePS, CveUnidadMedida, PU, 2, CveClasificacion, DdlSubProyectoDatos.SelectedValue.ToEntero(), Nothing, CantidadModal:=Cantidad, PSValidarModal:=CodigoPS) Then + Alert("No hay existencia.", TipoMensaje.MsgAdvertencia) + Exit Sub + End If + End If + Next + DdlTipoComprobante_SelectedIndexChanged(sender, Nothing) Dim CountPsAgregados As Integer = 0 @@ -40721,10 +40728,7 @@ Partial Class Ventas UpParametros.Update() End If - If RBLTipoVenta.SelectedValue.Contiene("5", "6") Then ' 3.avista,4.consig,5.consig mat, 6. avista mat. - AsignaAlmacenWS() - 'CargaPS(-1, DdlPS) - End If + If RBLTipoVenta.SelectedValue.Contiene("1") Then TxtPrecio.Enabled = True UpPS.Update()