agregando busqueda de almacen

This commit is contained in:
Antonio Gonzalez
2020-02-26 16:16:46 -07:00
parent 2ae43964b3
commit 29fd3fa4b8
4 changed files with 120 additions and 10 deletions

View File

@@ -4878,6 +4878,27 @@ Public Class ClsInventarios
End Try
Return Retorno
End Function
Public Function GetExistenciasMedRin(CvePS As Integer, CveEmpresa As Integer, CveRinTamaño As Integer, CveMedida As Integer) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Inv_ExistenciaMedRinGet")
With SqlAdapter.SelectCommand.Parameters
.Add("@CvePS", SqlDbType.Int).Value = CvePS
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
.Add("@CveRinTamaño", SqlDbType.Int).Value = CveRinTamaño
.Add("@CveMedida", SqlDbType.Int).Value = CveMedida
End With
Try
SqlAdapter.Fill(Data)
Retorno = True
Catch ex As Exception
OnError("Ocurrió un error al obtener las Existencias.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
End Try
Return Retorno
End Function
Public Function UpdateCamiones(CveCamion As Integer, Placa As String, Especificacion As String) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Inv_CamionesUpdate")

View File

@@ -1477,20 +1477,15 @@
<Paragraph>
<TextRuns>
<TextRun>
<Value>Expedido en Sucursal: 2</Value>
<Value>Expedido en Sucursal:</Value>
<Style>
<FontFamily>Calibri</FontFamily>
<FontSize>8pt</FontSize>
<FontWeight>Normal</FontWeight>
</Style>
</TextRun>
</TextRuns>
<Style />
</Paragraph>
<Paragraph>
<TextRuns>
<TextRun>
<Value>MATRIZ</Value>
<Value>=Parameters!Sucursal.Value</Value>
<Style>
<FontFamily>Calibri</FontFamily>
<FontSize>8pt</FontSize>
@@ -1867,7 +1862,23 @@
<Paragraph>
<TextRuns>
<TextRun>
<Value>Lugar, fecha y hora de emisión: </Value>
<Value>Lugar, fecha y hora de emisión:</Value>
<Style>
<FontFamily>Calibri</FontFamily>
<FontSize>8pt</FontSize>
<FontWeight>Normal</FontWeight>
</Style>
</TextRun>
<TextRun>
<Value>=Parameters!CiudadSucursal.Value</Value>
<Style>
<FontFamily>Calibri</FontFamily>
<FontSize>8pt</FontSize>
<FontWeight>Normal</FontWeight>
</Style>
</TextRun>
<TextRun>
<Value xml:space="preserve"> </Value>
<Style>
<FontFamily>Calibri</FontFamily>
<FontSize>8pt</FontSize>
@@ -2187,6 +2198,9 @@
<Height>1.05328cm</Height>
<Width>17.71415cm</Width>
<ZIndex>15</ZIndex>
<Visibility>
<Hidden>=IIF((Sum(IIF(Fields!CveClasificacion.Value = 20345,1,0), "DsOC") &gt; 0),false,true)</Hidden>
</Visibility>
<Style>
<Border>
<Style>None</Style>

View File

@@ -36,6 +36,18 @@
</asp:UpdatePanel>
</td>
</tr>
<tr runat="server" id="DivMed" visible="false">
<td class="text-right">Medida: </td>
<td >
<asp:DropDownList runat="server" ID="DdlMedidas" CssClass="form-control input-sm select2me" Width="150px" DataTextField="Medida" DataValueField="CveMedida"></asp:DropDownList>
</td>
</tr>
<tr runat="server" id="DivRin" visible="false">
<td class="text-right">Rin: </td>
<td >
<asp:DropDownList runat="server" ID="DdlRin" CssClass="form-control input-sm select2me" Width="150px" DataTextField="RinTamaño" DataValueField="CveRinTamaño"></asp:DropDownList>
</td>
</tr>
<tr runat="server" id="DivCodigoSeriePS" visible="false">
<td class="text-right"><b>C. Barras:</b></td>
<td>
@@ -89,7 +101,7 @@
</div>
</div>
<div class="row">
<div id="DivPS" style="overflow-y: auto; width: 765px; height: 365px;">
<div id="DivPS" style="overflow-y: auto; width: 765px; height: 365px;" runat="server">
<asp:GridView ID="GV" Width="100%" runat="server" AutoGenerateColumns="false" EmptyDataText="No se encontraron registros" ToolTip="Listado de Contratos encontrados." CssClass="table table-striped table-hover" GridLines="None">
<Columns>
<asp:BoundField DataField="Almacen" HeaderText="Almacén" />
@@ -101,6 +113,18 @@
</Columns>
</asp:GridView>
</div>
<div id="DivMedRin" style="overflow-y: auto; width: 765px; height: 365px;" runat="server" visible="True">
<asp:GridView ID="GvMedRin" Width="100%" runat="server" AutoGenerateColumns="false" EmptyDataText="No se encontraron registros" ToolTip="Listado de Contratos encontrados." 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="Existencia" ItemStyle-HorizontalAlign="Right" HeaderText="Existencia" DataFormatString="{0:#,###.######}" />
<asp:BoundField DataField="PendientePorSurtir" ItemStyle-HorizontalAlign="Right" HeaderText="Pendiente 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"/>
</Columns>
</asp:GridView>
</div>
</div>
</div>
</ContentTemplate>

View File

@@ -65,6 +65,13 @@ Partial Class Inventarios_Default
DDlPS.DataBind()
End If
If UsuarioActual.Empresa.Funcionalidad(558) = "1" Then
DivMed.Visible = True
DivRin.Visible = True
CargarMedRin()
DivMedRin.Visible = True
DivPS.Visible = False
End If
Dim Txt As String = IfNull(Request("Txt"), "").ToString
If Txt <> "" Then LblTitulo.Text = String.Format("Búsqueda de {0}", Txt)
@@ -80,7 +87,11 @@ Partial Class Inventarios_Default
End Sub
Protected Sub BtnBuscar_Click(sender As Object, e As System.EventArgs) Handles BtnBuscar.Click
CargaDatos(DDlPS.SelectedValue.ToEntero, 1)
If UsuarioActual.Empresa.Funcionalidad(558) = "1" Then
CargarDatosMedRin()
Else
CargaDatos(DDlPS.SelectedValue.ToEntero, 1)
End If
End Sub
Private Sub CargaDatos(CvePS As Integer, Tipo As Integer)
Dim ObjInventarios As New ClsInventarios()
@@ -162,6 +173,19 @@ Partial Class Inventarios_Default
End If
End Sub
Private Sub GvMedRin_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvMedRin.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
If e.Row.DBCampo("CveAlmacen") = "" Then
e.Row.CssClass = "Totales"
End If
If UsuarioActual.CveEmpresa = 119 Then
GV.Columns(5).Visible = True
End If
End If
End Sub
#Region " BUSCA | CODIGO - SERIE "
Protected Sub BtnCodigoPS_Click(sender As Object, e As EventArgs)
@@ -178,11 +202,38 @@ Partial Class Inventarios_Default
Exit Sub
End If
CargaDatos(DrPS("CvePS").ToString.ToEntero, 2)
TxtCodigoPS.Text = ""
TxtCodigoPS.Focus()
End Sub
#End Region
Private Sub CargarMedRin()
Dim ObjGral As New ClsGenerales
If ObjGral.GetMedidas(UsuarioActual.CveEmpresa) Then
DdlMedidas.DataSource = ObjGral.DtResultados
If ObjGral.GetRimTamanios(UsuarioActual.CveEmpresa) Then
DdlRin.DataSource = ObjGral.DtResultados
End If
End If
ObjGral.Dispose()
DdlMedidas.DataBind()
DdlRin.DataBind()
DdlMedidas.Items.Insert(0, New ListItem("-", "-1"))
DdlRin.Items.Insert(0, New ListItem("-", "-1"))
End Sub
Private Sub CargarDatosMedRin()
Dim ObjInventarios As New ClsInventarios
If ObjInventarios.GetExistenciasMedRin(DDlPS.SelectedValue.ToEntero, UsuarioActual.CveEmpresa, DdlRin.SelectedValue.ToEntero, DdlMedidas.SelectedValue.ToEntero) Then
GvMedRin.DataSource = ObjInventarios.DtResultados
End If
ObjInventarios.Dispose()
GvMedRin.DataBind()
UPDatos.Update()
End Sub
End Class