--filtro por compuesto

This commit is contained in:
2022-09-24 10:10:04 -07:00
parent 52c498d331
commit 1481b69c2a
2 changed files with 87 additions and 53 deletions

View File

@@ -91,6 +91,13 @@
</td>
<td></td>
</tr>
<tr align="left" runat="server" id="TrCompuesto" visible="false">
<td class="text-right"><b>Compuesto:</b></td>
<td>
<asp:TextBox ID="TxtCompuesto" AutoPostBack="True" runat="server" CssClass="form-control input-sm select2me" Width="400px"></asp:TextBox>
</td>
<td></td>
</tr>
<tr>
<td colspan="4" style="text-align: center;">
@@ -130,11 +137,12 @@
<asp:GridView ID="GV" Width="100%" runat="server" AutoGenerateColumns="false" EmptyDataText="No se encontraron registros" ToolTip="" CssClass="table table-striped table-hover" GridLines="None">
<Columns>
<asp:BoundField DataField="Almacen" HeaderText="Almacén" />
<asp:BoundField DataField="UnidadMedida" HeaderText="Unidad de Medida" />
<asp:BoundField DataField="UnidadMedida" HeaderText="Unidad Medida" />
<asp:BoundField DataField="Existencia" ItemStyle-HorizontalAlign="Right" HeaderText="Existencia" DataFormatString="{0:#,###.######}" />
<asp:BoundField DataField="PendientePorSurtir" ItemStyle-HorizontalAlign="Right" HeaderText="Pendiente Por Surtir" DataFormatString="{0:#,###.######}" />
<asp:BoundField DataField="PendientePorSurtir" ItemStyle-HorizontalAlign="Right" HeaderText="Pte. Por Surtir" DataFormatString="{0:#,###.######}" />
<asp:BoundField DataField="ExistenciaFinal" ItemStyle-HorizontalAlign="Right" HeaderText="Existencia Real" DataFormatString="{0:#,###.######}" />
<asp:BoundField DataField="CantidadDisponibleInv" ItemStyle-HorizontalAlign="Right" HeaderText="Pendiente Por Recibir" DataFormatString="{0:#,###.######}" Visible="false"/>
<asp:BoundField DataField="CantidadDisponibleInv" ItemStyle-HorizontalAlign="Right" HeaderText="Pendiente Recibir" DataFormatString="{0:#,###.######}" Visible="false"/>
<asp:BoundField DataField="Compuesto" HeaderText="Compuesto" Visible="false"/>
<%-- <asp:BoundField DataField="Importe" ItemStyle-HorizontalAlign="Right" HeaderText="Precio Neto" DataFormatString="{0:N2}"/>
<asp:BoundField DataField="ImportePromocion" ItemStyle-HorizontalAlign="Right" HeaderText="Precio Promoción" DataFormatString="{0:N2}"/>--%>
</Columns>

View File

