153 lines
5.3 KiB
VB.net
153 lines
5.3 KiB
VB.net
Imports Extensiones
|
|
Imports System.Data
|
|
Imports System.Drawing
|
|
Imports Microsoft.Reporting.WebForms
|
|
Imports System.IO
|
|
|
|
Partial Class Nominas_SobreRecibo
|
|
Inherits ClsPaginas
|
|
|
|
Private ReadOnly Property CvePersonal As Integer
|
|
Get
|
|
Return ViewState("CvePersonal").ToString.ToEntero
|
|
End Get
|
|
End Property
|
|
|
|
Private ReadOnly Property CvePeriodo As Integer
|
|
Get
|
|
Return ViewState("CvePeriodo").ToString.ToEntero
|
|
End Get
|
|
End Property
|
|
|
|
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
|
|
If Not IsPostBack Then
|
|
|
|
ViewState("CvePersonal") = 0
|
|
ViewState("CvePeriodo") = 0
|
|
|
|
If Request("CvePersonal") IsNot Nothing AndAlso IsNumeric(Request("CvePersonal")) AndAlso Request("CvePersonal").ToEntero > 0 Then
|
|
ViewState("CvePersonal") = Request("CvePersonal")
|
|
End If
|
|
|
|
If Request("CvePeriodo") IsNot Nothing AndAlso IsNumeric(Request("CvePeriodo")) AndAlso Request("CvePeriodo").ToEntero > 0 Then
|
|
ViewState("CvePeriodo") = Request("CvePeriodo")
|
|
End If
|
|
|
|
If CvePersonal > 0 AndAlso CvePeriodo > 0 Then
|
|
CargaDatos()
|
|
CargaPersonal()
|
|
DdlPersonal.SelectedValue = CvePersonal
|
|
LtNombrePersonal.Text = DdlPersonal.SelectedItem.Text
|
|
UPFiltros.Visible = False
|
|
End If
|
|
|
|
CargaPersonal()
|
|
CargaTiposPeriodo()
|
|
End If
|
|
End Sub
|
|
|
|
#Region "Carga Datos,Combos, Etc..."
|
|
|
|
Private Sub CargaPersonal()
|
|
DdlPersonal.DataSource = GlobalDTRHPersonal(UsuarioActual.CveEmpresa)
|
|
DdlPersonal.DataBind()
|
|
End Sub
|
|
|
|
Private Sub CargaTiposPeriodo()
|
|
DdlTipoPeriodo.DataSource = GlobalDTTipoPeriodo.FiltraParametros("Estatus = 'Activo'")
|
|
DdlTipoPeriodo.DataBind()
|
|
End Sub
|
|
|
|
Private Sub CargaPeriodos()
|
|
|
|
If DdlTipoPeriodo.SelectedValue.ToEntero > 0 Then
|
|
|
|
Dim ObjPeriodos As New ClsNominas
|
|
If ObjPeriodos.GetPeriodos(DdlTipoPeriodo.SelectedValue.ToEntero, UsuarioActual.CveEmpresa, Now.Year, -1, -1) Then
|
|
DdlPeriodo.DataSource = ObjPeriodos.DtResultados.FiltraParametros("Estatus IN (1,2,3)")
|
|
Else
|
|
DdlPeriodo.DataSource = Nothing
|
|
End If
|
|
ObjPeriodos.Dispose()
|
|
|
|
End If
|
|
|
|
DdlPeriodo.Items.Clear()
|
|
DdlPeriodo.DataBind()
|
|
DdlPeriodo.Items.Insert(0, New ListItem("Seleccione", "-1"))
|
|
End Sub
|
|
|
|
Private Sub CargaDatos()
|
|
Dim ObjRH As New ClsNominas
|
|
|
|
Dim CvePeriodoC As Integer
|
|
Dim CvePersonalC As Integer
|
|
|
|
If CvePeriodo > 0 Then
|
|
CvePeriodoC = CvePeriodo
|
|
Else
|
|
CvePeriodoC = DdlPeriodo.SelectedValue.ToEntero
|
|
End If
|
|
|
|
If CvePersonal > 0 Then
|
|
CvePersonalC = CvePersonal
|
|
Else
|
|
CvePersonalC = DdlPersonal.SelectedValue.ToEntero
|
|
End If
|
|
|
|
If ObjRH.GetSobreRecibo(CvePeriodoC, UsuarioActual.CveEmpresa, CvePersonalC) Then
|
|
tPercepciones.Visible = True
|
|
tDeducciones.Visible = True
|
|
tPercepcionesF.Visible = True
|
|
tDeduccionesF.Visible = True
|
|
|
|
LblTotalDeducciones.Text = (ObjRH.DtResultados.FiltroPrimeroValor("ImporteTotales", "Tipo='D' AND CveConcepto IS NULL").ToDecimal * -1).FormatoNumero(2)
|
|
LblTotalPercepciones.Text = ObjRH.DtResultados.FiltroPrimeroValor("ImporteTotales", "Tipo='P' AND CveConcepto IS NULL").FormatoNumero(2)
|
|
LblTotal.Text = ObjRH.DtResultados.FiltroPrimeroValor("ImporteTotales", "Tipo IS NULL AND CveConcepto IS NULL").FormatoNumero(2)
|
|
|
|
GvDeducciones.DataSource = ObjRH.DtResultados.FiltraParametros("Tipo='D' AND CveConcepto > 0")
|
|
GvPercepciones.DataSource = ObjRH.DtResultados.FiltraParametros("Tipo='P' AND CveConcepto > 0")
|
|
|
|
GvDeducciones.DataBind()
|
|
GvPercepciones.DataBind()
|
|
End If
|
|
|
|
UPDatos.Update()
|
|
ObjRH.Dispose()
|
|
End Sub
|
|
#End Region
|
|
|
|
#Region "BTN'S CLICK"
|
|
Protected Sub DdlTipoPeriodo_SelectedIndexChanged(sender As Object, e As System.EventArgs) Handles DdlTipoPeriodo.SelectedIndexChanged
|
|
CargaPeriodos()
|
|
End Sub
|
|
Protected Sub BtnConsultar_Click(sender As Object, e As System.EventArgs) Handles BtnConsultar.Click
|
|
CargaDatos()
|
|
End Sub
|
|
#End Region
|
|
|
|
#Region "Gv"
|
|
Protected Sub GvDeducciones_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvDeducciones.RowDataBound
|
|
If e.Row.RowType = DataControlRowType.DataRow Then
|
|
If e.Row.DBCampo("Origen").ToEntero = 1 Then
|
|
e.Row.Font.Italic = True
|
|
e.Row.Cells(0).Style.Add("padding-left", "16px")
|
|
End If
|
|
|
|
e.Row.FCLabel("LtlImporte").Text = e.Row.FCLabel("LtlImporte").Text.ToDecimal
|
|
End If
|
|
End Sub
|
|
|
|
Protected Sub GvPercepciones_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvPercepciones.RowDataBound
|
|
If e.Row.RowType = DataControlRowType.DataRow Then
|
|
If e.Row.DBCampo("Origen").ToEntero = 1 Then
|
|
e.Row.Font.Italic = True
|
|
e.Row.Cells(0).Style.Add("padding-left", "16px")
|
|
End If
|
|
End If
|
|
End Sub
|
|
#End Region
|
|
|
|
End Class
|
|
|