diff --git a/Ventas/Promociones.aspx.vb b/Ventas/Promociones.aspx.vb index 5e593a35a..f0b713f72 100644 --- a/Ventas/Promociones.aspx.vb +++ b/Ventas/Promociones.aspx.vb @@ -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}
") + 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}
Se detectaron productos que estan registrados como servicios:
{SBServiciosEnconrtados.ToString}", TipoMensaje.MsgAdvertencia) + + Else + Alert(Errores.ToString, TipoMensaje.MsgAdvertencia) + End If + Return False End If