This commit is contained in:
JORGE LUIS CAUDILLO ESPARZA
2022-03-10 09:06:19 -07:00
parent 2feab11f5e
commit 8f0524a095
16 changed files with 3529 additions and 232 deletions

View File

@@ -16,6 +16,18 @@ Partial Class RH_Personal
#Region "P R O P I E D A D E S"
Property CveFonacot As Integer
Get
If ViewState("CveFonacot") Is Nothing Then
Return -1
Else
Return DirectCast(ViewState("CveFonacot"), Integer)
End If
End Get
Set(value As Integer)
ViewState("CveFonacot") = value
End Set
End Property
Private Property DTCuentasBancos As DataTable
Get
Return CType(ViewState("DTCuentasBancos"), DataTable)
@@ -900,6 +912,7 @@ Partial Class RH_Personal
ViewState("CvePersonal") = -1
BtnEliminar.Visible = False
CarcaConceptosNomina()
CargaFonacot()
For Each Gvr As GridViewRow In GVConceptos.Rows
If CBool(Gvr.DataKey("Obligatorio")) Then
Gvr.FCCheckBox("ChkAplica").Checked = True
@@ -1690,6 +1703,7 @@ Partial Class RH_Personal
'Carga Conceptos de Nómina
CarcaConceptosNomina()
CargaFonacot()
'Carga Pagos no Bancarios
CargarPagosNoBancarios()
'Carga Resguardos
@@ -2555,22 +2569,22 @@ Partial Class RH_Personal
End If
frow = ObjPersonal.DtResultados.FiltroPrimero("CveSistema =4")
TxtFonValor.Text = ""
DdlFonTipoAplicacion.SelectedValueExist("-1")
TxtFonDescripcion.Text = ""
TxtFonNumCredito.Text = ""
TxtFonFechaInicio.Text = ""
ChkFonacot.Checked = False
If Not IsNothing(frow) Then
TxtFonValor.Text = String.Format("{0:###,###.##}", frow("Importe"))
DdlFonTipoAplicacion.SelectedValueExist(frow("TipoAplicacion").ToString())
'frow = ObjPersonal.DtResultados.FiltroPrimero("CveSistema =4")
'TxtFonValor.Text = ""
'DdlFonTipoAplicacion.SelectedValueExist("-1")
'TxtFonDescripcion.Text = ""
'TxtFonNumCredito.Text = ""
'TxtFonFechaInicio.Text = ""
'ChkFonacot.Checked = False
'If Not IsNothing(frow) Then
' TxtFonValor.Text = String.Format("{0:###,###.##}", frow("Importe"))
' DdlFonTipoAplicacion.SelectedValueExist(frow("TipoAplicacion").ToString())
TxtFonDescripcion.Text = String.Format("{0}", frow("Descripcion02"))
TxtFonNumCredito.Text = String.Format("{0}", frow("Descripcion01"))
TxtFonFechaInicio.Text = String.Format("{0:dd/MM/yyyy}", frow("FInicioAplicacion"))
ChkFonacot.Checked = frow("estatus").ToString().ToUpper().Contiene("1", "TRUE")
End If
' TxtFonDescripcion.Text = String.Format("{0}", frow("Descripcion02"))
' TxtFonNumCredito.Text = String.Format("{0}", frow("Descripcion01"))
' TxtFonFechaInicio.Text = String.Format("{0:dd/MM/yyyy}", frow("FInicioAplicacion"))
' ChkFonacot.Checked = frow("estatus").ToString().ToUpper().Contiene("1", "TRUE")
'End If
Else
GVConceptos.DataSource = Nothing
End If
@@ -6521,30 +6535,115 @@ Partial Class RH_Personal
gvrow.FCTextBox("TxtPorPago").Text = "87.5"
End If
End Sub
Public Sub LimpiarFonacot()
TxtFonValor.Text = ""
TxtFonImporteCredito.Text = ""
TxtFonPagosHechos.Text = ""
DdlFonTipoAplicacion.SelectedValueExist("-1")
TxtFonDescripcion.Text = ""
TxtFonNumCredito.Text = ""
TxtFonFechaInicio.Text = ""
ChkFonacot.Checked = False
End Sub
Protected Sub CargaFonacot()
Using onom As ClsNominas = New ClsNominas()
onom.NomFonacotGet(UsuarioActual.CveEmpresa, -1, CvePersonal)
GVNomFonacot.DataSource = onom.DtResultados
GVNomFonacot.DataBind()
End Using
UpFonacotGrid.Update()
End Sub
Protected Sub LnAddFonacot_Click(sender As Object, e As EventArgs)
LimpiarFonacot()
CveFonacot = -1
RegistraScript("$('#ModalFonacot').modal();")
End Sub
Protected Sub LnkEditarNomFonacot_Click(sender As Object, e As EventArgs)
Dim gvrow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
CveFonacot = gvrow.DataKey("CveFonacot").ToEntero()
Dim cvePersonal As Int32 = gvrow.DataKey("CvePersonal").ToEntero()
Dim numeroCredito As String = gvrow.DataKey("NumeroCredito")
Dim descripcion As String = gvrow.DataKey("Descripcion")
Dim periodo As Int32 = gvrow.DataKey("Periodo").ToEntero()
Dim cveTipoCalculo As Int32 = gvrow.DataKey("CveTipoCalculo").ToEntero()
Dim importeCredito As Decimal = gvrow.DataKey("ImporteCredito").ToDecimal()
Dim importeFijo As Decimal = gvrow.DataKey("ImporteFijo").ToDecimal()
Dim pagosHechos As Decimal = gvrow.DataKey("PagosHechos").ToDecimal()
Dim montoAcumulado As Decimal = gvrow.DataKey("MontoAcumulado").ToDecimal()
Dim saldo As Decimal = gvrow.DataKey("Saldo").ToDecimal()
Dim cveEstatus As Int32 = gvrow.DataKey("CveEstatus").ToEntero()
Dim observaciones As String = gvrow.DataKey("Observaciones")
If (periodo < 10000000) Then
periodo = 20000101
End If
LimpiarFonacot()
TxtFonValor.Text = importeFijo.ToString()
TxtFonImporteCredito.Text = importeCredito.ToString()
TxtFonPagosHechos.Text = pagosHechos.ToString()
DdlFonTipoAplicacion.SelectedValueExist(cveTipoCalculo.ToString())
TxtFonDescripcion.Text = descripcion
TxtFonNumCredito.Text = numeroCredito
TxtFonFechaInicio.Text = String.Format("{2}/{1}/{0}", periodo.ToString().Substring(0, 4), periodo.ToString().Substring(4, 2), periodo.ToString().Substring(6, 2))
ChkFonacot.Checked = (cveEstatus = 1)
UpModalFonacot.Update()
RegistraScript("$('#ModalFonacot').modal();")
End Sub
Protected Sub LnkEliminarNomFonacot_Click(sender As Object, e As EventArgs)
Dim gvrow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
Dim cveFonacot As Integer = gvrow.DataKey("CveFonacot").ToEntero()
Dim Continuar As Boolean = False
Using onom As ClsNominas = New ClsNominas()
Continuar = onom.NomFonacotRemove(UsuarioActual.CveEmpresa, cveFonacot)
End Using
If (Continuar) Then
CargaFonacot()
Alert("El registro fonacot se ha eliminado")
End If
End Sub
Protected Sub LnkGuardarFonacot_Click(sender As Object, e As EventArgs)
Dim importe As Double = TxtFonValor.Text.ToDouble()
Dim importe As Decimal = TxtFonValor.Text.ToDecimal()
Dim importeTotal As Decimal = TxtFonImporteCredito.Text.ToDecimal()
Dim importePagado As Decimal = TxtFonPagosHechos.Text.ToDecimal()
Dim TipoAplicacion As Integer = DdlFonTipoAplicacion.SelectedValue.ToEntero()
Dim NoPagos As Integer = 0
Dim SaldoIni As Double = 0
Dim descripcion02 As String = TxtFonDescripcion.Text
Dim descripcion01 As String = TxtFonNumCredito.Text
Dim NumCredito As String = TxtFonNumCredito.Text
Dim fecha As String = TxtFonFechaInicio.Text.Replace("_", "")
Dim estatus As Integer = If(ChkFonacot.Checked, 1, 0)
Dim periodo As Integer = 20000101
If fecha.Length > 8 Then
fecha = fecha.ToDateTime().ToString("yyyy/MM/dd")
periodo = fecha.ToDateTime().ToString("yyyyMMdd").ToEntero()
Else
fecha = ""
End If
Dim continuar As Boolean = True
Dim continuar As Boolean = False
Using onom As ClsNominas = New ClsNominas()
If (CveFonacot = -1) Then
continuar = onom.NomFonacotAdd(UsuarioActual.CveEmpresa, CvePersonal, NumCredito, descripcion02, periodo, TipoAplicacion, importeTotal, importe, importePagado, 0, 0, estatus, "", UsuarioActual.CveUsuario)
Else
continuar = onom.NomFonacotUp(UsuarioActual.CveEmpresa, CveFonacot, CvePersonal, NumCredito, descripcion02, periodo, TipoAplicacion, importeTotal, importe, importePagado, 0, 0, estatus, "", UsuarioActual.CveUsuario)
Using ObjPersonal As ClsRH = New ClsRH()
If Not ObjPersonal.AddConcepto(CvePersonal, -1, importe, TipoAplicacion, NoPagos, SaldoIni, UsuarioActual.CveUsuario, 4, descripcion01, descripcion02, fecha, "", estatus, UsuarioActual.CveEmpresa) Then continuar = False
End If
End Using
' Old Borrar Caudillo 01/Marzo/2022
'Using ObjPersonal As ClsRH = New ClsRH()
' If Not ObjPersonal.AddConcepto(CvePersonal, -1, importe, TipoAplicacion, NoPagos, SaldoIni, UsuarioActual.CveUsuario, 4, NumCredito, descripcion02, fecha, "", estatus, UsuarioActual.CveEmpresa) Then continuar = False
'End Using
If continuar Then
Alert("Se actualizo el calculo de fonacot")
CargaFonacot()
RegistraScript("$('#ModalFonacot').modal('hide');")
End If
End Sub
Protected Sub LnkCalcularFactor_Click(sender As Object, e As EventArgs)
@@ -6804,5 +6903,7 @@ Partial Class RH_Personal
End Sub
End Class