Ventas medicas sugerir productos de procedimiento
This commit is contained in:
@@ -8460,7 +8460,8 @@
|
||||
</div>
|
||||
<div class="form-group col-md-6 form-md-line-input input-iconright ">
|
||||
<asp:Label runat="server" Style="width: 90%; color: #888888;" AssociatedControlID="DdlProcedimientoModal">Procedimiento:</asp:Label>
|
||||
<asp:DropDownList ID="DdlProcedimientoModal" CssClass="form-control input-sm select2me" runat="server" AppendDataBoundItems="true" CausesValidation="true" DataTextField="Procedimiento" DataValueField="CveProcedimiento" >
|
||||
<asp:DropDownList ID="DdlProcedimientoModal" CssClass="form-control input-sm select2me" runat="server" AppendDataBoundItems="true" CausesValidation="true" DataTextField="Procedimiento" DataValueField="CveProcedimiento"
|
||||
OnSelectedIndexChanged="DdlProcedimientoModal_SelectedIndexChanged" AutoPostBack="true">
|
||||
<asp:ListItem Value="-1">Seleccione uno</asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
<asp:RequiredFieldValidator ID="RfvDdlProcedimientoModal" runat="server" CssClass="help-block errorimput" Display="None" InitialValue="-1"
|
||||
@@ -8487,6 +8488,53 @@
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
|
||||
|
||||
<asp:GridView ID="GvProductosProcedimiento" runat="server" CssClass="table table-hover table-striped ScrollAD mysmallbtn" data-sort="true" AutoGenerateColumns="False" Width="100%"
|
||||
DataKeyNames="CveProcedimientoProducto,CveProcedimiento,CvePS,CodigoPS,Autogenerado,Estatus,CveVenta,CveUnidadMedida,Abreviatura,CveClasificacion,Clasificacion" GridLines="None">
|
||||
<Columns>
|
||||
|
||||
<asp:TemplateField ItemStyle-HorizontalAlign="Center" ItemStyle-Width="20px">
|
||||
<ItemTemplate>
|
||||
<asp:CheckBox ID="Chk" runat="server" ></asp:CheckBox>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
|
||||
<asp:TemplateField ItemStyle-HorizontalAlign="Right" HeaderText="Cant." ItemStyle-Width="30px">
|
||||
<ItemTemplate>
|
||||
<asp:TextBox ID="TxtCantidad" runat="server" Text="1" Width="30px"></asp:TextBox>
|
||||
<ajax:FilteredTextBoxExtender ID="FilTxtCantidad" runat="server" TargetControlID="TxtCantidad" FilterType="Custom, Numbers" ValidChars="." />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
|
||||
<asp:BoundField DataField="CodigoPS" HeaderText="Producto">
|
||||
<ItemStyle HorizontalAlign="Left" />
|
||||
</asp:BoundField>
|
||||
<asp:BoundField DataField="Abreviatura" HeaderText="UM">
|
||||
<ItemStyle HorizontalAlign="Left" />
|
||||
</asp:BoundField>
|
||||
<%--<asp:BoundField DataField="Precio" HeaderText="Precio">
|
||||
<ItemStyle HorizontalAlign="Right" />
|
||||
</asp:BoundField> --%>
|
||||
|
||||
<asp:TemplateField ItemStyle-HorizontalAlign="Right" HeaderText="P.U." ItemStyle-Width="30px">
|
||||
<ItemTemplate>
|
||||
<asp:TextBox ID="TxtPrecio" runat="server" Text='<%# Eval("Precio") %>' Width="30px"></asp:TextBox>
|
||||
<ajax:FilteredTextBoxExtender ID="FilTxtPrecio" runat="server" TargetControlID="TxtPrecio" FilterType="Custom, Numbers" ValidChars="." />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
|
||||
</Columns>
|
||||
<HeaderStyle CssClass="Titulos" Height="15px"></HeaderStyle>
|
||||
</asp:GridView>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -35618,6 +35618,9 @@ Partial Class Ventas
|
||||
DdlMedicoModal.SelectedValueExist(-1)
|
||||
DdlProcedimientoModal.SelectedValueExist(-1)
|
||||
|
||||
GvProductosProcedimiento.DataSource = Nothing
|
||||
GvProductosProcedimiento.DataBind()
|
||||
|
||||
UpDvModalTipoVenta.Update()
|
||||
|
||||
End Sub
|
||||
@@ -35676,6 +35679,44 @@ Partial Class Ventas
|
||||
|
||||
RegistraScript("$('#DvModalTipoVenta').modal('hide');")
|
||||
|
||||
|
||||
|
||||
Dim CountPsAgregados As Integer = 0
|
||||
|
||||
For Each GvRow As GridViewRow In GvProductosProcedimiento.Rows
|
||||
|
||||
Dim Chk As CheckBox = GvRow.FCCheckBox("Chk")
|
||||
Dim Cantidad As Decimal = GvRow.FCTextBox("TxtCantidad").Text.ToDecimal
|
||||
|
||||
If Chk.Checked AndAlso Cantidad > 0 Then
|
||||
|
||||
|
||||
Dim CveUnidadMedida As Integer = GvRow.DataKey("CveUnidadMedida").ToEntero
|
||||
Dim Abreviatura As String = GvRow.DataKey("Abreviatura").ToString
|
||||
Dim PU As Decimal = GvRow.FCTextBox("TxtPrecio").Text.ToDecimal
|
||||
Dim CveClasificacion As Integer = GvRow.DataKey("CveClasificacion").ToEntero
|
||||
Dim Clasificacion As String = GvRow.DataKey("Clasificacion").ToString
|
||||
|
||||
Dim CvePS As Integer = GvRow.DataKey("CvePS").ToEntero
|
||||
|
||||
|
||||
If AgregarProductoServicio(Cantidad, CveUnidadMedida, Abreviatura, CveClasificacion, Clasificacion,
|
||||
CvePS, "", TxtObsPS.Text.TrimEnd, PU, 0,
|
||||
DdlProyecto.SelectedValue.ToEntero(), DdlProyecto.SelectedItem.Text, DdlSubProyecto.SelectedValue.ToEntero(), DdlSubProyecto.SelectedItem.Text,
|
||||
Serie:=If(DIVCod.Visible, TxtCodigoSerie.Text.Trim, ""), TiempoEntrega:=TxtTiempoEntrega.Text, CuentaPredial:=TxtCuentaPredial.Text.Trim, RegeneraIEPS:=ClienteDesglosaIEPS, CvePromocionDetalle:=-1,
|
||||
ImporteProntoPago:=0, ObjDescuento:=Nothing, CvePrecioLista:=-1, PrecioLista:="", NumTurnos:=0) Then
|
||||
CountPsAgregados = CountPsAgregados + 1
|
||||
Else
|
||||
Exit For
|
||||
End If
|
||||
End If
|
||||
|
||||
Next
|
||||
|
||||
If CountPsAgregados > 0 Then
|
||||
CalculaTotalesVenta()
|
||||
End If
|
||||
|
||||
UpCliente.Update()
|
||||
|
||||
End Sub
|
||||
@@ -35687,6 +35728,27 @@ Partial Class Ventas
|
||||
|
||||
End Sub
|
||||
|
||||
Protected Sub DdlProcedimientoModal_SelectedIndexChanged(sender As Object, e As EventArgs)
|
||||
|
||||
|
||||
If DdlProcedimientoModal.SelectedValue.ToEntero > 0 Then
|
||||
Dim objVenta As New ClsVentas
|
||||
|
||||
If objVenta.GetProcedimientoProducto(DdlProcedimientoModal.SelectedValue.ToEntero, -1, UsuarioActual.CveEmpresa) Then
|
||||
GvProductosProcedimiento.DataSource = objVenta.DtResultados
|
||||
End If
|
||||
|
||||
objVenta.Dispose()
|
||||
|
||||
Else
|
||||
GvProductosProcedimiento.DataSource = Nothing
|
||||
End If
|
||||
|
||||
GvProductosProcedimiento.DataBind()
|
||||
|
||||
UpDvModalTipoVenta.Update()
|
||||
|
||||
End Sub
|
||||
|
||||
Private Function GeneraOS(ByRef TransacSQL As SqlTransaction, ByRef errorList As List(Of String)) As Boolean
|
||||
|
||||
@@ -35772,5 +35834,7 @@ Partial Class Ventas
|
||||
|
||||
|
||||
'End Sub
|
||||
|
||||
|
||||
End Class
|
||||
|
||||
|
||||
Reference in New Issue
Block a user