From 40f61c1f031a4afa3614c6986ed50e2bd24f536a Mon Sep 17 00:00:00 2001 From: Jonathan Alexis Perez Morales Date: Tue, 10 Dec 2024 09:37:06 -0700 Subject: [PATCH] --FIX Ventas --- Ventas/Ventas.aspx.vb | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/Ventas/Ventas.aspx.vb b/Ventas/Ventas.aspx.vb index 367275147..a2edc2a23 100644 --- a/Ventas/Ventas.aspx.vb +++ b/Ventas/Ventas.aspx.vb @@ -8715,8 +8715,25 @@ Partial Class Ventas If UsuarioActual.Empresa.Funcionalidad(360) = "1" OrElse UsuarioActual.Empresa.Funcionalidad(109) = "1" Then e.Row.FCHtmlGenericControl("DivPrecioLista").Visible = True e.Row.FCDropDownList("DdlPrecioListaEdit").DataSource = GlobalDTPrecioListas(UsuarioActual.CveEmpresa) - e.Row.FCDropDownList("DdlPrecioListaEdit").DataBind() + If UsuarioActual.CveEmpresa = 189 Then + If DdlTipoComprobante.SelectedValue.Contiene("Ing", "Rem", "Cot", "Ped") Then + Using ObjVta As New ClsVentas + If ObjVta.GetPreciosListaSPPermitidos(DdlSubProyectoDatos.SelectedValue.ToEntero(), e.Row.DBCampo("CvePS").ToEntero(), UsuarioActual.CveEmpresa) Then + Dim Dt As DataTable = Nothing + If UsuarioActual.TienePermisoProceso(384) Then + Dt = ObjVta.DtResultados.Copy() + Else + Dt = ObjVta.DtResultados.FiltraParametros("Restringuida = 'False'") + End If + e.Row.FCDropDownList("DdlPrecioListaEdit").DataSource = Dt + End If + End Using + End If + + End If + + e.Row.FCDropDownList("DdlPrecioListaEdit").DataBind() e.Row.FCDropDownList("DdlPrecioListaEdit").SelectedValueExist(e.Row.DBCampo("CvePrecioLista")) End If @@ -18486,8 +18503,10 @@ Partial Class Ventas ObjInventarios.Dispose() If Costo > 0 Then - Dim PorUtilidad = String.Format("{0:N2} %", ((TxtPrecio.Text.ToDecimal() - Costo) / TxtPrecio.Text.ToDecimal()) * 100D) - LtlHeaderCosto.Text = String.Format("{0:N2}
{1}", Costo, PorUtilidad) + If TxtPrecio.Text.ToDecimal() > 0 Then + Dim PorUtilidad = String.Format("{0:N2} %", ((TxtPrecio.Text.ToDecimal() - Costo) / TxtPrecio.Text.ToDecimal()) * 100D) + LtlHeaderCosto.Text = String.Format("{0:N2}
{1}", Costo, PorUtilidad) + End If End If End If End If