This commit is contained in:
JORGE LUIS CAUDILLO ESPARZA
2020-10-06 13:35:49 -07:00
parent 512bae3116
commit f56bdba403
10 changed files with 306 additions and 469 deletions

View File

@@ -363,7 +363,8 @@ Public Class CFDINominaOtrosPagos
Public Property TipoOtroPago As String
Public Property Clave As String
Public Property Concepto As String
Public Property Importe As Double
Public Property Importe As Decimal
Public Property Subsidiocausado As Decimal
End Class

View File

@@ -107,7 +107,7 @@ Public Class LogicNominas
'Conexiones a la Base de Datos
Using objNomina As ClsNominas = New ClsNominas()
Using objPersonal As ClsRH = New ClsRH()
If objNomina.GetNom_Nominas(CveNomina, CvePersonal, CvePeriodo, -1, UsuarioActual.CveEmpresa) AndAlso objNomina.DtResultados.Rows.Count > 0 Then
If objNomina.GetNom_Nominas(CveNomina, -1, -1, -1, UsuarioActual.CveEmpresa) AndAlso objNomina.DtResultados.Rows.Count > 0 Then
CvePersonal = objNomina.DtResultados.Rows(0)("CvePersonal").ToString().ToEntero()
CvePeriodo = objNomina.DtResultados.Rows(0)("CvePeriodo").ToString().ToEntero()
Serie = objNomina.Serie
@@ -116,7 +116,6 @@ Public Class LogicNominas
If continuar Then GetError = "No se pudo obtener la información de la nomina" 'si continuar= true el error se origino en este nodo y se le asigno el error
continuar = False
End If
If continuar AndAlso objPersonal.GetPersonal(CvePersonal, UsuarioActual.CveEmpresa) AndAlso objPersonal.DtResultados.Rows.Count > 0 Then
RFC = objPersonal.RFC
NombreCompleto = objPersonal.NombreCompleto
@@ -143,11 +142,11 @@ Public Class LogicNominas
If continuar Then GetError = "No se pudo obtener la información del empleado" 'si continuar= true el error se origino en este nodo y le asigno el error
continuar = False
End If
If continuar AndAlso objNomina.GetNom_NominasDetalles(CveNomina, CvePersonal, CvePeriodo, "-1") Then
If objNomina.DtResultados.Rows.Count > 0 Then
DtPercepciones = objNomina.DtResultados.FiltraParametros("Tipo = 'P' AND EsPadre = 1 ")
DtDeducciones = objNomina.DtResultados.FiltraParametros("Tipo = 'D' AND EsPadre = 1 ")
DtPercepciones = objNomina.DtResultados.FiltraParametros("Tipo = 'P' AND EsPadre = 1 AND SoloVisible =0")
DtDeducciones = objNomina.DtResultados.FiltraParametros("Tipo = 'D' AND EsPadre = 1 AND SoloVisible =0")
DtOtrosPagos = objNomina.DtResultados.FiltraParametros(" TipoConceptoSAT='O'")
TotalPercepciones = DtPercepciones.SUM("Importe").ToString().ToDecimal()
TotalDeducciones = DtDeducciones.SUM("Importe").ToString().ToDecimal()
Total = CType((Total + DtPercepciones.SUM("Importe")), Decimal)
@@ -161,7 +160,6 @@ Public Class LogicNominas
Else
continuar = False
End If
If continuar AndAlso objNomina.GetPeriodos(-1, UsuarioActual.CveEmpresa, -1, -1, CvePeriodo) AndAlso objNomina.DtResultados.Rows().Count > 0 Then
Dim DrPeriodo As DataRow = objNomina.DtResultados.Rows(0)
@@ -183,8 +181,6 @@ Public Class LogicNominas
Else
continuar = False
End If
If DiasIncapacitados > 0 Then
If objNomina.GetIncapacidades(CvePersonal, CvePeriodo, UsuarioActual.CveEmpresa) Then
If objNomina.DtResultados IsNot Nothing AndAlso objNomina.DtResultados.Rows.Count > 0 Then
@@ -222,10 +218,11 @@ Public Class LogicNominas
cfdi.Receptor.RFC = RFC
cfdi.Receptor.Nombre = NombreCompleto
Dim ObjPercepciones As New List(Of CFDINominaPercepciones)
Dim ObjDeducciones As New List(Of CFDINominaDeducciones)
Dim ObjHorasExtras As New List(Of CFDINominaHorasExtras)
Dim ObjOtrosPagos As New List(Of CFDINominaOtrosPagos)
If DtPercepciones IsNot Nothing AndAlso DtPercepciones.Rows.Count > 0 Then
Dim ObjPercepciones As New List(Of CFDINominaPercepciones)
Dim ObjHorasExtras As New List(Of CFDINominaHorasExtras)
Dim ObjOtrosPagos As New List(Of CFDINominaOtrosPagos)
For Each Row As DataRow In DtPercepciones.Rows
If Row("Importe").ToString().ToDecimal > 0 AndAlso Row("SATCveConcepto").ToString().ToEntero() <> 17 Then
If Row("CveSATConcepto").ToString() = "" Then cfdi.AddMsg(String.Format("Concepto No registrado ({0})", Row("Concepto").ToString())) : Exit For
@@ -248,11 +245,62 @@ Public Class LogicNominas
.Clave = Row("Codigo").ToString(), .Concepto = Row("Concepto").ToString(), .Importe = Row("Importe").ToString().ToDecimal})
End If
Next
If ObjPercepciones IsNot Nothing AndAlso ObjPercepciones.Count > 0 Then cfdi.Nomina.Percepciones = ObjPercepciones
If ObjHorasExtras IsNot Nothing AndAlso ObjHorasExtras.Count > 0 Then cfdi.Nomina.HorasExtras = ObjHorasExtras
If ObjOtrosPagos IsNot Nothing AndAlso ObjOtrosPagos.Count > 0 Then cfdi.Nomina.OtrosPagos = ObjOtrosPagos
End If
If DtDeducciones IsNot Nothing AndAlso DtDeducciones.Rows.Count > 0 Then
For Each Row As DataRow In DtDeducciones.Rows
If Row("Importe").ToString().ToDecimal > 0 Then
If Row("CveSATConcepto").ToString() = "" Then cfdi.AddMsg(String.Format("Concepto No registrado ({0})", Row("Concepto").ToString())) : Exit For
If Row("SATCveConcepto").ToString().ToEntero().ToEntero() = 17 Then
ObjPercepciones.Add(New CFDINominaPercepciones With {.TipoPercepcion = Row("SATCveConcepto").ToString(), .Clave = Row("Codigo").ToString(), .Concepto = Row("Concepto").ToString(),
.ImporteGravado = Row("ImporteGravado").ToString().ToDecimal(), .ImporteExento = Row("ImporteExento").ToString().ToDecimal()})
Else
ObjDeducciones.Add(New CFDINominaDeducciones With {.TipoDeduccion = Row("SATCveConcepto").ToString(),
.Clave = Row("Codigo").ToString(),
.Concepto = Row("Concepto").ToString(),
.Importe = Row("Importe").ToString().ToDecimal()}
)
End If
End If
'subsidio al empleo
'If Row("SATCveConcepto").ToString().ToEntero().ToEntero() = 17 AndAlso Row("Importe").ToString().ToDecimal > 0 Then 'Subsidio
' ObjOtrosPagos.Add(New CFDINominaOtrosPagos With {.TipoOtroPago = "002", ' codigo fijo, por ser referente a subsidio al empleo
' .Clave = Row("Codigo").ToString(), .Concepto = Row("Concepto").ToString(), .Importe = Row("Importe").ToString().ToDecimal})
'End If
Next
End If
If DtOtrosPagos IsNot Nothing AndAlso DtOtrosPagos.Rows.Count > 0 Then
For Each Row As DataRow In DtOtrosPagos.Rows
If (Row("Importe").ToString().ToDecimal() > 0) OrElse (Row("SATCveConcepto").ToString().ToEntero().ToEntero() = 2 AndAlso Row("Importe").ToString().ToDecimal() < 0) Then
If Row("CveSATConcepto").ToString() = "" Then cfdi.AddMsg(String.Format("Concepto No registrado ({0})", Row("Concepto").ToString())) : Exit For
ObjOtrosPagos.Add(New CFDINominaOtrosPagos With {.TipoOtroPago = Row("SATCveConcepto").ToString(), .Clave = Row("Codigo").ToString(), .Concepto = Row("Concepto").ToString(),
.Importe = Row("Importe").ToString().ToDecimal().Abs(), .Subsidiocausado = Row("ImporteGravado").ToString().ToDecimal().Abs()})
If Row("SATCveConcepto").ToString().ToEntero().ToEntero() = 7 AndAlso Row("Importe").ToString().ToDecimal > 0 Then 'Subsidio
ObjDeducciones.Add(New CFDINominaDeducciones With {.TipoDeduccion = "002", ' codigo fijo
.Clave = Row("Codigo").ToString(), .Concepto = "ISR", .Importe = Row("Importe").ToString().ToDecimal})
End If
If Row("SATCveConcepto").ToString().ToEntero().ToEntero() = 8 AndAlso Row("Importe").ToString().ToDecimal > 0 Then 'Subsidio
ObjDeducciones.Add(New CFDINominaDeducciones With {.TipoDeduccion = "071", ' codigo fijo
.Clave = Row("Codigo").ToString(), .Concepto = "(Ajuste en Subsidio para el empleo (efectivamente entregado al trabajador)", .Importe = Row("Importe").ToString().ToDecimal})
End If
End If
Next
End If
If ObjPercepciones IsNot Nothing AndAlso ObjPercepciones.Count > 0 Then cfdi.Nomina.Percepciones = ObjPercepciones
If ObjHorasExtras IsNot Nothing AndAlso ObjHorasExtras.Count > 0 Then cfdi.Nomina.HorasExtras = ObjHorasExtras
If ObjOtrosPagos IsNot Nothing AndAlso ObjOtrosPagos.Count > 0 Then cfdi.Nomina.OtrosPagos = ObjOtrosPagos
If ObjIncapacidades IsNot Nothing AndAlso ObjIncapacidades.Count > 0 Then cfdi.Nomina.Incapacidades = ObjIncapacidades
If ObjDeducciones IsNot Nothing AndAlso ObjDeducciones.Count > 0 Then cfdi.Nomina.Deducciones = ObjDeducciones
cfdi.Comprobante.Version = "3.3"
@@ -301,260 +349,4 @@ Public Class LogicNominas
End If
End Function
Private Function PreTimbrar(CveNomina As Integer, CvePersonal As Integer, CvePeriodo As Integer, UsuarioActual As Usuario) As CFDITimbre
Dim cfdi As New CFDITimbre
Dim objPersonal As New ClsRH
Dim objNomina As New ClsNominas
objPersonal.GetPersonal(CvePersonal, UsuarioActual.CveEmpresa)
objNomina.GetNom_Nominas(CveNomina, CvePersonal, CvePeriodo, -1, UsuarioActual.CveEmpresa)
Dim DtPercepciones As Data.DataTable = Nothing
Dim DtDeducciones As Data.DataTable = Nothing
Dim DtOtrosPagos As Data.DataTable = Nothing
Dim TotalPercepciones As Decimal = 0
Dim TotalDeducciones As Decimal = 0
Dim TotalOtrosPagos As Decimal = 0
Dim Total As Decimal = 0
If objNomina.GetNom_NominasDetalles(CveNomina, CvePersonal, CvePeriodo, "-1") Then
If objNomina.DtResultados.Rows.Count > 0 Then
DtPercepciones = objNomina.DtResultados.FiltraParametros("Tipo = 'P' AND EsPadre = 1 ")
DtDeducciones = objNomina.DtResultados.FiltraParametros("Tipo = 'D' AND EsPadre = 1 ")
TotalPercepciones = DtPercepciones.SUM("Importe").ToString().ToDecimal()
TotalDeducciones = DtDeducciones.SUM("Importe").ToString().ToDecimal()
Total = CType((Total + DtPercepciones.SUM("Importe")), Decimal)
End If
End If
'nota. siempre y cuando halla concepto 19
Dim DtHorasExtras As Data.DataTable = Nothing
If objNomina.GetHorasExtras(CvePersonal, CvePeriodo, UsuarioActual.CveEmpresa) Then
DtHorasExtras = objNomina.DtResultados
End If
Dim TotalExcento As Decimal = 0
Dim TotalGravado As Decimal = 0
Dim AntiguedadSemanas As Integer = DateDiff(DateInterval.Weekday, objPersonal.FechaIngreso, Now).ToEntero()
Dim FormatoReciboCFDi As String = objPersonal.FormatoReciboCFDi
Dim FechaInicio, FechaFin, FechaPago As Date
Dim DiasPagados As Integer = 0
Dim Msg As String = String.Empty
Dim DiasIncapacitados As Integer = 0
Dim DrPeriodo As DataRow = Nothing
If objNomina.GetPeriodos(-1, UsuarioActual.CveEmpresa, -1, -1, CvePeriodo) Then
If objNomina.DtResultados.Rows().Count > 0 Then
DrPeriodo = objNomina.DtResultados.Rows(0)
End If
End If
'Dim DrPeriodo As DataRow = GlobalDTNominasPeriodos(-1, CvePeriodo, -1).FiltroPrimero("")
If DrPeriodo IsNot Nothing Then
FechaInicio = DrPeriodo("FechaInicio").ToString().ToDate
FechaFin = DrPeriodo("FechaFin").ToString().ToDate
FechaPago = DrPeriodo("FechaPago").ToString().ToDate
If objPersonal.GetAsistencias(CvePersonal, -1, -1, -1, -1, -1, FechaInicio, FechaFin, UsuarioActual.CveEmpresa) Then
Dim Asistencias As Integer = objPersonal.DtResultados.SUM("AplicaAsistencia").ToEntero()
Dim Vacaciones As Integer = objPersonal.DtResultados.SUM("AplicaVacacion").ToEntero()
DiasIncapacitados = objPersonal.DtResultados.SUM("AplicaIncapacidad").ToEntero()
DiasPagados = Asistencias - Vacaciones
If DiasPagados < 0 Then DiasPagados = 0
End If
End If
'Tipo Nomina O de Ordinaria o E de extraordinaria
'Dim FechaPago As Date = Now
Dim TotalSueldos As Decimal = 0
Dim TotalIndemnizacion As Decimal = 0
Dim TotalJubilacion As Decimal = 0
cfdi.Nomina = New CFDINomina
cfdi.Nomina.Version = "1.2"
cfdi.Nomina.TipoNomina = If(objNomina.CveTipoPeriodo = 6, "E", "O")
cfdi.Nomina.FechaPago = FechaPago
cfdi.Nomina.FechaInicio = FechaInicio.ToString()
cfdi.Nomina.FechaFin = FechaFin.ToString()
cfdi.Nomina.NumDiasPagados = DiasPagados
cfdi.Emisor.Nombre = UsuarioActual.Empresa.Empresa
cfdi.Emisor.RFC = UsuarioActual.Empresa.RFC
cfdi.Emisor.RegistroPatronal = UsuarioActual.Empresa.RegistroPatronal
cfdi.Emisor.RegimenFiscal = UsuarioActual.Empresa.CodigoRegimenFiscal
'aplica persona fisica debe de tener CURP
If cfdi.Emisor.RegimenFiscal.Contiene("605", "606", "608", "611", "612", "614", "616", "621", "622", "629", "630", "615") Then
cfdi.Emisor.CURP = UsuarioActual.Empresa.CURP
End If
cfdi.Nomina.CveNomina = CveNomina
cfdi.Receptor.UsoCFDI = "P01"
cfdi.Receptor.RFC = objPersonal.RFC
cfdi.Receptor.Nombre = objPersonal.NombreCompleto
If DtPercepciones IsNot Nothing Then
If DtPercepciones.Rows.Count > 0 Then
Dim ObjPercepciones As New List(Of CFDINominaPercepciones)
Dim ObjHorasExtras As New List(Of CFDINominaHorasExtras)
Dim ObjOtrosPagos As New List(Of CFDINominaOtrosPagos)
For Each Row As DataRow In DtPercepciones.Rows
If Row("Importe").ToString().ToDecimal > 0 AndAlso Row("SATCveConcepto").ToString().ToEntero() <> 17 Then
If Row("CveSATConcepto").ToString() = "" Then cfdi.AddMsg(String.Format("Concepto No registrado ({0})", Row("Concepto").ToString())) : Exit For
ObjPercepciones.Add(New CFDINominaPercepciones With {.TipoPercepcion = Row("SATCveConcepto").ToString(),
.Clave = Row("Codigo").ToString(),
.Concepto = Row("Concepto").ToString(),
.ImporteGravado = Row("ImporteGravado").ToString().ToDecimal,
.ImporteExento = Row("ImporteExento").ToString().ToDecimal}
)
End If
'RMF, falta poner el numero de horas pagadas
If Row("CveSATConcepto").ToString().ToEntero() = 19 Then 'cuando son horas extras
'Obtengo el desglose de horas extras
If DtHorasExtras IsNot Nothing Then
Dim dr As DataRow = DtHorasExtras.FiltroPrimero("")
If dr IsNot Nothing Then
If dr("HorasDobles").ToString().ToDouble > 0 Then ObjHorasExtras.Add(New CFDINominaHorasExtras With {.Dias = dr("DiasHorasDobles").ToString().ToEntero().ToString(), .TipoHoras = "01", .HorasExtra = dr("HorasDobles").ToString().ToEntero(), .ImportePagado = Row("Importe").ToString().ToDecimal})
If dr("HorasTriples").ToString().ToDouble > 0 Then ObjHorasExtras.Add(New CFDINominaHorasExtras With {.Dias = dr("DiasHorasTriples").ToString().ToEntero().ToString(), .TipoHoras = "02", .HorasExtra = dr("HorasTriples").ToString().ToEntero(), .ImportePagado = Row("Importe").ToString().ToDecimal})
End If
End If
End If
'subsidio al empleo
If Row("SATCveConcepto").ToString().ToEntero().ToEntero() = 17 AndAlso Row("Importe").ToString().ToDecimal > 0 Then 'Subsidio
ObjOtrosPagos.Add(New CFDINominaOtrosPagos With {.TipoOtroPago = "002", ' codigo fijo, por ser refernte a subsidio al empleo
.Clave = Row("Codigo").ToString(),
.Concepto = Row("Concepto").ToString(),
.Importe = Row("Importe").ToString().ToDecimal}
)
End If
Next
If ObjPercepciones IsNot Nothing AndAlso ObjPercepciones.Count > 0 Then cfdi.Nomina.Percepciones = ObjPercepciones
If ObjHorasExtras IsNot Nothing AndAlso ObjHorasExtras.Count > 0 Then cfdi.Nomina.HorasExtras = ObjHorasExtras
If ObjOtrosPagos IsNot Nothing AndAlso ObjOtrosPagos.Count > 0 Then cfdi.Nomina.OtrosPagos = ObjOtrosPagos
End If
End If
'cargo las incapacidades
If DiasIncapacitados > 0 Then
If objNomina.GetIncapacidades(CvePersonal, CvePeriodo, UsuarioActual.CveEmpresa) Then
If objNomina.DtResultados IsNot Nothing AndAlso objNomina.DtResultados.Rows.Count > 0 Then
Dim ObjIncapacidades As New List(Of CFDINominaIncapacidades)
For Each dr As DataRow In objNomina.DtResultados.Rows
ObjIncapacidades.Add(New CFDINominaIncapacidades With {.DiasIncapacidad = dr("Dias").ToString().ToEntero().ToString(), .TipoIncapacidad = dr("ClaveTipoIncapacidad").ToString(), .Importe = dr("Descuento").ToString().ToDecimal})
Next
If ObjIncapacidades IsNot Nothing AndAlso ObjIncapacidades.Count > 0 Then cfdi.Nomina.Incapacidades = ObjIncapacidades
End If
End If
End If
TotalExcento = 0
TotalGravado = 0
If DtDeducciones IsNot Nothing Then
If DtDeducciones.Rows.Count > 0 Then
Dim ObjDeducciones As New List(Of CFDINominaDeducciones)
For Each Row As DataRow In DtDeducciones.Rows
If Row("Importe").ToString().ToDecimal > 0 Then
If Row("CveSATConcepto").ToString() = "" Then cfdi.AddMsg(String.Format("Concepto No registrado ({0})", Row("Concepto").ToString())) : Exit For
ObjDeducciones.Add(New CFDINominaDeducciones With {.TipoDeduccion = Row("SATCveConcepto").ToString(),
.Clave = Row("Codigo").ToString(),
.Concepto = Row("Concepto").ToString(),
.Importe = Row("Importe").ToString().ToDecimal}
)
End If
Next
If ObjDeducciones IsNot Nothing AndAlso ObjDeducciones.Count > 0 Then cfdi.Nomina.Deducciones = ObjDeducciones
End If
End If
'If DtOtrosPagos IsNot Nothing Then
' If DtOtrosPagos.Rows.Count > 0 Then
' ' Total = CType((Total - DtOtrosPagos.SUM("Importe")), Decimal)
' Dim ObjOtrosPagos As New List(Of CFDINominaOtrosPagos)
' ' End If
' ' For Each Row As DataRow In DtOtrosPagos.Rows
' ' If Row("Importe").ToString().ToDecimal > 0 Then
' ' If Row("CveSATConcepto").ToString() = "" Then
' ' Msg = String.Format("Concepto No registrado ({0})", Row("Concepto").ToString())
' ' Else
' ' Msg = cfdi.ObjCompNomina12.AgregarOtroPago(Row("SATCveConcepto").ToString(), Row("Codigo").ToString(), Row("Concepto").ToString(), 0)
' ' 'Msg = CFDi.ObjCompNomina12.CargarSubsidioAlEmpleo(0)
' ' 'Msg = CFDi.ObjCompNomina12.CargarCompensacionSaldosAFavor(0, 0, 0)
' ' End If
' ' If Msg <> String.Empty Then
' ' Me.OnError("El SAT regresó el siguiente mensaje: " & Msg & ". Objeto: Otros Pagos", New Exception)
' ' Exit For
' ' End If
' ' End If
' ' Next
' If ObjOtrosPagos IsNot Nothing AndAlso ObjOtrosPagos.Count > 0 Then cfdi.Nomina.OtrosPagos = ObjOtrosPagos
' End If
'End If
cfdi.Comprobante.Version = "3.3"
cfdi.Comprobante.Serie = objNomina.Serie
cfdi.Comprobante.Folio = objNomina.Folio.ToString()
cfdi.Comprobante.Fecha = Now
cfdi.Comprobante.Subtotal = cfdi.Nomina.TotalPercepciones.ToString().ToDecimal() + cfdi.Nomina.TotalOtrosPagos.ToString().ToDecimal()
cfdi.Comprobante.Descuentos = cfdi.Nomina.TotalDeducciones.ToString().ToDecimal()
cfdi.Comprobante.Total = cfdi.Comprobante.Subtotal - cfdi.Comprobante.Descuentos 'cfdi.Nomina.TotalPercepciones + cfdi.Nomina.TotalOtrosPagos - cfdi.Nomina.TotalDeducciones
cfdi.Comprobante.MotivoDescuento = "" '"Deducciones nómina"
cfdi.Comprobante.Moneda = "MXN"
cfdi.Comprobante.TipoComprobante = "N"
cfdi.Comprobante.TipoDocto = "Egs"
cfdi.Comprobante.MetodoPago = "PUE"
cfdi.Comprobante.CondicionesdePago = "" '"CONTADO"
cfdi.Comprobante.FormadePago = "99"
cfdi.Comprobante.LugarExpedicion = UsuarioActual.Empresa.CP.ToString() ' AHORITA SOLO SE REQUIERE ESPECIFICAR EL CODIGO POSTAL
cfdi.Comprobante.NumCuentaPago = "" 'objPersonal.BancoNumCuenta
cfdi.Nomina.Receptor.CURP = objPersonal.CURP
cfdi.Nomina.Receptor.NSS = objPersonal.NumeroSS
cfdi.Nomina.Receptor.FechaInicioContrato = objPersonal.FechaInicioContrato.ToString()
cfdi.Nomina.Receptor.Antiguedad = $"P{AntiguedadSemanas}W"
cfdi.Nomina.Receptor.TipoContrato = objPersonal.CodigoTipoContrato
cfdi.Nomina.Receptor.CodigoTipoJornada = objPersonal.ClaveTipoJornada
cfdi.Nomina.Receptor.CodigoRegimenContratacion = objPersonal.CveRegimenContratacion
cfdi.Nomina.Receptor.CodigoEmpleado = objPersonal.Codigo
cfdi.Nomina.Receptor.Departamento = objPersonal.Departamento
cfdi.Nomina.Receptor.Puesto = objPersonal.Puesto
cfdi.Nomina.Receptor.CodigoRiesgoPuesto = objPersonal.CveSATRiesgoPuesto.ToString()
cfdi.Nomina.Receptor.TipoPeriodo = objPersonal.TipoPeriodoPago
cfdi.Nomina.Receptor.CodigoBanco = objPersonal.ClaveBanco
cfdi.Nomina.Receptor.NumeroCuenta = objPersonal.BancoNumCuenta
cfdi.Nomina.Receptor.SDI = objPersonal.SDI
cfdi.Nomina.Receptor.SBC = objPersonal.SDI
cfdi.Nomina.Receptor.Sindicalizado = ""
cfdi.Nomina.Receptor.CodigoEntidadFederativa = objPersonal.ClaveEstado
cfdi.Conceptos.Add(New CFDIConceptos With {.Cantidad = 1, .ClaveUnidad = "ACT", .ClaveProdServ = "84111505", .Descripcion = "Pago de nómina", .ValorUnitario = cfdi.Comprobante.Subtotal, .Importe = cfdi.Comprobante.Subtotal, .Descuento = cfdi.Nomina.TotalDeducciones.ToString().ToDecimal()})
objPersonal.Dispose()
objNomina.Dispose()
Return cfdi
End Function
End Class

