--FIX cargas de precios
This commit is contained in:
@@ -18733,7 +18733,22 @@ Partial Class Ventas
|
|||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Protected Sub DdlPSEdit_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs)
|
Protected Sub DdlPSEdit_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs)
|
||||||
If UsuarioActual.Empresa.Funcionalidad(109) = "1" OrElse UsuarioActual.Empresa.Funcionalidad(558) = "1" Then
|
|
||||||
|
Dim ActualizarPrecios As Boolean = False
|
||||||
|
|
||||||
|
If UsuarioActual.Empresa.Funcionalidad(109) = "1" Then
|
||||||
|
ActualizarPrecios = true
|
||||||
|
End If
|
||||||
|
|
||||||
|
If UsuarioActual.Empresa.Funcionalidad(558) = "1" Then
|
||||||
|
ActualizarPrecios = True
|
||||||
|
End If
|
||||||
|
|
||||||
|
If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then
|
||||||
|
ActualizarPrecios = True
|
||||||
|
End If
|
||||||
|
|
||||||
|
If ActualizarPrecios Then
|
||||||
|
|
||||||
Dim EditarPrecio As Boolean = True
|
Dim EditarPrecio As Boolean = True
|
||||||
If DdlTipoComprobante.SelectedValue = "Ant" AndAlso UsuarioActual.CveEmpresa = 189 Then
|
If DdlTipoComprobante.SelectedValue = "Ant" AndAlso UsuarioActual.CveEmpresa = 189 Then
|
||||||
@@ -18747,25 +18762,40 @@ Partial Class Ventas
|
|||||||
If (GvRow.RowState = DataControlRowState.Edit OrElse GvRow.RowState = 5) Then
|
If (GvRow.RowState = DataControlRowState.Edit OrElse GvRow.RowState = 5) Then
|
||||||
Dim CvePSParametro = ddlPSEdit.SelectedValue.ToEntero()
|
Dim CvePSParametro = ddlPSEdit.SelectedValue.ToEntero()
|
||||||
|
|
||||||
Dim DdlPrecioListaEdit = GvRow.FCDropDownList("DdlPrecioListaEdit")
|
Dim CveClasificacion As Integer = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa, CvePS:=CvePSParametro).FiltroPrimeroValor("CveClasificacion").ToEntero()
|
||||||
|
|
||||||
If UsuarioActual.CveEmpresa = 189 Then
|
If CveClasificacion > 0 Then
|
||||||
If DdlTipoComprobante.SelectedValue.Contiene("Ing", "Rem", "Cot", "Ped") AndAlso GvRow.FCHtmlGenericControl("DivPrecioLista").Visible Then
|
Dim DdlCla As DropDownList = GvRow.FCDropDownList("DdlClasificacion")
|
||||||
Using ObjVta As New ClsVentas
|
DdlCla.SelectedValueExist(CveClasificacion)
|
||||||
If ObjVta.GetPreciosListaSPPermitidos(DdlSubProyectoDatos.SelectedValue.ToEntero(), CvePSParametro, UsuarioActual.CveEmpresa) Then
|
End If
|
||||||
Dim Dt As DataTable = Nothing
|
|
||||||
If UsuarioActual.TienePermisoProceso(384) Then
|
Dim CvePrecioListaSugerido As Integer = -1
|
||||||
Dt = ObjVta.DtResultados.Copy()
|
|
||||||
Else
|
If UsuarioActual.Empresa.Funcionalidad(360) = "1" OrElse UsuarioActual.Empresa.Funcionalidad(109) = "1" Then
|
||||||
Dt = ObjVta.DtResultados.FiltraParametros("Restringuida = 'False'")
|
Dim DdlPrecioListaEdit = GvRow.FCDropDownList("DdlPrecioListaEdit")
|
||||||
|
|
||||||
|
If UsuarioActual.CveEmpresa = 189 Then
|
||||||
|
If DdlTipoComprobante.SelectedValue.Contiene("Ing", "Rem", "Cot", "Ped") AndAlso GvRow.FCHtmlGenericControl("DivPrecioLista").Visible Then
|
||||||
|
Using ObjVta As New ClsVentas
|
||||||
|
If ObjVta.GetPreciosListaSPPermitidos(DdlSubProyectoDatos.SelectedValue.ToEntero(), CvePSParametro, 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
|
||||||
|
|
||||||
|
GvRow.FCDropDownList("DdlPrecioListaEdit").DataSource = Dt
|
||||||
|
GvRow.FCDropDownList("DdlPrecioListaEdit").DataBind()
|
||||||
|
GvRow.FCDropDownList("DdlPrecioListaEdit").SelectedValueExist(GvRow.DataKey("CvePrecioLista"))
|
||||||
End If
|
End If
|
||||||
|
End Using
|
||||||
GvRow.FCDropDownList("DdlPrecioListaEdit").DataSource = Dt
|
End If
|
||||||
GvRow.FCDropDownList("DdlPrecioListaEdit").DataBind()
|
|
||||||
GvRow.FCDropDownList("DdlPrecioListaEdit").SelectedValueExist(GvRow.DataKey("CvePrecioLista"))
|
|
||||||
End If
|
|
||||||
End Using
|
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
CvePrecioListaSugerido = DdlPrecioListaEdit.SelectedValue.ToEntero()
|
||||||
|
Else
|
||||||
|
CvePrecioListaSugerido = GvRow.DataKey("CvePrecioLista").ToEntero()
|
||||||
End If
|
End If
|
||||||
|
|
||||||
Dim DrPS As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePSParametro).FiltroPrimero("")
|
Dim DrPS As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePSParametro).FiltroPrimero("")
|
||||||
@@ -18774,7 +18804,7 @@ Partial Class Ventas
|
|||||||
Dim PrecioSugerido As Decimal = 0
|
Dim PrecioSugerido As Decimal = 0
|
||||||
Dim tPrecioSugerido As Decimal = 0
|
Dim tPrecioSugerido As Decimal = 0
|
||||||
tPrecioSugerido = DrPS("Precio").ToString().ToDecimal
|
tPrecioSugerido = DrPS("Precio").ToString().ToDecimal
|
||||||
Dim ObjPrecioSugerido As Modelos.MPrecioSugerido = CalculaPrecioSugerido(CvePSParametro, DrPS("CveClasificacion").ToString().ToEntero(), CvePrecioListaSugerido:=DdlPrecioListaEdit.SelectedValue.ToEntero())
|
Dim ObjPrecioSugerido As Modelos.MPrecioSugerido = CalculaPrecioSugerido(CvePSParametro, DrPS("CveClasificacion").ToString().ToEntero(), CvePrecioListaSugerido:=CvePrecioListaSugerido)
|
||||||
|
|
||||||
PrecioSugerido = ObjPrecioSugerido.PrecioSugerido
|
PrecioSugerido = ObjPrecioSugerido.PrecioSugerido
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user