This commit is contained in:
2024-05-17 18:17:45 -07:00
4 changed files with 137 additions and 110 deletions

View File

@@ -674,6 +674,30 @@ Public Class ClsNominas
End Try
Return retorno
End Function
Public Function UtilidadesRegistrosGet(cveEmpresa As Int32, ejercicio As Int32, cvePersonal As Int32) As Boolean
Dim retorno As Boolean = False
DataAdapter("PA_NomUtilidadesRegistrosGet", CommandType.StoredProcedure)
addParameters("@CveEmpresa", SqlDbType.Int, cveEmpresa)
addParameters("@Ejercicio", SqlDbType.Int, ejercicio)
addParameters("@CvePersonal", SqlDbType.Int, cvePersonal)
retorno = RunQuery("Ocurrió un error al obtener el UtilidadesRegistros.")
Return retorno
End Function
Public Function UtilidadesRegistrosAddUp(cveEmpresa As Int32, ejercicio As Int32, cvePersonal As Int32, cveMetodoPago As Int32, cveTipoPeriodo As Int32, diasLaborados As Int32, sueldoTotal As Decimal, importe As Decimal) As Boolean
Dim retorno As Boolean = False
DataAdapter("PA_NomUtilidadesRegistrosAddUP", CommandType.StoredProcedure)
addParameters("@CveEmpresa", SqlDbType.Int, cveEmpresa)
addParameters("@Ejercicio", SqlDbType.Int, ejercicio)
addParameters("@CvePersonal", SqlDbType.Int, cvePersonal)
addParameters("@CveMetodoPago", SqlDbType.Int, cveMetodoPago)
addParameters("@CveTipoPeriodo", SqlDbType.Int, cveTipoPeriodo)
addParameters("@DiasLaborados", SqlDbType.Int, diasLaborados)
addParameters("@SueldoTotal", SqlDbType.Money, sueldoTotal)
addParameters("@Importe", SqlDbType.Money, importe)
retorno = RunQuery("Ocurrió un error al agregar el UtilidadesRegistros.")
Return retorno
End Function
Public Function GetEjercicios(CveEmpresa As Integer) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_NOM_GetEjercicios")

View File

@@ -1139,6 +1139,7 @@
<asp:ListItem Text="Infonavit(Factor Descuento)" Value="5002"></asp:ListItem>
<asp:ListItem Text="Infonavit(Cuota Fija)" Value="5003"></asp:ListItem>
<asp:ListItem Text="Infonavit(Cuota Fija por período)" Value="5004"></asp:ListItem>
<asp:ListItem Text="Infonavit(Cuota Fija (Mensual)" Value="5005"></asp:ListItem>
</asp:DropDownList>
</div>
</div>

View File

@@ -2048,7 +2048,7 @@
</ContentTemplate>
</asp:UpdatePanel>
<%--<div class="portlet light bordered xspadding" id="porletconceptos">
<div class="portlet light bordered xspadding" id="porletconceptos">
<div class="portlet-title">
<div class="caption font-green">
<i class="fa fa-bookmark font-green"></i>
@@ -2096,7 +2096,7 @@
</ItemTemplate>
<ItemStyle Width="40px" />
</asp:TemplateField>
<asp:TemplateField>
<asp:TemplateField Visible="false">
<HeaderTemplate>Importe</HeaderTemplate>
<ItemTemplate>
<asp:TextBox CssClass="form-control input-sm" ID="TxtImporte" runat="server" Text='<%# Eval("Importe", "{0:N2}") %>' Width="60px"></asp:TextBox>
@@ -2104,13 +2104,13 @@
</ItemTemplate>
<ItemStyle Width="50px" />
</asp:TemplateField>
<asp:TemplateField>
<asp:TemplateField Visible="false">
<HeaderTemplate>Tipo de Aplicación</HeaderTemplate>
<ItemTemplate>
<table>
<tr>
<td width="95px">
<asp:DropDownList ID="DdlTipoAplicacion" OnSelectedIndexChanged="DdlTipoAplicacion_SelectedIndexChanged" AutoPostBack="true" runat="server" Class="table-group-action-input form-control input-inline input-small input-sm" Width="100%">
<asp:DropDownList ID="DdlTipoAplicacion" runat="server" Class="table-group-action-input form-control input-inline input-small input-sm" Width="100%">
</asp:DropDownList></td>
<td width="65px">
@@ -2133,7 +2133,7 @@
</asp:GridView>
</div>
</div>--%>
</div>
<div class="portlet light bordered xspadding" id="porletInfonavit">
<div class="portlet-title">

View File