View File

@@ -2048,7 +2048,7 @@ Public Class Timbrado
For Each otpag As CFDINominaOtrosPagos In ObjCFDITimbre.Nomina.OtrosPagos
cfdi.Nomina12OtroPago(otpag.TipoOtroPago, otpag.Clave, otpag.Concepto, otpag.Importe)
If otpag.TipoOtroPago = "002" Then
cfdi.Nomina12SubsidioAlEmpleo(otpag.Importe)
cfdi.Nomina12SubsidioAlEmpleo(otpag.Subsidiocausado)
End If
Next
@@ -2895,10 +2895,10 @@ Public Class Timbrado
Nom.OtrosPagos(i).TipoOtroPago = otpag.TipoOtroPago
Nom.OtrosPagos(i).Clave = otpag.Clave
Nom.OtrosPagos(i).Concepto = otpag.Concepto
Nom.OtrosPagos(i).Importe = otpag.Importe.ToDecimal
Nom.OtrosPagos(i).Importe = otpag.Importe
If otpag.TipoOtroPago = "002" Then
Nom.OtrosPagos(i).SubsidioAlEmpleo = New Profact.TimbraCFDI33.Complementos.Nomina12.NominaOtroPagoSubsidioAlEmpleo()
Nom.OtrosPagos(i).SubsidioAlEmpleo.SubsidioCausado = otpag.Importe.ToDecimal
Nom.OtrosPagos(i).SubsidioAlEmpleo.SubsidioCausado = otpag.Importe
End If
i += 1
Next

