--FIX Validar cantidad

This commit is contained in:
2024-12-31 13:43:25 -07:00
parent 15a7001e19
commit ed88d2c05a

View File

@@ -9139,7 +9139,7 @@ Partial Class Ventas
Dim DrProducto = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa, CvePS:=CvePSNuevo).FiltroPrimero("")
If Not ValidaAgregarPS(Cantidad, CvePSNuevo, DdlUM.SelectedValue.ToEntero(), PU, DrProducto("CveTipoPS").ToString().ToEntero(), DdlCla.SelectedValue.ToEntero(), DdlSP.SelectedValue.ToEntero(), ObjDescuento) Then
If Not ValidaAgregarPS(Cantidad, CvePSNuevo, DdlUM.SelectedValue.ToEntero(), PU, DrProducto("CveTipoPS").ToString().ToEntero(), DdlCla.SelectedValue.ToEntero(), DdlSP.SelectedValue.ToEntero(), ObjDescuento, CantidadOriginal:=CantidadOriginal) Then
Exit Sub
End If
@@ -19337,7 +19337,7 @@ Partial Class Ventas
Protected Sub LbAgregar_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles LbAgregar.Click
AgregarPS()
End Sub
Private Function ValidaAgregarPS(Cantidad As Decimal, CvePS As Integer, CveUM As Integer, PU As Double, CveTipoPS As Integer, CveClasificacion As Integer, CveSubProyecto As Integer, ObjDescuento As Modelos.VentaDescuentos, Optional CantidadModal As Decimal = 0D, Optional PSValidarModal As String = "") As Boolean 'NO TOCAR - IPP
Private Function ValidaAgregarPS(Cantidad As Decimal, CvePS As Integer, CveUM As Integer, PU As Double, CveTipoPS As Integer, CveClasificacion As Integer, CveSubProyecto As Integer, ObjDescuento As Modelos.VentaDescuentos, Optional CantidadModal As Decimal = 0D, Optional PSValidarModal As String = "", Optional CantidadOriginal As Decimal = 0D) As Boolean 'NO TOCAR - IPP
'VALIDA PARAMETROS
If CvePS <= 0 Or CveUM <= 0 Then
@@ -19481,6 +19481,13 @@ Partial Class Ventas
Dim ValidaExistencia As Boolean = (DdlTipoComprobante.SelectedValue <> "Cot" And ChkSinExistencia.Checked = False) Or UsuarioActual.Empresa.Funcionalidad(578).ToEntero = 1
If CantidadOriginal > 0 Then
'SI NO HAY CAMBIOS EN LAS CANTIDADES, NO VALIDAR EXISTENCIA
If CantidadOriginal = Cantidad Then
ValidaExistencia = False
End If
End If
If ValidaExistencia Then
'VALIDA EXISTENCIA