@@ -73,6 +73,9 @@ Partial Class Inventarios_Default
DivEquivalentes.Visible = True
DivPS.Visible = False
End If
If UsuarioActual.CveEmpresa = 119 AndAlso UsuarioActual.CveUsuario.Contiene(1703, 100) Then
TrCompuesto.Visible = True
End If
Dim Txt As String = IfNull(Request("Txt"), "").ToString
If Txt <> "" Then LblTitulo.Text = String.Format("Búsqueda de {0}", Txt)
@@ -91,6 +94,8 @@ Partial Class Inventarios_Default
If UsuarioActual.Empresa.Funcionalidad(558) = "1" Then
CargarDatosMedRin()
CargaEquivalencia()
ElseIf UsuarioActual.CveEmpresa = 119 AndAlso UsuarioActual.CveUsuario.Contiene(1703, 100) Then
CargaDatosCompuesto()
Else
CargaDatos(DDlPS.SelectedValue.ToEntero, 1)
End If
@@ -107,53 +112,7 @@ Partial Class Inventarios_Default
If ObjInventarios.GetExistenciasProducto(CvePS, -1, UsuarioActual.CveEmpresa, -1, FechaMovto:=DateTime.Today.AddDays(1).ToString("yyyy/MM/dd HH:mm"),
ExcluyeApartados:=-1, ExcluyeAdelantado:=1, CveSubProyecto:=DdlSubProyecto.SelectedValue.ToEntero,
ExcluyeTransitorios:=1, RestringirAlmacenes:=RestringirAlmacenes, TopSelect:=100) Then
Dim dr As Data.DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePS).FiltroPrimero("")
If dr IsNot Nothing Then
LtPs.Text = $"Producto: <b>{dr("PSCodigo").ToString}</b>"
Dim CvePrecioLista As Integer = -1
If Not UsuarioActual.Empresa.Funcionalidad(404).ToEntero > 0 Then 'sino manneja precios de lista
CvePrecioLista = -2
End If
Dim ObjVta As New ClsVentas
Dim objPS As New ClsProductosServicios
If ObjVta.GetPrecioListas(UsuarioActual.CveEmpresa) Then
If ObjVta.DtResultados.Rows.Count > 0 Then
If CvePrecioLista = -1 Then CvePrecioLista = ObjVta.DtResultados.Rows(0)("CvePrecioLista").ToString.ToEntero
If objPS.GetPSPreciosLista(UsuarioActual.CveEmpresa, CvePrecioLista, -1, DDlPS.SelectedValue.ToEntero) Then
If objPS.DtResultados.Rows.Count > 0 Then
LtPrecioPS.Text = $"Precio de venta: <b>$: {objPS.DtResultados.Rows(0)("PrecioLista").ToString.FormatoNumero} {dr("Abreviatura").ToString}</b>"
End If
End If
End If
End If
ObjVta.Dispose()
objPS.Dispose()
If UsuarioActual.CveEmpresa = 119 Then
If CBool(dr("AplicaIEPS")) Then
LtlIEPS.Visible = True
LtlIEPSPorcentaje.Visible = True
LtlIEPSPorcentaje.Text = $"<b>% {(dr("IEPSPorcentaje").ToString.ToDouble * 100).FormatoNumero}</b>"
Else
LtlIEPS.Visible = False
LtlIEPSPorcentaje.Visible = False
End If
If dr("IVA").ToString = "-1" OrElse dr("IVA").ToString.ToDecimal > 0 Then
LtlIVA.Visible = True
LtlIVAPorcentaje.Visible = True
LtlIVAPorcentaje.Text = $"<b>Si</b>"
Else
LtlIVA.Visible = False
LtlIVAPorcentaje.Visible = False
End If
End If
End If
If UsuarioActual.TienePermisoPagina(624) Then
HlPendiente.Visible = True
HlPendiente.NavigateUrl = String.Format("/Inventarios/RepVentasXSurtir.aspx?CvePS={0}", CvePS)
End If
CargaPS(CvePS)
If ObjInventarios.DtResultados.Rows.Count > 0 Then
GV.DataSource = ObjInventarios.DtResultados
@@ -167,14 +126,66 @@ Partial Class Inventarios_Default
ObjInventarios.Dispose()
GV.DataBind()
UPDatos.Update()
TblBusqueda.Visible = True
Else
Alert("Seleccione un producto", TipoMensaje.MsgAdvertencia)
End If
End Sub
Private Sub CargaPS(CvePS As Integer)
If CvePS <= 0 Then Exit Sub
Dim dr As Data.DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePS).FiltroPrimero("")
If dr IsNot Nothing Then
TblBusqueda.Visible = True
LtPs.Text = $"Producto: <b>{dr("PSCodigo").ToString}</b>"
Dim CvePrecioLista As Integer = -1
If Not UsuarioActual.Empresa.Funcionalidad(404).ToEntero > 0 Then 'sino manneja precios de lista
CvePrecioLista = -2
End If
Dim ObjVta As New ClsVentas
Dim objPS As New ClsProductosServicios
If ObjVta.GetPrecioListas(UsuarioActual.CveEmpresa) Then
If ObjVta.DtResultados.Rows.Count > 0 Then
If CvePrecioLista = -1 Then CvePrecioLista = ObjVta.DtResultados.Rows(0)("CvePrecioLista").ToString.ToEntero
If objPS.GetPSPreciosLista(UsuarioActual.CveEmpresa, CvePrecioLista, -1, DDlPS.SelectedValue.ToEntero) Then
If objPS.DtResultados.Rows.Count > 0 Then
LtPrecioPS.Text = $"Precio de venta: <b>$: {objPS.DtResultados.Rows(0)("PrecioLista").ToString.FormatoNumero} {dr("Abreviatura").ToString}</b>"
End If
End If
End If
End If
ObjVta.Dispose()
objPS.Dispose()
If UsuarioActual.CveEmpresa = 119 Then
If CBool(dr("AplicaIEPS")) Then
LtlIEPS.Visible = True
LtlIEPSPorcentaje.Visible = True
LtlIEPSPorcentaje.Text = $"<b>% {(dr("IEPSPorcentaje").ToString.ToDouble * 100).FormatoNumero}</b>"
Else
LtlIEPS.Visible = False
LtlIEPSPorcentaje.Visible = False
End If
If dr("IVA").ToString = "-1" OrElse dr("IVA").ToString.ToDecimal > 0 Then
LtlIVA.Visible = True
LtlIVAPorcentaje.Visible = True
LtlIVAPorcentaje.Text = $"<b>Si</b>"
Else
LtlIVA.Visible = False
LtlIVAPorcentaje.Visible = False
End If
End If
If UsuarioActual.TienePermisoPagina(624) Then
HlPendiente.Visible = True
HlPendiente.NavigateUrl = String.Format("/Inventarios/RepVentasXSurtir.aspx?CvePS={0}", CvePS)
End If
End If
End Sub
Private Sub GV_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GV.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
If e.Row.DBCampo("CveAlmacen") = "" Then
@@ -199,7 +210,22 @@ Partial Class Inventarios_Default
End If
End Sub
Private Sub CargaDatosCompuesto()
Dim Compuesto As String = TxtCompuesto.Text.Trim
If Compuesto = "" Then Compuesto = "-1"
Dim ObjInventarios As New ClsInventarios
If ObjInventarios.GetExistencias119(DDlPS.SelectedValue.ToEntero, UsuarioActual.CveEmpresa, DdlSubProyecto.SelectedValue.ToEntero, UsuarioActual.CveUsuario, Compuesto) Then
GV.DataSource = ObjInventarios.DtResultados
TblBusqueda.Visible = False
CargaPS(DDlPS.SelectedValue.ToEntero)
GV.Columns(6).Visible = True
End If
ObjInventarios.Dispose()
GV.DataBind()
UPDatos.Update()
DivMedRin.Visible = True
End Sub
#Region " BUSCA | CODIGO - SERIE "
Protected Sub BtnCodigoPS_Click(sender As Object, e As EventArgs)