Merge branch 'master' of http://192.168.10.111:8383/SIG
This commit is contained in:
@@ -10670,6 +10670,10 @@ Partial Class Ventas
|
||||
End If
|
||||
End If
|
||||
|
||||
If Not ValidaPSSoloCotizacion() Then
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
'CREA UNA COPIA DE SEGURIDAD PARA LOS DATOS DEL TMPDT
|
||||
If TmpDTError Is Nothing OrElse TmpDTError.Rows.Count = 0 Then
|
||||
TmpDTError = TmpDT.Copy()
|
||||
@@ -19914,6 +19918,36 @@ Partial Class Ventas
|
||||
Protected Sub LbAgregar_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles LbAgregar.Click
|
||||
AgregarPS()
|
||||
End Sub
|
||||
|
||||
Private Function ValidaPSSoloCotizacion() As Boolean
|
||||
Dim Returno As Boolean = True
|
||||
If UsuarioActual.Empresa.Funcionalidad(720) <> "" AndAlso DdlTipoComprobante.SelectedValue <> "Cot" Then
|
||||
Dim ProductosSoloCotizacion As List(Of String) = UsuarioActual.Empresa.Funcionalidad(720).Split(","c).ToList()
|
||||
|
||||
If ProductosSoloCotizacion IsNot Nothing AndAlso ProductosSoloCotizacion.Count > 0 Then
|
||||
|
||||
For Each GvRow As GridViewRow In GvPS.Rows
|
||||
If GvRow.RowType = DataControlRowType.DataRow Then
|
||||
Dim CvePS As String = GvRow.DataKey("CvePS")
|
||||
If ProductosSoloCotizacion.Any(Function(CvePSCot) CvePSCot.Trim() = CvePS) Then
|
||||
Dim PSCot As String = ""
|
||||
Dim DrPSCot As DataRow = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa, CvePS:=CvePS.ToEntero()).Rows(0)
|
||||
If DrPSCot IsNot Nothing Then
|
||||
PSCot = DrPSCot("PSCodigo").ToString
|
||||
End If
|
||||
|
||||
Alert($"El producto y/o servicio '{PSCot}' está disponible únicamente para cotizaciones.", TipoMensaje.MsgAdvertencia)
|
||||
Returno = False
|
||||
Exit For
|
||||
End If
|
||||
End If
|
||||
Next
|
||||
End If
|
||||
End If
|
||||
|
||||
Return Returno
|
||||
End Function
|
||||
|
||||
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
|
||||
@@ -19922,6 +19956,23 @@ Partial Class Ventas
|
||||
Return False
|
||||
End If
|
||||
|
||||
'VALIDA PS DE COTIZACION
|
||||
If UsuarioActual.Empresa.Funcionalidad(720) <> "" Then
|
||||
Dim ProductosSoloCotizacion As List(Of String) = UsuarioActual.Empresa.Funcionalidad(720).Split(","c).ToList()
|
||||
If ProductosSoloCotizacion IsNot Nothing AndAlso ProductosSoloCotizacion.Count > 0 Then
|
||||
If DdlTipoComprobante.SelectedValue <> "Cot" AndAlso ProductosSoloCotizacion.Any(Function(CvePSCot) CvePSCot.Trim() = CvePS.ToString()) Then
|
||||
Dim PSCot As String = ""
|
||||
Dim DrPSCot As DataRow = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa, CvePS:=CvePS).Rows(0)
|
||||
If DrPSCot IsNot Nothing Then
|
||||
PSCot = DrPSCot("PSCodigo").ToString
|
||||
End If
|
||||
|
||||
Alert($"El producto y/o servicio '{PSCot}' está disponible únicamente para cotizaciones.", TipoMensaje.MsgAdvertencia)
|
||||
Return False
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
|
||||
If PSValidarModal.Trim.Length > 0 Then
|
||||
HdnPS.Value = PSValidarModal
|
||||
End If
|
||||
|
||||
Reference in New Issue
Block a user