-- cambio en selección de productos para SMS
This commit is contained in:
@@ -7222,6 +7222,30 @@ Public Class ClsVentas
|
||||
End Try
|
||||
Return Retorno
|
||||
|
||||
End Function
|
||||
|
||||
Public Function GetProcedimientoProductoListaPrecio(CveProcedimiento As Integer, CveEmpresa As Integer, CveCliente As Integer, CveSubProyecto As Integer,
|
||||
CveClienteSucursal As Integer, CveTipoVenta As Integer) As Boolean
|
||||
|
||||
Dim Retorno As Boolean = False
|
||||
DataAdapter("PA_Vta_ProcedimientosProductosPLGet")
|
||||
With SqlAdapter.SelectCommand.Parameters
|
||||
|
||||
.Add("@CveProcedimiento", SqlDbType.Int).Value = CveProcedimiento
|
||||
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
|
||||
.Add("@CveCliente", SqlDbType.Int).Value = CveCliente
|
||||
.Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto
|
||||
.Add("@CveClienteSucursal", SqlDbType.Int).Value = CveClienteSucursal
|
||||
.Add("@CveTipoVenta", SqlDbType.Int).Value = CveTipoVenta
|
||||
End With
|
||||
Try
|
||||
SqlAdapter.Fill(Data)
|
||||
Retorno = True
|
||||
Catch ex As Exception
|
||||
OnError("Ocurrió un error al obtener los Productos.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
|
||||
End Try
|
||||
Return Retorno
|
||||
|
||||
End Function
|
||||
Public Function RemoveProcedimientoProducto(CveProcedimientoProducto As Integer, CveEmpresa As Integer) As Boolean
|
||||
|
||||
|
||||
@@ -9064,7 +9064,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<%--Cliente Solo se usa para en PAgo Directo --%>
|
||||
<%--Cliente Solo se usa para en Pago Directo --%>
|
||||
<div runat="server" visible="False" id="DvModalTipoVentaCliente">
|
||||
<div class="row">
|
||||
<div class="form-group col-md-12 form-md-line-input input-iconright" style="margin-top: -7px!important">
|
||||
@@ -9075,8 +9075,6 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<%--Medico Procedimiento--%>
|
||||
<div runat="server" visible="False" id="DvModalTipoVentaPasoMedicoProcedimiento">
|
||||
<div class="row">
|
||||
@@ -9125,15 +9123,24 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row" runat="server" id="DVGvProductosProcedimiento" visible="false">
|
||||
<div class="row" runat="server" id="DVGvPSProced" visible="false">
|
||||
<div class="row">
|
||||
<div class="col-md-8">
|
||||
<asp:CheckBox ID="ChkVerTodosPS" runat="server" Text="Ver Todos" AutoPostBack="true" OnCheckedChanged="ChkVerTodosPS_CheckedChanged" />
|
||||
</div>
|
||||
<div class="col-md-4" style="text-align: right">
|
||||
<input type="text" id="TxtBus" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBus','{0}')", GvPSProced.ClientID) %>" style="display: inline-block; width: 150px;" />
|
||||
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBus','{0}')", GvPSProced.ClientID) %>" style="margin-top: -3px; margin-left: -13px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-12">
|
||||
Productos utilizados en el procedimiento
|
||||
<asp:GridView ID="GvProductosProcedimiento" runat="server" CssClass="table table-hover table-striped ScrollAD mysmallbtn" data-sort="true" AutoGenerateColumns="False" Width="100%" OnRowDataBound="GvProductosProcedimiento_RowDataBound"
|
||||
DataKeyNames="CveProcedimientoProducto,CveProcedimiento,Cantidad,CvePS,CodigoPS,Autogenerado,Estatus,CveVenta,CveUnidadMedida,Abreviatura,CveClasificacion,Clasificacion,Precio" GridLines="None">
|
||||
<asp:GridView ID="GvPSProced" runat="server" CssClass="table table-hover table-striped ScrollAD mysmallbtn" data-sort="true" AutoGenerateColumns="False" Width="100%" OnRowDataBound="GvPSProced_RowDataBound"
|
||||
DataKeyNames="Cantidad,CvePS,CodigoPS,CveUnidadMedida,Abreviatura,CveClasificacion,Clasificacion,Precio" GridLines="None">
|
||||
<Columns>
|
||||
<asp:TemplateField ItemStyle-HorizontalAlign="Right" HeaderText="Cant." ItemStyle-Width="40px">
|
||||
<asp:TemplateField ItemStyle-HorizontalAlign="Right" HeaderText="Cant." ItemStyle-Width="30px">
|
||||
<ItemTemplate>
|
||||
<asp:TextBox ID="TxtCantidad" runat="server" Text="" Width="40px" Style="text-align: right!important"></asp:TextBox>
|
||||
<asp:TextBox ID="TxtCantidad" runat="server" Text="" Width="35px" Style="text-align: right!important"></asp:TextBox>
|
||||
<ajax:FilteredTextBoxExtender ID="FilTxtCantidad" runat="server" TargetControlID="TxtCantidad" FilterType="Custom, Numbers" ValidChars="." />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
@@ -9142,19 +9149,15 @@
|
||||
</asp:BoundField>
|
||||
<asp:BoundField DataField="CodigoPS" HeaderText="Producto">
|
||||
<ItemStyle HorizontalAlign="Left" />
|
||||
</asp:BoundField>
|
||||
<asp:BoundField DataField="Abreviatura" HeaderText="UM">
|
||||
<ItemStyle HorizontalAlign="Left" />
|
||||
</asp:BoundField>
|
||||
</asp:BoundField>
|
||||
<asp:TemplateField ItemStyle-HorizontalAlign="Right" HeaderText="Precio" ItemStyle-Width="30px">
|
||||
<ItemTemplate>
|
||||
<asp:TextBox ID="TxtPrecio" runat="server" Text='<%# Eval("Precio", "{0:#,###.00##}") %>' Style="text-align: right!important" Width="80px" Enabled="false"></asp:TextBox>
|
||||
<asp:TextBox ID="TxtPrecio" runat="server" Text='<%# Eval("Precio", "{0:#,###.00##}") %>' Style="text-align: right!important" Width="70px" Enabled="false"></asp:TextBox>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
|
||||
<%--<asp:BoundField DataField="Precio" HeaderText="Precio" DataFormatString="{0:#,##0.###}" HtmlEncode="False" />--%>
|
||||
</Columns>
|
||||
<HeaderStyle CssClass="Titulos" Height="15px"></HeaderStyle>
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
|
||||
</div>
|
||||
|
||||
@@ -40086,13 +40086,13 @@ Partial Class Ventas
|
||||
DvModalTipoVentaPasoRequiereOS.Visible = False
|
||||
DvModalRequiereOSFecha.Visible = False
|
||||
DvModalTipoVentaPasoMedicoProcedimiento.Visible = False
|
||||
DVGvProductosProcedimiento.Visible = False
|
||||
DVGvPSProced.Visible = False
|
||||
Case "4" 'Consignación
|
||||
ChkRequiereTecnicoModal.Checked = False
|
||||
DvModalTipoVentaPasoRequiereOS.Visible = False
|
||||
DvModalRequiereOSFecha.Visible = False
|
||||
DvModalTipoVentaPasoMedicoProcedimiento.Visible = False
|
||||
DVGvProductosProcedimiento.Visible = False
|
||||
DVGvPSProced.Visible = False
|
||||
Case "99" ' Otros
|
||||
LnkDvModalTipoVentaAceptar.Visible = False
|
||||
UpDvModalTipoVenta.Update()
|
||||
@@ -40181,9 +40181,9 @@ Partial Class Ventas
|
||||
DdlMedicoModal.SelectedValueExist(-1)
|
||||
DdlProcedimientoModal.SelectedValueExist(-1)
|
||||
|
||||
GvProductosProcedimiento.DataSource = Nothing
|
||||
GvProductosProcedimiento.DataBind()
|
||||
DVGvProductosProcedimiento.Visible = False
|
||||
GvPSProced.DataSource = Nothing
|
||||
GvPSProced.DataBind()
|
||||
DVGvPSProced.Visible = False
|
||||
|
||||
|
||||
LblDvModalTipoVentaTitulo.Text = "Tipo de Venta"
|
||||
@@ -40233,7 +40233,7 @@ Partial Class Ventas
|
||||
End If
|
||||
End If
|
||||
|
||||
For Each GvRow As GridViewRow In GvProductosProcedimiento.Rows
|
||||
For Each GvRow As GridViewRow In GvPSProced.Rows
|
||||
Dim Cantidad As Decimal = GvRow.FCTextBox("TxtCantidad").Text.ToDecimal
|
||||
Dim CveUnidadMedida As Integer = GvRow.DataKey("CveUnidadMedida").ToEntero
|
||||
Dim Abreviatura As String = GvRow.DataKey("Abreviatura").ToString
|
||||
@@ -40316,7 +40316,7 @@ Partial Class Ventas
|
||||
|
||||
Dim CountPsAgregados As Integer = 0
|
||||
|
||||
For Each GvRow As GridViewRow In GvProductosProcedimiento.Rows
|
||||
For Each GvRow As GridViewRow In GvPSProced.Rows
|
||||
Dim Cantidad As Decimal = GvRow.FCTextBox("TxtCantidad").Text.ToDecimal
|
||||
Dim CveUnidadMedida As Integer = GvRow.DataKey("CveUnidadMedida").ToEntero
|
||||
Dim Abreviatura As String = GvRow.DataKey("Abreviatura").ToString
|
||||
@@ -40360,7 +40360,7 @@ Partial Class Ventas
|
||||
UpCliente.Update()
|
||||
End Sub
|
||||
|
||||
Protected Sub GvProductosProcedimiento_RowDataBound(sender As Object, e As GridViewRowEventArgs)
|
||||
Protected Sub GvPSProced_RowDataBound(sender As Object, e As GridViewRowEventArgs)
|
||||
If e.Row.RowType = DataControlRowType.DataRow Then
|
||||
If e.Row.DataKey("Precio").ToDecimal = 0 Then
|
||||
e.Row.FCTextBox("TxtCantidad").Enabled = False
|
||||
@@ -40374,26 +40374,30 @@ Partial Class Ventas
|
||||
UpDvModalTipoVenta.Update()
|
||||
|
||||
End Sub
|
||||
|
||||
Protected Sub DdlProcedimientoModal_SelectedIndexChanged(sender As Object, e As EventArgs)
|
||||
CargaPSProcedimiento(DdlProcedimientoModal.SelectedValue.ToEntero, DdlClienteSucursalCliente, DdlSubProyectoDatos.SelectedValue.ToEntero, CveClienteSucursalL:=DdlClienteSucursalSucursal, CveTipoVentaL:=RBLTipoVenta.SelectedValue.ToEntero)
|
||||
End Sub
|
||||
Protected Sub ChkVerTodosPS_CheckedChanged(sender As Object, e As EventArgs)
|
||||
|
||||
Private Sub CargaPSProcedimiento(CveProcedimiento As Integer, CveClienteL As Integer, CveSubProyectoL As Integer, Optional CveClienteSucursalL As Integer = -1, Optional CveTipoVentaL As Integer = -1)
|
||||
If CveProcedimiento > 0 Then
|
||||
CargaPSProcedimiento(DdlProcedimientoModal.SelectedValue.ToEntero, DdlClienteSucursalCliente, DdlSubProyectoDatos.SelectedValue.ToEntero, CveClienteSucursalL:=DdlClienteSucursalSucursal, CveTipoVentaL:=RBLTipoVenta.SelectedValue.ToEntero, AplicaTodos:=ChkVerTodosPS.Checked)
|
||||
End Sub
|
||||
|
||||
Private Sub CargaPSProcedimiento(CveProcedimiento As Integer, CveClienteL As Integer, CveSubProyectoL As Integer, Optional CveClienteSucursalL As Integer = -1, Optional CveTipoVentaL As Integer = -1, Optional AplicaTodos As Boolean = False)
|
||||
If CveProcedimiento > 0 OrElse AplicaTodos Then
|
||||
If AplicaTodos Then CveProcedimiento = -1
|
||||
Dim objVenta As New ClsVentas
|
||||
If objVenta.GetProcedimientoProducto(CveProcedimiento, 1, UsuarioActual.CveEmpresa, CveClienteL, CveSubProyectoL, CveClienteSucursalL, CveTipoVentaL) Then
|
||||
GvProductosProcedimiento.DataSource = objVenta.DtResultados
|
||||
If objVenta.GetProcedimientoProductoListaPrecio(CveProcedimiento, UsuarioActual.CveEmpresa, CveClienteL, CveSubProyectoL, CveClienteSucursalL, CveTipoVentaL) Then
|
||||
GvPSProced.DataSource = objVenta.DtResultados
|
||||
End If
|
||||
objVenta.Dispose()
|
||||
Else
|
||||
GvProductosProcedimiento.DataSource = Nothing
|
||||
GvPSProced.DataSource = Nothing
|
||||
End If
|
||||
|
||||
GvProductosProcedimiento.DataBind()
|
||||
DVGvProductosProcedimiento.Visible = True
|
||||
GvPSProced.DataBind()
|
||||
DVGvPSProced.Visible = True
|
||||
|
||||
For Each GvRow As GridViewRow In GvProductosProcedimiento.Rows
|
||||
For Each GvRow As GridViewRow In GvPSProced.Rows
|
||||
If RBLTipoVenta.SelectedValue = "2" Then
|
||||
|
||||
Dim Cantidad As Decimal = GvRow.FCTextBox("TxtCantidad").Text.ToDecimal
|
||||
@@ -41632,5 +41636,6 @@ Partial Class Ventas
|
||||
ObjVentas.Dispose()
|
||||
End Try
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
|
||||
|
||||
Reference in New Issue
Block a user