From 70d0f69c355cc0c22157ebdc52a92e39fdbfb672 Mon Sep 17 00:00:00 2001 From: JORGE LUIS CAUDILLO ESPARZA Date: Thu, 26 Sep 2019 18:58:18 -0700 Subject: [PATCH] Cambios nominas e inventarios --- App_Code/ClsInventarios.vb | 24 ++++++ App_Code/ClsLeyendasFiscales.vb | 2 +- App_Code/ClsMetodosPagos.vb | 2 +- App_Code/ClsRH.vb | 10 ++- Inventarios/InventarioFisicoDetalle.aspx | 39 +++++++++ Inventarios/InventarioFisicoDetalle.aspx.vb | 92 ++++++++++++-------- RH/Personal.aspx | 95 ++++++++++++++++++++- RH/Personal.aspx.vb | 37 ++++++++ 8 files changed, 259 insertions(+), 42 deletions(-) diff --git a/App_Code/ClsInventarios.vb b/App_Code/ClsInventarios.vb index 9e75b20fa..af57333b1 100644 --- a/App_Code/ClsInventarios.vb +++ b/App_Code/ClsInventarios.vb @@ -2443,6 +2443,30 @@ Public Class ClsInventarios Return Retorno End Function + Public Function GetInventarioFisicoContador(CveInventarioFisico As Integer, CveUsuario As Integer, CodigoBarras As String) As Boolean + Dim Retorno As Boolean = False + + DataAdapter("PA_Inv_InventarioFisicoContadorGET") + + With SqlAdapter.SelectCommand.Parameters + .Add("@CveInventarioFisico", SqlDbType.Int).Value = CveInventarioFisico + .Add("@CodigoBarras", SqlDbType.VarChar).Value = CodigoBarras + .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch Ex1 As SqlException + + Me.OnError("Ocurrió un error al Obtener los detalles del Inventario Físico(Contador).", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + + Catch ex As Exception + OnError("Ocurrió un error al Obtener los detalles del Inventario Físico(Contador).", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + + Return Retorno + End Function #End Region #Region "I N V E N T A R I O - F I S I C O - R E S U L T A D O" diff --git a/App_Code/ClsLeyendasFiscales.vb b/App_Code/ClsLeyendasFiscales.vb index 7da70a2dd..55c873e76 100644 --- a/App_Code/ClsLeyendasFiscales.vb +++ b/App_Code/ClsLeyendasFiscales.vb @@ -39,7 +39,7 @@ Public Class ClsLeyendasFiscales Try SqlConexion.Open() Catch ex As Exception - Me.OnError("Ocurrió un error al intentar conectarse a la base de datos.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + Me.OnError("Ocurrió un error al intentar conectarse a la base de datos.", ex) End Try SqlAdapter = New SqlDataAdapter("PA_LeyendasFiscalesGet", SqlConexion) ConexionAdd() diff --git a/App_Code/ClsMetodosPagos.vb b/App_Code/ClsMetodosPagos.vb index dfb99b1f4..59097d1df 100644 --- a/App_Code/ClsMetodosPagos.vb +++ b/App_Code/ClsMetodosPagos.vb @@ -41,7 +41,7 @@ Public Class ClsMetodosPagos Try SqlConexion.Open() Catch ex As Exception - Me.OnError("Ocurrió un error al intentar conectarse a la base de datos.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + Me.OnError("Ocurrió un error al intentar conectarse a la base de datos.", ex) End Try SqlAdapter = New SqlDataAdapter("", SqlConexion) ConexionAdd() diff --git a/App_Code/ClsRH.vb b/App_Code/ClsRH.vb index 245553772..7aa66e67c 100644 --- a/App_Code/ClsRH.vb +++ b/App_Code/ClsRH.vb @@ -2086,19 +2086,25 @@ Public Class ClsRH Return Retorno End Function - Public Function AddConcepto(CvePersonal As Integer, CveConcepto As Integer, Importe As Double, TipoAplicacion As Integer, NoPagos As Integer, SaldoIni As Double, CveUsuario As Integer) As Boolean + Public Function AddConcepto(CvePersonal As Integer, CveConcepto As Integer, Importe As Double, TipoAplicacion As Integer, NoPagos As Integer, SaldoIni As Double, CveUsuario As Integer, Optional CveSistema As Integer = -1, Optional Descripcion01 As String = "", Optional Descripcion02 As String = "", Optional strFInicioAplicacion As String = "", Optional strFFinAplicacion As String = "", Optional Estatus As Integer = 1, Optional CveEmpresa As Integer = -1) As Boolean Dim Retorno As Boolean = False - SqlDataAdapter("PA_RH_PersonalConceptosAddUpd") With SqlAdapter.SelectCommand.Parameters .Add("@CvePersonal", SqlDbType.Int).Value = CvePersonal .Add("@CveConcepto", SqlDbType.Int).Value = CveConcepto + .Add("@CveSistema", SqlDbType.Int).Value = CveSistema + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa .Add("@Importe", SqlDbType.Money).Value = Importe .Add("@TipoAplicacion", SqlDbType.Int).Value = TipoAplicacion .Add("@NoPagos", SqlDbType.Int).Value = NoPagos .Add("@SaldoIni", SqlDbType.Money).Value = SaldoIni .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario + .Add("@Descripcion01", SqlDbType.VarChar).Value = Descripcion01 + .Add("@Descripcion02", SqlDbType.VarChar).Value = Descripcion02 + .Add("@strFInicioAplicacion", SqlDbType.VarChar).Value = strFInicioAplicacion + .Add("@strFFinAplicacion", SqlDbType.VarChar).Value = strFFinAplicacion + .Add("@Estatus", SqlDbType.Int).Value = Estatus End With Try diff --git a/Inventarios/InventarioFisicoDetalle.aspx b/Inventarios/InventarioFisicoDetalle.aspx index 097783418..2a55c0a31 100644 --- a/Inventarios/InventarioFisicoDetalle.aspx +++ b/Inventarios/InventarioFisicoDetalle.aspx @@ -244,6 +244,45 @@ + + +
+ +
+
+
+ +
+
+ Consultar Producto + +
+
+
+
+ +
+ +
+
+ +
+
+
+ <%----%> +
+

+ +

+
+ +
+
+
+
+
+
+
diff --git a/Inventarios/InventarioFisicoDetalle.aspx.vb b/Inventarios/InventarioFisicoDetalle.aspx.vb index ba4af4ee1..33153f984 100644 --- a/Inventarios/InventarioFisicoDetalle.aspx.vb +++ b/Inventarios/InventarioFisicoDetalle.aspx.vb @@ -277,42 +277,44 @@ Partial Class Inventarios_InventarioFisicoDetalle If SerieLote <> "" And (SerieLote.ToUpper = dr("Codigo").ToString.ToUpper Or SerieLote.ToUpper = dr("CodigoBarras").ToString.ToUpper) Then Alert($"La serie indicada {SerieLote} coincide con el codigo o codigo de barras del producto. Por favor rectifique y vuelva a intentar.", TipoMensaje.MsgAdvertencia) Exit Sub - End If - - - Dim Inventarios As New ClsInventarios + End If + + Dim Consulto As Boolean = False - If Inventarios.AddInventarioFisicoDetalle(CveInventarioFisico, CveProducto, CveUnidadMedida, If(CveMetodoInv = 5, 1, Cantidad), SerieLote, UsuarioActual.CveUsuario) Then - If GvIFDUltimoRegistrado.Rows.Count > 0 Then - GvIFDUltimoRegistrado.Rows(0).Cells(0).Text = Now - GvIFDUltimoRegistrado.Rows(0).Cells(1).Text = dr("CodigoBarras").ToString - GvIFDUltimoRegistrado.Rows(0).Cells(2).Text = dr("Codigo").ToString - GvIFDUltimoRegistrado.Rows(0).Cells(3).Text = dr("PS").ToString - GvIFDUltimoRegistrado.Rows(0).Cells(4).Text = TxtCodigoSerie.Text.Trim - GvIFDUltimoRegistrado.Rows(0).Cells(5).Text = TxtCantidadProducto.Text.Trim - Else - Consulto = True - If Inventarios.GetInventarioFisicoDetalle(CveInventarioFisico, UsuarioActual.CveUsuario) Then - If Inventarios.DtResultados.Rows.Count > 0 Then - GvIFDUltimoRegistrado.DataSource = Inventarios.DtResultados.AsEnumerable.OrderByDescending(Function(k) k!CveInventarioFisicoDetalle).Take(1).CopyToDataTable - Else - GvIFDUltimoRegistrado.DataSource = Nothing - End If - Else - Alert("Ocurrió un error al consultar el inventario fisico. Por favor vuelva a intentar.", TipoMensaje.MsgError) - RegistraScript("playsonidito('142608__autistic-lucario__error.wav')") - End If - End If - TxtCodigoBarras.Text = "" - TxtCodigoSerie.Text = "" - TxtCodigo.Text = "" - TxtCantidadProducto.Text = "1" - RegistraScript("playsonidito('beep-07.wav')") - Else - TxtCodigoSerie.Text = "" - End If - TxtCodigoBarras.Focus() - Inventarios.Dispose() + Using Inventarios As New ClsInventarios + + If Inventarios.AddInventarioFisicoDetalle(CveInventarioFisico, CveProducto, CveUnidadMedida, If(CveMetodoInv = 5, 1, Cantidad), SerieLote, UsuarioActual.CveUsuario) Then + If GvIFDUltimoRegistrado.Rows.Count > 0 Then + GvIFDUltimoRegistrado.Rows(0).Cells(0).Text = Now + GvIFDUltimoRegistrado.Rows(0).Cells(1).Text = dr("CodigoBarras").ToString + GvIFDUltimoRegistrado.Rows(0).Cells(2).Text = dr("Codigo").ToString + GvIFDUltimoRegistrado.Rows(0).Cells(3).Text = dr("PS").ToString + GvIFDUltimoRegistrado.Rows(0).Cells(4).Text = TxtCodigoSerie.Text.Trim + GvIFDUltimoRegistrado.Rows(0).Cells(5).Text = TxtCantidadProducto.Text.Trim + Else + Consulto = True + If Inventarios.GetInventarioFisicoDetalle(CveInventarioFisico, UsuarioActual.CveUsuario) Then + If Inventarios.DtResultados.Rows.Count > 0 Then + GvIFDUltimoRegistrado.DataSource = Inventarios.DtResultados.AsEnumerable.OrderByDescending(Function(k) k!CveInventarioFisicoDetalle).Take(1).CopyToDataTable + Else + GvIFDUltimoRegistrado.DataSource = Nothing + End If + Else + Alert("Ocurrió un error al consultar el inventario fisico. Por favor vuelva a intentar.", TipoMensaje.MsgError) + RegistraScript("playsonidito('142608__autistic-lucario__error.wav')") + End If + End If + TxtCodigoBarras.Text = "" + TxtCodigoSerie.Text = "" + TxtCodigo.Text = "" + TxtCantidadProducto.Text = "1" + RegistraScript("playsonidito('beep-07.wav')") + Else + TxtCodigoSerie.Text = "" + End If + TxtCodigoBarras.Focus() + End Using + If Consulto Then GvIFDUltimoRegistrado.DataBind() Else TxtCodigoBarras.Text = "" @@ -469,4 +471,24 @@ Partial Class Inventarios_InventarioFisicoDetalle #End Region + Protected Sub BtnBuscarCodVarras_Click(sender As Object, e As EventArgs) + Dim CodigoBarras As String = If(TxtConCodigoVarras.Text.Trim <> "", TxtConCodigoVarras.Text.Trim, "-1").Replace("'", "''") + LblContador.Text = "No se encontraron resultados" + Using Inventarios As New ClsInventarios + If Inventarios.GetInventarioFisicoContador(CveInventarioFisico, ddlUsuario.SelectedValue.ToString.ToEntero, CodigoBarras) Then + 'Cantidad,@CodigoBarras CodigoBarras + If (Inventarios.DtResultados.Rows.Count > 0) Then + Dim drow As DataRow = Inventarios.DtResultados.Rows(0) + If (drow("Cantidad").ToString().ToDouble() > 0) Then + LblContador.Text = String.Format("Contador={0:##,###.##}", drow("Cantidad")) + Else + + End If + End If + End If + End Using + UpBuscar.Update() + ' UsuarioActual.CveUsuario + ' + End Sub End Class diff --git a/RH/Personal.aspx b/RH/Personal.aspx index 0d84775c0..3b139a670 100644 --- a/RH/Personal.aspx +++ b/RH/Personal.aspx @@ -1248,12 +1248,16 @@
-
+
- + Conceptos
+
+ + +
@@ -1261,7 +1265,9 @@
- + Aplica @@ -1309,6 +1315,10 @@ + + + + @@ -1331,6 +1341,85 @@
+ +
+
+
+ + Infonavit +
+
+ + +
+
+
+ +
+
+
+
+
+
+
+ + +
+
+
+
+ + +
+
+
+
+
+
+ + + + + + + + +
+
+
+
+ + +
+
+
+
+
+
+ + + + + +
+
+ + + +
+
+
+
+ +
+
+
+ +
+
+
+
+
diff --git a/RH/Personal.aspx.vb b/RH/Personal.aspx.vb index f77aa2fbb..c26034a1b 100644 --- a/RH/Personal.aspx.vb +++ b/RH/Personal.aspx.vb @@ -2036,6 +2036,17 @@ Partial Class RH_Personal Dim ObjPersonal As New ClsRH If ObjPersonal.GetPersonalConceptos(CvePersonal, UsuarioActual.CveEmpresa) Then GVConceptos.DataSource = ObjPersonal.DtResultados + Dim frow As DataRow = ObjPersonal.DtResultados.FiltroPrimero("CveSistema =3") + If Not IsNothing(frow) Then + TxtInfoValor.Text = String.Format("{0:###,###.##}", frow("Importe")) + DdlInfoTipoAplicacion.SelectedValueExist(frow("TipoAplicacion").ToString()) + + Dim TipoAplicacion As Integer = DdlInfoTipoAplicacion.SelectedValue.ToEntero + TxtInfoDescripcion.Text = String.Format("{0}", frow("Descripcion02")) + TxtInfoNumCredito.Text = String.Format("{0}", frow("Descripcion01")) + TxtInfoFechaInicio.Text = String.Format("{0:dd/MM/yyyy}", frow("FInicioAplicacion")) + ChkInfo.Checked = frow("estatus").ToString().ToUpper().Contiene("1", "TRUE") + End If Else GVConceptos.DataSource = Nothing End If @@ -2093,6 +2104,32 @@ Partial Class RH_Personal End If End Sub + Protected Sub BtnGuardarInfornavit_Click(sender As Object, e As EventArgs) + Dim importe As Decimal = TxtInfoValor.Text.ToDecimal() + Dim TipoAplicacion As Integer = DdlInfoTipoAplicacion.SelectedValue.ToEntero + Dim NoPagos As Integer = 0 + Dim SaldoIni As Decimal = 0 + Dim descripcion02 As String = TxtInfoDescripcion.Text + Dim descripcion01 As String = TxtInfoNumCredito.Text + Dim fecha As String = TxtInfoFechaInicio.Text.Replace("_", "") + Dim estatus As Integer = If(ChkInfo.Checked, 1, 0) + If fecha.Length > 8 Then + fecha = fecha.ToDateTime().ToString("yyyy/MM/dd") + Else + fecha = "" + End If + Dim OcurrioError As Boolean = False + Using ObjPersonal As New ClsRH + + If Not ObjPersonal.AddConcepto(CvePersonal, -1, importe, TipoAplicacion, NoPagos, SaldoIni, UsuarioActual.CveUsuario, 3, descripcion01, descripcion02, fecha, "", estatus, UsuarioActual.CveEmpresa) Then + OcurrioError = True + End If + End Using + If Not OcurrioError Then + Alert("Se actualizo el calculo de infonavit") + CarcaConceptosNomina() + End If + End Sub Protected Sub BtnGuardarConceptos_Click(sender As Object, e As System.EventArgs) Handles BtnGuardarConceptos.Click If CvePersonal > 0 Then Dim ObjPersonal As New ClsRH