--FIX ventas

This commit is contained in:
2025-05-08 18:01:27 -07:00
parent e10beef274
commit 27a173ac1b
3 changed files with 51 additions and 7 deletions

View File

@@ -301,9 +301,6 @@ Partial Class Ventas_RepVentas
Dim Vendedores As String = If(DdlVendedor.GetSelectedValuesM = "", "-1", DdlVendedor.GetSelectedValuesM)
Dim CveCliente As Integer = If(DdlClientes.SelectedValue = "", -1, DdlClientes.SelectedValue.ToEntero)
If TipoComprobante.Contiene("Rem") And Not Estatus.Contiene("11") Then
Estatus = Estatus & ",11"
End If
If RblTipoCambio.SelectedValue.ToEntero = 3 And TxtEspecifico.Text <> "" Then
TCEspecifico = TxtEspecifico.Text.ToDecimal

View File

@@ -459,10 +459,6 @@ Partial Class RepVentasDetalle
FechaIEjec = If(IsDate(TxtFechaIEjec.Text.Trim()), TxtFechaIEjec.Text.Trim.ToDate, MinFecha)
FechaFEjec = If(IsDate(TxtFechaFEjec.Text.Trim()), TxtFechaFEjec.Text.Trim.ToDate, MaxFecha)
If TipoComprobante.Contiene("Rem") And Not Estatus.Contiene("11") Then
Estatus = Estatus & ",11"
End If
Dim ModalidadContable As Boolean = CBool(If(Request("ModalidadContable") IsNot Nothing, Request("ModalidadContable").ToEntero(), 0))
ChkLecturaAdmin.Checked = Not ModalidadContable

View File

@@ -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