6 Comp: Validar que los PS tipo servicio no lo los permita poner en promociones, solo la 189
This commit is contained in:
@@ -425,8 +425,26 @@ Partial Class Ventas_Promociones
|
|||||||
End If
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
Protected Sub DdlPS_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlPS.selectedindexchange
|
Protected Sub DdlPS_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlPS.selectedindexchange
|
||||||
|
|
||||||
DdlTipoPromocion.Items.FindByValue("1").Enabled = True
|
DdlTipoPromocion.Items.FindByValue("1").Enabled = True
|
||||||
DdlTipoPromocion.Items.FindByValue("3").Enabled = True
|
DdlTipoPromocion.Items.FindByValue("3").Enabled = True
|
||||||
|
|
||||||
|
If EmpresaGrupoDiaz Then
|
||||||
|
BtnAgregar.Enabled = False
|
||||||
|
Dim CvePS As Integer = DdlPS.SelectedValue.ToEntero
|
||||||
|
|
||||||
|
Dim TipCveTipoPS As Integer = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS).FiltroPrimeroValor("CveTipoPS").ToEntero
|
||||||
|
|
||||||
|
If TipCveTipoPS = 1 Then
|
||||||
|
Alert("El producto esta registrado como servicio", TipoMensaje.MsgAdvertencia)
|
||||||
|
Else
|
||||||
|
BtnAgregar.Enabled = True
|
||||||
|
End If
|
||||||
|
|
||||||
|
UpAgregar.Update()
|
||||||
|
|
||||||
|
End If
|
||||||
|
|
||||||
End Sub
|
End Sub
|
||||||
#End Region
|
#End Region
|
||||||
|
|
||||||
@@ -1409,6 +1427,8 @@ Partial Class Ventas_Promociones
|
|||||||
DTPlantilla.Columns.Add("CodigoPS", GetType(String))
|
DTPlantilla.Columns.Add("CodigoPS", GetType(String))
|
||||||
DTPlantilla.Columns.Add("RinTamaño", GetType(String))
|
DTPlantilla.Columns.Add("RinTamaño", GetType(String))
|
||||||
|
|
||||||
|
Dim HayServicios As Boolean = False
|
||||||
|
Dim SBServiciosEnconrtados As New StringBuilder
|
||||||
|
|
||||||
Dim DTPS As DataTable = New DataTable
|
Dim DTPS As DataTable = New DataTable
|
||||||
Dim DTRines As DataTable = New DataTable
|
Dim DTRines As DataTable = New DataTable
|
||||||
@@ -1499,16 +1519,32 @@ Partial Class Ventas_Promociones
|
|||||||
dRow("CodigoPS") = If(CveClasificacion > 0, "Todos", CodigoPS)
|
dRow("CodigoPS") = If(CveClasificacion > 0, "Todos", CodigoPS)
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
If EmpresaGrupoDiaz AndAlso CvePS > 0 Then
|
||||||
|
Dim CveTipoPS As Integer = DTPS.FiltroPrimeroValor("CveTipoPS", $"Codigo = '{CodigoStr}'").ToString().ToEntero()
|
||||||
|
If CveTipoPS = 1 Then
|
||||||
|
HayServicios = True
|
||||||
|
SBServiciosEnconrtados.AppendLine($"{CodigoStr}<br>")
|
||||||
|
End If
|
||||||
|
|
||||||
|
End If
|
||||||
|
|
||||||
End If
|
End If
|
||||||
RegistroActual = RegistroActual + 1
|
RegistroActual = RegistroActual + 1
|
||||||
|
|
||||||
Next
|
Next
|
||||||
|
|
||||||
If Errores.ToString.Length = 0 Then
|
If Errores.ToString.Length = 0 AndAlso Not HayServicios Then
|
||||||
DTPlantilla.AcceptChanges()
|
DTPlantilla.AcceptChanges()
|
||||||
Return True
|
Return True
|
||||||
Else
|
Else
|
||||||
Alert(Errores.ToString, TipoMensaje.MsgAdvertencia)
|
|
||||||
|
If EmpresaGrupoDiaz AndAlso HayServicios Then
|
||||||
|
Alert($"{Errores.ToString} <br>Se detectaron productos que estan registrados como servicios:<br>{SBServiciosEnconrtados.ToString}", TipoMensaje.MsgAdvertencia)
|
||||||
|
|
||||||
|
Else
|
||||||
|
Alert(Errores.ToString, TipoMensaje.MsgAdvertencia)
|
||||||
|
End If
|
||||||
|
|
||||||
Return False
|
Return False
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user