6 Comp: Validar que los PS tipo servicio no lo los permita poner en promociones, solo la 189

This commit is contained in:
rakcsle
2025-01-15 10:03:44 -07:00
parent 6a6aacc9a4
commit 027db82dff

View File

@@ -425,8 +425,26 @@ Partial Class Ventas_Promociones
End If
End Sub
Protected Sub DdlPS_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlPS.selectedindexchange
DdlTipoPromocion.Items.FindByValue("1").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 Region
@@ -1409,6 +1427,8 @@ Partial Class Ventas_Promociones
DTPlantilla.Columns.Add("CodigoPS", 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 DTRines As DataTable = New DataTable
@@ -1499,16 +1519,32 @@ Partial Class Ventas_Promociones
dRow("CodigoPS") = If(CveClasificacion > 0, "Todos", CodigoPS)
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
RegistroActual = RegistroActual + 1
Next
If Errores.ToString.Length = 0 Then
If Errores.ToString.Length = 0 AndAlso Not HayServicios Then
DTPlantilla.AcceptChanges()
Return True
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
End If