--Recalcular el PU en el cambio de producto al editar

This commit is contained in:
2024-02-22 15:59:16 -07:00
parent 66a680a992
commit 24b46e5540
2 changed files with 31 additions and 1 deletions

View File

@@ -1256,7 +1256,7 @@
<asp:ListItem Selected="True" Text="Seleccione la Clasificación (Todas)" Value="-1"></asp:ListItem>
</asp:DropDownList>
<asp:Literal ID="LtlPSEdit" runat="server" Visible="false" Text='<%# Eval("PS") %>'></asp:Literal>
<ADS:Dropdownlost runat="server" ID="DdlPS" CssStyle="width: 100%;" CssClass="DdlPS" CssClassDdl="select2me " DataTextField="PSCodigo" DataValueField="CvePS" data-onresult="CargaExistenciaAlmacenes" />
<ADS:Dropdownlost runat="server" ID="DdlPS" CssStyle="width: 100%;" CssClass="DdlPS" CssClassDdl="select2me " DataTextField="PSCodigo" DataValueField="CvePS" data-onresult="CargaExistenciaAlmacenes" Onselectedindexchange="DdlPSEdit_SelectedIndexChanged" />
<%--<asp:RequiredFieldValidator ID="RFVPS" runat="server" ControlToValidate="DdlPS" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Producto o Servicio''</b> es necesario, por favor seleccione uno." ValidationGroup="GprGV" CssClass="select2me"></asp:RequiredFieldValidator>--%>
<%--<ajax:ValidatorCalloutExtender ID="VCOPS" runat="server" HighlightCssClass="vco" TargetControlID="RFVPS" Width="300px"></ajax:ValidatorCalloutExtender>--%>
</EditItemTemplate>

View File

@@ -17095,6 +17095,35 @@ Partial Class Ventas
Protected Sub DdlPS_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles DdlPS.selectedindexchange
DdlPSIndexChange(DdlPS.SelectedValue.ToEntero(), DdlPS)
End Sub
Protected Sub DdlPSEdit_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs)
If UsuarioActual.Empresa.Funcionalidad(109) = "1" Then
If GvPS.EditIndex >= 0 Then
Dim ddlPSEdit = DirectCast(sender, ADServerControl.Dropdownlost)
Dim GvRow = DirectCast(ddlPSEdit.NamingContainer, GridViewRow)
If (GvRow.RowState = DataControlRowState.Edit OrElse GvRow.RowState = 5) Then
Dim CvePSParametro = ddlPSEdit.SelectedValue.ToEntero()
Dim DrPS As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePSParametro).FiltroPrimero("")
If DrPS IsNot Nothing Then
'SUGIERE PRECIO
Dim PrecioSugerido As Decimal = 0
Dim tPrecioSugerido As Decimal = 0
tPrecioSugerido = DrPS("Precio").ToString().ToDecimal
Dim ObjPrecioSugerido As Modelos.MPrecioSugerido = CalculaPrecioSugerido(CvePSParametro, DrPS("CveClasificacion").ToString().ToEntero())
PrecioSugerido = ObjPrecioSugerido.PrecioSugerido
If PrecioSugerido <= 0 Then PrecioSugerido = tPrecioSugerido
GvRow.FCTextBox("TxtPrecio").Text = PrecioSugerido.ToString("#,###.####") ' que muestre hasta los 4 digitos si lo requiere
End If
End If
End If
End If
End Sub
Protected Sub DdlClasificacion_SelectedIndexChanged(sender As Object, e As System.EventArgs) Handles DdlClasificacion.SelectedIndexChanged
CargaPS(DdlClasificacion.SelectedValue.ToEntero(), DdlPS)
UpPS.Update()
@@ -36985,5 +37014,6 @@ Partial Class Ventas
End If
End Sub
End Class