--FIX ventas
This commit is contained in:
@@ -301,9 +301,6 @@ Partial Class Ventas_RepVentas
|
|||||||
Dim Vendedores As String = If(DdlVendedor.GetSelectedValuesM = "", "-1", DdlVendedor.GetSelectedValuesM)
|
Dim Vendedores As String = If(DdlVendedor.GetSelectedValuesM = "", "-1", DdlVendedor.GetSelectedValuesM)
|
||||||
Dim CveCliente As Integer = If(DdlClientes.SelectedValue = "", -1, DdlClientes.SelectedValue.ToEntero)
|
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
|
If RblTipoCambio.SelectedValue.ToEntero = 3 And TxtEspecifico.Text <> "" Then
|
||||||
TCEspecifico = TxtEspecifico.Text.ToDecimal
|
TCEspecifico = TxtEspecifico.Text.ToDecimal
|
||||||
|
|||||||
@@ -459,10 +459,6 @@ Partial Class RepVentasDetalle
|
|||||||
FechaIEjec = If(IsDate(TxtFechaIEjec.Text.Trim()), TxtFechaIEjec.Text.Trim.ToDate, MinFecha)
|
FechaIEjec = If(IsDate(TxtFechaIEjec.Text.Trim()), TxtFechaIEjec.Text.Trim.ToDate, MinFecha)
|
||||||
FechaFEjec = If(IsDate(TxtFechaFEjec.Text.Trim()), TxtFechaFEjec.Text.Trim.ToDate, MaxFecha)
|
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))
|
Dim ModalidadContable As Boolean = CBool(If(Request("ModalidadContable") IsNot Nothing, Request("ModalidadContable").ToEntero(), 0))
|
||||||
|
|
||||||
ChkLecturaAdmin.Checked = Not ModalidadContable
|
ChkLecturaAdmin.Checked = Not ModalidadContable
|
||||||
|
|||||||
@@ -10670,6 +10670,10 @@ Partial Class Ventas
|
|||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
If Not ValidaPSSoloCotizacion() Then
|
||||||
|
Exit Sub
|
||||||
|
End If
|
||||||
|
|
||||||
'CREA UNA COPIA DE SEGURIDAD PARA LOS DATOS DEL TMPDT
|
'CREA UNA COPIA DE SEGURIDAD PARA LOS DATOS DEL TMPDT
|
||||||
If TmpDTError Is Nothing OrElse TmpDTError.Rows.Count = 0 Then
|
If TmpDTError Is Nothing OrElse TmpDTError.Rows.Count = 0 Then
|
||||||
TmpDTError = TmpDT.Copy()
|
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
|
Protected Sub LbAgregar_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles LbAgregar.Click
|
||||||
AgregarPS()
|
AgregarPS()
|
||||||
End Sub
|
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
|
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
|
||||||
@@ -19922,6 +19956,23 @@ Partial Class Ventas
|
|||||||
Return False
|
Return False
|
||||||
End If
|
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
|
If PSValidarModal.Trim.Length > 0 Then
|
||||||
HdnPS.Value = PSValidarModal
|
HdnPS.Value = PSValidarModal
|
||||||
End If
|
End If
|
||||||
|
|||||||
Reference in New Issue
Block a user