diff --git a/App_Code/CFDITimbre.vb b/App_Code/CFDITimbre.vb
index baa5ff738..8de6639ec 100644
--- a/App_Code/CFDITimbre.vb
+++ b/App_Code/CFDITimbre.vb
@@ -308,8 +308,8 @@ Public Class CFDINominaReceptor
Public Property TipoPeriodo As String = ""
Public Property CodigoBanco As String = ""
Public Property NumeroCuenta As String = ""
- Public Property SDI As Double = 0
- Public Property SBC As Double = 0
+ Public Property SDI As Decimal = 0
+ Public Property SBC As Decimal = 0
Public Property CodigoEntidadFederativa As String = ""
End Class
@@ -486,7 +486,7 @@ Public Class CFDIComplementoPagos20
Get
Dim Ret As Decimal = 0
For Each cfd As CFDIComplementoPago In ComplementoPagos
- Ret = Ret + ((From c In cfd.Traslados Where c.Impuesto = "002" And c.TasaOCuota = 0.0 Select c.BaseMN).Sum() * cfd.TipoCambioP)
+ Ret = Ret + ((From c In cfd.Traslados Where c.Impuesto = "002" And c.TasaOCuota = 0.0 Select c.BaseMN).Sum() * cfd.TipoCambioP.RoundSQL(4)) 'temporal redondeo a 4, 2023.07.07
Next
Return Ret.RoundSQL()
End Get
diff --git a/App_Code/ClsPaginas.vb b/App_Code/ClsPaginas.vb
index f030cdee9..7c7703e18 100644
--- a/App_Code/ClsPaginas.vb
+++ b/App_Code/ClsPaginas.vb
@@ -6,7 +6,6 @@ Imports System.IO
Imports System.Net.Http
Imports System.Xml
Imports CrystalDecisions.CrystalReports.Engine
-Imports CrystalDecisions.ReportSource
Imports CrystalDecisions.Shared
Imports Extensiones
Imports iText.Kernel.Pdf
@@ -1972,6 +1971,23 @@ Public Class ClsPaginas
End Set
End Property
+
+ Property GlobalDTTipoPeriodos(CveEmpresa As Integer) As DataTable
+ Get
+ Dim AppNombre As String = $"GlobalDTTipoPeriodo-{CveEmpresa}"
+ If HttpContext.Current.Application(AppNombre) Is Nothing Then
+ Dim dtt As DataTable = GlobalDTNominasPeriodos(-1, -1, CveEmpresa)
+ If dtt IsNot Nothing Then
+ Application(AppNombre) = dtt.FiltraParametros("", DistinctColumns:={"CveTipoPeriodo", "TipoPeriodo"})
+ End If
+ End If
+ GlobalDTTipoPeriodos = DirectCast(HttpContext.Current.Application(AppNombre), DataTable)
+ End Get
+ Set(value As DataTable)
+ Dim AppNombre As String = $"GlobalDTTipoPeriodo-{CveEmpresa}"
+ HttpContext.Current.Application(AppNombre) = value
+ End Set
+ End Property
'Fin TipoPeriodo
'Periodos
Property GlobalDTNominasPeriodos(CveTipoPeriodo As Integer, CvePeriodo As Integer, CveEmpresa As Integer) As DataTable
@@ -8172,6 +8188,7 @@ Public Class ClsPaginas
PaginaDict.Add("/RH/CalculoSBC.aspx".ToUpper(), 915)
PaginaDict.Add("/Inicio.aspx".ToUpper(), -1)
PaginaDict.Add("/reporteador.aspx".ToUpper(), -1)
+ PaginaDict.Add("/SigAyuda.aspx".ToUpper(), -1)
PaginaDict.Add("/General/CATIEPSxEntidadFed.aspx".ToUpper(), 719)
PaginaDict.Add("/GPS/ReporteUnidadesnoTransmiten.aspx".ToUpper(), 917)
PaginaDict.Add("/GPS/RepArrastre.aspx".ToUpper(), 718)
diff --git a/App_Code/ClsRH.vb b/App_Code/ClsRH.vb
index f0bbd4fc1..744ccdac5 100644
--- a/App_Code/ClsRH.vb
+++ b/App_Code/ClsRH.vb
@@ -1523,16 +1523,14 @@ Public Class ClsRH
Public Property TipoPeriodoPago As String
Public Property NumeroSS As String
Public Property SeInscribioSS As Boolean
- Public Property SalarioDiarioPago As Double
- Public Property NetoPeriodo As Double
-
-
- Public Property SalarioDiario As Double
- Public Property SDI As Double
- Public Property SalarioDiarioSS As Double
+ Public Property SalarioDiarioPago As Decimal
+ Public Property NetoPeriodo As Decimal
+ Public Property SalarioDiario As Decimal
+ Public Property SDI As Decimal
+ Public Property SalarioDiarioSS As Decimal
Public Property NumDiasAguinaldo As Integer
- Public Property PorPrimaVacacional As Double
- Public Property Bono As Double
+ Public Property PorPrimaVacacional As Decimal
+ 'Public Property Bono As Double
Public Property CveMetodoPago As Integer
Public Property MetodoPago As String
Public Property MetodoPagoSAT As String
@@ -1644,14 +1642,14 @@ Public Class ClsRH
TipoPeriodoPago = Data.Rows(0)("TipoPerioricidadPago").ToString
Me.NumeroSS = Data.Rows(0)("NumeroSS").ToString
Me.SeInscribioSS = CBool(Data.Rows(0)("SeInscribioSS").ToString)
- Me.SalarioDiarioPago = Data.Rows(0)("SalarioDiarioPago").ToString.ToDouble
+ Me.SalarioDiarioPago = Data.Rows(0)("SalarioDiarioPago").ToString.ToDecimal
Me.NetoPeriodo = Data.Rows(0)("NetoPeriodo").ToString.ToDecimal
- Me.SalarioDiario = Data.Rows(0)("SalarioDiario").ToString.ToDouble
- Me.SDI = Data.Rows(0)("SDI").ToString.ToDouble
- Me.Bono = Data.Rows(0)("Bono").ToString.ToDouble
- Me.SalarioDiarioSS = Data.Rows(0)("SalarioDiarioSS").ToString.ToDouble
+ Me.SalarioDiario = Data.Rows(0)("SalarioDiario").ToString.ToDecimal
+ Me.SDI = Data.Rows(0)("SDI").ToString.ToDecimal
+ 'Me.Bono = Data.Rows(0)("Bono").ToString.ToDouble
+ Me.SalarioDiarioSS = Data.Rows(0)("SalarioDiarioSS").ToString.ToDecimal
Me.NumDiasAguinaldo = Data.Rows(0)("NumDiasAguinaldo").ToString.ToEntero
- Me.PorPrimaVacacional = Data.Rows(0)("PorPrimaVacacional").ToString.ToDouble
+ Me.PorPrimaVacacional = Data.Rows(0)("PorPrimaVacacional").ToString.ToDecimal
Me.CveMetodoPago = Data.Rows(0)("CveMetodoPago").ToString.ToEntero
Me.MetodoPago = Data.Rows(0)("MetodoPago").ToString
Me.MetodoPagoSAT = Data.Rows(0)("MetodoPagoSAT").ToString
@@ -1824,13 +1822,13 @@ Public Class ClsRH
Me.TipoPeriodo = Data.Rows(0)("TipoPeriodo").ToString
Me.NumeroSS = Data.Rows(0)("NumeroSS").ToString
Me.SeInscribioSS = CBool(Data.Rows(0)("SeInscribioSS").ToString)
- Me.SalarioDiarioPago = Data.Rows(0)("SalarioDiarioPago").ToString.ToDouble
- Me.SalarioDiario = Data.Rows(0)("SalarioDiario").ToString.ToDouble
- Me.SDI = Data.Rows(0)("SDI").ToString.ToDouble
- Me.Bono = Data.Rows(0)("Bono").ToString.ToDouble
- Me.SalarioDiarioSS = Data.Rows(0)("SalarioDiarioSS").ToString.ToDouble
+ Me.SalarioDiarioPago = Data.Rows(0)("SalarioDiarioPago").ToString.ToDecimal
+ Me.SalarioDiario = Data.Rows(0)("SalarioDiario").ToString.ToDecimal
+ Me.SDI = Data.Rows(0)("SDI").ToString.ToDecimal
+ 'Me.Bono = Data.Rows(0)("Bono").ToString.ToDouble
+ Me.SalarioDiarioSS = Data.Rows(0)("SalarioDiarioSS").ToString.ToDecimal
Me.NumDiasAguinaldo = Data.Rows(0)("NumDiasAguinaldo").ToString.ToEntero
- Me.PorPrimaVacacional = Data.Rows(0)("PorPrimaVacacional").ToString.ToDouble
+ Me.PorPrimaVacacional = Data.Rows(0)("PorPrimaVacacional").ToString.ToDecimal
Me.CveMetodoPago = Data.Rows(0)("CveMetodoPago").ToString.ToEntero
Me.MetodoPago = Data.Rows(0)("MetodoPago").ToString
Me.MetodoPagoSAT = Data.Rows(0)("MetodoPagoSAT").ToString
diff --git a/App_Code/ClsSisUsuarios.vb b/App_Code/ClsSisUsuarios.vb
index 46296e77d..299054caa 100644
--- a/App_Code/ClsSisUsuarios.vb
+++ b/App_Code/ClsSisUsuarios.vb
@@ -1845,7 +1845,7 @@ Public Class ClsSisUsuarios
#Region " CLONAR USUARIOS "
- Public Function ClonarUsuario(CveUsuario As Integer, CveUsuarioClonado As Integer, UsuariosEmpresas As Boolean, UsuariosModulos As Boolean, UsuariosProcesos As Boolean, UsuariosSubProyectos As Boolean, UsuariosAlmacenes As Boolean, UsuariosOC As Boolean, UsuariosOS As Boolean) As Boolean
+ Public Function ClonarUsuario(CveUsuario As Integer, CveUsuarioClonado As Integer, UsuariosEmpresas As Boolean, UsuariosModulos As Boolean, UsuariosProcesos As Boolean, UsuariosSubProyectos As Boolean, UsuariosAlmacenes As Boolean, UsuariosOC As Boolean, UsuariosOS As Boolean, CveUsuarioModifico As Integer) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Sis_ClonarUsuario")
@@ -1860,6 +1860,7 @@ Public Class ClsSisUsuarios
.Add("@UsuariosAlmacenes", SqlDbType.Bit).Value = UsuariosAlmacenes
.Add("@UsuariosOC", SqlDbType.Bit).Value = UsuariosOC
.Add("@UsuariosOS", SqlDbType.Bit).Value = UsuariosOS
+ .Add("@CveUsuarioModifico", SqlDbType.Int).Value = CveUsuarioModifico
End With
Try
diff --git a/App_Code/LogicNominas.vb b/App_Code/LogicNominas.vb
index 4fac911f2..30212760e 100644
--- a/App_Code/LogicNominas.vb
+++ b/App_Code/LogicNominas.vb
@@ -140,8 +140,8 @@ Public Class LogicNominas
Dim TipoPeriodoPago As String = ""
Dim ClaveBanco As String = ""
Dim BancoNumCuenta As String = ""
- Dim SDI As Double = 0
- Dim SalarioDiarioSS As Double = 0
+ Dim SDI As Decimal = 0
+ Dim SalarioDiarioSS As Decimal = 0
Dim ClaveEstado As String = ""
Dim MetodoPagoFijo As Boolean
Dim totalDb As Decimal
diff --git a/App_Code/Timbrado.vb b/App_Code/Timbrado.vb
index aa758b05f..64cca2945 100644
--- a/App_Code/Timbrado.vb
+++ b/App_Code/Timbrado.vb
@@ -1403,7 +1403,7 @@ Public Class Timbrado
comprobante.Version = "4.0"
comprobante.Fecha = ObjCFDITimbre.Comprobante.Fecha
comprobante.FormaPago = ObjCFDITimbre.Comprobante.FormadePago
- If ObjCFDITimbre.Comprobante.TipoComprobante.Contiene("I", "E", "N") Then comprobante.CondicionesDePago = ObjCFDITimbre.Comprobante.CondicionesdePago
+ If ObjCFDITimbre.Comprobante.TipoComprobante.Contiene("I", "E") Then comprobante.CondicionesDePago = ObjCFDITimbre.Comprobante.CondicionesdePago
comprobante.SubTotal = ObjCFDITimbre.Comprobante.SubTotal.RoundSQL(NumDecimalesImporte)
If ObjCFDITimbre.Comprobante.TipoComprobante.Contiene("I", "E", "N") AndAlso ObjCFDITimbre.Comprobante.Descuentos > 0 Then
@@ -1472,8 +1472,14 @@ Public Class Timbrado
If concep.Unidad <> "" Then comprobante.Conceptos(i).Unidad = concep.Unidad
comprobante.Conceptos(i).ClaveUnidad = concep.ClaveUnidad
comprobante.Conceptos(i).Descripcion = concep.Descripcion
- comprobante.Conceptos(i).ValorUnitario = Decimal.Parse(concep.ValorUnitario.ToString("0.00####")) ' formateo forzoso, ej,2543.1
- comprobante.Conceptos(i).Importe = Decimal.Parse(concep.Importe.RoundSQL(NumDecimalesImporte).ToString("0.00")) ' formateo forzoso, ej,2543.1
+ If ObjCFDITimbre.Comprobante.TipoComprobante.Contiene("P") Then ' consideración especial para pagos, debe ser "0" sin decimales
+ comprobante.Conceptos(i).ValorUnitario = 0
+ comprobante.Conceptos(i).Importe = 0
+ Else
+ comprobante.Conceptos(i).ValorUnitario = Decimal.Parse(concep.ValorUnitario.ToString("0.00####")) ' formateo forzoso, ej,2543.1
+ comprobante.Conceptos(i).Importe = Decimal.Parse(concep.Importe.RoundSQL(NumDecimalesImporte).ToString("0.00")) ' formateo forzoso, ej,2543.1
+ End If
+
comprobante.Conceptos(i).ClaveProdServ = concep.ClaveProdServ
comprobante.Conceptos(i).ObjetoImp = concep.ObjetoImpuesto
@@ -2218,8 +2224,8 @@ Public Class Timbrado
Nom.Percepciones.Percepcion(i).TipoPercepcion = percep.TipoPercepcion
Nom.Percepciones.Percepcion(i).Clave = percep.Clave
Nom.Percepciones.Percepcion(i).Concepto = percep.Concepto
- Nom.Percepciones.Percepcion(i).ImporteGravado = Math.Round(percep.ImporteGravado, 2).ToString.ToDecimal
- Nom.Percepciones.Percepcion(i).ImporteExento = Math.Round(percep.ImporteExento, 2).ToString.ToDecimal
+ Nom.Percepciones.Percepcion(i).ImporteGravado = percep.ImporteGravado.RoundSQL
+ Nom.Percepciones.Percepcion(i).ImporteExento = percep.ImporteExento.RoundSQL
If ObjCFDITimbre.Nomina.HorasExtras IsNot Nothing AndAlso ObjCFDITimbre.Nomina.HorasExtras.Count > 0 Then
Nom.Percepciones.Percepcion(i).HorasExtra = New Profact.TimbraCFDI33.Complementos.Nomina12.NominaPercepcionesPercepcionHorasExtra(ObjCFDITimbre.Nomina.HorasExtras.Count - 1) {}
@@ -2259,10 +2265,15 @@ Public Class Timbrado
If ObjCFDITimbre.Nomina.Deducciones IsNot Nothing AndAlso ObjCFDITimbre.Nomina.Deducciones.Count > 0 Then
Nom.Deducciones = New Profact.TimbraCFDI33.Complementos.Nomina12.NominaDeducciones()
- Nom.Deducciones.TotalOtrasDeduccionesSpecified = True
- Nom.Deducciones.TotalOtrasDeducciones = Math.Round(ObjCFDITimbre.Nomina.TotalDeduccionesOtras, 2)
- Nom.Deducciones.TotalImpuestosRetenidosSpecified = True
- Nom.Deducciones.TotalImpuestosRetenidos = Math.Round(ObjCFDITimbre.Nomina.TotalDeduccionesImpuestosRetenidos, 2)
+ If ObjCFDITimbre.Nomina.TotalDeduccionesOtras > 0 Then
+ Nom.Deducciones.TotalOtrasDeduccionesSpecified = True
+ Nom.Deducciones.TotalOtrasDeducciones = ObjCFDITimbre.Nomina.TotalDeduccionesOtras.RoundSQL
+ End If
+ If ObjCFDITimbre.Nomina.TotalDeduccionesImpuestosRetenidos > 0 Then
+ Nom.Deducciones.TotalImpuestosRetenidosSpecified = True
+ Nom.Deducciones.TotalImpuestosRetenidos = ObjCFDITimbre.Nomina.TotalDeduccionesImpuestosRetenidos.RoundSQL
+ End If
+
Nom.Deducciones.Deduccion = New Profact.TimbraCFDI33.Complementos.Nomina12.NominaDeduccionesDeduccion(ObjCFDITimbre.Nomina.Deducciones.Count - 1) {}
Dim i As Integer = 0
For Each deduc As CFDINominaDeducciones In ObjCFDITimbre.Nomina.Deducciones
@@ -2270,7 +2281,7 @@ Public Class Timbrado
Nom.Deducciones.Deduccion(i).TipoDeduccion = deduc.TipoDeduccion
Nom.Deducciones.Deduccion(i).Clave = deduc.Clave
Nom.Deducciones.Deduccion(i).Concepto = deduc.Concepto
- Nom.Deducciones.Deduccion(i).Importe = Math.Round(deduc.Importe, 2)
+ Nom.Deducciones.Deduccion(i).Importe = deduc.Importe.RoundSQL
i += 1
Next
End If
@@ -2286,10 +2297,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
+ Nom.OtrosPagos(i).Importe = otpag.Importe.RoundSQL
If otpag.TipoOtroPago = "002" Then
Nom.OtrosPagos(i).SubsidioAlEmpleo = New Profact.TimbraCFDI33.Complementos.Nomina12.NominaOtroPagoSubsidioAlEmpleo()
- Nom.OtrosPagos(i).SubsidioAlEmpleo.SubsidioCausado = otpag.Importe
+ Nom.OtrosPagos(i).SubsidioAlEmpleo.SubsidioCausado = otpag.Importe.RoundSQL
End If
i += 1
Next
@@ -2316,13 +2327,15 @@ Public Class Timbrado
Nom.Receptor.RiesgoPuestoSpecified = True
Nom.Receptor.RiesgoPuesto = ObjCFDITimbre.Nomina.Receptor.CodigoRiesgoPuesto
Nom.Receptor.PeriodicidadPago = ObjCFDITimbre.Nomina.Receptor.TipoPeriodo
- Nom.Receptor.BancoSpecified = True
- Nom.Receptor.Banco = ObjCFDITimbre.Nomina.Receptor.CodigoBanco
- Nom.Receptor.CuentaBancaria = ObjCFDITimbre.Nomina.Receptor.NumeroCuenta
+ If ObjCFDITimbre.Nomina.Receptor.CodigoBanco <> "" Then
+ Nom.Receptor.BancoSpecified = True
+ Nom.Receptor.Banco = ObjCFDITimbre.Nomina.Receptor.CodigoBanco
+ Nom.Receptor.CuentaBancaria = ObjCFDITimbre.Nomina.Receptor.NumeroCuenta
+ End If
Nom.Receptor.SalarioBaseCotAporSpecified = True
- Nom.Receptor.SalarioBaseCotApor = Decimal.Round(ObjCFDITimbre.Nomina.Receptor.SBC.ToDecimal(), 2)
+ Nom.Receptor.SalarioBaseCotApor = ObjCFDITimbre.Nomina.Receptor.SBC.RoundSQL
Nom.Receptor.SalarioDiarioIntegradoSpecified = True
- Nom.Receptor.SalarioDiarioIntegrado = Decimal.Round(ObjCFDITimbre.Nomina.Receptor.SDI.ToDecimal(), 2)
+ Nom.Receptor.SalarioDiarioIntegrado = ObjCFDITimbre.Nomina.Receptor.SDI.RoundSQL
Nom.Receptor.ClaveEntFed = ObjCFDITimbre.Nomina.Receptor.CodigoEntidadFederativa
Dim nsNom As New System.Xml.Serialization.XmlSerializerNamespaces()
diff --git a/Bancos/IE.aspx.vb b/Bancos/IE.aspx.vb
index 4067c7eb5..19e05fdb1 100644
--- a/Bancos/IE.aspx.vb
+++ b/Bancos/IE.aspx.vb
@@ -1897,585 +1897,586 @@ Partial Class Bancos_IE
#End Region
-#Region "VIATICOS"
+ '#Region "VIATICOS"
- Private Function TimbrarNomina12(CvePersonal As Integer) As String
+ ' Private Function TimbrarNomina12(CvePersonal As Integer) As String
- Dim Retorno As String = ""
- UsuarioActual.Empresa.CvePAC = 2
- Dim sw As New Diagnostics.Stopwatch
- sw.Start()
- Select Case UsuarioActual.Empresa.CvePAC
- Case 1
- 'Retorno = TimbrarBIInformNomina12(CveNomina, CvePersonal, CvePeriodo)
- Case 2, 4
- Dim cfdi As CFDITimbre = PreTimbrar(CvePersonal)
- If cfdi Is Nothing Then
- sw.Stop()
- Return "No tiene asignado un folio de viaticos"
- End If
- If cfdi IsNot Nothing AndAlso cfdi.Mensaje = "" Then
- Dim ObjTimbrado As New Timbrado
- Dim ObjFactura As New Modelos.Factura
- ObjFactura.TipoDocto = "Viaticos"
- ObjFactura.Folio = cfdi.Comprobante.Folio.ToEntero
- ObjFactura.Serie = cfdi.Comprobante.Serie
- ObjFactura.Timbre = cfdi
- If Not ObjTimbrado.TimbrarFactura(UsuarioActual, ObjFactura) Then
- Retorno = ObjTimbrado.MensajeErrorCFDI
- End If
+ ' Dim Retorno As String = ""
+ ' UsuarioActual.Empresa.CvePAC = 2
+ ' Dim sw As New Diagnostics.Stopwatch
+ ' sw.Start()
+ ' Select Case UsuarioActual.Empresa.CvePAC
+ ' Case 1
+ ' 'Retorno = TimbrarBIInformNomina12(CveNomina, CvePersonal, CvePeriodo)
+ ' Case 2, 4
+ ' Dim cfdi As CFDITimbre = PreTimbrar(CvePersonal)
+ ' If cfdi Is Nothing Then
+ ' sw.Stop()
+ ' Return "No tiene asignado un folio de viaticos"
+ ' End If
+ ' If cfdi IsNot Nothing AndAlso cfdi.Mensaje = "" Then
+ ' Dim ObjTimbrado As New Timbrado
+ ' Dim ObjFactura As New Modelos.Factura
+ ' ObjFactura.TipoDocto = "Viaticos"
+ ' ObjFactura.Folio = cfdi.Comprobante.Folio.ToEntero
+ ' ObjFactura.Serie = cfdi.Comprobante.Serie
+ ' ObjFactura.Timbre = cfdi
+ ' If Not ObjTimbrado.TimbrarFactura(UsuarioActual, ObjFactura) Then
+ ' Retorno = ObjTimbrado.MensajeErrorCFDI
+ ' End If
- 'Retorno = TimbrarFacturaRealVirtual(cfdi, UsuarioActual)
- If Retorno <> "" Then
- Retorno = $"{Retorno} - {cfdi.Receptor.Nombre}"
- Else
- 'Genero la addenda Ford
- ' GeneraPDFNuevo(String.Format("{0}XML\Nomina\{1}.xml", Ruta, NominaFolio), CvePersonal, CvePeriodo)
- End If
- Else
- Retorno = $"No se pudo generar el pretimbre:
{cfdi.Mensaje}"
- End If
- End Select
- sw.Stop()
- GuardaLogTimbrado(sw.ElapsedMilliseconds.ToString, UsuarioActual.Empresa.CvePAC, "Nomina")
-
- Return Retorno
-
- End Function
-
-
-
-
- Private Function PreTimbrar(CvePersonal As Integer) As CFDITimbre
- Dim cfdi As New CFDITimbre
- Dim ObjFolio As New ClsGralFolios
- If ObjFolio.GetFolios("VIA", UsuarioActual.CveEmpresa) Then
- If ObjFolio.DtResultados.Rows.Count > 0 Then
- Folio = ObjFolio.DtResultados.Rows(0)("FActual").ToString
- Else
- ObjFolio.Dispose()
- Return Nothing
- End If
- End If
- ObjFolio.Dispose()
-
- Dim objPersonal As New ClsRH
- objPersonal.GetPersonal(CvePersonal, UsuarioActual.CveEmpresa)
-
- Dim AntiguedadSemanas As Integer = DateDiff(DateInterval.Weekday, objPersonal.FechaIngreso, Now).ToEntero
-
- cfdi.Nomina = New CFDINomina
- cfdi.Nomina.Version = "1.2"
- cfdi.Nomina.TipoNomina = "E"
- cfdi.Nomina.FechaPago = TxtFechaDocumento.Text.ToDate
- cfdi.Nomina.FechaInicio = TxtFechaDocumento.Text
- cfdi.Nomina.FechaFin = TxtFechaDocumento.Text
- cfdi.Nomina.NumDiasPagados = 1
- cfdi.Emisor.Nombre = UsuarioActual.Empresa.Empresa
- cfdi.Emisor.RFC = UsuarioActual.Empresa.RFC
- cfdi.Emisor.RegistroPatronal = objPersonal.DtResultados.Rows(0)("RegistroPatronal").ToString()
- 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.Receptor.UsoCFDI = "P01"
- cfdi.Receptor.RFC = objPersonal.RFC
- cfdi.Receptor.Nombre = objPersonal.NombreCompleto
-
- Dim ObjOtrosPagos As New List(Of CFDINominaOtrosPagos)
- ObjOtrosPagos.Add(New CFDINominaOtrosPagos With {.TipoOtroPago = "003",
- .Clave = "003",
- .Concepto = "Viáticos (entregados al trabajador).",
- .Importe = TxtImporte.Text.ToString.ToDecimal
- }
- )
- If ObjOtrosPagos IsNot Nothing AndAlso ObjOtrosPagos.Count > 0 Then cfdi.Nomina.OtrosPagos = ObjOtrosPagos
-
- cfdi.Comprobante.Version = "3.3"
- cfdi.Comprobante.Serie = "VIA"
- cfdi.Comprobante.Folio = Folio
- cfdi.Comprobante.Fecha = Now
- cfdi.Comprobante.Subtotal = TxtImporte.Text.ToDecimal
- cfdi.Comprobante.Descuentos = 0
- cfdi.Comprobante.Total = TxtImporte.Text.ToDecimal
- cfdi.Comprobante.MotivoDescuento = ""
- cfdi.Comprobante.Moneda = "MXN"
- cfdi.Comprobante.TipoComprobante = "N"
- cfdi.Comprobante.TipoDocto = "Egs"
- cfdi.Comprobante.MetodoPago = "PUE"
- cfdi.Comprobante.CondicionesdePago = ""
- cfdi.Comprobante.FormadePago = "99"
- cfdi.Comprobante.LugarExpedicion = UsuarioActual.Empresa.CP.ToString
- cfdi.Comprobante.NumCuentaPago = ""
-
-
- cfdi.Nomina.Receptor.CURP = objPersonal.CURP
- cfdi.Nomina.Receptor.NSS = objPersonal.NumeroSS
- cfdi.Nomina.Receptor.FechaInicioContrato = objPersonal.FechaInicioContrato.ToShortDateString
- cfdi.Nomina.Receptor.Antiguedad = $"P{AntiguedadSemanas}W"
- cfdi.Nomina.Receptor.TipoContrato = objPersonal.CodigoTipoContrato
- cfdi.Nomina.Receptor.CodigoTipoJornada = objPersonal.ClaveTipoJornada
- cfdi.Nomina.Receptor.CodigoRegimenContratacion = If(objPersonal.CveRegimenContratacion = "", "99", objPersonal.CveRegimenContratacion)
- cfdi.Nomina.Receptor.CodigoEmpleado = objPersonal.Codigo
- cfdi.Nomina.Receptor.Departamento = objPersonal.Departamento
- cfdi.Nomina.Receptor.Puesto = objPersonal.Puesto
- cfdi.Nomina.Receptor.CodigoRiesgoPuesto = If(objPersonal.CveSATRiesgoPuesto.ToString = "0", "99", 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.ToDecimal})
-
- objPersonal.Dispose()
- Return cfdi
- End Function
-
- 'Private Function TimbrarBIInformNomina12(CveNomina As Integer, CvePersonal As Integer, CvePeriodo As Integer) As String
-
- ' If UsuarioActual.CveEmpresa = 8 Then
- ' UsuarioActual.Empresa.FacturaProduccion = True
- ' End If
- ' 'UsuarioActual.Empresa.FacturaProduccion = False
-
- ' Dim MsgError As String = String.Empty
-
- ' Dim CFDi As New ClbNegBICFDv3_2.ClsNegEDI
- ' CFDi.ObjCompNomina12 = New ClbNegBICFDv3_2.ClsNegComplementoNomina12()
- ' 'CFDi.ObjCompNomina = New ClbNegBICFDv3_2.ClsNegCompNomina
-
- ' 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 Total As Decimal = 0
- ' Dim SubTotal As Decimal = 0
- ' Dim Descuentos As Decimal = 0
- ' Dim RetISR As Decimal = 0
- ' Dim TotalExcento As Decimal = 0
- ' Dim TotalGravado As Decimal = 0
- ' Dim TotalPercepciones As Decimal = 0
- ' Dim TotalDeducciones As Decimal = 0
- ' Dim TotalOtrosPagos As Decimal = 0
-
- ' Dim Serie As String = ""
- ' Dim Folio As String = ""
- ' Dim NominaFolio As String = Serie & "-" & Folio
- ' Dim RFC As String = objPersonal.RFC.Trim
- ' Dim Nombre As String = objPersonal.NombreCompleto.Trim
- ' Dim Direccion As String = String.Format("{0} {1} {2}", objPersonal.Calle.Trim, objPersonal.NumExt.Trim, objPersonal.NumInt.Trim).Trim
- ' Dim Ciudad As String = objPersonal.Ciudad.Trim
- ' Dim Estado As String = objPersonal.Estado.Trim
- ' Dim CP As String = objPersonal.CP.Trim
-
-
-
- ' 'Dim TipoContrato As String = GlobalDTTiposContrato.FiltraParametros("CveTipoContrato = " + objPersonal.CveTipoContrato.ToString)(0)("TipoContrato").ToString
- ' 'Dim TipoPeriodo As String = GlobalDTTipoPeriodo.FiltraParametros("CveTipoPeriodo = " + objPersonal.CveTipoPeriodo.ToString)(0)("TipoPeriodo").ToString
- ' 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
-
- ' Dim ObjFolio As New ClsGralFolios
- ' If ObjFolio.GetFolios("VIA", UsuarioActual.CveEmpresa) Then
- ' If ObjFolio.DtResultados.Rows.Count > 0 Then
- ' Folio = ObjFolio.DtResultados.Rows(0)("FActual").ToString
- ' End If
- ' End If
-
-
- ' 'If objNomina.GetPeriodos(-1, -1, -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
-
- ' Dim DtPercepciones As Data.DataTable = Nothing
- ' Dim DtDeducciones As Data.DataTable = Nothing
- ' Dim DtOtrosPagos As Data.DataTable = Nothing
- ' '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")
- ' ' TotalDeducciones = DtDeducciones.SUM("Importe")
- ' ' Total = CType((Total + DtPercepciones.SUM("Importe")), Decimal)
- ' ' 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
- ' Msg = CFDi.ObjCompNomina12.Cargar("O", FechaPago, FechaInicio, FechaFin, DiasPagados, TotalPercepciones, TotalDeducciones, 0)
-
-
-
- ' If Msg = String.Empty Then
- ' If DtPercepciones IsNot Nothing Then
- ' If DtPercepciones.Rows.Count > 0 Then
- ' TotalSueldos = DtPercepciones.SUM("Importe", "SATCveConcepto = '001'")
- ' TotalIndemnizacion = DtPercepciones.SUM("Importe", "SATCveConcepto IN ('022','023','025')") ' https://www.ccpm.org.mx/avisos/nuevo-complemento-de-nomina-version-1.2-puntos-finos-diciembre-2016.pdf
- ' TotalJubilacion = DtPercepciones.SUM("Importe", "SATCveConcepto IN ('039','044')") 'https://www.ccpm.org.mx/avisos/nuevo-complemento-de-nomina-version-1.2-puntos-finos-diciembre-2016.pdf
- ' Msg = CFDi.ObjCompNomina12.CargarPercepciones(TotalSueldos, TotalIndemnizacion, TotalJubilacion, DtPercepciones.SUM("ImporteGravado").ToDecimal, DtPercepciones.SUM("ImporteExento").ToDecimal)
- ' End If
- ' For Each Row As DataRow In DtPercepciones.Rows
- ' If Row("Importe").ToString.ToDecimal > 0 Then
- ' If Row("CveSATConcepto").ToString = "" Then
- ' Msg = String.Format("Concepto No registrado ({0})", Row("Concepto").ToString)
+ ' 'Retorno = TimbrarFacturaRealVirtual(cfdi, UsuarioActual)
+ ' If Retorno <> "" Then
+ ' Retorno = $"{Retorno} - {cfdi.Receptor.Nombre}"
' Else
- ' Msg = CFDi.ObjCompNomina12.AgregarPercepcion(Row("SATCveConcepto").ToString, Row("Codigo").ToString, Row("Concepto").ToString, Row("ImporteGravado").ToString.ToDecimal, Row("ImporteExento").ToString.ToDecimal)
- ' TotalExcento = TotalExcento + Row("ImporteExento").ToString.ToDecimal
- ' TotalGravado = TotalGravado + Row("ImporteGravado").ToString.ToDecimal
- ' SubTotal = SubTotal + Row("Importe").ToString.ToDecimal
- ' End If
-
- ' If Msg <> String.Empty Then
- ' Me.OnError("El SAT regresó el siguiente mensaje: " & Msg & ". Objeto: Percepcion", New Exception)
- ' Exit For
- ' End If
- ' 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 objNomina.GetHorasExtras(CvePersonal, CvePeriodo, UsuarioActual.CveEmpresa) Then
-
- ' Dim dr As DataRow = objNomina.DtResultados.FiltroPrimero("")
- ' If dr IsNot Nothing Then
-
- ' If dr("HorasDobles").ToString.ToDouble > 0 Then CFDi.ObjCompNomina12.AgregarHorasExtra(dr("DiasHorasDobles").ToString.ToEntero, ClbNegBICFDv3_2.TipoHoras.Dobles, dr("HorasDobles").ToString.ToEntero, Row("Importe").ToString.ToDecimal)
- ' If dr("HorasTriples").ToString.ToDouble > 0 Then CFDi.ObjCompNomina12.AgregarHorasExtra(dr("DiasHorasTriples").ToString.ToEntero, ClbNegBICFDv3_2.TipoHoras.Triples, dr("HorasTriples").ToString.ToEntero, Row("Importe").ToString.ToDecimal)
-
-
- ' End If
-
-
- ' End If
-
- ' End If
- ' Next
- ' If Msg = "" Then
- ' CFDi.ObjCompNomina12.ObjPercepciones.TotalExento = TotalExcento
- ' CFDi.ObjCompNomina12.ObjPercepciones.TotalGravado = TotalGravado
- ' End If
-
- ' End If
-
- ' 'cargo las incapacidades
- ' If DiasIncapacitados > 0 Then
-
- ' If objNomina.GetIncapacidades(CvePersonal, CvePeriodo, UsuarioActual.CveEmpresa) Then
-
- ' CFDi.ObjCompNomina12.CargarIncapacidades()
- ' For Each dr As DataRow In objNomina.DtResultados.Rows
- ' CFDi.ObjCompNomina12.AgregarIncapacidad(dr("Dias").ToString.ToDecimal, dr("ClaveTipoIncapacidad").ToString.ToEntero, dr("Descuento").ToString.ToDecimal)
- ' Next
-
- ' End If
-
- ' End If
-
-
-
- ' TotalExcento = 0
- ' TotalGravado = 0
-
- ' If Msg = String.Empty Then
- ' If DtDeducciones IsNot Nothing Then
- ' If DtDeducciones.Rows.Count > 0 Then
- ' Total = CType((Total - DtDeducciones.SUM("Importe")), Decimal)
- ' CFDi.ObjCompNomina12.CargarDeducciones(CType(DtDeducciones.SUM("ImporteGravado"), Decimal), CType(DtDeducciones.SUM("ImporteExento"), Decimal))
- ' End If
- ' For Each Row As DataRow In DtDeducciones.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.AgregarDeduccion(Row("SATCveConcepto").ToString, Row("Codigo").ToString, Row("Concepto").ToString, 0)
- ' TotalExcento = TotalExcento + Row("ImporteExento").ToString.ToDecimal
- ' TotalGravado = TotalGravado + Row("ImporteGravado").ToString.ToDecimal
-
- ' If Row("CveSATConcepto").ToString.ToEntero = 3 Then
- ' RetISR = RetISR + Row("Importe").ToString.ToDecimal
- ' Else
- ' Descuentos = Descuentos + Row("Importe").ToString.ToDecimal
- ' End If
- ' End If
-
- ' If Msg <> String.Empty Then
- ' Me.OnError("El SAT regresó el siguiente mensaje: " & Msg & ". Objeto: Deduccion", New Exception)
- ' Exit For
- ' End If
- ' End If
- ' Next
- ' If Msg = "" Then
- ' If CFDi.ObjCompNomina12.ObjDeducciones IsNot Nothing Then
- ' CFDi.ObjCompNomina12.ObjDeducciones.TotalOtrasDeducciones = Descuentos
- ' CFDi.ObjCompNomina12.ObjDeducciones.TotalImpuestosRetenidos = RetISR
- ' End If
-
- ' End If
- ' End If
-
- ' If Msg = String.Empty Then
- ' If DtOtrosPagos IsNot Nothing Then
- ' If DtOtrosPagos.Rows.Count > 0 Then
- ' Total = CType((Total - DtOtrosPagos.SUM("Importe")), Decimal)
- ' CFDi.ObjCompNomina12.CargarOtrosPagos()
- ' 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
-
- ' End If
-
- ' If Msg = String.Empty Then
- ' Dim x As Integer = 0
-
- ' Dim Moneda As String = "MXN"
- ' Dim LugarExp As String = String.Format("{0}, {1}, {2}, {3}, {4}, {5}, {6}, {7}, {8} ", SucCalle, SucNoExt, SucNoInt, SucColonia, SucLocalidad, SucMunicipio, SucEstado, SucPais, SucCP)
- ' Dim FechaFactura As DateTime = Now
- ' 'Nodo Comprobante
-
- ' Dim TipoComprobante As ClbNegBICFDv3_2.TipoDeComprobante = ClbNegBICFDv3_2.TipoDeComprobante.egreso
- ' Msg = CFDi.comprobantecfd(0, 0, Serie, Folio, FechaFactura, "PAGO EN UNA SOLA EXHIBICION", "CONTADO", SubTotal, Descuentos, "Deducciones nómina", "1", Moneda, Total, objPersonal.MetodoPagoSAT, ClbNegBICFDv3_2.TipoDeComprobante.egreso, LugarExp, "", "", "", New Date(1900, 1, 1), 0)
-
- ' If Msg = String.Empty Then
- ' 'Nodo emisor
- ' Msg = CFDi.ObjCompNomina12.CargarEmisor("", objPersonal.DtResultados.Rows(0)("RegistroPatronal").ToString(), UsuarioActual.Empresa.RFC)
- ' 'If Msg = String.Empty Then Msg = CFDi.EmisorRegimen(UsuarioActual.Empresa.CodigoRegimenFiscal)
- ' If Msg = String.Empty Then
- ' 'Nodo Entidad SNCF
- ' If 1 = 2 Then 'cuando es gobierno
- ' Msg = CFDi.ObjCompNomina12.CargarEntidadSNCF("", 0)
- ' End If
-
- ' If Msg = String.Empty Then
- ' 'Nodo Receptor
- ' Msg = CFDi.ObjCompNomina12.CargarReceptor(objPersonal.CURP, objPersonal.NumeroSS, objPersonal.FechaInicioContrato, AntiguedadSemanas, objPersonal.TipoContrato, "", objPersonal.ClaveTipoJornada, objPersonal.CveRegimenContratacion, objPersonal.Codigo.ToString,
- ' objPersonal.Departamento, objPersonal.Puesto, objPersonal.CveRiesgoPuesto, objPersonal.TipoPeriodo, objPersonal.ClaveBanco, objPersonal.BancoNumCuenta, Total, objPersonal.SDI.ToString.ToDecimal, objPersonal.ClaveEstado)
- ' If Msg = String.Empty Then
- ' 'Nodo SubContratacion
- ' If 1 = 2 Then Msg = CFDi.ObjCompNomina12.AgregarSubContratacion("", 0)
- ' If Msg = String.Empty Then
-
- ' CFDi.LstCompNomina12.Add(CFDi.ObjCompNomina12)
-
- ' Dim HasErrorConceptos As Boolean = False
- ' 'Dim Importe As Decimal = 0
-
-
- ' Msg = CFDi.ConceptosCfd(1, "ACT", "", "Pago de nómina", SubTotal, SubTotal)
-
- ' 'Timbrado
-
- ' 'Web Services de producción: http://biinform.com.mx/srvCFDi/service1.asmx
- ' 'Web Services de pruebasd: http://biinform.com.mx/srvCFDiPrueba/service1.asmx
-
-
- ' Dim WS As String = String.Empty
- ' If UsuarioActual.Empresa.FacturaProduccion Then
- ' WS = "http://portalbiinform.com.mx/srvCFDiPrueba/service1.asmx"
- ' Else
- ' WS = "http://portalbiinform.com.mx/srvCFDiPrueba/service1.asmx"
- ' End If
-
- ' If Not System.IO.Directory.Exists(Ruta & "XML\") Then System.IO.Directory.CreateDirectory(Ruta & "XML\")
- ' If Not System.IO.Directory.Exists(Ruta & "XML\Nomina\") Then System.IO.Directory.CreateDirectory(Ruta & "XML\Nomina\")
-
- ' 'Generar Timbre
- ' 'If UsuarioActual.Empresa.FacturaProduccion Then
- ' If 1 = 2 Then
- ' CFDi.Generar(String.Format("{0}Certificados\{1}", Ruta, UsuarioActual.Empresa.ArchivoPfx),
- ' UsuarioActual.Empresa.ContraseñaKey,
- ' String.Format("{0}Certificados\{1}", Ruta, UsuarioActual.Empresa.ArchivoCer),
- ' String.Format("{0}XML\Nomina\{1}.xml", Ruta, NominaFolio),
- ' String.Format("{0}Certificados\", Ruta),
- ' UsuarioActual.Empresa.BIUsuario,
- ' UsuarioActual.Empresa.BIContraseña,
- ' WS,
- ' True)
- ' Else
- ' If Not System.IO.Directory.Exists(Ruta & "XML\Nomina\Demo\") Then System.IO.Directory.CreateDirectory(Ruta & "XML\Nomina\Demo\")
- ' 'RutaPruebas & "XML\Demo\" & NominaFolio & ".xml",
- ' CFDi.Generar(String.Format("{0}Certificados\aaa010101aaa__csd_01.pfx", RutaPruebas),
- ' "12345678a",
- ' String.Format("{0}Certificados\aaa010101aaa__csd_01.cer", RutaPruebas),
- ' String.Format("{0}XML\Nomina\Demo\{1}.xml", Ruta, NominaFolio),
- ' String.Format("{0}Certificados\", RutaPruebas),
- ' "prueba",
- ' "123",
- ' WS,
- ' True)
- ' End If
-
-
- ' If CFDi.MsgError <> String.Empty Then
-
- ' 'OnError("Ocurrió un error al generar el timbre: " & CFDi.MsgError, New Exception)
-
- ' Dim params As New ActualizaTimbre
- ' params.Estatus = False
- ' params.CveNomina = CveNomina
- ' params.CvePAC = 1
-
- ' 'Dim Hilo As New System.Threading.Thread(AddressOf ActualizaTimbrado)
- ' 'Hilo.Start(params)
- ' BtnAutorizar.Enabled = False
- ' MsgError = "Nombre: " & Nombre & ". Error: " & CFDi.MsgError
- ' Else
- ' 'Actualiza Estatus Timbrado
- ' Dim params As New ActualizaTimbre
- ' params.Estatus = True
- ' params.CveNomina = CveNomina
- ' params.CvePAC = 1
-
- ' 'Dim Hilo As New System.Threading.Thread(AddressOf ActualizaTimbrado)
- ' 'Hilo.Start(params)
-
- ' Dim CBB As New ClbNegBICFDv3_2.ClsNegCBBGenerar()
- ' Dim FechaCertificacion As DateTime
- ' Dim FolioFiscal, NoSerieCertificado, NoSerieCertificadoContribuyente, SelloCFDi, SelloSAT As String
-
- ' FolioFiscal = CFDi.Timbrado.UUDI 'XmlDoc.DocumentElement("cfdi:Complemento").FirstChild.Attributes("UUID").InnerText
- ' NoSerieCertificado = CFDi.Timbrado.NoCertificadoSAT
- ' FechaCertificacion = CFDi.Timbrado.FechaTimbrado
- ' SelloCFDi = CFDi.Timbrado.SelloCFD
- ' SelloSAT = CFDi.Timbrado.SelloSAT
- ' NoSerieCertificadoContribuyente = CFDi.Timbrado.NoCertificado
- ' ViewState("FolioFiscal") = FolioFiscal
-
- ' 'Actualiza Estatus Factura
- ' CveNominaT = CveNomina
-
- ' Dim Rastro As String = String.Format("Nomina: CvePeriodo:{0}, CvePersonal:{1}, UUID: {2}, RFC:{3}", CvePeriodo, CvePersonal, FolioFiscal, objPersonal.RFC)
- ' Rastro.GuardaLog()
-
- ' If FolioFiscal <> "" Then
-
- ' 'If UsuarioActual.Empresa.FacturaProduccion Then
- ' ' Dim ObjNomina2 As New ClsNominas()
- ' ' ObjNomina2.UpdateEstatusNomNominas(3, UsuarioActual.Empresa.CvePAC, FolioFiscal, "", ("01/01/2000").ToDate, CveNomina, SubTotal, Descuentos, RetISR, Total, DiasPagados)
- ' ' ObjNomina2.Dispose()
- ' 'End If
- ' Rastro = "--Estatus" & Rastro
- ' Rastro.GuardaLog()
- ' 'Dim Hilo1 As New System.Threading.Thread(AddressOf ActualizaEstatus)
- ' 'Hilo1.Start(3)
- ' End If
-
-
- ' Dim RutaCBB As String = String.Empty
- ' If Not System.IO.Directory.Exists(Ruta & "CBB\") Then System.IO.Directory.CreateDirectory(Ruta & "CBB\")
- ' If Not System.IO.Directory.Exists(Ruta & "CBB\Nomina\") Then System.IO.Directory.CreateDirectory(Ruta & "CBB\Nomina\")
-
- ' If UsuarioActual.Empresa.FacturaProduccion Then
- ' RutaCBB = Ruta & "CBB\Nomina\" & NominaFolio & ".jpg"
- ' Else
- ' If Not System.IO.Directory.Exists(Ruta & "CBB\Nomina\Demo\") Then System.IO.Directory.CreateDirectory(Ruta & "CBB\Nomina\Demo\")
- ' RutaCBB = Ruta & "CBB\Nomina\Demo\" & NominaFolio & ".jpg"
- ' End If
- ' CBB.GenerarCBB(UsuarioActual.Empresa.RFC, RFC, Total, FolioFiscal, RutaCBB)
-
-
- ' 'GeneraPDF(FechaFactura, FolioFiscal, NoSerieCertificado, FechaCertificacion, NoSerieCertificadoContribuyente, TmpDT, SelloCFDi, SelloSAT, RutaCBB, VentaFolio, Ruta & "XML\" & VentaFolio & ".xml", False, CFDi.CadenaOriginal)
- ' 'GeneraPDF(CveNomina, CvePersonal, CvePeriodo, FechaFactura, FolioFiscal, NoSerieCertificado, FechaCertificacion, NoSerieCertificadoContribuyente, SelloCFDi, SelloSAT, RutaCBB, Ruta & "Nomina\XML\" & NominaFolio & ".xml", False, CFDi.Timbrado.CadenaOriginal, FormatoReciboCFDi)
- ' GeneraPDFNuevo(String.Format("{0}XML\Nomina\{1}.xml", Ruta, NominaFolio), CvePersonal, CvePeriodo)
- ' End If
- ' Else
- ' 'Me.OnError(String.Format("El SAT regresó el siguiente mensaje: {0} Nombre: {1}. Objeto: EmisorRegimen", Msg, Nombre), New Exception)
- ' MsgError = String.Format("El SAT regresó el siguiente mensaje: {0} Nombre: {1}. Objeto: EmisorRegimen", Msg, Nombre)
- ' End If
- ' Else
- ' 'Me.OnError(String.Format("El SAT regresó el siguiente mensaje: {0} Nombre: {1}. Objeto: EmisorDomicilioExpedidoEn", Msg, Nombre), New Exception)
- ' MsgError = String.Format("El SAT regresó el siguiente mensaje: {0} Nombre: {1}. Objeto: EmisorDomicilioExpedidoEn", Msg, Nombre)
- ' End If
- ' Else
- ' 'Me.OnError(String.Format("El SAT regresó el siguiente mensaje: {0} Nombre: {1}. Objeto: EmisorDomicilioFiscalCfd", Msg, Nombre), New Exception)
- ' MsgError = String.Format("El SAT regresó el siguiente mensaje: {0} Nombre: {1}. Objeto: EmisorDomicilioFiscalCfd", Msg, Nombre)
- ' End If
- ' Else
- ' 'Me.OnError(String.Format("El SAT regresó el siguiente mensaje: {0} Nombre: {1}. Objeto: EmisorCfd", Msg, Nombre), New Exception)
- ' MsgError = String.Format("El SAT regresó el siguiente mensaje: {0} Nombre: {1}. Objeto: EmisorCfd", Msg, Nombre)
- ' End If
- ' Else
- ' 'Me.OnError(String.Format("El SAT regresó el siguiente mensaje: {0} Nombre: {1}. Objeto: Comprobante", Msg, Nombre), New Exception)
- ' MsgError = String.Format("El SAT regresó el siguiente mensaje: {0} Nombre: {1}. Objeto: Comprobante", Msg, Nombre)
+ ' 'Genero la addenda Ford
+ ' ' GeneraPDFNuevo(String.Format("{0}XML\Nomina\{1}.xml", Ruta, NominaFolio), CvePersonal, CvePeriodo)
' End If
' Else
- ' 'Me.OnError(String.Format("El SAT regresó el siguiente mensaje: {0} Nombre: {1}. Objeto: Comprobante", Msg, Nombre), New Exception)
- ' MsgError = String.Format("El SAT regresó el siguiente mensaje: {0} Nombre: {1}. Objeto: Comprobante", Msg, Nombre)
+ ' Retorno = $"No se pudo generar el pretimbre:
{cfdi.Mensaje}"
' End If
+ ' End Select
+ ' sw.Stop()
+ ' GuardaLogTimbrado(sw.ElapsedMilliseconds.ToString, UsuarioActual.Empresa.CvePAC, "Nomina")
+
+ ' Return Retorno
+
+ ' End Function
+
+
+
+
+ ' Private Function PreTimbrar(CvePersonal As Integer) As CFDITimbre
+ ' Dim cfdi As New CFDITimbre
+ ' Dim ObjFolio As New ClsGralFolios
+ ' If ObjFolio.GetFolios("VIA", UsuarioActual.CveEmpresa) Then
+ ' If ObjFolio.DtResultados.Rows.Count > 0 Then
+ ' Folio = ObjFolio.DtResultados.Rows(0)("FActual").ToString
' Else
- ' 'Me.OnError(String.Format("El SAT regresó el siguiente mensaje: {0} Nombre: {1}. Objeto: Comprobante", Msg, Nombre), New Exception)
- ' MsgError = String.Format("El SAT regresó el siguiente mensaje: {0} Nombre: {1}. Objeto: Comprobante", Msg, Nombre)
+ ' ObjFolio.Dispose()
+ ' Return Nothing
' End If
- ' Else
- ' 'Me.OnError(String.Format("El SAT regresó el siguiente mensaje: {0} Nombre: {1}. Objeto: Comprobante", Msg, Nombre), New Exception)
- ' MsgError = String.Format("El SAT regresó el siguiente mensaje: {0} Nombre: {1}. Objeto: Comprobante", Msg, Nombre)
' End If
- ' Else
- ' 'Me.OnError(String.Format("El SAT regresó el siguiente mensaje: {0} Nombre: {1}. Objeto: Comprobante", Msg, Nombre), New Exception)
- ' MsgError = String.Format("El SAT regresó el siguiente mensaje: {0} Nombre: {1}. Objeto: Comprobante", Msg, Nombre)
- ' End If
- ' objPersonal.Dispose()
- ' objNomina.Dispose()
+ ' ObjFolio.Dispose()
- ' Return MsgError
- 'End Function
+ ' Dim objPersonal As New ClsRH
+ ' objPersonal.GetPersonal(CvePersonal, UsuarioActual.CveEmpresa)
+
+ ' Dim AntiguedadSemanas As Integer = DateDiff(DateInterval.Weekday, objPersonal.FechaIngreso, Now).ToEntero
+
+ ' cfdi.Nomina = New CFDINomina
+ ' cfdi.Nomina.Version = "1.2"
+ ' cfdi.Nomina.TipoNomina = "E"
+ ' cfdi.Nomina.FechaPago = TxtFechaDocumento.Text.ToDate
+ ' cfdi.Nomina.FechaInicio = TxtFechaDocumento.Text
+ ' cfdi.Nomina.FechaFin = TxtFechaDocumento.Text
+ ' cfdi.Nomina.NumDiasPagados = 1
+ ' cfdi.Emisor.Nombre = UsuarioActual.Empresa.Empresa
+ ' cfdi.Emisor.RFC = UsuarioActual.Empresa.RFC
+ ' cfdi.Emisor.RegistroPatronal = objPersonal.DtResultados.Rows(0)("RegistroPatronal").ToString()
+ ' 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
-#End Region
+ ' cfdi.Receptor.UsoCFDI = "P01"
+ ' cfdi.Receptor.RFC = objPersonal.RFC
+ ' cfdi.Receptor.Nombre = objPersonal.NombreCompleto
+
+ ' Dim ObjOtrosPagos As New List(Of CFDINominaOtrosPagos)
+ ' ObjOtrosPagos.Add(New CFDINominaOtrosPagos With {.TipoOtroPago = "003",
+ ' .Clave = "003",
+ ' .Concepto = "Viáticos (entregados al trabajador).",
+ ' .Importe = TxtImporte.Text.ToString.ToDecimal
+ ' }
+ ' )
+ ' If ObjOtrosPagos IsNot Nothing AndAlso ObjOtrosPagos.Count > 0 Then cfdi.Nomina.OtrosPagos = ObjOtrosPagos
+
+ ' cfdi.Comprobante.Version = "3.3"
+ ' cfdi.Comprobante.Serie = "VIA"
+ ' cfdi.Comprobante.Folio = Folio
+ ' cfdi.Comprobante.Fecha = Now
+ ' cfdi.Comprobante.Subtotal = TxtImporte.Text.ToDecimal
+ ' cfdi.Comprobante.Descuentos = 0
+ ' cfdi.Comprobante.Total = TxtImporte.Text.ToDecimal
+ ' cfdi.Comprobante.MotivoDescuento = ""
+ ' cfdi.Comprobante.Moneda = "MXN"
+ ' cfdi.Comprobante.TipoComprobante = "N"
+ ' cfdi.Comprobante.TipoDocto = "Egs"
+ ' cfdi.Comprobante.MetodoPago = "PUE"
+ ' cfdi.Comprobante.CondicionesdePago = ""
+ ' cfdi.Comprobante.FormadePago = "99"
+ ' cfdi.Comprobante.LugarExpedicion = UsuarioActual.Empresa.CP.ToString
+ ' cfdi.Comprobante.NumCuentaPago = ""
+
+
+ ' cfdi.Nomina.Receptor.CURP = objPersonal.CURP
+ ' cfdi.Nomina.Receptor.NSS = objPersonal.NumeroSS
+ ' cfdi.Nomina.Receptor.FechaInicioContrato = objPersonal.FechaInicioContrato.ToShortDateString
+ ' cfdi.Nomina.Receptor.Antiguedad = $"P{AntiguedadSemanas}W"
+ ' cfdi.Nomina.Receptor.TipoContrato = objPersonal.CodigoTipoContrato
+ ' cfdi.Nomina.Receptor.CodigoTipoJornada = objPersonal.ClaveTipoJornada
+ ' cfdi.Nomina.Receptor.CodigoRegimenContratacion = If(objPersonal.CveRegimenContratacion = "", "99", objPersonal.CveRegimenContratacion)
+ ' cfdi.Nomina.Receptor.CodigoEmpleado = objPersonal.Codigo
+ ' cfdi.Nomina.Receptor.Departamento = objPersonal.Departamento
+ ' cfdi.Nomina.Receptor.Puesto = objPersonal.Puesto
+ ' cfdi.Nomina.Receptor.CodigoRiesgoPuesto = If(objPersonal.CveSATRiesgoPuesto.ToString = "0", "99", 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.ToDecimal
+ ' cfdi.Nomina.Receptor.SBC = objPersonal.SDI.ToDecimal
+
+ ' 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.ToDecimal})
+
+ ' objPersonal.Dispose()
+ ' Return cfdi
+ ' End Function
+
+ ' 'Private Function TimbrarBIInformNomina12(CveNomina As Integer, CvePersonal As Integer, CvePeriodo As Integer) As String
+
+ ' ' If UsuarioActual.CveEmpresa = 8 Then
+ ' ' UsuarioActual.Empresa.FacturaProduccion = True
+ ' ' End If
+ ' ' 'UsuarioActual.Empresa.FacturaProduccion = False
+
+ ' ' Dim MsgError As String = String.Empty
+
+ ' ' Dim CFDi As New ClbNegBICFDv3_2.ClsNegEDI
+ ' ' CFDi.ObjCompNomina12 = New ClbNegBICFDv3_2.ClsNegComplementoNomina12()
+ ' ' 'CFDi.ObjCompNomina = New ClbNegBICFDv3_2.ClsNegCompNomina
+
+ ' ' 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 Total As Decimal = 0
+ ' ' Dim SubTotal As Decimal = 0
+ ' ' Dim Descuentos As Decimal = 0
+ ' ' Dim RetISR As Decimal = 0
+ ' ' Dim TotalExcento As Decimal = 0
+ ' ' Dim TotalGravado As Decimal = 0
+ ' ' Dim TotalPercepciones As Decimal = 0
+ ' ' Dim TotalDeducciones As Decimal = 0
+ ' ' Dim TotalOtrosPagos As Decimal = 0
+
+ ' ' Dim Serie As String = ""
+ ' ' Dim Folio As String = ""
+ ' ' Dim NominaFolio As String = Serie & "-" & Folio
+ ' ' Dim RFC As String = objPersonal.RFC.Trim
+ ' ' Dim Nombre As String = objPersonal.NombreCompleto.Trim
+ ' ' Dim Direccion As String = String.Format("{0} {1} {2}", objPersonal.Calle.Trim, objPersonal.NumExt.Trim, objPersonal.NumInt.Trim).Trim
+ ' ' Dim Ciudad As String = objPersonal.Ciudad.Trim
+ ' ' Dim Estado As String = objPersonal.Estado.Trim
+ ' ' Dim CP As String = objPersonal.CP.Trim
+
+
+
+ ' ' 'Dim TipoContrato As String = GlobalDTTiposContrato.FiltraParametros("CveTipoContrato = " + objPersonal.CveTipoContrato.ToString)(0)("TipoContrato").ToString
+ ' ' 'Dim TipoPeriodo As String = GlobalDTTipoPeriodo.FiltraParametros("CveTipoPeriodo = " + objPersonal.CveTipoPeriodo.ToString)(0)("TipoPeriodo").ToString
+ ' ' 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
+
+ ' ' Dim ObjFolio As New ClsGralFolios
+ ' ' If ObjFolio.GetFolios("VIA", UsuarioActual.CveEmpresa) Then
+ ' ' If ObjFolio.DtResultados.Rows.Count > 0 Then
+ ' ' Folio = ObjFolio.DtResultados.Rows(0)("FActual").ToString
+ ' ' End If
+ ' ' End If
+
+
+ ' ' 'If objNomina.GetPeriodos(-1, -1, -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
+
+ ' ' Dim DtPercepciones As Data.DataTable = Nothing
+ ' ' Dim DtDeducciones As Data.DataTable = Nothing
+ ' ' Dim DtOtrosPagos As Data.DataTable = Nothing
+ ' ' '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")
+ ' ' ' TotalDeducciones = DtDeducciones.SUM("Importe")
+ ' ' ' Total = CType((Total + DtPercepciones.SUM("Importe")), Decimal)
+ ' ' ' 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
+ ' ' Msg = CFDi.ObjCompNomina12.Cargar("O", FechaPago, FechaInicio, FechaFin, DiasPagados, TotalPercepciones, TotalDeducciones, 0)
+
+
+
+ ' ' If Msg = String.Empty Then
+ ' ' If DtPercepciones IsNot Nothing Then
+ ' ' If DtPercepciones.Rows.Count > 0 Then
+ ' ' TotalSueldos = DtPercepciones.SUM("Importe", "SATCveConcepto = '001'")
+ ' ' TotalIndemnizacion = DtPercepciones.SUM("Importe", "SATCveConcepto IN ('022','023','025')") ' https://www.ccpm.org.mx/avisos/nuevo-complemento-de-nomina-version-1.2-puntos-finos-diciembre-2016.pdf
+ ' ' TotalJubilacion = DtPercepciones.SUM("Importe", "SATCveConcepto IN ('039','044')") 'https://www.ccpm.org.mx/avisos/nuevo-complemento-de-nomina-version-1.2-puntos-finos-diciembre-2016.pdf
+ ' ' Msg = CFDi.ObjCompNomina12.CargarPercepciones(TotalSueldos, TotalIndemnizacion, TotalJubilacion, DtPercepciones.SUM("ImporteGravado").ToDecimal, DtPercepciones.SUM("ImporteExento").ToDecimal)
+ ' ' End If
+ ' ' For Each Row As DataRow In DtPercepciones.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.AgregarPercepcion(Row("SATCveConcepto").ToString, Row("Codigo").ToString, Row("Concepto").ToString, Row("ImporteGravado").ToString.ToDecimal, Row("ImporteExento").ToString.ToDecimal)
+ ' ' TotalExcento = TotalExcento + Row("ImporteExento").ToString.ToDecimal
+ ' ' TotalGravado = TotalGravado + Row("ImporteGravado").ToString.ToDecimal
+ ' ' SubTotal = SubTotal + Row("Importe").ToString.ToDecimal
+ ' ' End If
+
+ ' ' If Msg <> String.Empty Then
+ ' ' Me.OnError("El SAT regresó el siguiente mensaje: " & Msg & ". Objeto: Percepcion", New Exception)
+ ' ' Exit For
+ ' ' End If
+ ' ' 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 objNomina.GetHorasExtras(CvePersonal, CvePeriodo, UsuarioActual.CveEmpresa) Then
+
+ ' ' Dim dr As DataRow = objNomina.DtResultados.FiltroPrimero("")
+ ' ' If dr IsNot Nothing Then
+
+ ' ' If dr("HorasDobles").ToString.ToDouble > 0 Then CFDi.ObjCompNomina12.AgregarHorasExtra(dr("DiasHorasDobles").ToString.ToEntero, ClbNegBICFDv3_2.TipoHoras.Dobles, dr("HorasDobles").ToString.ToEntero, Row("Importe").ToString.ToDecimal)
+ ' ' If dr("HorasTriples").ToString.ToDouble > 0 Then CFDi.ObjCompNomina12.AgregarHorasExtra(dr("DiasHorasTriples").ToString.ToEntero, ClbNegBICFDv3_2.TipoHoras.Triples, dr("HorasTriples").ToString.ToEntero, Row("Importe").ToString.ToDecimal)
+
+
+ ' ' End If
+
+
+ ' ' End If
+
+ ' ' End If
+ ' ' Next
+ ' ' If Msg = "" Then
+ ' ' CFDi.ObjCompNomina12.ObjPercepciones.TotalExento = TotalExcento
+ ' ' CFDi.ObjCompNomina12.ObjPercepciones.TotalGravado = TotalGravado
+ ' ' End If
+
+ ' ' End If
+
+ ' ' 'cargo las incapacidades
+ ' ' If DiasIncapacitados > 0 Then
+
+ ' ' If objNomina.GetIncapacidades(CvePersonal, CvePeriodo, UsuarioActual.CveEmpresa) Then
+
+ ' ' CFDi.ObjCompNomina12.CargarIncapacidades()
+ ' ' For Each dr As DataRow In objNomina.DtResultados.Rows
+ ' ' CFDi.ObjCompNomina12.AgregarIncapacidad(dr("Dias").ToString.ToDecimal, dr("ClaveTipoIncapacidad").ToString.ToEntero, dr("Descuento").ToString.ToDecimal)
+ ' ' Next
+
+ ' ' End If
+
+ ' ' End If
+
+
+
+ ' ' TotalExcento = 0
+ ' ' TotalGravado = 0
+
+ ' ' If Msg = String.Empty Then
+ ' ' If DtDeducciones IsNot Nothing Then
+ ' ' If DtDeducciones.Rows.Count > 0 Then
+ ' ' Total = CType((Total - DtDeducciones.SUM("Importe")), Decimal)
+ ' ' CFDi.ObjCompNomina12.CargarDeducciones(CType(DtDeducciones.SUM("ImporteGravado"), Decimal), CType(DtDeducciones.SUM("ImporteExento"), Decimal))
+ ' ' End If
+ ' ' For Each Row As DataRow In DtDeducciones.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.AgregarDeduccion(Row("SATCveConcepto").ToString, Row("Codigo").ToString, Row("Concepto").ToString, 0)
+ ' ' TotalExcento = TotalExcento + Row("ImporteExento").ToString.ToDecimal
+ ' ' TotalGravado = TotalGravado + Row("ImporteGravado").ToString.ToDecimal
+
+ ' ' If Row("CveSATConcepto").ToString.ToEntero = 3 Then
+ ' ' RetISR = RetISR + Row("Importe").ToString.ToDecimal
+ ' ' Else
+ ' ' Descuentos = Descuentos + Row("Importe").ToString.ToDecimal
+ ' ' End If
+ ' ' End If
+
+ ' ' If Msg <> String.Empty Then
+ ' ' Me.OnError("El SAT regresó el siguiente mensaje: " & Msg & ". Objeto: Deduccion", New Exception)
+ ' ' Exit For
+ ' ' End If
+ ' ' End If
+ ' ' Next
+ ' ' If Msg = "" Then
+ ' ' If CFDi.ObjCompNomina12.ObjDeducciones IsNot Nothing Then
+ ' ' CFDi.ObjCompNomina12.ObjDeducciones.TotalOtrasDeducciones = Descuentos
+ ' ' CFDi.ObjCompNomina12.ObjDeducciones.TotalImpuestosRetenidos = RetISR
+ ' ' End If
+
+ ' ' End If
+ ' ' End If
+
+ ' ' If Msg = String.Empty Then
+ ' ' If DtOtrosPagos IsNot Nothing Then
+ ' ' If DtOtrosPagos.Rows.Count > 0 Then
+ ' ' Total = CType((Total - DtOtrosPagos.SUM("Importe")), Decimal)
+ ' ' CFDi.ObjCompNomina12.CargarOtrosPagos()
+ ' ' 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
+
+ ' ' End If
+
+ ' ' If Msg = String.Empty Then
+ ' ' Dim x As Integer = 0
+
+ ' ' Dim Moneda As String = "MXN"
+ ' ' Dim LugarExp As String = String.Format("{0}, {1}, {2}, {3}, {4}, {5}, {6}, {7}, {8} ", SucCalle, SucNoExt, SucNoInt, SucColonia, SucLocalidad, SucMunicipio, SucEstado, SucPais, SucCP)
+ ' ' Dim FechaFactura As DateTime = Now
+ ' ' 'Nodo Comprobante
+
+ ' ' Dim TipoComprobante As ClbNegBICFDv3_2.TipoDeComprobante = ClbNegBICFDv3_2.TipoDeComprobante.egreso
+ ' ' Msg = CFDi.comprobantecfd(0, 0, Serie, Folio, FechaFactura, "PAGO EN UNA SOLA EXHIBICION", "CONTADO", SubTotal, Descuentos, "Deducciones nómina", "1", Moneda, Total, objPersonal.MetodoPagoSAT, ClbNegBICFDv3_2.TipoDeComprobante.egreso, LugarExp, "", "", "", New Date(1900, 1, 1), 0)
+
+ ' ' If Msg = String.Empty Then
+ ' ' 'Nodo emisor
+ ' ' Msg = CFDi.ObjCompNomina12.CargarEmisor("", objPersonal.DtResultados.Rows(0)("RegistroPatronal").ToString(), UsuarioActual.Empresa.RFC)
+ ' ' 'If Msg = String.Empty Then Msg = CFDi.EmisorRegimen(UsuarioActual.Empresa.CodigoRegimenFiscal)
+ ' ' If Msg = String.Empty Then
+ ' ' 'Nodo Entidad SNCF
+ ' ' If 1 = 2 Then 'cuando es gobierno
+ ' ' Msg = CFDi.ObjCompNomina12.CargarEntidadSNCF("", 0)
+ ' ' End If
+
+ ' ' If Msg = String.Empty Then
+ ' ' 'Nodo Receptor
+ ' ' Msg = CFDi.ObjCompNomina12.CargarReceptor(objPersonal.CURP, objPersonal.NumeroSS, objPersonal.FechaInicioContrato, AntiguedadSemanas, objPersonal.TipoContrato, "", objPersonal.ClaveTipoJornada, objPersonal.CveRegimenContratacion, objPersonal.Codigo.ToString,
+ ' ' objPersonal.Departamento, objPersonal.Puesto, objPersonal.CveRiesgoPuesto, objPersonal.TipoPeriodo, objPersonal.ClaveBanco, objPersonal.BancoNumCuenta, Total, objPersonal.SDI.ToString.ToDecimal, objPersonal.ClaveEstado)
+ ' ' If Msg = String.Empty Then
+ ' ' 'Nodo SubContratacion
+ ' ' If 1 = 2 Then Msg = CFDi.ObjCompNomina12.AgregarSubContratacion("", 0)
+ ' ' If Msg = String.Empty Then
+
+ ' ' CFDi.LstCompNomina12.Add(CFDi.ObjCompNomina12)
+
+ ' ' Dim HasErrorConceptos As Boolean = False
+ ' ' 'Dim Importe As Decimal = 0
+
+
+ ' ' Msg = CFDi.ConceptosCfd(1, "ACT", "", "Pago de nómina", SubTotal, SubTotal)
+
+ ' ' 'Timbrado
+
+ ' ' 'Web Services de producción: http://biinform.com.mx/srvCFDi/service1.asmx
+ ' ' 'Web Services de pruebasd: http://biinform.com.mx/srvCFDiPrueba/service1.asmx
+
+
+ ' ' Dim WS As String = String.Empty
+ ' ' If UsuarioActual.Empresa.FacturaProduccion Then
+ ' ' WS = "http://portalbiinform.com.mx/srvCFDiPrueba/service1.asmx"
+ ' ' Else
+ ' ' WS = "http://portalbiinform.com.mx/srvCFDiPrueba/service1.asmx"
+ ' ' End If
+
+ ' ' If Not System.IO.Directory.Exists(Ruta & "XML\") Then System.IO.Directory.CreateDirectory(Ruta & "XML\")
+ ' ' If Not System.IO.Directory.Exists(Ruta & "XML\Nomina\") Then System.IO.Directory.CreateDirectory(Ruta & "XML\Nomina\")
+
+ ' ' 'Generar Timbre
+ ' ' 'If UsuarioActual.Empresa.FacturaProduccion Then
+ ' ' If 1 = 2 Then
+ ' ' CFDi.Generar(String.Format("{0}Certificados\{1}", Ruta, UsuarioActual.Empresa.ArchivoPfx),
+ ' ' UsuarioActual.Empresa.ContraseñaKey,
+ ' ' String.Format("{0}Certificados\{1}", Ruta, UsuarioActual.Empresa.ArchivoCer),
+ ' ' String.Format("{0}XML\Nomina\{1}.xml", Ruta, NominaFolio),
+ ' ' String.Format("{0}Certificados\", Ruta),
+ ' ' UsuarioActual.Empresa.BIUsuario,
+ ' ' UsuarioActual.Empresa.BIContraseña,
+ ' ' WS,
+ ' ' True)
+ ' ' Else
+ ' ' If Not System.IO.Directory.Exists(Ruta & "XML\Nomina\Demo\") Then System.IO.Directory.CreateDirectory(Ruta & "XML\Nomina\Demo\")
+ ' ' 'RutaPruebas & "XML\Demo\" & NominaFolio & ".xml",
+ ' ' CFDi.Generar(String.Format("{0}Certificados\aaa010101aaa__csd_01.pfx", RutaPruebas),
+ ' ' "12345678a",
+ ' ' String.Format("{0}Certificados\aaa010101aaa__csd_01.cer", RutaPruebas),
+ ' ' String.Format("{0}XML\Nomina\Demo\{1}.xml", Ruta, NominaFolio),
+ ' ' String.Format("{0}Certificados\", RutaPruebas),
+ ' ' "prueba",
+ ' ' "123",
+ ' ' WS,
+ ' ' True)
+ ' ' End If
+
+
+ ' ' If CFDi.MsgError <> String.Empty Then
+
+ ' ' 'OnError("Ocurrió un error al generar el timbre: " & CFDi.MsgError, New Exception)
+
+ ' ' Dim params As New ActualizaTimbre
+ ' ' params.Estatus = False
+ ' ' params.CveNomina = CveNomina
+ ' ' params.CvePAC = 1
+
+ ' ' 'Dim Hilo As New System.Threading.Thread(AddressOf ActualizaTimbrado)
+ ' ' 'Hilo.Start(params)
+ ' ' BtnAutorizar.Enabled = False
+ ' ' MsgError = "Nombre: " & Nombre & ". Error: " & CFDi.MsgError
+ ' ' Else
+ ' ' 'Actualiza Estatus Timbrado
+ ' ' Dim params As New ActualizaTimbre
+ ' ' params.Estatus = True
+ ' ' params.CveNomina = CveNomina
+ ' ' params.CvePAC = 1
+
+ ' ' 'Dim Hilo As New System.Threading.Thread(AddressOf ActualizaTimbrado)
+ ' ' 'Hilo.Start(params)
+
+ ' ' Dim CBB As New ClbNegBICFDv3_2.ClsNegCBBGenerar()
+ ' ' Dim FechaCertificacion As DateTime
+ ' ' Dim FolioFiscal, NoSerieCertificado, NoSerieCertificadoContribuyente, SelloCFDi, SelloSAT As String
+
+ ' ' FolioFiscal = CFDi.Timbrado.UUDI 'XmlDoc.DocumentElement("cfdi:Complemento").FirstChild.Attributes("UUID").InnerText
+ ' ' NoSerieCertificado = CFDi.Timbrado.NoCertificadoSAT
+ ' ' FechaCertificacion = CFDi.Timbrado.FechaTimbrado
+ ' ' SelloCFDi = CFDi.Timbrado.SelloCFD
+ ' ' SelloSAT = CFDi.Timbrado.SelloSAT
+ ' ' NoSerieCertificadoContribuyente = CFDi.Timbrado.NoCertificado
+ ' ' ViewState("FolioFiscal") = FolioFiscal
+
+ ' ' 'Actualiza Estatus Factura
+ ' ' CveNominaT = CveNomina
+
+ ' ' Dim Rastro As String = String.Format("Nomina: CvePeriodo:{0}, CvePersonal:{1}, UUID: {2}, RFC:{3}", CvePeriodo, CvePersonal, FolioFiscal, objPersonal.RFC)
+ ' ' Rastro.GuardaLog()
+
+ ' ' If FolioFiscal <> "" Then
+
+ ' ' 'If UsuarioActual.Empresa.FacturaProduccion Then
+ ' ' ' Dim ObjNomina2 As New ClsNominas()
+ ' ' ' ObjNomina2.UpdateEstatusNomNominas(3, UsuarioActual.Empresa.CvePAC, FolioFiscal, "", ("01/01/2000").ToDate, CveNomina, SubTotal, Descuentos, RetISR, Total, DiasPagados)
+ ' ' ' ObjNomina2.Dispose()
+ ' ' 'End If
+ ' ' Rastro = "--Estatus" & Rastro
+ ' ' Rastro.GuardaLog()
+ ' ' 'Dim Hilo1 As New System.Threading.Thread(AddressOf ActualizaEstatus)
+ ' ' 'Hilo1.Start(3)
+ ' ' End If
+
+
+ ' ' Dim RutaCBB As String = String.Empty
+ ' ' If Not System.IO.Directory.Exists(Ruta & "CBB\") Then System.IO.Directory.CreateDirectory(Ruta & "CBB\")
+ ' ' If Not System.IO.Directory.Exists(Ruta & "CBB\Nomina\") Then System.IO.Directory.CreateDirectory(Ruta & "CBB\Nomina\")
+
+ ' ' If UsuarioActual.Empresa.FacturaProduccion Then
+ ' ' RutaCBB = Ruta & "CBB\Nomina\" & NominaFolio & ".jpg"
+ ' ' Else
+ ' ' If Not System.IO.Directory.Exists(Ruta & "CBB\Nomina\Demo\") Then System.IO.Directory.CreateDirectory(Ruta & "CBB\Nomina\Demo\")
+ ' ' RutaCBB = Ruta & "CBB\Nomina\Demo\" & NominaFolio & ".jpg"
+ ' ' End If
+ ' ' CBB.GenerarCBB(UsuarioActual.Empresa.RFC, RFC, Total, FolioFiscal, RutaCBB)
+
+
+ ' ' 'GeneraPDF(FechaFactura, FolioFiscal, NoSerieCertificado, FechaCertificacion, NoSerieCertificadoContribuyente, TmpDT, SelloCFDi, SelloSAT, RutaCBB, VentaFolio, Ruta & "XML\" & VentaFolio & ".xml", False, CFDi.CadenaOriginal)
+ ' ' 'GeneraPDF(CveNomina, CvePersonal, CvePeriodo, FechaFactura, FolioFiscal, NoSerieCertificado, FechaCertificacion, NoSerieCertificadoContribuyente, SelloCFDi, SelloSAT, RutaCBB, Ruta & "Nomina\XML\" & NominaFolio & ".xml", False, CFDi.Timbrado.CadenaOriginal, FormatoReciboCFDi)
+ ' ' GeneraPDFNuevo(String.Format("{0}XML\Nomina\{1}.xml", Ruta, NominaFolio), CvePersonal, CvePeriodo)
+ ' ' End If
+ ' ' Else
+ ' ' 'Me.OnError(String.Format("El SAT regresó el siguiente mensaje: {0} Nombre: {1}. Objeto: EmisorRegimen", Msg, Nombre), New Exception)
+ ' ' MsgError = String.Format("El SAT regresó el siguiente mensaje: {0} Nombre: {1}. Objeto: EmisorRegimen", Msg, Nombre)
+ ' ' End If
+ ' ' Else
+ ' ' 'Me.OnError(String.Format("El SAT regresó el siguiente mensaje: {0} Nombre: {1}. Objeto: EmisorDomicilioExpedidoEn", Msg, Nombre), New Exception)
+ ' ' MsgError = String.Format("El SAT regresó el siguiente mensaje: {0} Nombre: {1}. Objeto: EmisorDomicilioExpedidoEn", Msg, Nombre)
+ ' ' End If
+ ' ' Else
+ ' ' 'Me.OnError(String.Format("El SAT regresó el siguiente mensaje: {0} Nombre: {1}. Objeto: EmisorDomicilioFiscalCfd", Msg, Nombre), New Exception)
+ ' ' MsgError = String.Format("El SAT regresó el siguiente mensaje: {0} Nombre: {1}. Objeto: EmisorDomicilioFiscalCfd", Msg, Nombre)
+ ' ' End If
+ ' ' Else
+ ' ' 'Me.OnError(String.Format("El SAT regresó el siguiente mensaje: {0} Nombre: {1}. Objeto: EmisorCfd", Msg, Nombre), New Exception)
+ ' ' MsgError = String.Format("El SAT regresó el siguiente mensaje: {0} Nombre: {1}. Objeto: EmisorCfd", Msg, Nombre)
+ ' ' End If
+ ' ' Else
+ ' ' 'Me.OnError(String.Format("El SAT regresó el siguiente mensaje: {0} Nombre: {1}. Objeto: Comprobante", Msg, Nombre), New Exception)
+ ' ' MsgError = String.Format("El SAT regresó el siguiente mensaje: {0} Nombre: {1}. Objeto: Comprobante", Msg, Nombre)
+ ' ' End If
+ ' ' Else
+ ' ' 'Me.OnError(String.Format("El SAT regresó el siguiente mensaje: {0} Nombre: {1}. Objeto: Comprobante", Msg, Nombre), New Exception)
+ ' ' MsgError = String.Format("El SAT regresó el siguiente mensaje: {0} Nombre: {1}. Objeto: Comprobante", Msg, Nombre)
+ ' ' End If
+ ' ' Else
+ ' ' 'Me.OnError(String.Format("El SAT regresó el siguiente mensaje: {0} Nombre: {1}. Objeto: Comprobante", Msg, Nombre), New Exception)
+ ' ' MsgError = String.Format("El SAT regresó el siguiente mensaje: {0} Nombre: {1}. Objeto: Comprobante", Msg, Nombre)
+ ' ' End If
+ ' ' Else
+ ' ' 'Me.OnError(String.Format("El SAT regresó el siguiente mensaje: {0} Nombre: {1}. Objeto: Comprobante", Msg, Nombre), New Exception)
+ ' ' MsgError = String.Format("El SAT regresó el siguiente mensaje: {0} Nombre: {1}. Objeto: Comprobante", Msg, Nombre)
+ ' ' End If
+ ' ' Else
+ ' ' 'Me.OnError(String.Format("El SAT regresó el siguiente mensaje: {0} Nombre: {1}. Objeto: Comprobante", Msg, Nombre), New Exception)
+ ' ' MsgError = String.Format("El SAT regresó el siguiente mensaje: {0} Nombre: {1}. Objeto: Comprobante", Msg, Nombre)
+ ' ' End If
+ ' ' objPersonal.Dispose()
+ ' ' objNomina.Dispose()
+
+ ' ' Return MsgError
+ ' 'End Function
+
+
+ '#End Region
#Region " GUARDAR - ACTUALIZAR "
Private Function ValidaGuardar() As Boolean
@@ -2574,6 +2575,12 @@ Partial Class Bancos_IE
Dim alertaContabilizacion As String = "Se enviaron correctamente las siguientes pólizas:
"
Dim Msg As New StringBuilder
+
+ If RBL.SelectedValue = "C" AndAlso DdlCliente.SelectedValue.ToEntero > 0 Then ' Clientes
+ CveConceptoCompra = 66
+ End If
+
+
If CveIE = -1 Then
@@ -3770,16 +3777,16 @@ Partial Class Bancos_IE
MsgError = GuardaSolicitudAnticipoOC(ObjOC)
End If
- If MsgError = "" Then
- 'VIATICOS
- If ChkAplicaViatico.Checked Then
- Dim Retorno As String = TimbrarNomina12(CvePersonal)
- If Retorno <> "" Then MsgError = $"{MsgError} {Retorno}" : Msg.Clear() : CveIE = -1
- If Retorno <> "" Then
- Alert(Retorno, TipoMensaje.MsgError)
- End If
- End If
- End If
+ 'If MsgError = "" Then
+ ' 'VIATICOS
+ ' If ChkAplicaViatico.Checked Then
+ ' Dim Retorno As String = TimbrarNomina12(CvePersonal)
+ ' If Retorno <> "" Then MsgError = $"{MsgError} {Retorno}" : Msg.Clear() : CveIE = -1
+ ' If Retorno <> "" Then
+ ' Alert(Retorno, TipoMensaje.MsgError)
+ ' End If
+ ' End If
+ 'End If
If MsgError = "" Then
If ObjMov.ValidacionPrePolizaCuadre(CvePrePoliza, -1) Then
diff --git a/Bancos/ProveedoresAbonar.aspx.vb b/Bancos/ProveedoresAbonar.aspx.vb
index 79c04fe66..09310593f 100644
--- a/Bancos/ProveedoresAbonar.aspx.vb
+++ b/Bancos/ProveedoresAbonar.aspx.vb
@@ -895,7 +895,7 @@ Partial Class Bancos_ProveedoresAbonar
IdCuenta = ObjCreditos.DtResultados.Rows(0)("IdCtaContableTarjeta").ToString.ToEntero
End If
- Dim Importe42 As Decimal = Pago.ImportePago + Pago.OtroGastoIngreso
+ Dim Importe42 As Decimal = Pago.ImportePago
tImporteMN = If(Pago.CveMonedaPago = 2, If(DivTC.Visible, Importe42 / TxtTC.Text.ToDecimal * Pago.TCPago, Importe42 * Pago.TCPago), Importe42)
If MsgError = "" AndAlso Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, True, Importe42, tImporteMN, 42, Referencia, ConceptoMovimiento, IdCuenta, CveIE:=CveIE, CveProveedor:=CveProveedor, TipoCambio:=Pago.TCPago, CveSubProyecto:=CveSubProyecto) Then
diff --git a/Bancos/RepComplementoPago.aspx.vb b/Bancos/RepComplementoPago.aspx.vb
index 77615c98a..603e2c53b 100644
--- a/Bancos/RepComplementoPago.aspx.vb
+++ b/Bancos/RepComplementoPago.aspx.vb
@@ -241,7 +241,7 @@ Partial Class Bancos_RepComplementoPago
e.Row.FCLabel("LblImp").ForeColor = Drawing.Color.Red
e.Row.FCLabel("LblImp").ToolTip = String.Format("Importe Pagado:{0} Importe Pagado PUE: {1}, Ot. Ingresos {2}", e.Row.DBCampo("Importe").FormatoNumero, e.Row.DBCampo("PagadoPUE").FormatoNumero, e.Row.DBCampo("PagadoOtIngresos").FormatoNumero) ' VentasTotalPagado
'si hay una diferencia generado por el tipo de cambio o alguna situación especial, detendrá el timbrado
- If Math.Abs(e.Row.DBCampo("Importe").ToDecimal - e.Row.DBCampo("VentasTotalPagado").ToDecimal) > 11 Then
+ If Math.Abs(e.Row.DBCampo("Importe").ToDecimal - e.Row.DBCampo("VentasTotalPagado").ToDecimal) > 20 Then
' si tiene pagado PUE, habilitamos la condición porque esa puede ser la diferencia
If e.Row.DBCampo("PagadoPUE").ToDecimal > 0 OrElse e.Row.DBCampo("PagadoOtIngresos").ToDecimal > 0 Then
e.Row.FCCheckBox("Chk").Visible = True
diff --git a/Compras/ReembolsosComprobaciones.aspx.vb b/Compras/ReembolsosComprobaciones.aspx.vb
index 95a0f5c77..ab0edc788 100644
--- a/Compras/ReembolsosComprobaciones.aspx.vb
+++ b/Compras/ReembolsosComprobaciones.aspx.vb
@@ -402,8 +402,10 @@ Partial Class Compras_ReembolsosComprobaciones
Protected Sub BtnIEGuardar_Click(sender As Object, e As EventArgs) Handles BtnIEGuardar.Click
Dim ValFechaDocumento As Boolean = False
- Dim FoliosFechasValFechaDocumento As New StringBuilder
- FoliosFechasValFechaDocumento.AppendLine("Se seleccionaron facturas con fecha de mes superior al mes del pago:
")
+
+ Dim FoliosFechasValFechaDocumentoAnio As New StringBuilder
+ Dim FoliosFechasValFechaDocumentoPagoMesSuperior As New StringBuilder
+ Dim FoliosFechasValFechaDocumentoMesInferior As New StringBuilder
For Each gvRowVal As GridViewRow In GvCxP.Rows
@@ -422,12 +424,16 @@ Partial Class Compras_ReembolsosComprobaciones
Dim MesDocumento As Integer = FechaDocumento.Month
If AnioFactura > AnioDocumento Then
- FoliosFechasValFechaDocumento.AppendLine($"Folio: { gvRowVal.DataKey("SerieFolio") } fecha: {gvRowVal.DataKey("FechaCompra").ToDate.ToString("dd/MM/yyyy") }
")
+ FoliosFechasValFechaDocumentoAnio.AppendLine($"Folio: { gvRowVal.DataKey("SerieFolio") } fecha: {gvRowVal.DataKey("FechaCompra").ToDate.ToString("dd/MM/yyyy") }
")
ValFechaDocumento = True
ElseIf AnioFactura = AnioDocumento And MesFactura > MesDocumento Then
- FoliosFechasValFechaDocumento.AppendLine($"Folio: { gvRowVal.DataKey("SerieFolio") } fecha: {gvRowVal.DataKey("FechaCompra").ToDate.ToString("dd/MM/yyyy") }
")
+ FoliosFechasValFechaDocumentoMesInferior.AppendLine($"Folio: { gvRowVal.DataKey("SerieFolio") } fecha: {gvRowVal.DataKey("FechaCompra").ToDate.ToString("dd/MM/yyyy") }
")
+ ValFechaDocumento = True
+ ElseIf AnioFactura = AnioDocumento And MesDocumento > MesFactura Then
+ FoliosFechasValFechaDocumentoPagoMesSuperior.AppendLine($"Folio: { gvRowVal.DataKey("SerieFolio") } fecha: {gvRowVal.DataKey("FechaCompra").ToDate.ToString("dd/MM/yyyy") }
")
ValFechaDocumento = True
End If
+
End If
Next
@@ -437,7 +443,13 @@ Partial Class Compras_ReembolsosComprobaciones
End If
If ValFechaDocumento Then
- Alert(FoliosFechasValFechaDocumento.ToString, TipoMensaje.MsgAdvertencia)
+
+ Dim strMensajeValFechas As String = ""
+ strMensajeValFechas = $"{strMensajeValFechas}{If(FoliosFechasValFechaDocumentoAnio.Length > 0, "Se seleccionarón facturas con fecha de año superior al año del pago:
" & FoliosFechasValFechaDocumentoAnio.ToString, "")}"
+ strMensajeValFechas = $"{strMensajeValFechas}{If(FoliosFechasValFechaDocumentoPagoMesSuperior.Length > 0, "Se seleccionarón facturas con fecha de mes inferior al mes del pago:
" & FoliosFechasValFechaDocumentoPagoMesSuperior.ToString, "")}"
+ strMensajeValFechas = $"{strMensajeValFechas}{If(FoliosFechasValFechaDocumentoMesInferior.Length > 0, "Se seleccionarón facturas con fecha de mes superior al mes del pago:
" & FoliosFechasValFechaDocumentoMesInferior.ToString, "")}"
+
+ Alert(strMensajeValFechas, TipoMensaje.MsgAdvertencia)
Exit Sub
End If
diff --git a/Compras/eFacturas.aspx b/Compras/eFacturas.aspx
index d5ac164f8..09a6f4be6 100644
--- a/Compras/eFacturas.aspx
+++ b/Compras/eFacturas.aspx
@@ -80,6 +80,9 @@
| "); - str.Append("Concepto Contable"); - str.Append(" | "); - str.Append(""); - str.Append("Concepto Nomina"); - str.Append(" | "); - str.Append(""); - str.Append("Personal"); - str.Append(" | "); - str.Append("
|---|---|---|
| "); - str.Append(item["ConceptoContable"]); - str.Append(" | "); - str.Append(""); - str.Append(item["ConceptoNomina"]); - str.Append(" | "); - str.Append(""); - str.Append(item["CodigoNombreCompleto"]); - str.Append(" | "); - str.Append("