--FIX Validar cantidad
This commit is contained in:
@@ -9139,7 +9139,7 @@ Partial Class Ventas
|
|||||||
|
|
||||||
Dim DrProducto = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa, CvePS:=CvePSNuevo).FiltroPrimero("")
|
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
|
Exit Sub
|
||||||
End If
|
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
|
Protected Sub LbAgregar_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles LbAgregar.Click
|
||||||
AgregarPS()
|
AgregarPS()
|
||||||
End Sub
|
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
|
'VALIDA PARAMETROS
|
||||||
If CvePS <= 0 Or CveUM <= 0 Then
|
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
|
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
|
If ValidaExistencia Then
|
||||||
|
|
||||||
'VALIDA EXISTENCIA
|
'VALIDA EXISTENCIA
|
||||||
|
|||||||
Reference in New Issue
Block a user