View File

@@ -52,7 +52,7 @@ Public Class SIGWeb : Implements IHttpHandler, IRequiresSessionState
Case "sendMail"
context.Response.Write(sendMail(context))
Case "sendMailLPM"
context.Response.Write(sendMail(context))
context.Response.Write(sendMailLPM(context))
End Select
Catch ex As Exception

View File

@@ -535,7 +535,7 @@
</Style>
</PageHeader>
<PageFooter>
<Height>7.37187cm</Height>
<Height>7.35216cm</Height>
<PrintOnFirstPage>true</PrintOnFirstPage>
<PrintOnLastPage>true</PrintOnLastPage>
<ReportItems>
@@ -557,7 +557,7 @@
</Paragraph>
</Paragraphs>
<rd:DefaultName>Textbox31</rd:DefaultName>
<Top>0.07053cm</Top>
<Top>0.07054cm</Top>
<Left>0.11166cm</Left>
<Height>0.6cm</Height>
<Width>2.77516cm</Width>
@@ -588,7 +588,7 @@
</Paragraph>
</Paragraphs>
<rd:DefaultName>Textbox31</rd:DefaultName>
<Top>0.1058cm</Top>
<Top>0.10581cm</Top>
<Left>2.9221cm</Left>
<Height>1.2cm</Height>
<Width>13.85147cm</Width>
@@ -604,7 +604,7 @@
</Style>
</Textbox>
<Line Name="Line4">
<Top>0.10581cm</Top>
<Top>0.10582cm</Top>
<Left>0.05604cm</Left>
<Height>0cm</Height>
<Width>16.76689cm</Width>
@@ -616,7 +616,7 @@
</Style>
</Line>
<Line Name="Line3">
<Top>1.3058cm</Top>
<Top>1.30581cm</Top>
<Left>0.11166cm</Left>
<Height>0cm</Height>
<Width>16.71127cm</Width>
@@ -646,7 +646,7 @@
</Paragraph>
</Paragraphs>
<rd:DefaultName>Textbox21</rd:DefaultName>
<Top>1.65886cm</Top>
<Top>1.65887cm</Top>
<Left>0.55741cm</Left>
<Height>0.63528cm</Height>
<Width>7.11779cm</Width>
@@ -692,7 +692,7 @@
</Paragraph>
</Paragraphs>
<rd:DefaultName>Textbox21</rd:DefaultName>
<Top>2.85337cm</Top>
<Top>2.85338cm</Top>
<Left>0.55115cm</Left>
<Height>0.90367cm</Height>
<Width>7.11779cm</Width>
@@ -726,7 +726,7 @@
</Paragraph>
</Paragraphs>
<rd:DefaultName>Textbox22</rd:DefaultName>
<Top>1.3058cm</Top>
<Top>1.30581cm</Top>
<Left>0.56367cm</Left>
<Height>0.6cm</Height>
<Width>7.11153cm</Width>
@@ -760,7 +760,7 @@
</Paragraph>
</Paragraphs>
<rd:DefaultName>Textbox21</rd:DefaultName>
<Top>1.62358cm</Top>
<Top>1.62359cm</Top>
<Left>9.66204cm</Left>
<Height>0.63528cm</Height>
<Width>7.11779cm</Width>
@@ -806,7 +806,7 @@
</Paragraph>
</Paragraphs>
<rd:DefaultName>Textbox21</rd:DefaultName>
<Top>2.85337cm</Top>
<Top>2.85338cm</Top>
<Left>9.65578cm</Left>
<Height>0.90367cm</Height>
<Width>7.11779cm</Width>
@@ -840,7 +840,7 @@
</Paragraph>
</Paragraphs>
<rd:DefaultName>Textbox22</rd:DefaultName>
<Top>1.3058cm</Top>
<Top>1.30581cm</Top>
<Left>9.66204cm</Left>
<Height>0.6cm</Height>
<Width>7.11779cm</Width>
@@ -873,7 +873,7 @@
</Paragraph>
</Paragraphs>
<rd:DefaultName>Textbox17</rd:DefaultName>
<Top>3.82759cm</Top>
<Top>3.8276cm</Top>
<Left>0.00042cm</Left>
<Height>1.36498cm</Height>
<Width>16.77315cm</Width>
@@ -888,51 +888,6 @@
<PaddingBottom>2pt</PaddingBottom>
</Style>
</Textbox>
<Textbox Name="Textbox8">
<CanGrow>true</CanGrow>
<KeepTogether>true</KeepTogether>
<Paragraphs>
<Paragraph>
<TextRuns>
<TextRun>
<Value>Fecha Impresión:</Value>
<Style>
<FontSize>8pt</FontSize>
<FontWeight>Bold</FontWeight>
</Style>
</TextRun>
<TextRun>
<Value xml:space="preserve"> </Value>
<Style>
<FontSize>8pt</FontSize>
</Style>
</TextRun>
<TextRun>
<Value>=Today</Value>
<Style>
<FontSize>8pt</FontSize>
</Style>
</TextRun>
</TextRuns>
<Style />
</Paragraph>
</Paragraphs>
<rd:DefaultName>Textbox8</rd:DefaultName>
<Top>6.50728cm</Top>
<Left>0.11166cm</Left>
<Height>0.6cm</Height>
<Width>6.86562cm</Width>
<ZIndex>11</ZIndex>
<Style>
<Border>
<Style>None</Style>
</Border>
<PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
<PaddingBottom>2pt</PaddingBottom>
</Style>
</Textbox>
</ReportItems>
<Style>
<Border>