@@ -2849,7 +2849,7 @@ Partial Class RH_Personal
Private Sub CarcaConceptosNomina()
Dim ObjPersonal As New ClsRH
If ObjPersonal.GetPersonalConceptos(CvePersonal, UsuarioActual.CveEmpresa) Then
'GVConceptos.DataSource = ObjPersonal.DtResultados.FiltraParametros("(CveSistema <>3 AND CveSistema <>4) OR CveSistema IS NULL")
GVConceptos.DataSource = ObjPersonal.DtResultados.FiltraParametros("(CveSistema <>3 AND CveSistema <>4) OR CveSistema IS NULL")
Dim frow As DataRow = ObjPersonal.DtResultados.FiltroPrimero("CveSistema =3")
If Not IsNothing(frow) Then
TxtInfoValor.Text = String.Format("{0:###,###.##}", frow("Importe"))
@@ -2883,7 +2883,7 @@ Partial Class RH_Personal
'Conceptos.DataSource = Nothing
End If
ObjPersonal.Dispose()
'GVConceptos.DataBind()
GVConceptos.DataBind()
'For Each Row As GridViewRow In GVConceptos.Rows
' Dim Ddl As DropDownList = DirectCast(GVConceptos.Rows(Row.RowIndex).FCDropDownList("DdlTipoAplicacion"), DropDownList)
@@ -2891,68 +2891,70 @@ Partial Class RH_Personal
'Next
End Sub
'Protected Sub GVConceptos_RowCreated(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GVConceptos.RowDataBound
' If e.Row.RowType = DataControlRowType.DataRow Then
' e.Row.Cells(1).HorizontalAlign = HorizontalAlign.Left
Protected Sub GVConceptos_RowCreated(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GVConceptos.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
e.Row.Cells(1).HorizontalAlign = HorizontalAlign.Left
' e.Row.Cells(0).Width = Unit.Pixel(50)
' e.Row.Cells(1).Width = Unit.Pixel(50)
' e.Row.Cells(3).Width = Unit.Pixel(70)
' e.Row.Cells(4).Width = Unit.Pixel(70)
' e.Row.Cells(5).Width = Unit.Pixel(160)
e.Row.Cells(0).Width = Unit.Pixel(50)
e.Row.Cells(1).Width = Unit.Pixel(50)
e.Row.Cells(3).Width = Unit.Pixel(70)
e.Row.Cells(4).Width = Unit.Pixel(70)
e.Row.Cells(5).Width = Unit.Pixel(160)
' If e.Row.DBCampo("Aplica").ToEntero() = 1 Then e.Row.FCCheckBox("ChkAplica").Checked = True
If e.Row.DBCampo("Aplica").ToEntero() = 1 Then e.Row.FCCheckBox("ChkAplica").Checked = True
' If e.Row.DBCampo("Formula") = "S" Then
' e.Row.FCDropDownList("DdlTipoAplicacion").Visible = False : e.Row.Cells(3).Text = "Calculado"
' e.Row.FCDropDownList("DdlTipoAplicacion").Visible = False : e.Row.Cells(4).Text = "Permanente"
' Else
' Dim TipoAplicacion As String = e.Row.DBCampo("TipoAplicacion").ToString()
' e.Row.FCDropDownList("DdlTipoAplicacion").Items.Clear()
' e.Row.FCDropDownList("DdlTipoAplicacion").Items.Add(New ListItem("Seleccione", "-1"))
' If (e.Row.DBCampo("CveSistema").ToString() = "3") Then
' e.Row.FCDropDownList("DdlTipoAplicacion").Items.Add(New ListItem("Infonavit(Movto Permanente)", "5000"))
' e.Row.FCDropDownList("DdlTipoAplicacion").Items.Add(New ListItem("Infonavit(Porcentaje)", "5001"))
' e.Row.FCDropDownList("DdlTipoAplicacion").Items.Add(New ListItem("Infonavit(Factor Descuento)", "5002"))
' e.Row.FCDropDownList("DdlTipoAplicacion").Items.Add(New ListItem("Infonavit(Cuota Fija)", "5003"))
If e.Row.DBCampo("Formula") = "S" Then
e.Row.FCDropDownList("DdlTipoAplicacion").Visible = False : e.Row.Cells(3).Text = "Calculado"
e.Row.FCDropDownList("DdlTipoAplicacion").Visible = False : e.Row.Cells(4).Text = "Permanente"
Else
Dim TipoAplicacion As String = e.Row.DBCampo("TipoAplicacion").ToString()
e.Row.FCDropDownList("DdlTipoAplicacion").Items.Clear()
e.Row.FCDropDownList("DdlTipoAplicacion").Items.Add(New ListItem("Seleccione", "-1"))
If (e.Row.DBCampo("CveSistema").ToString() = "3") Then
e.Row.FCDropDownList("DdlTipoAplicacion").Items.Add(New ListItem("Infonavit(Movto Permanente)", "5000"))
e.Row.FCDropDownList("DdlTipoAplicacion").Items.Add(New ListItem("Infonavit(Porcentaje)", "5001"))
e.Row.FCDropDownList("DdlTipoAplicacion").Items.Add(New ListItem("Infonavit(Factor Descuento)", "5002"))
e.Row.FCDropDownList("DdlTipoAplicacion").Items.Add(New ListItem("Infonavit(Cuota Fija Bimestral)", "5003"))
e.Row.FCDropDownList("DdlTipoAplicacion").Items.Add(New ListItem("Infonavit(Cuota Fija Periodo)", "5004"))
e.Row.FCDropDownList("DdlTipoAplicacion").Items.Add(New ListItem("Infonavit(Cuota Fija Mensual)", "5005"))
' ElseIf (e.Row.DBCampo("CveSistema").ToString() = "4") Then
' e.Row.FCDropDownList("DdlTipoAplicacion").Items.Add(New ListItem("Fonacot(Importe fijo)", "3001"))
' e.Row.FCDropDownList("DdlTipoAplicacion").Items.Add(New ListItem("Fonacot(Por días Labarados)", "3002"))
' Else
' e.Row.FCDropDownList("DdlTipoAplicacion").Items.Add(New ListItem("Saldo", "1"))
' e.Row.FCDropDownList("DdlTipoAplicacion").Items.Add(New ListItem("No. Pagos", "2"))
' e.Row.FCDropDownList("DdlTipoAplicacion").Items.Add(New ListItem("Permanente", "2600"))
' End If
ElseIf (e.Row.DBCampo("CveSistema").ToString() = "4") Then
e.Row.FCDropDownList("DdlTipoAplicacion").Items.Add(New ListItem("Fonacot(Importe fijo)", "3001"))
e.Row.FCDropDownList("DdlTipoAplicacion").Items.Add(New ListItem("Fonacot(Por días Labarados)", "3002"))
Else
e.Row.FCDropDownList("DdlTipoAplicacion").Items.Add(New ListItem("Saldo", "1"))
e.Row.FCDropDownList("DdlTipoAplicacion").Items.Add(New ListItem("No. Pagos", "2"))
e.Row.FCDropDownList("DdlTipoAplicacion").Items.Add(New ListItem("Permanente", "2600"))
End If
' If e.Row.DBCampo("TipoAplicacion").ToEntero() > 5 Then
' TipoAplicacion = "2600"
' End If
' e.Row.FCDropDownList("DdlTipoAplicacion").SelectedValueExist(TipoAplicacion)
' End If
If e.Row.DBCampo("TipoAplicacion").ToEntero() > 5 Then
TipoAplicacion = "2600"
End If
e.Row.FCDropDownList("DdlTipoAplicacion").SelectedValueExist(TipoAplicacion)
End If
' 'If e.Row.DBCampo("TipoCalculo") = "False" Then
' ' e.Row.FCTextBox("TxtImporte").Visible = False
' ' e.Row.FCDropDownList("DdlTipoAplicacion").Visible = False
' 'Else
' ' Select Case e.Row.DBCampo("TipoAplicacion").ToEntero()
' ' Case 1
' ' 'Saldo
' ' e.Row.FCLiteral("LtlSaldo").Visible = True
' ' e.Row.FCTextBox("TxtSaldoIni").Visible = True
' ' Case 2
' ' 'Numero de Pagos
' ' e.Row.FCLiteral("LtlNoPago").Visible = True
' ' e.Row.FCTextBox("TxtNoPagos").Visible = True
' ' Case 2600
' ' 'Permanente
' ' End Select
' 'End If
'If e.Row.DBCampo("TipoCalculo") = "False" Then
' e.Row.FCTextBox("TxtImporte").Visible = False
' e.Row.FCDropDownList("DdlTipoAplicacion").Visible = False
'Else
' Select Case e.Row.DBCampo("TipoAplicacion").ToEntero()
' Case 1
' 'Saldo
' e.Row.FCLiteral("LtlSaldo").Visible = True
' e.Row.FCTextBox("TxtSaldoIni").Visible = True
' Case 2
' 'Numero de Pagos
' e.Row.FCLiteral("LtlNoPago").Visible = True
' e.Row.FCTextBox("TxtNoPagos").Visible = True
' Case 2600
' 'Permanente
' End Select
'End If
' End If
'End Sub
End If
End Sub
Protected Sub BtnGuardarInfornavit_Click(sender As Object, e As EventArgs)
Dim importe As Decimal = TxtInfoValor.Text.ToDecimal()
@@ -2981,61 +2983,61 @@ Partial Class RH_Personal
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
' ObjPersonal.IniciaTransacSQL()
Protected Sub BtnGuardarConceptos_Click(sender As Object, e As System.EventArgs) Handles BtnGuardarConceptos.Click
If CvePersonal > 0 Then
Dim ObjPersonal As New ClsRH
ObjPersonal.IniciaTransacSQL()
' Dim OcurrioError As Boolean = False
' For Each Row As GridViewRow In GVConceptos.Rows
' If Row.FCCheckBox("ChkAplica").Checked = True Then
' Dim CveConcepto As Integer = Row.DataKey("CveConcepto").ToEntero()
' Dim Importe As Double = Row.FCTextBox("TxtImporte").Text.ToDouble
' Dim TipoAplicacion As Integer = Row.FCDropDownList("DdlTipoAplicacion").SelectedValue.ToEntero()
' Dim NoPagos As Integer = If(Row.FCTextBox("TxtNoPagos").Text.ToEntero() = 0, -1, Row.FCTextBox("TxtNoPagos").Text.ToEntero())
' Dim SaldoIni As Double = If(Row.FCTextBox("TxtSaldoIni").Text.ToDouble = 0, -1, Row.FCTextBox("TxtSaldoIni").Text.ToDouble)
Dim OcurrioError As Boolean = False
For Each Row As GridViewRow In GVConceptos.Rows
If Row.FCCheckBox("ChkAplica").Checked = True Then
Dim CveConcepto As Integer = Row.DataKey("CveConcepto").ToEntero()
Dim Importe As Double = Row.FCTextBox("TxtImporte").Text.ToDouble
Dim TipoAplicacion As Integer = -1 'Row.FCDropDownList("DdlTipoAplicacion").SelectedValue.ToEntero()
Dim NoPagos As Integer = If(Row.FCTextBox("TxtNoPagos").Text.ToEntero() = 0, -1, Row.FCTextBox("TxtNoPagos").Text.ToEntero())
Dim SaldoIni As Double = If(Row.FCTextBox("TxtSaldoIni").Text.ToDouble = 0, -1, Row.FCTextBox("TxtSaldoIni").Text.ToDouble)
' Select Case TipoAplicacion
' Case 1
' 'Saldo
' NoPagos = -1
' Case 2
' 'Numero de Pagos
' SaldoIni = -1
' Case 2600
' 'Permanente
' NoPagos = -1
' SaldoIni = -1
' End Select
Select Case TipoAplicacion
Case 1
'Saldo
NoPagos = -1
Case 2
'Numero de Pagos
SaldoIni = -1
Case 2600
'Permanente
NoPagos = -1
SaldoIni = -1
End Select
' 'Insertarlo o Actualizarlo
' If Not ObjPersonal.AddConcepto(CvePersonal, CveConcepto, Importe, TipoAplicacion, NoPagos, SaldoIni, UsuarioActual.CveUsuario) Then
' OcurrioError = True
' ObjPersonal.RollBack()
' Exit For
' End If
' Else
' 'Borrarlo
' If Row.DataKey("CvePersonalConcepto") <> "" Then
' If Not ObjPersonal.RemoveConcepto(Row.DataKey("CvePersonalConcepto").ToEntero()) Then
' OcurrioError = True
' ObjPersonal.RollBack()
' Exit For
' End If
' End If
' End If
' Next
'Insertarlo o Actualizarlo
If Not ObjPersonal.AddConcepto(CvePersonal, CveConcepto, Importe, TipoAplicacion, NoPagos, SaldoIni, UsuarioActual.CveUsuario) Then
OcurrioError = True
ObjPersonal.RollBack()
Exit For
End If
Else
'Borrarlo
If Row.DataKey("CvePersonalConcepto") <> "" Then
If Not ObjPersonal.RemoveConcepto(Row.DataKey("CvePersonalConcepto").ToEntero()) Then
OcurrioError = True
ObjPersonal.RollBack()
Exit For
End If
End If
End If
Next
' If Not OcurrioError Then
' ObjPersonal.Commit()
' Alert("La información se guardó correctamente.", TipoMensaje.MsgInformacion)
' Else
' Alert("Ocurrió un error al guardar la información.", TipoMensaje.MsgError)
' End If
If Not OcurrioError Then
ObjPersonal.Commit()
Alert("La información se guardó correctamente.", TipoMensaje.MsgInformacion)
Else
Alert("Ocurrió un error al guardar la información.", TipoMensaje.MsgError)
End If
' ObjPersonal.Dispose()
' End If
'End Sub
ObjPersonal.Dispose()
End If
End Sub
#End Region