From 29fd3fa4b8c5b980487b18f9f1a9ceef5a23af17 Mon Sep 17 00:00:00 2001 From: Antonio Gonzalez Date: Wed, 26 Feb 2020 16:16:46 -0700 Subject: [PATCH] agregando busqueda de almacen --- App_Code/ClsInventarios.vb | 21 ++++++++ Empresas/141/Formatos/Factura.rdlc | 30 ++++++++---- Inventarios/PopUpExistenciasAlmacen.aspx | 26 +++++++++- Inventarios/PopUpExistenciasAlmacen.aspx.vb | 53 ++++++++++++++++++++- 4 files changed, 120 insertions(+), 10 deletions(-) diff --git a/App_Code/ClsInventarios.vb b/App_Code/ClsInventarios.vb index 7b8d53ecf..393e72e95 100644 --- a/App_Code/ClsInventarios.vb +++ b/App_Code/ClsInventarios.vb @@ -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") diff --git a/Empresas/141/Formatos/Factura.rdlc b/Empresas/141/Formatos/Factura.rdlc index 98de34936..894b6a23f 100644 --- a/Empresas/141/Formatos/Factura.rdlc +++ b/Empresas/141/Formatos/Factura.rdlc @@ -1477,20 +1477,15 @@ - Expedido en Sucursal: 2 + Expedido en Sucursal: - - + + + =Parameters!CiudadSucursal.Value + + + + diff --git a/Inventarios/PopUpExistenciasAlmacen.aspx b/Inventarios/PopUpExistenciasAlmacen.aspx index 4d0b6cd19..6b9f912bd 100644 --- a/Inventarios/PopUpExistenciasAlmacen.aspx +++ b/Inventarios/PopUpExistenciasAlmacen.aspx @@ -36,6 +36,18 @@ + + Medida: + + + + + + Rin: + + + + C. Barras: @@ -89,7 +101,7 @@
-
+
@@ -101,6 +113,18 @@
+
+ + + + + + + + + + +
diff --git a/Inventarios/PopUpExistenciasAlmacen.aspx.vb b/Inventarios/PopUpExistenciasAlmacen.aspx.vb index a3b1a02d3..4f988dc7f 100644 --- a/Inventarios/PopUpExistenciasAlmacen.aspx.vb +++ b/Inventarios/PopUpExistenciasAlmacen.aspx.vb @@ -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