View File

@@ -916,51 +916,6 @@
<PaddingBottom>2pt</PaddingBottom>
</Style>
</Textbox>
<Textbox Name="Textbox8">
<CanGrow>true</CanGrow>
<KeepTogether>true</KeepTogether>
<Paragraphs>
<Paragraph>
<TextRuns>
<TextRun>
<Value>Fecha Impresión:</Value>
<Style>
<FontSize>8pt</FontSize>
<FontWeight>Bold</FontWeight>
</Style>
</TextRun>
<TextRun>
<Value xml:space="preserve"> </Value>
<Style>
<FontSize>8pt</FontSize>
</Style>
</TextRun>
<TextRun>
<Value>=Today</Value>
<Style>
<FontSize>8pt</FontSize>
</Style>
</TextRun>
</TextRuns>
<Style />
</Paragraph>
</Paragraphs>
<rd:DefaultName>Textbox8</rd:DefaultName>
<Top>8.22649cm</Top>
<Left>0.16462cm</Left>
<Height>0.6cm</Height>
<Width>6.86562cm</Width>
<ZIndex>11</ZIndex>
<Style>
<Border>
<Style>None</Style>
</Border>
<PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
<PaddingBottom>2pt</PaddingBottom>
</Style>
</Textbox>
</ReportItems>
<Style>
<Border>

