--FIX validacion de monedas
This commit is contained in:
@@ -9252,7 +9252,7 @@ Partial Class Ventas
|
|||||||
Exit Sub
|
Exit Sub
|
||||||
End If
|
End If
|
||||||
|
|
||||||
If Not ValidaAgregarPS(Cantidad, CvePSNuevo, DdlUM.SelectedValue.ToEntero(), PU, DrProducto("CveTipoPS").ToString().ToEntero(), DdlCla.SelectedValue.ToEntero(), DdlSubProyectoDatos.SelectedValue.ToEntero(), ObjDescuento, CantidadOriginal:=CantidadOriginal) Then
|
If Not ValidaAgregarPS(Cantidad, CvePSNuevo, DdlUM.SelectedValue.ToEntero(), PU, DrProducto("CveTipoPS").ToString().ToEntero(), DdlCla.SelectedValue.ToEntero(), DdlSubProyectoDatos.SelectedValue.ToEntero(), ObjDescuento, CantidadOriginal:=CantidadOriginal, EsEdicion:=True) Then
|
||||||
Exit Sub
|
Exit Sub
|
||||||
End If
|
End If
|
||||||
|
|
||||||
@@ -19529,7 +19529,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 = "", Optional CantidadOriginal As Decimal = 0D) 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, Optional EsEdicion As Boolean = False) As Boolean 'NO TOCAR - IPP
|
||||||
|
|
||||||
'VALIDA PARAMETROS
|
'VALIDA PARAMETROS
|
||||||
If CvePS <= 0 Or CveUM <= 0 Then
|
If CvePS <= 0 Or CveUM <= 0 Then
|
||||||
@@ -19616,17 +19616,34 @@ Partial Class Ventas
|
|||||||
' Return False
|
' Return False
|
||||||
'End If
|
'End If
|
||||||
|
|
||||||
|
Dim ValidarMonedas As Boolean = False
|
||||||
|
|
||||||
'SI NO TIENE LA FUNCIONALIDAD VALIDARA LAS MONEDAS
|
'SI NO TIENE LA FUNCIONALIDAD VALIDARA LAS MONEDAS
|
||||||
If UsuarioActual.Empresa.Funcionalidad(524) <> "" Then
|
If UsuarioActual.Empresa.Funcionalidad(524) <> "" Then
|
||||||
If TmpDT IsNot Nothing AndAlso TmpDT.Rows.Count >= 1 Then
|
ValidarMonedas = True
|
||||||
Dim DrPS As DataRow = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa, CvePS:=CvePS).Rows(0)
|
|
||||||
If DrPS IsNot Nothing Then
|
'MODALIDAD EDICION
|
||||||
If DrPS("CveMoneda").ToString.ToEntero() <> DdlMoneda.SelectedValue.ToEntero() Then
|
If EsEdicion Then
|
||||||
Alert("No puede agregar un producto de diferente moneda a la ya seleccionada", TipoMensaje.MsgAdvertencia)
|
ValidarMonedas = False
|
||||||
Return False
|
End If
|
||||||
|
|
||||||
|
'REFACTURACION
|
||||||
|
If NuevaFactura = 1 Then
|
||||||
|
ValidarMonedas = False
|
||||||
|
End If
|
||||||
|
|
||||||
|
If ValidarMonedas Then
|
||||||
|
If TmpDT IsNot Nothing AndAlso TmpDT.Rows.Count >= 1 Then
|
||||||
|
Dim DrPS As DataRow = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa, CvePS:=CvePS).Rows(0)
|
||||||
|
If DrPS IsNot Nothing Then
|
||||||
|
If DrPS("CveMoneda").ToString.ToEntero() <> DdlMoneda.SelectedValue.ToEntero() Then
|
||||||
|
Alert("No puede agregar un producto de diferente moneda a la ya seleccionada", TipoMensaje.MsgAdvertencia)
|
||||||
|
Return False
|
||||||
|
End If
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
|
|
||||||
End If
|
End If
|
||||||
|
|
||||||
' NO VALIDA EXISTENCIAS NI COSTO - PERMISO PARA NO VALIDAR
|
' NO VALIDA EXISTENCIAS NI COSTO - PERMISO PARA NO VALIDAR
|
||||||
|
|||||||
Reference in New Issue
Block a user