From c31724b338e6f2d6e5acdca451e2fc1719ff0af5 Mon Sep 17 00:00:00 2001 From: JORGE LUIS CAUDILLO ESPARZA Date: Fri, 16 Apr 2021 09:49:45 -0700 Subject: [PATCH] --- App_Code/ClsGenerales.vb | 36 ++++++++++++- App_Code/ClsNominas.vb | 35 +++++++++++++ App_Code/modExtensiones.vb | 4 +- Nomina/Nomina2.aspx | 87 ++++++++++++++++++++++++++++++-- Nomina/Nomina2.aspx.cs | 100 +++++++++++++++++++++++++++++++++++++ RH/Personal.aspx | 48 +++++++++++------- RH/Personal.aspx.vb | 56 ++++++++++++++++++--- 7 files changed, 332 insertions(+), 34 deletions(-) diff --git a/App_Code/ClsGenerales.vb b/App_Code/ClsGenerales.vb index 59017b394..353146e49 100644 --- a/App_Code/ClsGenerales.vb +++ b/App_Code/ClsGenerales.vb @@ -1592,7 +1592,41 @@ Public Class ClsGenerales End Try Return Retorno - End Function + End Function + + Public Function UpdateCuentasDepositosPersonal(CveCuentaDeposito As Integer, BancoNombre As String, Cuenta As String, CLABE As String, CveMoneda As Integer, CveUsuarioModifico As Integer, EstatusPagoElectronico As Boolean, Estatus As Boolean, CveSATBanco As Integer) As Boolean + Dim Retorno As Boolean = False + + DataAdapter("PA_Gral_CuentasDepositosPersonalUpdate") + + With SqlAdapter.SelectCommand.Parameters + .Add("@CveCuentaDeposito", SqlDbType.Int).Value = CveCuentaDeposito + .Add("@BancoNombre", SqlDbType.VarChar).Value = BancoNombre + .Add("@Cuenta", SqlDbType.VarChar).Value = Cuenta + .Add("@CLABE", SqlDbType.VarChar).Value = CLABE + .Add("@Estatus", SqlDbType.VarChar).Value = Estatus + .Add("@CveMoneda", SqlDbType.Int).Value = CveMoneda + .Add("@CveUsuarioModifico", SqlDbType.Int).Value = CveUsuarioModifico + .Add("@Correo", SqlDbType.VarChar).Value = Correo + .Add("@EstatusPagoElectronico", SqlDbType.Bit).Value = EstatusPagoElectronico + .Add("@CveSATBanco", SqlDbType.Int).Value = CveSATBanco + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch Ex1 As SqlException + If Ex1.Message.Contains("Número: 2627;") Then + Alert("Ya existe un registro con el mismo nombre", TipoMensaje.MsgAdvertencia) + Else + Me.OnError("Ocurrió un error al guardar los cambios", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End If + Catch ex As Exception + OnError("Ocurrió un error al guardar los cambios.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + + Return Retorno + End Function Public Function UpdateCuentasDepositos(CveCuentaDeposito As Integer, BancoNombre As String, Plaza As String, Sucursal As String, Cuenta As String, CLABE As String, CIE As String, SWIFT As String, Referencia As String, RefCrediProveedor As String, Predeterminada As Boolean, Estatus As Boolean, CveMoneda As Integer, Optional CveUsuarioModifico As Integer = -1, Optional Correo As String = "", diff --git a/App_Code/ClsNominas.vb b/App_Code/ClsNominas.vb index 32d650303..fa2e30bf1 100644 --- a/App_Code/ClsNominas.vb +++ b/App_Code/ClsNominas.vb @@ -198,6 +198,41 @@ Public Class ClsNominas End Function + Public Function ReportedeincidenciasGET(cveEmpresa As Integer, FechaInicio As DateTime, FechaFin As DateTime, CveTipoPeriodo As Integer) As Boolean + Dim retorno As Boolean = False + DTSet = New DataSet() + DataAdapter("PA_RH_ReportedeincidenciasGET", CommandType.StoredProcedure) + With SqlAdapter.SelectCommand.Parameters + .Add("@CveEmpresa", SqlDbType.Int).Value = cveEmpresa + .Add("@FechaInicio", SqlDbType.Date).Value = FechaInicio + .Add("@FechaFin", SqlDbType.Date).Value = FechaFin + .Add("@TipoPeriodo", SqlDbType.Int).Value = CveTipoPeriodo + End With + Try + SqlAdapter.Fill(DTSet) + retorno = True + Catch ex As Exception + OnError("Ocurrió un error al obtener el reporte de incidencias.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + Return retorno + End Function + Public Function ReportedeAcumuladosGET(cveEmpresa As Integer, Periodo As Integer, CveTipoPeriodo As Integer) As Boolean + Dim retorno As Boolean = False + DTSet = New DataSet() + DataAdapter("PA_RH_ReportedeAcumuladosGET", CommandType.StoredProcedure) + With SqlAdapter.SelectCommand.Parameters + .Add("@CveEmpresa", SqlDbType.Int).Value = cveEmpresa + .Add("@Periodo", SqlDbType.Int).Value = Periodo + .Add("@TipoPeriodo", SqlDbType.Int).Value = CveTipoPeriodo + End With + Try + SqlAdapter.Fill(DTSet) + retorno = True + Catch ex As Exception + OnError("Ocurrió un error al obtener el reporte de acumulados.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + Return retorno + End Function Public Function GetCalculoAguinaldo(ejercicio As Int32, cveEmpresa As Int32, importe As Double, CveTipoPeriodo As Integer, CvePeriodo As Integer) As Boolean Dim retorno As Boolean = False DataAdapter("PA_NomCalcularAguinaldo", CommandType.StoredProcedure) diff --git a/App_Code/modExtensiones.vb b/App_Code/modExtensiones.vb index fbe97480e..95db7694d 100644 --- a/App_Code/modExtensiones.vb +++ b/App_Code/modExtensiones.vb @@ -577,8 +577,8 @@ Namespace Extensiones Else Return CDbl(Obj(key)) End If - End Function - + End Function + Public Function ToEntero(Obj As Object) As Integer diff --git a/Nomina/Nomina2.aspx b/Nomina/Nomina2.aspx index 27158a68e..881dcec31 100644 --- a/Nomina/Nomina2.aspx +++ b/Nomina/Nomina2.aspx @@ -159,6 +159,12 @@
  • Timbrar todos
  • +
  • + Incidencias asistencia +
  • +
  • + Reporte acumulados +
  • Empleado concepto
  • @@ -197,7 +203,7 @@ - + @@ -1123,7 +1129,7 @@
    - + - + <%----%> <%-- --%> @@ -1546,7 +1552,7 @@
    - Actualizar + Actualizar
    @@ -1949,7 +1955,80 @@ + + -
    - - - - - -
    -
    - - - -
    -
    - - - +
    +
    + + + + + +
    +
    + + + +
    +
    + + + +
    @@ -3959,12 +3964,17 @@
    -
    - +
    + +
    +
    +
    +
    diff --git a/RH/Personal.aspx.vb b/RH/Personal.aspx.vb index 4617e3a44..7270d7c3f 100644 --- a/RH/Personal.aspx.vb +++ b/RH/Personal.aspx.vb @@ -88,6 +88,18 @@ Partial Class RH_Personal ViewState("Documentacion") = value End Set End Property + Property CveCuentaDeposito As Integer + Get + If ViewState("CveCuentaDeposito") Is Nothing Then + Return -1 + Else + Return DirectCast(ViewState("CveCuentaDeposito"), Integer) + End If + End Get + Set(value As Integer) + ViewState("CveCuentaDeposito") = value + End Set + End Property Property CveDocumentacion As Integer Get If ViewState("CveDocumentacion") Is Nothing Then @@ -2890,11 +2902,23 @@ Partial Class RH_Personal End Sub Protected Sub Lnkopenaddcuentabancaria_Click(sender As Object, e As EventArgs) - BtnAgregarCuentaBanco.Visible = False + BtnActualizarCuentaBanco.Visible = False BtnAgregarCuentaBanco.Visible = True RegistraScript("$('#DivCuentasVancarias').modal();") End Sub + + Protected Sub LbActualizarCuentaBanco_Click(sender As Object, e As EventArgs) + Using ObjCuentasBancos As New ClsGenerales + Dim nombrebanco As String = DdlBancoSat.SelectedItem.Text + If ObjCuentasBancos.UpdateCuentasDepositosPersonal(CveCuentaDeposito, nombrebanco, TxtNumeroCuenta.Text, TxtCLABECB.Text, DdlMoneda.SelectedValue.ToEntero, UsuarioActual.CveUsuario, ChkEstatusPagoE.Checked, ChkEstatuscuenta.Checked, DdlBancoSat.SelectedValue.ToEntero()) Then + 'UpdateCuentasDepositosPersonal(CveCuentaDeposito As Integer, BancoNombre As String, Cuenta As String, CLABE As String, CveMoneda As Integer, CveUsuarioModifico As Integer, EstatusPagoElectronico As Boolean, Estatus As Boolean, CveSATBanco As Integer) As Boolean + Alert("Cuenta actualizada") + End If + End Using + CargaCuentasBancarias() + RegistraScript("$('#DivCuentasVancarias').modal('hide');") + End Sub Protected Sub LbAgregarCuentaBanco_Click(sender As Object, e As EventArgs) Dim EsBancomer = False Dim nombrebanco As String = DdlBancoSat.SelectedItem.Text @@ -2938,7 +2962,7 @@ Partial Class RH_Personal ' Exit Sub 'End If - AgregarCuentaBanco(nombrebanco, "", TxtCLABECB.Text.Trim, "", "", TxtNumeroCuenta.Text.Trim, "", "", DdlMoneda.SelectedValue.ToEntero, DdlMoneda.SelectedItem.Text, "", DdlBancoSat.SelectedValue.ToEntero()) + AgregarCuentaBanco(nombrebanco, "", TxtCLABECB.Text.Trim, "", "", TxtNumeroCuenta.Text.Trim, "", "", DdlMoneda.SelectedValue.ToEntero, DdlMoneda.SelectedItem.Text, "", DdlBancoSat.SelectedValue.ToEntero(), ChkEstatusPagoE.Checked) RegistraScript("$('#DivCuentasVancarias').modal('hide');") End Sub Private Sub CargaGridCuentasBancos(Orden As String) @@ -2963,13 +2987,13 @@ Partial Class RH_Personal GvBancosCuentas.DataBind() UpCuentasBancos.Update() End Sub - Private Sub AgregarCuentaBanco(NombreBanco As String, NumeroSucursal As String, CLABE As String, SWIFT As String, Plaza As String, NumeroCuenta As String, ConvenioCIE As String, Referencia As String, CveMoneda As Integer, Moneda As String, BBVAAlias As String, CveSATBanco As Integer) + Private Sub AgregarCuentaBanco(NombreBanco As String, NumeroSucursal As String, CLABE As String, SWIFT As String, Plaza As String, NumeroCuenta As String, ConvenioCIE As String, Referencia As String, CveMoneda As Integer, Moneda As String, BBVAAlias As String, CveSATBanco As Integer, EstatusPagoElectronico As Boolean) Dim Row As DataRow If CvePersonal > 0 Then Dim ObjCuentasBancos As New ClsGenerales - If ObjCuentasBancos.AddCuentasDepositos(NombreBanco, Plaza, NumeroSucursal, NumeroCuenta, CLABE, ConvenioCIE, SWIFT, Referencia, "", UsuarioActual.CveUsuario, CveMoneda, CvePersonal:=CvePersonal, CveUsuarioModifico:=UsuarioActual.CveUsuario, BBVAAlias:=BBVAAlias, CveSATBanco:=CveSATBanco) Then + If ObjCuentasBancos.AddCuentasDepositos(NombreBanco, Plaza, NumeroSucursal, NumeroCuenta, CLABE, ConvenioCIE, SWIFT, Referencia, "", UsuarioActual.CveUsuario, CveMoneda, CvePersonal:=CvePersonal, CveUsuarioModifico:=UsuarioActual.CveUsuario, BBVAAlias:=BBVAAlias, CveSATBanco:=CveSATBanco, EstatusPagoElectronico:=EstatusPagoElectronico) Then DTCuentasBancos.Clear() DTCuentasBancos.Merge(ObjCuentasBancos.DtResultados.FiltraParametros(String.Format("CvePersonal = {0}", CvePersonal))) @@ -2991,7 +3015,7 @@ Partial Class RH_Personal Row("Referencia") = Referencia Row("CveMoneda") = CveMoneda Row("Moneda") = Moneda - Row("EstatusPagoElectronico") = False + Row("EstatusPagoElectronico") = EstatusPagoElectronico TempDTCuentasBancos.Rows.Add(Row) End If @@ -3062,8 +3086,22 @@ Partial Class RH_Personal End If End Sub Protected Sub GvBancosCuentas_RowEditing(sender As Object, e As System.Web.UI.WebControls.GridViewEditEventArgs) Handles GvBancosCuentas.RowEditing - GvBancosCuentas.EditIndex = e.NewEditIndex - CargaGridCuentasBancos(ViewState("OrdenCuentasBancos").ToString()) + Dim gvrow As GridViewRow = GvBancosCuentas.Rows(e.NewEditIndex) 'DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow) + BtnActualizarCuentaBanco.Visible = True + BtnAgregarCuentaBanco.Visible = False + 'CveCuentaDeposito,CveSATBanco,Cuenta,CLABE,EstatusPagoElectronico,CveMoneda + CveCuentaDeposito = gvrow.DataKey("CveCuentaDeposito").ToEntero() + DdlBancoSat.SelectedValueExist(gvrow.DataKey("CveSATBanco")) + DdlMoneda.SelectedValueExist(gvrow.DataKey("CveMoneda")) + TxtNumeroCuenta.Text = gvrow.DataKey("Cuenta") + TxtCLABECB.Text = gvrow.DataKey("CLABE") + ChkEstatusPagoE.Checked = gvrow.DataKey("EstatusPagoElectronico").ToUpper().Contiene("TRUE", "1") + ChkEstatuscuenta.Checked = gvrow.DataKey("EstatusTexto").ToUpper().Contiene("TRUE", "1", "ACTIVO") + UpCuentasVancarias.Update() + RegistraScript("$('#DivCuentasVancarias').modal();") + + 'GvBancosCuentas.EditIndex = e.NewEditIndex + 'CargaGridCuentasBancos(ViewState("OrdenCuentasBancos").ToString()) End Sub Protected Sub GvBancosCuentas_RowCancelingEdit(sender As Object, e As System.Web.UI.WebControls.GridViewCancelEditEventArgs) Handles GvBancosCuentas.RowCancelingEdit GvBancosCuentas.EditIndex = -1 @@ -3080,6 +3118,8 @@ Partial Class RH_Personal Dim Referencia = GvBancosCuentas.Rows(e.RowIndex).FCTextBox("TxtReferencia").Text.Trim Dim CveMoneda = GvBancosCuentas.Rows(e.RowIndex).FCDropDownList("DdlMoneda").SelectedValue.ToString().ToEntero Dim Estatus = GvBancosCuentas.Rows(e.RowIndex).FCCheckBox("ChkEstatus").Checked + Dim EstatusPagoElectronico = GvBancosCuentas.Rows(e.RowIndex).FCCheckBox("ChkEstatusPagoE").Checked + Dim Moneda = GvBancosCuentas.Rows(e.RowIndex).FCDropDownList("DdlMoneda").SelectedItem.Text Dim BBVAAlias As String = GvBancosCuentas.Rows(e.RowIndex).FCTextBox("TxtBBVAAlias").Text @@ -3134,7 +3174,7 @@ Partial Class RH_Personal End If Dim ObjCuentasBancos As New ClsGenerales If CvePersonal > 0 Then - If ObjCuentasBancos.UpdateCuentasDepositos(GvBancosCuentas.DataKeys(e.RowIndex)("CveCuentaDeposito").ToString().ToEntero, NombreBanco, Plaza, NumeroSucursal, NumeroCuenta, CLABE, ConvenioCIE, SWIFT, Referencia, RefCrediProveedor, False, Estatus, CveMoneda, CveUsuarioModifico:=UsuarioActual.CveUsuario, BBVAAlias:=BBVAAlias) Then + If ObjCuentasBancos.UpdateCuentasDepositos(GvBancosCuentas.DataKeys(e.RowIndex)("CveCuentaDeposito").ToString().ToEntero, NombreBanco, Plaza, NumeroSucursal, NumeroCuenta, CLABE, ConvenioCIE, SWIFT, Referencia, RefCrediProveedor, False, Estatus, CveMoneda, CveUsuarioModifico:=UsuarioActual.CveUsuario, BBVAAlias:=BBVAAlias, EstatusPagoElectronico:=EstatusPagoElectronico) Then DTCuentasBancos.Clear() DTCuentasBancos.Merge(ObjCuentasBancos.DtResultados.FiltraParametros(String.Format("CvePersonal = {0}", CvePersonal))) Alert("Cuenta actualizada con exito.", TipoMensaje.MsgInformacion)