View File

@@ -4,6 +4,7 @@
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
<style>
a.sline{white-space: nowrap ;}
td.cellFail {
color: red;
}
@@ -398,8 +399,8 @@
<ItemTemplate>
<div style="width: 70px; text-align: right;">
<asp:LinkButton runat="server" ID="LnkTimbrar" CssClass="btn btn-circle btn-sm blue mysmallbtn" Text="<i class='fa fa-bell'></i>" OnClick="LnkTimbrar_Click" data-toggle="confirmation" data-popout="true" data-original-title="¿Está seguro que desea Timbrar?" data-btn-ok-label="si" />
<asp:LinkButton runat="server" ID="ImgDelete" CssClass="btn btn-circle btn-sm red mysmallbtn" Text="<i class='icon-trash'></i>" OnClick="ImgDelete_Click" CommandArgument='<%# Eval("CveNomina") %>' Visible='<%# (Eval("CveNomina").ToString() != "" && Eval("SeTimbro").ToString() == "False"? true :false)%>' OnClientClick="javascript:return confirm('¿Está seguro que desea eliminar la nómina?');" />
<asp:LinkButton runat="server" ID="LnkCancelar" CssClass="btn btn-circle btn-sm red mysmallbtn" Text="<i class='fas fa-ban'></i>" OnClick="LnkCancelar_Click" CommandArgument='<%# Eval("CveNomina") %>' Visible='<%# (Eval("CveNomina").ToString() != "" && PermisoCancelarEmitido && Eval("SeTimbro").ToString() == "True"? true :false)%>' OnClientClick="javascript:return confirm('¿Está seguro que desea cancelar la nómina?');" />
<asp:LinkButton runat="server" ID="ImgDelete" CssClass="btn btn-circle btn-sm red mysmallbtn" Text="<i class='icon-trash'></i>" OnClick="ImgDelete_Click" CommandArgument='<%# Eval("CveNomina") %>' Visible='<%# (Eval("CveNomina").ToString() != "" && Eval("SeTimbro").ToString() == "False"? true :false)%>' data-popout="true" data-original-title="¿Está seguro que desea eliminar la nómina?" data-btn-ok-label="si" />
<asp:LinkButton runat="server" ID="LnkCancelar" CssClass="btn btn-circle btn-sm red mysmallbtn" Text="<i class='fas fa-ban'></i>" OnClick="LnkCancelar_Click" CommandArgument='<%# Eval("CveNomina") %>' Visible='<%# (Eval("CveNomina").ToString() != "" && PermisoCancelarEmitido && Eval("SeTimbro").ToString() == "True"? true :false)%>' data-popout="true" data-original-title="¿Está seguro que desea cancelar la nómina?" data-btn-ok-label="si" />
</div>
</ItemTemplate>
</asp:TemplateField>
@@ -1626,7 +1627,6 @@
<%= String.Format("$('#{0}').click();", btnasis.ClientID) %>
}
function ADSBegin() {
debugger;
if ($('.GvConceptos .thTituloConcepto').length == 0) {
$('.GvConceptos').prepend("<tr class=\"thTituloConcepto\"> <th scope=\"col\" colspan=\"3\">Percepciones</th><th scope=\"col\" colspan=\"3\">Deducciones</th> </tr>");
}

View File

@@ -7,6 +7,8 @@ using System.Web.UI.WebControls;
using Extensiones;
using System.Data;
using System.Text;
using static Extensiones.ModExtensiones;
using System.Drawing;
public partial class Nomina_Nomina2 : ClsPaginas
{
@@ -114,6 +116,57 @@ public partial class Nomina_Nomina2 : ClsPaginas
set { ViewState["CcveMovtoPermanente"] = value; }
}
protected int FiltCveProyecto
{
get
{
if (ViewState["FiltCveProyecto"] == null) { return 0; }
else { return ViewState["FiltCveProyecto"].ToString().ToEntero(); }
}
set { ViewState["FiltCveProyecto"] = value; }
}
protected int FiltCveSubProyecto
{
get
{
if (ViewState["FiltCveSubProyecto"] == null) { return 0; }
else { return ViewState["FiltCveSubProyecto"].ToString().ToEntero(); }
}
set { ViewState["FiltCveSubProyecto"] = value; }
}
protected int FiltCveTurno
{
get
{
if (ViewState["FiltCveTurno"] == null) { return 0; }
else { return ViewState["FiltCveTurno"].ToString().ToEntero(); }
}
set { ViewState["FiltCveTurno"] = value; }
}
protected int FiltCvePeriodo
{
get
{
if (ViewState["FiltCvePeriodo"] == null) { return 0; }
else { return ViewState["FiltCvePeriodo"].ToString().ToEntero(); }
}
set { ViewState["FiltCvePeriodo"] = value; }
}
protected int FiltAgrupador
{
get
{
if (ViewState["FiltAgrupador"] == null) { return 0; }
else { return ViewState["FiltAgrupador"].ToString().ToEntero(); }
}
set { ViewState["FiltAgrupador"] = value; }
}
#endregion
protected void Page_Load(object sender, EventArgs e)
{
@@ -256,30 +309,40 @@ public partial class Nomina_Nomina2 : ClsPaginas
protected void LnkConsultar_Click(object sender, EventArgs e)
{
bool continuar = false;
int CveProyecto = DdlProyecto.SelectedValue.ToEntero();
int CveSubProyecto = DdlSubProyecto.SelectedValue.ToEntero();
int CveTurno = DdlTurno.SelectedValue.ToEntero();
int CvePeriodo = DdlPeriodo.SelectedValue.ToEntero();
int CveEmpresa = UsuarioActual.CveEmpresa;
int Agrupador = DdlAgrupador.SelectedValue.ToEntero();
FiltCveProyecto = DdlProyecto.SelectedValue.ToEntero();
FiltCveSubProyecto = DdlSubProyecto.SelectedValue.ToEntero();
FiltCveTurno = DdlTurno.SelectedValue.ToEntero();
FiltCvePeriodo = DdlPeriodo.SelectedValue.ToEntero();
FiltAgrupador = DdlAgrupador.SelectedValue.ToEntero();
cargaDatos();
}
public void cargaDatos()
{
int CveEmpresa = UsuarioActual.CveEmpresa;
bool continuar = false;
CvePeriodoSeleccionado = 0;
dtempleados = null;
dtConceptos = null;
DataTable dtPeriodo = new DataTable();
DataTable dtasistencia = new DataTable();
using (ClsNominas objnom = new ClsNominas())
if (FiltCvePeriodo > 0)
{
if (objnom.GetNominaEmpleado(CveProyecto, CveSubProyecto, CveTurno, CvePeriodo, CveEmpresa, Agrupador) && objnom.DTSetResultados.Tables.Count > 1)
using (ClsNominas objnom = new ClsNominas())
{
dtempleados = objnom.DTSetResultados.Tables[3];
dtempleadosConceptos = objnom.DTSetResultados.Tables[4];
dtConceptos = objnom.DTSetResultados.Tables[0];
dtPeriodo = objnom.DTSetResultados.Tables[1];
dtasistencia = objnom.DTSetResultados.Tables[2];
CvePeriodoSeleccionado = CvePeriodo;
continuar = true;
if (objnom.GetNominaEmpleado(FiltCveProyecto, FiltCveSubProyecto, FiltCveTurno, FiltCvePeriodo, CveEmpresa, FiltAgrupador) && objnom.DTSetResultados.Tables.Count > 1)
{
dtempleados = objnom.DTSetResultados.Tables[3];
dtempleadosConceptos = objnom.DTSetResultados.Tables[4];
dtConceptos = objnom.DTSetResultados.Tables[0];
dtPeriodo = objnom.DTSetResultados.Tables[1];
dtasistencia = objnom.DTSetResultados.Tables[2];
CvePeriodoSeleccionado = FiltCvePeriodo;
continuar = true;
}
}
}
@@ -688,7 +751,6 @@ public partial class Nomina_Nomina2 : ClsPaginas
UpDatos.Update();
}
protected void GvNominas_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
@@ -707,7 +769,7 @@ public partial class Nomina_Nomina2 : ClsPaginas
LnkTimbrar.Visible = false;
if (cvePersonal > 0)
{
LtlNombre.Text = String.Format("<a class=\"Texto\" href=\"/RH/Personal.aspx?CvePersonal={0}\">{2}<br/>{1}</a>", cvePersonal, Nombre, Codigo);
LtlNombre.Text = String.Format("<a class=\"Texto sline\" href=\"/RH/Personal.aspx?CvePersonal={0}\">{2}<br/>{1}</a>", cvePersonal, Nombre, Codigo);
if (CveNomina > 0)
{
if (NomAutorizado == "False")
@@ -761,17 +823,76 @@ public partial class Nomina_Nomina2 : ClsPaginas
protected void LnkTimbrar_Click(object sender, EventArgs e)
{
LinkButton lnk = (LinkButton)sender;
GridViewRow gvRow = (GridViewRow)lnk.NamingContainer;
int CvePeriodo = gvRow.DataKey("CvePeriodo").ToEntero();
int CvePersonal = gvRow.DataKey("CvePersonal").ToEntero();
int CveNomina = gvRow.DataKey("CveNomina").ToEntero();
LogicNominas lognom = new LogicNominas();
string Msg = lognom.TimbrarNomina(CveNomina, CvePersonal, CvePeriodo, UsuarioActual);
if (Msg != null && Msg.Length > 0)
{ Alert(Msg, TipoMensaje.MsgAdvertencia); }
else
{
ClsNominas ObjPeriodo = new ClsNominas();
ObjPeriodo.CambiaEstatusPeriodo(CvePeriodo, (int)enumNominasEstatus.Timbrada, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa);
ObjPeriodo.Dispose();
Alert("Se ha timbrado correctamente");
gvRow.FindControl("ImgDelete").Visible = false;
gvRow.FindControl("LnkCancelar").Visible = false;
//gvRow.FCImage("ImgBandera").ImageUrl = "/Imagenes/flag_green.png";
gvRow.ForeColor = Color.Green;
lnk.Visible = false; UpDatos.Update();
}
}
protected void ImgDelete_Click(object sender, EventArgs e)
{
int Cve = ((LinkButton)sender).CommandArgument.ToEntero();
ClsNominas Nom = new ClsNominas();
if (Nom.RemoveNom_Nominas(Cve))
{
Alert("Los movimientos de la nómina fueron eliminados", TipoMensaje.MsgInformacion); cargaDatos();
}
Nom.Dispose();
}
protected void LnkCancelar_Click(object sender, EventArgs e)
{
int CveNomina = ((LinkButton)sender).CommandArgument.ToEntero();
if (CveNomina > 0)
{
ClsNominas Nom = new ClsNominas();
if (Nom.GetNom_Nominas(CveNomina, -1, -1, -1, UsuarioActual.CveEmpresa))
{
Timbrado ObjTimbrado = new Timbrado();
string FolioFiscal = Nom.FolioFiscal;
decimal Total = Nom.Total.ToString().ToDecimal();
string RFCReceptor = Nom.RFC;
string RFCEmisor = UsuarioActual.Empresa.RFC;
if (ObjTimbrado.CFDICancelar(UsuarioActual.Empresa, FolioFiscal, Total, RFCReceptor, RFCEmisor))
{
Nom.UpdateEstatusNomNominas(2, UsuarioActual.Empresa.CvePAC, "", "", ("01/01/2000").ToDate(), CveNomina, 0, 0, 0, 0, 0);
Alert("La nómina con folio fiscal fue cancelada ante el SAT", TipoMensaje.MsgInformacion);
}
}
Nom.Dispose();
cargaDatos();
}
}
protected void LnkCargarNomina_Click(object sender, EventArgs e)
@@ -1094,7 +1215,7 @@ public partial class Nomina_Nomina2 : ClsPaginas
{
int BorradoLogico = 0;
int CveConcepto = row["CveConcepto"].ToString().ToEntero();
if (!(dtempleados.SUM(string.Format("[V_{0}]", CveConcepto)) > 0))
if (!(dtempleados.SUM(string.Format("[V_{0}]", CveConcepto)) != 0))
{
BorradoLogico = 1;
}
@@ -1105,7 +1226,7 @@ public partial class Nomina_Nomina2 : ClsPaginas
{
int BorradoLogico = 0;
int CveConcepto = row["CveConcepto"].ToString().ToEntero();
if (!(dtempleados.SUM(string.Format("[V_{0}]", CveConcepto)) > 0))
if (!(dtempleados.SUM(string.Format("[V_{0}]", CveConcepto)) != 0))
{
BorradoLogico = 1;
}
@@ -1246,7 +1367,7 @@ public partial class Nomina_Nomina2 : ClsPaginas
{
int BorradoLogico = 0;
int CveConcepto = row["CveConcepto"].ToString().ToEntero();
if (!(dtempleados.SUM(string.Format("[V_{0}]", CveConcepto)) > 0))
if (!(dtempleados.SUM(string.Format("[V_{0}]", CveConcepto)) != 0))
{
BorradoLogico = 1;
}
@@ -1257,7 +1378,7 @@ public partial class Nomina_Nomina2 : ClsPaginas
{
int BorradoLogico = 0;
int CveConcepto = row["CveConcepto"].ToString().ToEntero();
if (!(dtempleados.SUM(string.Format("[V_{0}]", CveConcepto)) > 0))
if (!(dtempleados.SUM(string.Format("[V_{0}]", CveConcepto)) != 0))
{
BorradoLogico = 1;
}
@@ -1856,12 +1977,7 @@ public partial class Nomina_Nomina2 : ClsPaginas
paragraphh.ParagraphFormat.Style = styilo;
paragraphh = new GemBox.Document.Paragraph(document, string.Format("Días pagados:{0}, Retardos: {1}, Ausencias:{2} ", drow2["DiasPago"], drow2["DiasRetardos"], drow2["DiasFaltados"])); cell.Blocks.Add(paragraphh);
paragraphh.ParagraphFormat.Style = styilo;
/*
Gonzalez Gaitan Jorge
DIRECTOR OPERATIVO RFC: GOGJ-720331-TZ3 Afiliación IMSS: 11-96-72-1082-1
Fecha Ingr: 01/03/2019 Sal. diario: 3849.84 S.D.I: 4023.87 S.B.C: 2112.25 Cotiza Fijo
Días pagados: 15.00 Tot Hrs trab: 120.00 Hrs día: 8.00 Hrs extras: 0.00 CURP: GOGJ-720331-HMCNTR09
*/
row = new GemBox.Document.Tables.TableRow(document);
sobrereciboTable.Rows.Add(row);
@@ -3374,7 +3490,7 @@ public partial class Nomina_Nomina2 : ClsPaginas
{
bool continuar = true;
DataTable dtr = dtempleados.FiltraParametros(string.Format("CvePersonal={0} OR {0}=-1", FiltroCvePersonal));
DataTable dtr = dtempleados.FiltraParametros(string.Format("(CvePersonal={0} OR {0}=-1) AND CvePersonal > 0 AND NomAutorizado =0", FiltroCvePersonal), "", new string[] { "CvePersonal", "CveMetodoPago" });
DataTable dtconp = null;
int CvePeriodoSeleccionado = DdlPeriodo.SelectedValue.ToEntero();//cambiar reparar
#region PropNomina
@@ -3433,7 +3549,7 @@ public partial class Nomina_Nomina2 : ClsPaginas
if (continuar)
{
dtconp = dtempleadosConceptos.FiltraParametros(string.Format("CvePersonal={0}", CvePersonal));
dtconp = dtempleadosConceptos.FiltraParametros(string.Format("CvePersonal={0} AND Importe<>0", CvePersonal));
foreach (DataRow rcon in dtconp.Rows)
{
@@ -3467,6 +3583,7 @@ public partial class Nomina_Nomina2 : ClsPaginas
{
objNomina.Commit();
Alert("La nomina se autorizó correctamente.");
cargaDatos();
}
else
{
@@ -3474,15 +3591,16 @@ public partial class Nomina_Nomina2 : ClsPaginas
}
}
if(dtr != null){
dtr.Dispose();
if (dtr != null)
{
dtr.Dispose();
}
if (dtconp != null)
{
dtconp.Dispose();
}
}
}
protected void LnkCargaAsistenciaMasiva_Click(object sender, EventArgs e)
@@ -3544,11 +3662,7 @@ public partial class Nomina_Nomina2 : ClsPaginas
{
cargaPeriodosCM();
}
protected void DdlTipoPeriodoCM_SelectedIndexChanged1(object sender, EventArgs e)
{
}
protected void LnkGuardarASistencia_Click(object sender, EventArgs e)
@@ -3878,7 +3992,7 @@ public partial class Nomina_Nomina2 : ClsPaginas
if (ObjPersonal.DTSetResultados.Tables.Count > 4)
{
DateTime dateperiodo;
DateTime.TryParseExact( string.Format ("{0}01",ObjPersonal.DTSetResultados.Tables[1].Rows[0]["Periodo"]), "yyyyMMdd", new System.Globalization.CultureInfo("es-MX"), System.Globalization.DateTimeStyles.None,out dateperiodo);
DateTime.TryParseExact(string.Format("{0}01", ObjPersonal.DTSetResultados.Tables[1].Rows[0]["Periodo"]), "yyyyMMdd", new System.Globalization.CultureInfo("es-MX"), System.Globalization.DateTimeStyles.None, out dateperiodo);
LtlPeriodo.Text = dateperiodo.Date.ToString("MMMM yyyy", new System.Globalization.CultureInfo("es-MX"));
DtSuaProcesado = ObjPersonal.DTSetResultados.Tables[3];
GVProcesarSUA.DataSource = ObjPersonal.DTSetResultados.Tables[3];
@@ -3980,31 +4094,31 @@ public partial class Nomina_Nomina2 : ClsPaginas
{
ClosedXML.Excel.XLWorkbook wb = new ClosedXML.Excel.XLWorkbook();
var libro = wb.AddWorksheet("SUA");
var libro = wb.AddWorksheet("SUA");
int Fila = 1;
libro.Column(1).Width = 50;
libro.Column(1).Width = 50;
ClosedXML.Excel.IXLRange range = libro.Range(Fila, 2, Fila, 3);
range.Merge();
range.Value = "Salario";
range = libro.Range(Fila,4, Fila, 5);
range = libro.Range(Fila, 4, Fila, 5);
range.Merge();
range.Value = "Cuota Fija";
range = libro.Range(Fila, 6, Fila,7 );
range = libro.Range(Fila, 6, Fila, 7);
range.Merge();
range.Value = "Cuota Excedente";
range = libro.Range(Fila,8, Fila, 9);
range = libro.Range(Fila, 8, Fila, 9);
range.Merge();
range.Value = "Prestaciones en Dinero";
range = libro.Range(Fila, 10, Fila,11 );
range = libro.Range(Fila, 10, Fila, 11);
range.Merge();
range.Value = "Gastos Medicos";
range = libro.Range(Fila, 12, Fila, 13);
range.Merge();
range.Value = "Riesgos de Trabajo";
range = libro.Range(Fila, 14, Fila,15 );
range = libro.Range(Fila, 14, Fila, 15);
range.Merge();
range.Value = "Invalidez y Vida";
range = libro.Range(Fila,16 , Fila, 17);
range = libro.Range(Fila, 16, Fila, 17);
range.Merge();
range.Value = "Guarderia";
range = libro.Range(Fila, 18, Fila, 19);
@@ -4012,24 +4126,24 @@ public partial class Nomina_Nomina2 : ClsPaginas
range.Value = "Retiro";
Fila = Fila + 1;
libro.Cell(Fila, 1).Value = "Empleado";
libro.Cell(Fila, 2).Value = "SUA"; //SalarioSUA
libro.Cell(Fila, 3).Value = "SIG";//SalarioSIG
libro.Cell(Fila, 4).Value = "SUA";//CuotaFijaSUA
libro.Cell(Fila, 5).Value = "SIG";//CuotaFijaSIG
libro.Cell(Fila, 6).Value = "SUA";//CuotaExcedenteSUA
libro.Cell(Fila, 7).Value = "SIG";//CuotaExcedenteSIG
libro.Cell(Fila, 8).Value = "SUA";//PrestacionesDineroSUA
libro.Cell(Fila, 9).Value = "SIG";//PrestacionesSIG
libro.Cell(Fila, 10 ).Value = "SUA";//GastosMedPenSUA
libro.Cell(Fila, 11 ).Value = "SIG";//GastosMedicosSIG
libro.Cell(Fila, 12 ).Value = "SUA";//RiesgosdeTrabajoSUA
libro.Cell(Fila, 13 ).Value = "SIG";//RiesgoTrabajoSIG
libro.Cell(Fila, 14 ).Value = "SUA";//InvalidezyVidaSUA
libro.Cell(Fila, 15 ).Value = "SIG";//InvalidezyVidaSIG
libro.Cell(Fila, 16 ).Value = "SUA";//GuarderiaSUA
libro.Cell(Fila, 17 ).Value = "SIG";//GuarderiaSIG
libro.Cell(Fila, 18 ).Value = "SUA";//RetiroSUA
libro.Cell(Fila, 19 ).Value = "SIG";//RetiroSIG
libro.Cell(Fila, 2).Value = "SUA"; //SalarioSUA
libro.Cell(Fila, 3).Value = "SIG";//SalarioSIG
libro.Cell(Fila, 4).Value = "SUA";//CuotaFijaSUA
libro.Cell(Fila, 5).Value = "SIG";//CuotaFijaSIG
libro.Cell(Fila, 6).Value = "SUA";//CuotaExcedenteSUA
libro.Cell(Fila, 7).Value = "SIG";//CuotaExcedenteSIG
libro.Cell(Fila, 8).Value = "SUA";//PrestacionesDineroSUA
libro.Cell(Fila, 9).Value = "SIG";//PrestacionesSIG
libro.Cell(Fila, 10).Value = "SUA";//GastosMedPenSUA
libro.Cell(Fila, 11).Value = "SIG";//GastosMedicosSIG
libro.Cell(Fila, 12).Value = "SUA";//RiesgosdeTrabajoSUA
libro.Cell(Fila, 13).Value = "SIG";//RiesgoTrabajoSIG
libro.Cell(Fila, 14).Value = "SUA";//InvalidezyVidaSUA
libro.Cell(Fila, 15).Value = "SIG";//InvalidezyVidaSIG
libro.Cell(Fila, 16).Value = "SUA";//GuarderiaSUA
libro.Cell(Fila, 17).Value = "SIG";//GuarderiaSIG
libro.Cell(Fila, 18).Value = "SUA";//RetiroSUA
libro.Cell(Fila, 19).Value = "SIG";//RetiroSIG
libro.Cell(1, 1).Style.Font.FontColor = ClosedXML.Excel.XLColor.White;
@@ -4041,30 +4155,30 @@ public partial class Nomina_Nomina2 : ClsPaginas
foreach (DataRow erow in DtSuaProcesado.Rows)
{
Fila++;
Fila++;
libro.Cell(Fila, 1).Value = erow["CodigoNombreCompleto"];
libro.Cell(Fila, 2).Value = string.Format("{0:N2}",erow["SalarioSUA"]);
libro.Cell(Fila, 3).Value = string.Format("{0:N2}",erow["SalarioSIG"]);
libro.Cell(Fila, 4).Value = string.Format("{0:N2}",erow["CuotaFijaSUA"]);
libro.Cell(Fila, 2).Value = string.Format("{0:N2}", erow["SalarioSUA"]);
libro.Cell(Fila, 3).Value = string.Format("{0:N2}", erow["SalarioSIG"]);
libro.Cell(Fila, 4).Value = string.Format("{0:N2}", erow["CuotaFijaSUA"]);
libro.Cell(Fila, 5).Value = string.Format("{0:N2}", erow["CuotaFijaSIG"]);
libro.Cell(Fila, 6).Value = string.Format("{0:N2}",erow["CuotaExcedenteSUA"]);
libro.Cell(Fila, 7).Value = string.Format("{0:N2}",erow["CuotaExcedenteSIG"]);
libro.Cell(Fila, 8).Value = string.Format("{0:N2}",erow["PrestacionesDineroSUA"]);
libro.Cell(Fila, 9).Value = string.Format("{0:N2}",erow["PrestacionesSIG"]);
libro.Cell(Fila, 10).Value = string.Format("{0:N2}",erow["GastosMedPenSUA"]);
libro.Cell(Fila, 11).Value = string.Format("{0:N2}",erow["GastosMedicosSIG"]);
libro.Cell(Fila, 12).Value = string.Format("{0:N2}",erow["RiesgosdeTrabajoSUA"]);
libro.Cell(Fila, 13).Value = string.Format("{0:N2}",erow["RiesgoTrabajoSIG"]);
libro.Cell(Fila, 14).Value = string.Format("{0:N2}",erow["InvalidezyVidaSUA"]);
libro.Cell(Fila, 15).Value = string.Format("{0:N2}",erow["InvalidezyVidaSIG"]);
libro.Cell(Fila, 16).Value = string.Format("{0:N2}",erow["GuarderiaSUA"]);
libro.Cell(Fila, 17).Value = string.Format("{0:N2}",erow["GuarderiaSIG"]);
libro.Cell(Fila, 18).Value = string.Format("{0:N2}",erow["RetiroSUA"]);
libro.Cell(Fila, 19).Value = string.Format("{0:N2}",erow["RetiroSIG"]);
libro.Cell(Fila, 6).Value = string.Format("{0:N2}", erow["CuotaExcedenteSUA"]);
libro.Cell(Fila, 7).Value = string.Format("{0:N2}", erow["CuotaExcedenteSIG"]);
libro.Cell(Fila, 8).Value = string.Format("{0:N2}", erow["PrestacionesDineroSUA"]);
libro.Cell(Fila, 9).Value = string.Format("{0:N2}", erow["PrestacionesSIG"]);
libro.Cell(Fila, 10).Value = string.Format("{0:N2}", erow["GastosMedPenSUA"]);
libro.Cell(Fila, 11).Value = string.Format("{0:N2}", erow["GastosMedicosSIG"]);
libro.Cell(Fila, 12).Value = string.Format("{0:N2}", erow["RiesgosdeTrabajoSUA"]);
libro.Cell(Fila, 13).Value = string.Format("{0:N2}", erow["RiesgoTrabajoSIG"]);
libro.Cell(Fila, 14).Value = string.Format("{0:N2}", erow["InvalidezyVidaSUA"]);
libro.Cell(Fila, 15).Value = string.Format("{0:N2}", erow["InvalidezyVidaSIG"]);
libro.Cell(Fila, 16).Value = string.Format("{0:N2}", erow["GuarderiaSUA"]);
libro.Cell(Fila, 17).Value = string.Format("{0:N2}", erow["GuarderiaSIG"]);
libro.Cell(Fila, 18).Value = string.Format("{0:N2}", erow["RetiroSUA"]);
libro.Cell(Fila, 19).Value = string.Format("{0:N2}", erow["RetiroSIG"]);
}
//libro.Row(2).SetAutoFilter();
System.IO.Stream fs = new System.IO.MemoryStream();

View File

@@ -1,6 +1,7 @@
var IHAVEALLTHEPOWER = false;
var objscollapse = null;
var objsexpand = null;
var adscrollerposition =[];
conf = {
error: console.error,
info: console.info,
@@ -503,10 +504,10 @@ function ADScroller2() {
divbodyScroll.css('width', (widthGral - anchoc1));
divbodyScroll.css('height', (heightGral - altoc1 + 20));
};
$(window).resize(function () {
setTimeout(resizefncscroller, 50);
setTimeout(sizeoftablefunc, 150);
});
//$(window).resize(function () {
// setTimeout(resizefncscroller, 50);
// setTimeout(sizeoftablefunc, 150);
//});
$('table#ADCol' + Tid + ' tr').hover(
function () { $('table#' + Tid + ' tr:nth-child(' + ($(this).index() + 1) + ')').addClass('hover');},
@@ -516,6 +517,16 @@ function ADScroller2() {
function () { $('table#ADCol' + Tid + ' tr:nth-child(' + ($(this).index() + 1) + ')').removeClass('hover'); });
setTimeout(sizeoftablefunc, 100);
let found = adscrollerposition.find(element => element.id = 'C_Tab_TabNominas_GvNominas');
if (found != null) {
divheaderScroll.scrollLeft(found.scrollLeft);
divbodyScroll.scrollLeft(found.scrollLeft);
divcolsScroll.scrollTop(found.scrollTop);
divbodyScroll.scrollTop(found.scrollTop);
}
}
catch (err) {
console.log("ADSCROLLER2 Error:" + err.message);
@@ -1975,7 +1986,12 @@ jQuery(document).ready(function () {
// let id = $(this).attr('id');
// $(this).val(CKEDITOR.instances[id].getData());
//});
adscrollerposition = [];
$('.ADSContainer .AdsBody .ADSCroll table').each(function () {
let _this = $(this);
let _thisScroll = _this.parent();
adscrollerposition.push({ id: _this.attr('id'), scrollLeft: _thisScroll.scrollLeft(), scrollTop: _thisScroll.scrollTop() });
});
saveposicionADScroller();
loaderinit();
});

View File

@@ -108,6 +108,10 @@