diff --git a/App_Code/CFDITimbre.vb b/App_Code/CFDITimbre.vb index 3138f25ba..85197ff2d 100644 --- a/App_Code/CFDITimbre.vb +++ b/App_Code/CFDITimbre.vb @@ -395,7 +395,8 @@ End Class Public Class CFDIRetenciones Public Property Impuesto As String - Public Property Importe As Double + Public Property Importe As Decimal + Public Property TasaOCuota As String End Class @@ -439,8 +440,8 @@ Public Class CFDIComplementoPagos Public Property FormaDePagoP As String = "" Public Property MonedaP As String = "" Public Property NumOperacion As String = "" - Public Property TipoCambioP As Double = 0 - Public Property Monto As Double + Public Property TipoCambioP As Decimal = 0 + Public Property Monto As Decimal Public Property RfcEmisorCtaOrd As String = "" Public Property NomBancoOrdExt As String = "" Public Property CtaOrdenante As String = "" @@ -452,8 +453,24 @@ Public Class CFDIComplementoPagos Public Property SelloPago As String = "" Public Property DocumentosRelacionados As List(Of CFDIComplementoPagosDocsRelacionados) Public Property Impuestos As List(Of CFDIConceptosImpuestos) + Public ReadOnly Property Totales As CFDIComplementoPagosTotales + Get + Dim tRetorno As New CFDIComplementoPagosTotales + tRetorno.MontoTotalPagos = (From c In DocumentosRelacionados Select c.ImpPagado).Sum() - Public ReadOnly Property TotalImpuestosRetenidos As Double + tRetorno.TotalTrasladosBaseIVA0 = (From c In Traslados Where c.Impuesto = "002" And c.TasaOCuota = 0 Select c.Base).Sum() + tRetorno.TotalTrasladosBaseIVA8 = (From c In Traslados Where c.Impuesto = "002" And c.TasaOCuota = 0.08 Select c.Base).Sum() + tRetorno.TotalTrasladosBaseIVA16 = (From c In Traslados Where c.Impuesto = "002" And c.TasaOCuota = 0.16 Select c.Base).Sum() + + tRetorno.TotalTrasladosImpuestoIVA0 = (From c In Traslados Where c.Impuesto = "002" And c.TasaOCuota = 0 Select c.Importe).Sum() + tRetorno.TotalTrasladosImpuestoIVA8 = (From c In Traslados Where c.Impuesto = "002" And c.TasaOCuota = 0.08 Select c.Importe).Sum() + tRetorno.TotalTrasladosImpuestoIVA16 = (From c In Traslados Where c.Impuesto = "002" And c.TasaOCuota = 0.16 Select c.Importe).Sum() + + Return tRetorno + End Get + End Property + + Public ReadOnly Property TotalImpuestosRetenidos As Decimal Get Return (From c In Impuestos Where c.TrasladooRetencion = "R" @@ -461,7 +478,7 @@ Public Class CFDIComplementoPagos End Get End Property - Public ReadOnly Property TotalImpuestosTrasladados As Double + Public ReadOnly Property TotalImpuestosTrasladados As Decimal Get Return (From c In Impuestos Where c.TrasladooRetencion = "T" @@ -476,6 +493,60 @@ Public Class CFDIComplementoPagos End Sub + Public ReadOnly Property Retenciones As List(Of CFDIRetenciones) + Get + Dim tRetorno As New List(Of CFDIRetenciones) + Dim TRetenciones As New List(Of CFDIRetenciones) + + For Each c As CFDIComplementoPagosDocsRelacionados In DocumentosRelacionados + For Each imp As CFDIConceptosImpuestos In c.Impuestos + If imp.TrasladooRetencion = "R" Then + tRetorno.Add(New CFDIRetenciones With {.Impuesto = imp.Impuesto, .Importe = imp.Importe}) + + End If + Next + Next + If tRetorno.Count > 0 Then + TRetenciones = tRetorno.GroupBy(Function(t) New With {Key t.Impuesto}) _ + .Select(Function(t) New CFDIRetenciones With {.Impuesto = t.Key.Impuesto, + .Importe = t.Sum(Function(tt) tt.Importe)}) _ + .OrderBy(Function(x) x.Impuesto).ToList + End If + + tRetorno = Nothing + Return TRetenciones + + End Get + End Property + + Public ReadOnly Property Traslados As List(Of CFDITraslados) + Get + Dim tRetorno As New List(Of CFDITraslados) + Dim TTraslados As New List(Of CFDITraslados) + For Each c As CFDIComplementoPagosDocsRelacionados In DocumentosRelacionados + For Each imp As CFDIConceptosImpuestos In c.Impuestos + If imp.TrasladooRetencion = "T" Then + tRetorno.Add(New CFDITraslados With {.Impuesto = imp.Impuesto, .Base = imp.Base, .Importe = imp.Importe, .TasaOCuota = imp.TasaOCuota, .TipoFactor = imp.TipoFactor}) + End If + Next + Next + 'ya generado todos los registros posibles, los agrupo y los sumo + If tRetorno.Count > 0 Then + TTraslados = tRetorno.GroupBy(Function(t) New With {Key t.TipoFactor, Key t.Impuesto, Key t.TasaOCuota}) _ + .Select(Function(t) New CFDITraslados With {.Impuesto = t.Key.Impuesto, + .TipoFactor = t.Key.TipoFactor, + .TasaOCuota = t.Key.TasaOCuota, + .Base = t.Sum(Function(tt) tt.Base), + .Importe = t.Sum(Function(tt) tt.Importe)}) _ + .OrderBy(Function(x) x.Impuesto).ToList + + End If + tRetorno = Nothing + Return TTraslados + + End Get + End Property + End Class @@ -486,10 +557,33 @@ Public Class CFDIComplementoPagosDocsRelacionados Public Property MonedaDR As String = "" Public Property MetodoDePagoDR As String = "" Public Property TipoCambioDR As Decimal + Public Property EquivalenciaDR As Decimal = 1 Public Property NumParcialidad As Integer = 1 - Public Property ImpSaldoAnt As Double - Public Property ImpPagado As Double - Public Property ImpSaldoInsoluto As Double + Public Property ImpSaldoAnt As Decimal + Public Property ImpPagado As Decimal + Public Property ImpSaldoInsoluto As Decimal + Public Property ObjetoImpuesto As String = "01" + Public Property Impuestos As List(Of CFDIConceptosImpuestos) + Sub New() + Impuestos = New List(Of CFDIConceptosImpuestos) + End Sub +End Class + + + +Public Class CFDIComplementoPagosTotales + Public Property MontoTotalPagos As Decimal = 0 + Public Property TotalTrasladosBaseIVA16 As Decimal = 0 + Public Property TotalTrasladosImpuestoIVA16 As Decimal = 0 + Public Property TotalTrasladosBaseIVA8 As Decimal = 0 + Public Property TotalTrasladosImpuestoIVA8 As Decimal = 0 + Public Property TotalTrasladosBaseIVA0 As Decimal = 0 + Public Property TotalTrasladosImpuestoIVA0 As Decimal = 0 + Public Property TotalTrasladosBaseExento As Decimal = 0 + Public Property TotalRetencionesIVA As Decimal = 0 + Public Property TotalRetencionesISR As Decimal = 0 + Public Property TotalRetencionesIEPS As Decimal = 0 + End Class diff --git a/App_Code/ClsBancos.vb b/App_Code/ClsBancos.vb index 3d3f33619..55ee851fb 100644 --- a/App_Code/ClsBancos.vb +++ b/App_Code/ClsBancos.vb @@ -953,6 +953,7 @@ Public Class ClsBancos Dim Estatus As Integer = 1 Dim dttpagos As DataTable = Nothing + Dim dttpagosimpuestos As DataTable = Nothing Dim dr As Data.DataRow = Nothing If GetComplementoPagosRep(-1, Now.AddYears(-5), Now, If(CvePrePoliza > 0, -1, CveIE), CveVenta, If(EsRegeneracion, 2, 1), UsuarioActual.CveEmpresa, CvePrePoliza:=CvePrePoliza) Then @@ -996,7 +997,6 @@ Public Class ClsBancos 'ReceptorRFC = drr("RFC").ToString 'ReceptorNombre = drr("NombreCliente").ToString - Folio = FActual ComplementoSerieFolio = $"{Serie}-{Folio}" @@ -1084,12 +1084,25 @@ Public Class ClsBancos Dim Timbre As CFDITimbre = Nothing Dim Timbrado As New Timbrado + If UsuarioActual.Empresa.Funcionalidad(350) = "1" Then + If GetComplementoPagosImpuestos(CveIE, UsuarioActual.CveEmpresa) Then + dttpagosimpuestos = DtResultados + End If - Timbre = Timbrado.PreparaTimbrePago(RFCEmpresa, UsuarioActual.Empresa.Empresa, UsuarioActual.Empresa.CodigoRegimenFiscal, + Timbre = Timbrado.PreparaTimbrePago40(RFCEmpresa, UsuarioActual.Empresa.Empresa, UsuarioActual.Empresa.CodigoRegimenFiscal, + RFCCliente, dr("NombreCliente").ToString, dr("ClienteCP").ToString, dr("CodigoRegimenFiscal").ToString, Serie, Folio.ToString, FechaTimbrado, Cuentapago, + dr("FechaDocumento").ToString.ToDate, dr("ClaveFormaPagoSAT").ToString, dr("AbreviaturaSAT").ToString, dr("VentasTotalPagado").ToString.ToDecimal, + UsuarioActual.Empresa.CP.ToString, CuentaBeneficiario, dr("TipoCambioPago").ToString.ToDecimal, dttpagos, dttpagosimpuestos, CFDIRelacionado:=CFDIRelacionado) + + Else + Timbre = Timbrado.PreparaTimbrePago(RFCEmpresa, UsuarioActual.Empresa.Empresa, UsuarioActual.Empresa.CodigoRegimenFiscal, RFCCliente, dr("NombreCliente").ToString, Serie, Folio.ToString, FechaTimbrado, Cuentapago, - dr("FechaDocumento").ToString.ToDate, dr("ClaveFormaPagoSAT").ToString, dr("AbreviaturaSAT").ToString, dr("VentasTotalPagado").ToString.ToDouble, - UsuarioActual.Empresa.CP.ToString, CuentaBeneficiario, dr("TipoCambioPago").ToString.ToDouble, dttpagos, CFDIRelacionado:=CFDIRelacionado, EsCancelacion:=False) + dr("FechaDocumento").ToString.ToDate, dr("ClaveFormaPagoSAT").ToString, dr("AbreviaturaSAT").ToString, dr("VentasTotalPagado").ToString.ToDecimal, + UsuarioActual.Empresa.CP.ToString, CuentaBeneficiario, dr("TipoCambioPago").ToString.ToDecimal, dttpagos, CFDIRelacionado:=CFDIRelacionado, EsCancelacion:=False) + + End If + ''PREPARA PARA CANCELACION POR SUSTITUCION DE COMPLEMENTO DE PAGO 'If CFDIRelacionado <> "-1" And CFDIRelacionado <> "" Then @@ -1365,6 +1378,26 @@ Public Class ClsBancos Return Retorno End Function + Public Function GetComplementoPagosImpuestos(CveIE As Integer, CveEmpresa As Integer) As Boolean + Dim Retorno As Boolean = False + + DataAdapter("PA_Banc_ComplementoPagoImpuestosGet") + + With SqlAdapter.SelectCommand.Parameters + .Add("@CveIE", SqlDbType.Int).Value = CveIE + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With + Try + SqlAdapter.Fill(Data) + + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al obtener informacion de complementos de pago en impuestos.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + + Return Retorno + End Function + Public Function GetComplementoPagos(CveComplementoPago As Integer, CveIE As Integer, CveVenta As Integer, CveEmpresa As Integer) As Boolean Dim Retorno As Boolean = False diff --git a/App_Code/ClsContabilidad.vb b/App_Code/ClsContabilidad.vb index 1fa789d2c..591b8d100 100644 --- a/App_Code/ClsContabilidad.vb +++ b/App_Code/ClsContabilidad.vb @@ -5807,7 +5807,7 @@ Public Class ClsContabilidad Public Function AddCuentasAsignaciones(Optional CveConceptoContable As Integer = -1, Optional CveEmpresa As Integer = -1, Optional CveCuenta As Integer = -1, Optional IdCtaContable As Integer = -1, Optional CveProveedor As Integer = -1, Optional CveCliente As Integer = -1, Optional CvePersonal As Integer = -1, Optional CveClasificacion As Integer = -1, Optional CveAlmacen As Integer = -1, Optional PorcentajeIVA As Decimal = -1, Optional CveConceptoNomina As Decimal = -1, Optional CveBancoCuenta As Integer = -1, - Optional CveSubProyecto As Integer = -1, Optional CveActivoFijo As Integer = -1) As Boolean + Optional CveSubProyecto As Integer = -1, Optional CveActivoFijo As Integer = -1, Optional CveTipoGasto As Integer = -1) As Boolean Dim Retorno = False DataAdapter("PA_Conta_CuentasAsignacionesAdd") @@ -5827,6 +5827,7 @@ Public Class ClsContabilidad .Add("@CveBancoCuenta", SqlDbType.Int).Value = CveBancoCuenta .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto .Add("@CveActivoFijo", SqlDbType.Int).Value = CveActivoFijo + .Add("@CveTipoGasto", SqlDbType.Int).Value = CveTipoGasto End With Try @@ -5862,7 +5863,7 @@ Public Class ClsContabilidad Optional IdCtaContable As Integer = -1, Optional CveProveedor As Integer = -1, Optional CveCliente As Integer = -1, Optional CvePersonal As Integer = -1, Optional CveClasificacion As Integer = -1, Optional CveAlmacen As Integer = -1, Optional PorcentajeIVA As Decimal = -1, Optional CveConceptoNomina As Decimal = -1, Optional CveBancoCuenta As Integer = -1, - Optional CveSubProyecto As Integer = -1, Optional CveActivoFijo As Integer = -1) As Boolean + Optional CveSubProyecto As Integer = -1, Optional CveActivoFijo As Integer = -1, Optional CveTipoGasto As Integer = -1) As Boolean Dim Retorno = False DataAdapter("PA_Conta_CuentasAsignacionesUpdate") @@ -5882,6 +5883,7 @@ Public Class ClsContabilidad .Add("@CveBancoCuenta", SqlDbType.Int).Value = CveBancoCuenta .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto .Add("@CveActivoFijo", SqlDbType.Int).Value = CveActivoFijo + .Add("@CveTipoGasto", SqlDbType.Int).Value = CveTipoGasto End With Try @@ -6629,6 +6631,30 @@ Public Class ClsContabilidad End Function + Public Function GetRepOrigenAplicacion(FechaFin As Date, CveEmpresa As Integer) As Boolean + Dim Respuesta As Boolean = False + + DataAdapter("PA_Conta_RepOrigenAplicacionGet2") + + With SqlAdapter.SelectCommand.Parameters + + .Add("@FechaFin", SqlDbType.Date).Value = FechaFin + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + + + End With + Try + SqlAdapter.Fill(Data) + Respuesta = True + Catch ex As Exception + Me.OnError("Ocurrió un error al obtener el reporte", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + + Return Respuesta + + End Function + + #Region "IDisposable Support" ' IDisposable Protected Overridable Sub Dispose(disposing As Boolean) diff --git a/App_Code/ClsEdocumentacion.vb b/App_Code/ClsEdocumentacion.vb index a7c6401b3..576b6b90b 100644 --- a/App_Code/ClsEdocumentacion.vb +++ b/App_Code/ClsEdocumentacion.vb @@ -31,11 +31,22 @@ Public Class ClsEdocumentacion SqlAdapter.SelectCommand.Transaction = SqlTransacc End If Data = New DataTable - End Sub - - + End Sub + + +#End Region +#Region "materialidad" + + Public Function Materialidad_Tablero(cveEmpresa As Int32, anio As Int32, mes As Int32) As Boolean + Dim retorno As Boolean = False + DataAdapter("PA_Materialidad_TableroGET", CommandType.StoredProcedure) + addParameters("@CveEmpresa", SqlDbType.Int, cveEmpresa) + addParameters("@Anio", SqlDbType.Int, anio) + addParameters("@Mes", SqlDbType.Int, mes) + retorno = RunQuery("Ocurrió un error al obtener el Materialidad_Tablero.") + Return retorno + End Function #End Region - #Region "Propiedades" Public ReadOnly Property DSResultados() As DataSet Get diff --git a/App_Code/ClsPaginas.vb b/App_Code/ClsPaginas.vb index d921cbd71..0d33d9c0c 100644 --- a/App_Code/ClsPaginas.vb +++ b/App_Code/ClsPaginas.vb @@ -4264,7 +4264,7 @@ Public Class ClsPaginas PaginaDict.Add("/Nomina/ChecadorAsistencia.aspx".ToUpper(), 921) PaginaDict.Add("/Nomina/ISRCalculoAnual.aspx".ToUpper(), 918) PaginaDict.Add("/Nomina/MovimientosSUA.aspx".ToUpper(), 919) - 'PaginaDict.Add("/Nomina/Acumulados.aspx".ToUpper(), 916) + PaginaDict.Add("/Nomina/Acumulados.aspx".ToUpper(), 916) PaginaDict.Add("/RH/CalculoSBC.aspx".ToUpper(), 915) PaginaDict.Add("/Inicio.aspx".ToUpper(), -1) PaginaDict.Add("/reporteador.aspx".ToUpper(), -1) @@ -4863,7 +4863,6 @@ Public Class ClsPaginas 'PaginaDict.Add("/Contabilidad2/RepBalanceGeneral.aspx".ToUpper(), 530) PaginaDict.Add("/Contabilidad2/CatCuentasAsignaciones.aspx".ToUpper(), 724) PaginaDict.Add("/Contabilidad2/CatContaEjercicios.aspx".ToUpper(), 725) - PaginaDict.Add("/Contabilidad2/PolizasImpresion.aspx".ToUpper(), 726) PaginaDict.Add("/Contabilidad2/RepEstadoResultadosHorizontal.aspx".ToUpper(), 420) PaginaDict.Add("/Contabilidad2/RepAnexoCatalogoMensualHorizontal.aspx".ToUpper(), -1) diff --git a/App_Code/Modelos.vb b/App_Code/Modelos.vb index 1a3e6f0cf..c46c6b549 100644 --- a/App_Code/Modelos.vb +++ b/App_Code/Modelos.vb @@ -686,7 +686,7 @@ Namespace Modelos Return Not ErrorPrePolizas End Function - Public Function EmitirFactura(Optional Timbrar As Boolean = True, Optional Transac As SqlClient.SqlTransaction = Nothing, Optional ObjContPaqTransac As ClsContPAQi = Nothing) As MMensajeFactura + Public Function EmitirFactura(Optional Timbrar As Boolean = True, Optional Transac As SqlClient.SqlTransaction = Nothing, Optional ObjContPaqTransac As ClsContPAQi = Nothing, Optional Modulo As String = "Modelos/GuardarVentaM") As MMensajeFactura Dim Retorno As New MMensajeFactura() If Me.Version = "3.3" AndAlso Not Me.TipoDocto.Contiene("Ped", "PeC") Then @@ -782,7 +782,7 @@ Namespace Modelos Next End If - GuardarVenta(Me, ObjVentas, ObjConta, ObjInventario, ObjContr, DtDetalle, Me.CveNCaVincular, ObjContPaq, ObjBancos, ObjOS, ObjEventos, ObjCGame, ObjClientes, ObjAcum:=ObjAcum, Resp:=Retorno) + GuardarVenta(Me, ObjVentas, ObjConta, ObjInventario, ObjContr, DtDetalle, Me.CveNCaVincular, ObjContPaq, ObjBancos, ObjOS, ObjEventos, ObjCGame, ObjClientes, ObjAcum:=ObjAcum, Resp:=Retorno, Modulo:=Modulo) 'SI ES REFACTURACION Dim ObjNC As List(Of Object) = Nothing @@ -1453,10 +1453,10 @@ Namespace Modelos End If End Sub - Public Sub GuardarVenta(ByRef factura As Modelos.Factura, ByRef ObjVentas As ClsVentas, ByRef ObjConta As ClsContabilidad, ByRef ObjInventario As ClsInventarios, ByRef ObjContr As ClsContratos, ByRef TmpDTDetalle As DataTable, CveNCaVincular As Integer, ByRef objContPaqi As ClsContPAQi, Optional ByRef ObjBancos As ClsBancos = Nothing, Optional ByRef ObjOS As ClsOS = Nothing, ByRef Optional ObjEventos As ClsOIEventos = Nothing, ByRef Optional ObjCGame As ClsCGame = Nothing, ByRef Optional ObjCliente As ClsClientes = Nothing, Optional EsNotaCredito As Boolean = False, Optional ObjAcum As ClsAcumuladores = Nothing, ByRef Optional Resp As MMensajeFactura = Nothing) + Public Sub GuardarVenta(ByRef factura As Modelos.Factura, ByRef ObjVentas As ClsVentas, ByRef ObjConta As ClsContabilidad, ByRef ObjInventario As ClsInventarios, ByRef ObjContr As ClsContratos, ByRef TmpDTDetalle As DataTable, CveNCaVincular As Integer, ByRef objContPaqi As ClsContPAQi, Optional ByRef ObjBancos As ClsBancos = Nothing, Optional ByRef ObjOS As ClsOS = Nothing, ByRef Optional ObjEventos As ClsOIEventos = Nothing, ByRef Optional ObjCGame As ClsCGame = Nothing, ByRef Optional ObjCliente As ClsClientes = Nothing, Optional EsNotaCredito As Boolean = False, Optional ObjAcum As ClsAcumuladores = Nothing, ByRef Optional Resp As MMensajeFactura = Nothing, Optional Modulo As String = "Modelos/GuardarVentaM") Dim Msgok As New StringBuilder - factura.CvePrePoliza = ObjConta.AddPrePolizas("Modelos/GuardarVentaM", factura.CvePlantillaPoliza, factura.TotalTC, factura.TotalTC, factura.CveMoneda, factura.Fecha, If(factura.CveEmpresaCRM > 0, factura.EmpresaCRM, factura.Cliente.Nombre), factura.CveUsuario, factura.CveEmpresa) + factura.CvePrePoliza = ObjConta.AddPrePolizas(Modulo, factura.CvePlantillaPoliza, factura.TotalTC, factura.TotalTC, factura.CveMoneda, factura.Fecha, If(factura.CveEmpresaCRM > 0, factura.EmpresaCRM, factura.Cliente.Nombre), factura.CveUsuario, factura.CveEmpresa) Dim RFCReceptor As String = "" diff --git a/App_Code/Timbrado.vb b/App_Code/Timbrado.vb index d499f9b8b..0bcf64bbb 100644 --- a/App_Code/Timbrado.vb +++ b/App_Code/Timbrado.vb @@ -898,8 +898,8 @@ Public Class Timbrado Public Function PreparaTimbrePago(EmisorRFC As String, EmisorNombre As String, EmisorRegimenFiscal As String, ReceptorRFC As String, ReceptorNombre As String, Serie As String, Folio As String, FechaTimbrado As DateTime, - CuentaPago As String, FechaPago As DateTime, FormaPago As String, MonedaPago As String, Monto As Double, LugarExpedicion As String, - CuentaBeneficiario As String, TipoCambioP As Double, dttpagos As Data.DataTable, + CuentaPago As String, FechaPago As DateTime, FormaPago As String, MonedaPago As String, Monto As Decimal, LugarExpedicion As String, + CuentaBeneficiario As String, TipoCambioP As Decimal, dttpagos As Data.DataTable, Optional UsoCFDI As String = "P01", Optional CFDIRelacionado As String = "", Optional EsCancelacion As Boolean = False) As CFDITimbre ' validación extra para cuando es cancelación requiere el folio relacionado If EsCancelacion AndAlso CFDIRelacionado = "" Then @@ -957,7 +957,7 @@ Public Class Timbrado Dim ImporteCancelacion As Decimal = 1 Dim MonedaCancelacion As String = "MXN" - Dim TipoCambioCancelacion As Double = 1 + Dim TipoCambioCancelacion As Decimal = 1 If EsCancelacion Then MonedaPago = MonedaCancelacion 'como registra un peso por cada fatura que se cancele, se tiene que multiplicar por el numero de facturas, para que se pueda emitir el timbre If dttpagos IsNot Nothing AndAlso dttpagos.Rows.Count > 0 Then ImporteCancelacion = ImporteCancelacion * dttpagos.Rows.Count @@ -966,7 +966,7 @@ Public Class Timbrado Timbre.ComplementoPagos.FechaPago = FechaPago Timbre.ComplementoPagos.FormaDePagoP = FormaPago Timbre.ComplementoPagos.MonedaP = MonedaPago - Timbre.ComplementoPagos.Monto = If(EsCancelacion, ImporteCancelacion, Monto) + Timbre.ComplementoPagos.Monto = If(EsCancelacion, ImporteCancelacion, Monto).RoundSQL Timbre.ComplementoPagos.TipoCambioP = If(EsCancelacion, TipoCambioCancelacion, TipoCambioP) @@ -1019,6 +1019,155 @@ Public Class Timbrado If PorcentajeIEPS > 0 Then Timbre.ComplementoPagos.Impuestos.Add(New CFDIConceptosImpuestos With {.Base = VentaImportePago * PorcentajeIEPS, .TasaOCuota = PorcentajeIEPS, .Impuesto = "003"}) + 'Next + + Return Timbre + + End Function + + Public Function PreparaTimbrePago40(EmisorRFC As String, EmisorNombre As String, EmisorRegimenFiscal As String, + ReceptorRFC As String, ReceptorNombre As String, ReceptorDomicilioFiscal As String, ReceptorRegimenFiscal As String, + Serie As String, Folio As String, FechaTimbrado As DateTime, + CuentaPago As String, FechaPago As DateTime, FormaPago As String, MonedaPago As String, Monto As Decimal, LugarExpedicion As String, + CuentaBeneficiario As String, TipoCambioP As Decimal, dttpagos As Data.DataTable, dttpagosimpuestos As DataTable, + Optional UsoCFDI As String = "CP01", Optional CFDIRelacionado As String = "") As CFDITimbre + + Dim Timbre As New CFDITimbre + + Timbre.Comprobante.TipoComprobante = "P" + Timbre.Comprobante.Folio = Folio + Timbre.Comprobante.Serie = Serie + Timbre.Comprobante.Fecha = FechaTimbrado + Timbre.Comprobante.FormadePago = "" + Timbre.Comprobante.CondicionesdePago = "" + Timbre.Comprobante.MetodoPago = "" + Timbre.Comprobante.SubTotal = 0 + Timbre.Comprobante.Descuentos = 0 + Timbre.Comprobante.Moneda = "XXX" + Timbre.Comprobante.TipoCambio = "" + Timbre.Comprobante.Total = 0 + + Timbre.Comprobante.LugarExpedicion = LugarExpedicion + + Timbre.Emisor.RegimenFiscal = EmisorRegimenFiscal + Timbre.Emisor.Nombre = EmisorNombre + Timbre.Emisor.RFC = EmisorRFC + + Timbre.Receptor.RFC = ReceptorRFC + Timbre.Receptor.Nombre = ReceptorNombre + Timbre.Receptor.DomicilioFiscalReceptor = ReceptorDomicilioFiscal + Timbre.Receptor.RegimenFiscalReceptor = ReceptorRegimenFiscal + Timbre.Receptor.UsoCFDI = UsoCFDI + + If CFDIRelacionado <> "-1" And CFDIRelacionado <> "" Then + Timbre.CFDIRelacionados.TipoRelacion = "04" + Timbre.CFDIRelacionados.UUID.Add(CFDIRelacionado) + End If + + 'detalles + + Dim concepto As New CFDIConceptos With {.Cantidad = 1, + .Descripcion = "Pago", + .ValorUnitario = 0, + .Importe = 0, + .Unidad = "", + .ClaveUnidad = "ACT", + .ClaveProdServ = "84111506", + .Noidentificacion = "", + .ObjetoImpuesto = "01"} + Timbre.Conceptos.Add(concepto) + + Select Case FormaPago + Case "01" + CuentaPago = "" + CuentaBeneficiario = "" + + End Select + + Dim ImporteCancelacion As Decimal = 1 + Dim MonedaCancelacion As String = "MXN" + Dim TipoCambioCancelacion As Decimal = 1 + + 'como registra un peso por cada fatura que se cancele, se tiene que multiplicar por el numero de facturas, para que se pueda emitir el timbre + If dttpagos IsNot Nothing AndAlso dttpagos.Rows.Count > 0 Then ImporteCancelacion = ImporteCancelacion * dttpagos.Rows.Count + Timbre.ComplementoPagos.CtaOrdenante = CuentaPago + Timbre.ComplementoPagos.CtaBeneficiario = CuentaBeneficiario + Timbre.ComplementoPagos.FechaPago = FechaPago + Timbre.ComplementoPagos.FormaDePagoP = FormaPago + Timbre.ComplementoPagos.MonedaP = MonedaPago + Timbre.ComplementoPagos.Monto = Monto.RoundSQL + Timbre.ComplementoPagos.TipoCambioP = TipoCambioP + + + Dim VentaFolioFiscal, VentaSerie, VentaFolio, VentaAbreviaturaSAT, VentaMetodoPago, ObjetoImpuesto As String + Dim VentaImportePago, VentaImporteSaldoInsoluto, VentaImporteSaldoAnterior, VentaTipoCambio, PorcentajeIVA, PorcentajeIEPS As Decimal + Dim VentaNumParcialidad As Integer + + If dttpagos IsNot Nothing AndAlso dttpagos.Rows.Count > 0 Then + + For Each dr As Data.DataRow In dttpagos.Rows + VentaFolioFiscal = dr("FolioFiscal").ToString + VentaSerie = dr("VentaSerie").ToString + VentaFolio = dr("VentaFolio").ToString + VentaAbreviaturaSAT = dr("VentaAbreviaturaSAT").ToString + VentaMetodoPago = dr("MetodoPago").ToString + VentaImportePago = dr("VentaImportePagado").ToString.ToDecimal + VentaImporteSaldoInsoluto = dr("ImpSaldoInsoluto").ToString.ToDecimal + VentaImporteSaldoAnterior = dr("ImpSaldoAnterior").ToString.ToDecimal + VentaTipoCambio = dr("TipoCambio").ToString.ToDecimal + VentaNumParcialidad = dr("NumParcialidad").ToString.ToEntero + PorcentajeIVA = dr("PorcentajeIVA").ToString.ToDecimal + PorcentajeIEPS = dr("PorcentajeIEPS").ToString.ToDecimal + ObjetoImpuesto = dr("ObjetoImpuesto").ToString + ' si la moneda es igual, se omite el tipo de cambio de la venta + If MonedaPago = VentaAbreviaturaSAT Then + VentaTipoCambio = 1 + End If + + 'condiciones especiales para el pago en pesos, facturas en moneda extranjera + If MonedaPago = "MXN" AndAlso VentaAbreviaturaSAT <> "MXN" Then + VentaTipoCambio = 1 / VentaTipoCambio + End If + + ' For Each drr As Data.DataRow In DtFacturasPagadas.Rows + Dim doc As New CFDIComplementoPagosDocsRelacionados With {.IdDocumento = VentaFolioFiscal, + .Serie = VentaSerie, + .Folio = VentaFolio, + .MonedaDR = VentaAbreviaturaSAT, + .MetodoDePagoDR = VentaMetodoPago, + .ImpPagado = VentaImportePago, + .ImpSaldoInsoluto = VentaImporteSaldoInsoluto, + .ImpSaldoAnt = VentaImporteSaldoAnterior, + .TipoCambioDR = VentaTipoCambio, + .EquivalenciaDR = VentaTipoCambio, + .NumParcialidad = VentaNumParcialidad, + .ObjetoImpuesto = ObjetoImpuesto} 'If(drr("MetodoPago").ToString = "PUE", 0, drr("NumParcialidad").ToString.ToEntero)} + + For Each drp As DataRow In dttpagosimpuestos.FiltraParametros(String.Format("FolioFiscal = '{0}'", VentaFolioFiscal.ToLower)).Rows + doc.Impuestos.Add(New CFDIConceptosImpuestos With { + .TrasladooRetencion = drp("Tipo").ToString, + .Base = drp("Base").ToString.ToDecimal.RoundSQL, + .TasaOCuota = drp("PorcentajeImpuesto").ToString().ToDecimal, + .Impuesto = drp("TipoImpuesto").ToString, + .Importe = drp("Importe").ToString().ToDecimal.RoundSQL + } + ) + + Next + + Timbre.ComplementoPagos.DocumentosRelacionados.Add(doc) + + Next + + + End If + 'If drr("IVA").ToString.ToDouble > 0 Then + 'If PorcentajeIVA > 0 Then Timbre.ComplementoPagos.Impuestos.Add(New CFDIConceptosImpuestos With {.TrasladooRetencion = "T", .Base = VentaImportePago * PorcentajeIVA, .TasaOCuota = PorcentajeIVA, .Impuesto = "002"}) + 'Timbre.ComplementoPagos.Impuestos.Add(New CFDIConceptosImpuestos With {.TrasladooRetencion = "R", .Base = 0, .TasaOCuota = 0, .Impuesto = "002"}) + + 'If PorcentajeIEPS > 0 Then Timbre.ComplementoPagos.Impuestos.Add(New CFDIConceptosImpuestos With {.Base = VentaImportePago * PorcentajeIEPS, .TasaOCuota = PorcentajeIEPS, .Impuesto = "003"}) + + 'Next Return Timbre @@ -1204,7 +1353,7 @@ Public Class Timbrado For Each Ret In ObjCFDITimbre.Retenciones Dim clbImp As ClbNegBICFDv3_3.Impuesto = If(Ret.Impuesto = "002", ClbNegBICFDv3_3.Impuesto.IVA, If(Ret.Impuesto = "003", ClbNegBICFDv3_3.Impuesto.IEPS, ClbNegBICFDv3_3.Impuesto.ISR)) - Msg = CFDi.ImpuestosRetencionesCfd(clbImp, Ret.Importe.ToDecimal) + Msg = CFDi.ImpuestosRetencionesCfd(clbImp, Ret.Importe) Next If Not HasErrorRetenciones Then @@ -3551,6 +3700,10 @@ Public Class Timbrado #End Region #Region "Receptor" + If ObjCFDITimbre.Receptor.RFC.ToUpper.Contiene("XAXX010101000", "XEXX010101000") Then 'Condición del SAT. CFDI40149 + ObjCFDITimbre.Receptor.DomicilioFiscalReceptor = ObjCFDITimbre.Comprobante.LugarExpedicion + End If + comprobante.Receptor = New Profact.TimbraCFDI40.ComprobanteReceptor() comprobante.Receptor.Rfc = ObjCFDITimbre.Receptor.RFC comprobante.Receptor.Nombre = ObjCFDITimbre.Receptor.Nombre @@ -3675,7 +3828,7 @@ Public Class Timbrado For Each Ret In ObjCFDITimbre.Retenciones comprobante.Impuestos.Retenciones(w) = New Profact.TimbraCFDI40.ComprobanteImpuestosRetencion() comprobante.Impuestos.Retenciones(w).Impuesto = Ret.Impuesto - comprobante.Impuestos.Retenciones(w).Importe = Ret.Importe.ToDecimal + comprobante.Impuestos.Retenciones(w).Importe = Ret.Importe w += 1 Next @@ -3899,9 +4052,9 @@ Public Class Timbrado ComPag.Pago(0).FechaPago = ObjCFDITimbre.ComplementoPagos.FechaPago.ToString("yyyy-MM-ddTHH:mm:ss").ToDate() ComPag.Pago(0).FormaDePagoP = ObjCFDITimbre.ComplementoPagos.FormaDePagoP ComPag.Pago(0).MonedaP = ObjCFDITimbre.ComplementoPagos.MonedaP - ComPag.Pago(0).TipoCambioPSpecified = If(ObjCFDITimbre.ComplementoPagos.MonedaP = "MXN", False, True) - ComPag.Pago(0).TipoCambioP = ObjCFDITimbre.ComplementoPagos.TipoCambioP.ToDecimal - ComPag.Pago(0).Monto = ObjCFDITimbre.ComplementoPagos.Monto.ToDecimal + ComPag.Pago(0).TipoCambioPSpecified = True 'If(ObjCFDITimbre.ComplementoPagos.MonedaP = "MXN", False, True) + ComPag.Pago(0).TipoCambioP = ObjCFDITimbre.ComplementoPagos.TipoCambioP + ComPag.Pago(0).Monto = ObjCFDITimbre.ComplementoPagos.Monto If ObjCFDITimbre.ComplementoPagos.NumOperacion <> "" Then ComPag.Pago(0).NumOperacion = ObjCFDITimbre.ComplementoPagos.NumOperacion End If @@ -3936,6 +4089,30 @@ Public Class Timbrado End If If ObjCFDITimbre.ComplementoPagos.DocumentosRelacionados.Count > 0 Then + Dim Totales As New Profact.TimbraCFDI40.Complementos.Pagos20.PagosTotales() + 'Totales Generales + + Totales.MontoTotalPagos = ObjCFDITimbre.ComplementoPagos.Totales.MontoTotalPagos + + Totales.TotalTrasladosBaseIVA16 = ObjCFDITimbre.ComplementoPagos.Totales.TotalTrasladosBaseIVA16 + Totales.TotalTrasladosBaseIVA16Specified = Totales.TotalTrasladosBaseIVA16 > 0 + Totales.TotalTrasladosImpuestoIVA16 = ObjCFDITimbre.ComplementoPagos.Totales.TotalTrasladosImpuestoIVA16.RoundSQL + Totales.TotalTrasladosImpuestoIVA16Specified = Totales.TotalTrasladosBaseIVA16 > 0 + + Totales.TotalTrasladosBaseIVA8 = ObjCFDITimbre.ComplementoPagos.Totales.TotalTrasladosBaseIVA8 + Totales.TotalTrasladosBaseIVA8Specified = Totales.TotalTrasladosBaseIVA8 > 0 + Totales.TotalTrasladosImpuestoIVA8 = ObjCFDITimbre.ComplementoPagos.Totales.TotalTrasladosBaseIVA8.RoundSQL + Totales.TotalTrasladosImpuestoIVA8Specified = Totales.TotalTrasladosBaseIVA8 > 0 + + Totales.TotalTrasladosBaseIVA0 = ObjCFDITimbre.ComplementoPagos.Totales.TotalTrasladosBaseIVA0 + Totales.TotalTrasladosBaseIVA0Specified = Totales.TotalTrasladosBaseIVA0 > 0 + Totales.TotalTrasladosImpuestoIVA0 = 0 + Totales.TotalTrasladosImpuestoIVA0Specified = Totales.TotalTrasladosBaseIVA0 > 0 + + + Totales.TotalRetencionesIEPSSpecified = False + ComPag.Totales = Totales + ComPag.Pago(0).DoctoRelacionado = New Profact.TimbraCFDI40.Complementos.Pagos20.PagosPagoDoctoRelacionado(ObjCFDITimbre.ComplementoPagos.DocumentosRelacionados.Count - 1) {} Dim i As Integer For Each doc As CFDIComplementoPagosDocsRelacionados In ObjCFDITimbre.ComplementoPagos.DocumentosRelacionados @@ -3946,60 +4123,124 @@ Public Class Timbrado End If ComPag.Pago(0).DoctoRelacionado(i).Folio = doc.Folio ComPag.Pago(0).DoctoRelacionado(i).MonedaDR = doc.MonedaDR - 'ComPag.Pago(0).DoctoRelacionado(i).TipoCambioDRSpecifiedP = If(doc.TipoCambioDR = 0, False, True) - 'ComPag.Pago(0).DoctoRelacionado(i).TipoCambioDR = doc.TipoCambioDR - 'ComPag.Pago(0).DoctoRelacionado(i).MetodoDePagoDR = doc.MetodoDePagoDR ComPag.Pago(0).DoctoRelacionado(i).NumParcialidad = doc.NumParcialidad.ToString - - 'ComPag.Pago(0).DoctoRelacionado(i).ImpSaldoAntSpecified = True - ComPag.Pago(0).DoctoRelacionado(i).ImpSaldoAnt = doc.ImpSaldoAnt.ToDecimal - + ComPag.Pago(0).DoctoRelacionado(i).ImpSaldoAnt = doc.ImpSaldoAnt.RoundSQL ComPag.Pago(0).DoctoRelacionado(i).ImpPagadoSpecified = True - ComPag.Pago(0).DoctoRelacionado(i).ImpPagado = doc.ImpPagado.ToDecimal + ComPag.Pago(0).DoctoRelacionado(i).ImpPagado = doc.ImpPagado.RoundSQL + ComPag.Pago(0).DoctoRelacionado(i).ImpSaldoInsoluto = doc.ImpSaldoInsoluto.RoundSQL + ComPag.Pago(0).DoctoRelacionado(i).EquivalenciaDR = doc.EquivalenciaDR + ComPag.Pago(0).DoctoRelacionado(i).EquivalenciaDRSpecified = True + ComPag.Pago(0).DoctoRelacionado(i).ObjetoImpDR = doc.ObjetoImpuesto - 'ComPag.Pago(0).DoctoRelacionado(i).ImpSaldoInsolutoSpecified = True - ComPag.Pago(0).DoctoRelacionado(i).ImpSaldoInsoluto = doc.ImpSaldoInsoluto.ToDecimal + If doc.Impuestos IsNot Nothing Then + ComPag.Pago(0).DoctoRelacionado(i).ImpuestosDR = New Profact.TimbraCFDI40.Complementos.Pagos20.PagosPagoDoctoRelacionadoImpuestosDR + ''traslados + If (doc.Impuestos).Where(Function(x) x.TrasladooRetencion = "T").Count > 0 Then + Dim j As Integer = 0 + For Each docimp As CFDIConceptosImpuestos In doc.Impuestos.Where(Function(x) x.TrasladooRetencion = "T") + + ComPag.Pago(0).DoctoRelacionado(i).ImpuestosDR.TrasladosDR = New Profact.TimbraCFDI40.Complementos.Pagos20.PagosPagoDoctoRelacionadoImpuestosDRTrasladoDR(doc.Impuestos.Where(Function(x) x.TrasladooRetencion = "T").Count - 1) {} + If docimp.TrasladooRetencion = "T" Then + Dim Tra As New Profact.TimbraCFDI40.Complementos.Pagos20.PagosPagoDoctoRelacionadoImpuestosDRTrasladoDR + Tra.BaseDR = docimp.Base + Tra.ImporteDRSpecified = True + Tra.ImporteDR = docimp.Importe + Tra.ImpuestoDR = docimp.Impuesto + Tra.TipoFactorDR = docimp.TipoFactor + Tra.TasaOCuotaDRSpecified = True + Tra.TasaOCuotaDR = docimp.TasaOCuota + ComPag.Pago(0).DoctoRelacionado(i).ImpuestosDR.TrasladosDR(j) = Tra + End If + j += 1 + Next + End If + + ''retenciones + If (doc.Impuestos).Where(Function(x) x.TrasladooRetencion = "R").Count > 0 Then + Dim j As Integer = 0 + For Each docimp As CFDIConceptosImpuestos In doc.Impuestos.Where(Function(x) x.TrasladooRetencion = "R") + ComPag.Pago(0).DoctoRelacionado(i).ImpuestosDR.RetencionesDR = New Profact.TimbraCFDI40.Complementos.Pagos20.PagosPagoDoctoRelacionadoImpuestosDRRetencionDR(doc.Impuestos.Where(Function(x) x.TrasladooRetencion = "R").Count - 1) {} + If docimp.TrasladooRetencion = "R" Then + Dim Tra As New Profact.TimbraCFDI40.Complementos.Pagos20.PagosPagoDoctoRelacionadoImpuestosDRRetencionDR + Tra.BaseDR = docimp.Base + Tra.ImporteDR = docimp.Importe + Tra.ImpuestoDR = docimp.Impuesto + Tra.TipoFactorDR = docimp.TipoFactor + Tra.TasaOCuotaDR = docimp.TasaOCuota + ComPag.Pago(0).DoctoRelacionado(i).ImpuestosDR.RetencionesDR(j) = Tra + End If + j += 1 + Next + End If + End If i += 1 Next - 'Estos impuestos aplicarían para anticipos - If ObjCFDITimbre.ComplementoPagos.TotalImpuestosRetenidos > 0 OrElse ObjCFDITimbre.ComplementoPagos.TotalImpuestosTrasladados > 0 Then + If ObjCFDITimbre.ComplementoPagos.Traslados.Count > 0 Then + Dim x As Integer ComPag.Pago(0).ImpuestosP = New Profact.TimbraCFDI40.Complementos.Pagos20.PagosPagoImpuestosP(0) {} ComPag.Pago(0).ImpuestosP(0) = New Profact.TimbraCFDI40.Complementos.Pagos20.PagosPagoImpuestosP() - 'ComPag.Pago(0).ImpuestosP(0).TotalImpuestosRetenidosSpecifiedP = True - 'ComPag.Pago(0).ImpuestosP(0).TotalImpuestosRetenidos = ObjCFDITimbre.ComplementoPagos.TotalImpuestosRetenidos.ToDecimal - 'ComPag.Pago(0).ImpuestosP(0).TotalImpuestosTrasladadosSpecified = True - 'ComPag.Pago(0).ImpuestosP(0).TotalImpuestosTrasladados = ObjCFDITimbre.ComplementoPagos.TotalImpuestosTrasladados.ToDecimal - - If (ObjCFDITimbre.ComplementoPagos.Impuestos).Where(Function(x) x.TrasladooRetencion = "R").Count > 0 Then - Dim x As Integer - ComPag.Pago(0).ImpuestosP(0).RetencionesP = New Profact.TimbraCFDI40.Complementos.Pagos20.PagosPagoImpuestosPRetencionP((ObjCFDITimbre.ComplementoPagos.Impuestos).Where(Function(w) w.TrasladooRetencion = "R").Count - 1) {} - For Each Ret As CFDIConceptosImpuestos In (ObjCFDITimbre.ComplementoPagos.Impuestos).Where(Function(w) w.TrasladooRetencion = "R") - ComPag.Pago(0).ImpuestosP(0).RetencionesP(x) = New Profact.TimbraCFDI40.Complementos.Pagos20.PagosPagoImpuestosPRetencionP() - ComPag.Pago(0).ImpuestosP(0).RetencionesP(x).ImpuestoP = Ret.Impuesto - ComPag.Pago(0).ImpuestosP(0).RetencionesP(x).ImporteP = Ret.Importe - x += 1 - Next - End If - If (ObjCFDITimbre.ComplementoPagos.Impuestos).Where(Function(x) x.TrasladooRetencion = "T").Count > 0 Then - Dim x As Integer - ComPag.Pago(0).ImpuestosP(0).TrasladosP = New Profact.TimbraCFDI40.Complementos.Pagos20.PagosPagoImpuestosPTrasladoP((ObjCFDITimbre.ComplementoPagos.Impuestos).Where(Function(w) w.TrasladooRetencion = "T").Count - 1) {} - For Each Tra As CFDIConceptosImpuestos In (ObjCFDITimbre.ComplementoPagos.Impuestos).Where(Function(w) w.TrasladooRetencion = "T") - ComPag.Pago(0).ImpuestosP(0).TrasladosP(x) = New Profact.TimbraCFDI40.Complementos.Pagos20.PagosPagoImpuestosPTrasladoP() - ComPag.Pago(0).ImpuestosP(0).TrasladosP(x).ImpuestoP = Tra.Impuesto - ComPag.Pago(0).ImpuestosP(0).TrasladosP(x).TipoFactorP = Tra.TipoFactor - ComPag.Pago(0).ImpuestosP(0).TrasladosP(x).TasaOCuotaP = Tra.TasaOCuota - ComPag.Pago(0).ImpuestosP(0).TrasladosP(x).ImporteP = Tra.Importe - x += 1 - Next - End If + ComPag.Pago(0).ImpuestosP(0).TrasladosP = New Profact.TimbraCFDI40.Complementos.Pagos20.PagosPagoImpuestosPTrasladoP((ObjCFDITimbre.ComplementoPagos.Traslados).Count - 1) {} + For Each Tra As CFDITraslados In (ObjCFDITimbre.ComplementoPagos.Traslados) + ComPag.Pago(0).ImpuestosP(0).TrasladosP(x) = New Profact.TimbraCFDI40.Complementos.Pagos20.PagosPagoImpuestosPTrasladoP() + ComPag.Pago(0).ImpuestosP(0).TrasladosP(x).ImpuestoP = Tra.Impuesto + ComPag.Pago(0).ImpuestosP(0).TrasladosP(x).TipoFactorP = Tra.TipoFactor + ComPag.Pago(0).ImpuestosP(0).TrasladosP(x).TasaOCuotaP = Tra.TasaOCuota + ComPag.Pago(0).ImpuestosP(0).TrasladosP(x).ImporteP = Tra.Importe + ComPag.Pago(0).ImpuestosP(0).TrasladosP(x).BaseP = Tra.Base + x += 1 + Next + End If + If (ObjCFDITimbre.ComplementoPagos.Retenciones).Count > 0 Then + Dim x As Integer + If ComPag.Pago(0).ImpuestosP(0) Is Nothing Then ComPag.Pago(0).ImpuestosP = New Profact.TimbraCFDI40.Complementos.Pagos20.PagosPagoImpuestosP(0) {} + ComPag.Pago(0).ImpuestosP(0).RetencionesP = New Profact.TimbraCFDI40.Complementos.Pagos20.PagosPagoImpuestosPRetencionP((ObjCFDITimbre.ComplementoPagos.Retenciones).Count - 1) {} + For Each Ret As CFDIRetenciones In ObjCFDITimbre.ComplementoPagos.Retenciones + ComPag.Pago(0).ImpuestosP(0).RetencionesP(x) = New Profact.TimbraCFDI40.Complementos.Pagos20.PagosPagoImpuestosPRetencionP() + ComPag.Pago(0).ImpuestosP(0).RetencionesP(x).ImpuestoP = Ret.Impuesto + ComPag.Pago(0).ImpuestosP(0).RetencionesP(x).ImporteP = Ret.Importe + x += 1 + Next End If - Dim nsComp As New System.Xml.Serialization.XmlSerializerNamespaces() - nsComp.Add("pago20", "http://www.sat.gob.mx/Pagos") - Dim xmlComp As String = Profact.TimbraCFDI.XMLUtilerias.SerializaObjeto(ComPag, GetType(Profact.TimbraCFDI33.Complementos.Pagos10.Pagos), nsComp) + ''Estos impuestos aplicarían para anticipos + 'If ObjCFDITimbre.ComplementoPagos.tota > 0 OrElse ObjCFDITimbre.ComplementoPagos.TotalImpuestosTrasladados > 0 Then + ' ComPag.Pago(0).ImpuestosP = New Profact.TimbraCFDI40.Complementos.Pagos20.PagosPagoImpuestosP(0) {} + ' ComPag.Pago(0).ImpuestosP(0) = New Profact.TimbraCFDI40.Complementos.Pagos20.PagosPagoImpuestosP() + + ' If (ObjCFDITimbre.ComplementoPagos.Impuestos).Where(Function(x) x.TrasladooRetencion = "T").Count > 0 Then + ' Dim x As Integer + ' ComPag.Pago(0).ImpuestosP(0).TrasladosP = New Profact.TimbraCFDI40.Complementos.Pagos20.PagosPagoImpuestosPTrasladoP((ObjCFDITimbre.ComplementoPagos.Impuestos).Where(Function(w) w.TrasladooRetencion = "T").Count - 1) {} + ' For Each Tra As CFDIConceptosImpuestos In (ObjCFDITimbre.ComplementoPagos.Impuestos).Where(Function(w) w.TrasladooRetencion = "T") + ' ComPag.Pago(0).ImpuestosP(0).TrasladosP(x) = New Profact.TimbraCFDI40.Complementos.Pagos20.PagosPagoImpuestosPTrasladoP() + ' ComPag.Pago(0).ImpuestosP(0).TrasladosP(x).ImpuestoP = Tra.Impuesto + ' ComPag.Pago(0).ImpuestosP(0).TrasladosP(x).TipoFactorP = Tra.TipoFactor + ' ComPag.Pago(0).ImpuestosP(0).TrasladosP(x).TasaOCuotaP = Tra.TasaOCuota + ' ComPag.Pago(0).ImpuestosP(0).TrasladosP(x).ImporteP = Tra.Importe + ' x += 1 + ' Next + ' End If + + ' If (ObjCFDITimbre.ComplementoPagos.Impuestos).Where(Function(x) x.TrasladooRetencion = "R").Count > 0 Then + ' Dim x As Integer + ' ComPag.Pago(0).ImpuestosP(0).RetencionesP = New Profact.TimbraCFDI40.Complementos.Pagos20.PagosPagoImpuestosPRetencionP((ObjCFDITimbre.ComplementoPagos.Impuestos).Where(Function(w) w.TrasladooRetencion = "R").Count - 1) {} + ' For Each Ret As CFDIConceptosImpuestos In (ObjCFDITimbre.ComplementoPagos.Impuestos).Where(Function(w) w.TrasladooRetencion = "R") + ' ComPag.Pago(0).ImpuestosP(0).RetencionesP(x) = New Profact.TimbraCFDI40.Complementos.Pagos20.PagosPagoImpuestosPRetencionP() + ' ComPag.Pago(0).ImpuestosP(0).RetencionesP(x).ImpuestoP = Ret.Impuesto + ' ComPag.Pago(0).ImpuestosP(0).RetencionesP(x).ImporteP = Ret.Importe + ' x += 1 + ' Next + ' End If + + + 'End If + + + Dim nsComp As New System.Xml.Serialization.XmlSerializerNamespaces() + nsComp.Add("pago20", "http://www.sat.gob.mx/Pagos20") + Dim xmlComp As String = Profact.TimbraCFDI.XMLUtilerias.SerializaObjeto(ComPag, GetType(Profact.TimbraCFDI40.Complementos.Pagos20.Pagos), nsComp) Dim docComp As New XmlDocument() docComp.LoadXml(xmlComp) 'comprobante.PagosSpecified = True @@ -4638,7 +4879,6 @@ Public Class Timbrado If FolioFiscal <> "" Then resultadoTimbre.GuardaXml(RutaArchivo, NombreArchivoXML) - If ObjCFDITimbre.Comprobante.TipoComprobante <> "P" Then 'Actualiza Estatus Factura @@ -4732,6 +4972,7 @@ Public Class Timbrado End If End If + resultadoTimbre.GuardaXml(RutaArchivo, NombreArchivoXML) Catch ex As Exception Retorno = ex.ToString() End Try @@ -4790,6 +5031,9 @@ Public Class Timbrado #End Region #Region "Receptor" + If ObjCFDITimbre.Receptor.RFC.ToUpper.Contiene("XAXX010101000", "XEXX010101000") Then 'Condición del SAT. CFDI40149 + ObjCFDITimbre.Receptor.DomicilioFiscalReceptor = ObjCFDITimbre.Comprobante.LugarExpedicion + End If cfdi.Receptor(ObjCFDITimbre.Receptor.RFC, ObjCFDITimbre.Receptor.Nombre, ObjCFDITimbre.Receptor.DomicilioFiscalReceptor, ObjCFDITimbre.Receptor.ResidenciaFiscal, ObjCFDITimbre.Receptor.NumeroRegistroTributario, ObjCFDITimbre.Receptor.RegimenFiscalReceptor, ObjCFDITimbre.Receptor.UsoCFDI) @@ -5046,7 +5290,19 @@ Public Class Timbrado If ObjCFDITimbre.Comprobante.TipoComprobante = "P" Then - cfdi.Pago(ObjCFDITimbre.ComplementoPagos.FechaPago.ToString("yyyy-MM-ddTHH:mm:ss"), + cfdi.Pago20Totales(ObjCFDITimbre.ComplementoPagos.Totales.TotalRetencionesIVA, + ObjCFDITimbre.ComplementoPagos.Totales.TotalRetencionesISR, + ObjCFDITimbre.ComplementoPagos.Totales.TotalRetencionesIEPS, + ObjCFDITimbre.ComplementoPagos.Totales.TotalTrasladosBaseIVA16, + ObjCFDITimbre.ComplementoPagos.Totales.TotalTrasladosImpuestoIVA16, + ObjCFDITimbre.ComplementoPagos.Totales.TotalTrasladosBaseIVA8, + ObjCFDITimbre.ComplementoPagos.Totales.TotalTrasladosImpuestoIVA8, + ObjCFDITimbre.ComplementoPagos.Totales.TotalTrasladosBaseIVA0, + ObjCFDITimbre.ComplementoPagos.Totales.TotalTrasladosImpuestoIVA0, + ObjCFDITimbre.ComplementoPagos.Totales.TotalTrasladosBaseExento, + ObjCFDITimbre.ComplementoPagos.Totales.MontoTotalPagos) + + cfdi.Pago20(ObjCFDITimbre.ComplementoPagos.FechaPago.ToString("yyyy-MM-ddTHH:mm:ss"), ObjCFDITimbre.ComplementoPagos.FormaDePagoP, ObjCFDITimbre.ComplementoPagos.MonedaP, ObjCFDITimbre.ComplementoPagos.TipoCambioP, @@ -5067,40 +5323,57 @@ Public Class Timbrado For Each doc As CFDIComplementoPagosDocsRelacionados In ObjCFDITimbre.ComplementoPagos.DocumentosRelacionados - cfdi.PagoDoctoRelacionado(doc.IdDocumento, + cfdi.Pago20DoctoRelacionado(doc.IdDocumento, doc.Serie, doc.Folio, doc.MonedaDR, doc.TipoCambioDR, - doc.MetodoDePagoDR, doc.NumParcialidad, doc.ImpSaldoAnt, doc.ImpPagado, - doc.ImpSaldoInsoluto) + doc.ImpSaldoInsoluto, + doc.ObjetoImpuesto) + If doc.Impuestos IsNot Nothing Then + + ''traslados + If (doc.Impuestos).Where(Function(x) x.TrasladooRetencion = "T").Count > 0 Then + Dim j As Integer = 0 + For Each docimp As CFDIConceptosImpuestos In doc.Impuestos.Where(Function(x) x.TrasladooRetencion = "T") + + If docimp.TrasladooRetencion = "T" Then + cfdi.Pago20TrasladoDR(docimp.Base, docimp.Impuesto, docimp.TipoFactor, docimp.TasaOCuota, docimp.Importe) + End If + j += 1 + Next + End If + + ''retenciones + If (doc.Impuestos).Where(Function(x) x.TrasladooRetencion = "R").Count > 0 Then + Dim j As Integer = 0 + For Each docimp As CFDIConceptosImpuestos In doc.Impuestos.Where(Function(x) x.TrasladooRetencion = "R") + If docimp.TrasladooRetencion = "R" Then + cfdi.Pago20RetencionDR(docimp.Base, docimp.Impuesto, docimp.TipoFactor, docimp.TasaOCuota, docimp.Importe) + End If + j += 1 + Next + End If + End If Next - 'Estos impuestos aplicarían para anticipos - If ObjCFDITimbre.ComplementoPagos.TotalImpuestosRetenidos > 0 OrElse ObjCFDITimbre.ComplementoPagos.TotalImpuestosTrasladados > 0 Then - - cfdi.PagoImpuestos(ObjCFDITimbre.ComplementoPagos.TotalImpuestosRetenidos, ObjCFDITimbre.ComplementoPagos.TotalImpuestosTrasladados) - If (ObjCFDITimbre.ComplementoPagos.Impuestos).Where(Function(x) x.TrasladooRetencion = "R").Count > 0 Then - For Each Ret As CFDIConceptosImpuestos In (ObjCFDITimbre.ComplementoPagos.Impuestos).Where(Function(x) x.TrasladooRetencion = "R") - cfdi.PagoRetencion(Ret.Impuesto, Ret.Importe) - Next - End If - If (ObjCFDITimbre.ComplementoPagos.Impuestos).Where(Function(x) x.TrasladooRetencion = "T").Count > 0 Then - For Each Tra As CFDIConceptosImpuestos In (ObjCFDITimbre.ComplementoPagos.Impuestos).Where(Function(x) x.TrasladooRetencion = "T") - cfdi.PagoTraslado(Tra.Impuesto, Tra.TipoFactor, Tra.TasaOCuota, Tra.Importe) - Next - End If + If ObjCFDITimbre.ComplementoPagos.Traslados.Count > 0 Then + For Each Tra As CFDITraslados In (ObjCFDITimbre.ComplementoPagos.Traslados) + cfdi.Pago20TrasladoP(Tra.Base, Tra.Impuesto, Tra.TipoFactor, Tra.TasaOCuota, Tra.Importe) + Next End If - - + If (ObjCFDITimbre.ComplementoPagos.Retenciones).Count > 0 Then + For Each Ret As CFDIRetenciones In ObjCFDITimbre.ComplementoPagos.Retenciones + cfdi.Pago20RetencionP(Ret.Impuesto, Ret.Importe) + Next + End If End If - End If #End Region @@ -6036,7 +6309,7 @@ Public Class Timbrado For Each Ret In ObjCFDITimbre.Retenciones comprobante.Impuestos.Retenciones(w) = New Profact.TimbraCFDI33.ComprobanteImpuestosRetencion() comprobante.Impuestos.Retenciones(w).Impuesto = Ret.Impuesto - comprobante.Impuestos.Retenciones(w).Importe = Ret.Importe.ToDecimal + comprobante.Impuestos.Retenciones(w).Importe = Ret.Importe w += 1 Next @@ -6260,8 +6533,8 @@ Public Class Timbrado ComPag.Pago(0).FormaDePagoP = ObjCFDITimbre.ComplementoPagos.FormaDePagoP ComPag.Pago(0).MonedaP = ObjCFDITimbre.ComplementoPagos.MonedaP ComPag.Pago(0).TipoCambioPSpecified = If(ObjCFDITimbre.ComplementoPagos.MonedaP = "MXN", False, True) - ComPag.Pago(0).TipoCambioP = ObjCFDITimbre.ComplementoPagos.TipoCambioP.ToDecimal - ComPag.Pago(0).Monto = ObjCFDITimbre.ComplementoPagos.Monto.ToDecimal + ComPag.Pago(0).TipoCambioP = ObjCFDITimbre.ComplementoPagos.TipoCambioP + ComPag.Pago(0).Monto = ObjCFDITimbre.ComplementoPagos.Monto If ObjCFDITimbre.ComplementoPagos.NumOperacion <> "" Then ComPag.Pago(0).NumOperacion = ObjCFDITimbre.ComplementoPagos.NumOperacion End If @@ -6312,13 +6585,13 @@ Public Class Timbrado ComPag.Pago(0).DoctoRelacionado(i).NumParcialidad = doc.NumParcialidad.ToString ComPag.Pago(0).DoctoRelacionado(i).ImpSaldoAntSpecified = True - ComPag.Pago(0).DoctoRelacionado(i).ImpSaldoAnt = doc.ImpSaldoAnt.ToDecimal + ComPag.Pago(0).DoctoRelacionado(i).ImpSaldoAnt = doc.ImpSaldoAnt ComPag.Pago(0).DoctoRelacionado(i).ImpPagadoSpecified = True - ComPag.Pago(0).DoctoRelacionado(i).ImpPagado = doc.ImpPagado.ToDecimal + ComPag.Pago(0).DoctoRelacionado(i).ImpPagado = doc.ImpPagado ComPag.Pago(0).DoctoRelacionado(i).ImpSaldoInsolutoSpecified = True - ComPag.Pago(0).DoctoRelacionado(i).ImpSaldoInsoluto = doc.ImpSaldoInsoluto.ToDecimal + ComPag.Pago(0).DoctoRelacionado(i).ImpSaldoInsoluto = doc.ImpSaldoInsoluto i += 1 Next @@ -6327,9 +6600,9 @@ Public Class Timbrado ComPag.Pago(0).Impuestos = New Profact.TimbraCFDI33.Complementos.Pagos10.PagosPagoImpuestos(0) {} ComPag.Pago(0).Impuestos(0) = New Profact.TimbraCFDI33.Complementos.Pagos10.PagosPagoImpuestos() ComPag.Pago(0).Impuestos(0).TotalImpuestosRetenidosSpecified = True - ComPag.Pago(0).Impuestos(0).TotalImpuestosRetenidos = ObjCFDITimbre.ComplementoPagos.TotalImpuestosRetenidos.ToDecimal + ComPag.Pago(0).Impuestos(0).TotalImpuestosRetenidos = ObjCFDITimbre.ComplementoPagos.TotalImpuestosRetenidos ComPag.Pago(0).Impuestos(0).TotalImpuestosTrasladadosSpecified = True - ComPag.Pago(0).Impuestos(0).TotalImpuestosTrasladados = ObjCFDITimbre.ComplementoPagos.TotalImpuestosTrasladados.ToDecimal + ComPag.Pago(0).Impuestos(0).TotalImpuestosTrasladados = ObjCFDITimbre.ComplementoPagos.TotalImpuestosTrasladados If (ObjCFDITimbre.ComplementoPagos.Impuestos).Where(Function(x) x.TrasladooRetencion = "R").Count > 0 Then Dim x As Integer diff --git a/Bancos/IE.aspx.vb b/Bancos/IE.aspx.vb index ae4c77908..7f21b8479 100644 --- a/Bancos/IE.aspx.vb +++ b/Bancos/IE.aspx.vb @@ -2622,7 +2622,7 @@ Partial Class Bancos_IE If Request("Opcion") IsNot Nothing AndAlso Request("Opcion").ToString = "ANTC" Then If CveCliente > 0 Then - CveConceptoCompra = 3 'Clientes + CveConceptoCompra = 66 'Clientes CveConceptoContable = 30 'Bancos CvePlantillaPoliza = 12 End If diff --git a/Bancos/PagoAcreedor.aspx b/Bancos/PagoAcreedor.aspx index 7905f115d..aac7ecfc0 100644 --- a/Bancos/PagoAcreedor.aspx +++ b/Bancos/PagoAcreedor.aspx @@ -101,7 +101,7 @@
- +
@@ -664,7 +664,7 @@ if (textBoxes[i].id.indexOf('C_Tab_TabPago_GvMovAcreedor_TxtComision') >= 0) { if (textBoxes[i].value != '') { - Comision = parseFloat(Comision) + parseFloat(textBoxes[i].value.split(',').join('')); + Comision = parseFloat(Comision) + ToDouble(textBoxes[i].value); } } @@ -673,16 +673,15 @@ idd = textBoxes[i].id.replace('C_Tab_TabPago_GvMovAcreedor_TxtAbonar_', ''); Facturas = Facturas + (Importe == 0 ? '' : ', ') + $get("C_Tab_TabPago_GvMovAcreedor_HplF_" + idd).innerText; if (CveMoneda == 2 && CveMonedaPago == 1) { - Importe = parseFloat(Importe) + (parseFloat($get('TxtTCPago').value) * parseFloat(textBoxes[i].value.split(',').join(''))); + Importe = parseFloat(Importe) + (parseFloat($get('TxtTCPago').value) * ToDouble(textBoxes[i].value)); } else if (CveMoneda == 1 && CveMonedaPago == 2) { - Importe = parseFloat(Importe) + (parseFloat($get('TxtTCPago').value) / parseFloat(textBoxes[i].value.split(',').join(''))); + Importe = parseFloat(Importe) + (ToDouble(textBoxes[i].value) / ToDouble($get('TxtTCPago').value)); } else if ((CveMoneda == 1 && CveMonedaPago == 1) || (CveMoneda == 2 && CveMonedaPago == 2)) { - Importe = parseFloat(Importe) + parseFloat(textBoxes[i].value.split(',').join('')); - } + Importe = parseFloat(Importe) + ToDouble(textBoxes[i].value); + } } } } - } if (!Facturas == '') { diff --git a/Bancos/PagoAcreedor.aspx.cs b/Bancos/PagoAcreedor.aspx.cs index 56fa5710f..9ec719505 100644 --- a/Bancos/PagoAcreedor.aspx.cs +++ b/Bancos/PagoAcreedor.aspx.cs @@ -277,7 +277,7 @@ public partial class Bancos_PagoAcreedor : ClsPaginas int CveConceptoContablePrestamoComplementario = 202; int CvePlantillaPoliza = 21; int CvePrePoliza = 0; - int CveMoneda = get_GlobalDTBancosCuentas(-1, CveEmpresa: UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveMoneda", $"CveEmpresa = {UsuarioActual.CveEmpresa} AND CveCuenta = {DdlCuenta.SelectedValue.ToEntero()}").ToEntero(); + int CveMonedaPago = get_GlobalDTBancosCuentas(-1, CveEmpresa: UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveMoneda", $"CveEmpresa = {UsuarioActual.CveEmpresa} AND CveCuenta = {DdlCuenta.SelectedValue.ToEntero()}").ToEntero(); int FolioFijo = 0; int IDPoliza = 0; StringBuilder Msg = new StringBuilder(); @@ -300,7 +300,7 @@ public partial class Bancos_PagoAcreedor : ClsPaginas // DATOS PREPOLIZA if ( DdlTipoTransaccion.SelectedValue == "1" && UsuarioActual.CveEmpresa != 119) FolioFijo = TxtFolio.Text.ToEntero(); - CvePrePoliza = ObjMov.AddPrePolizas("Bancos/IE PAGO ACRREDORES", CvePlantillaPoliza, TxtImporte.Text.Trim().ToDouble(), TxtImporte.Text.Trim().ToDouble(), CveMoneda, TxtFechaDocumento.Text.ToDate(), DdlProveedores.SelectedText.ToString(), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, FolioFijo: FolioFijo, ReglaFolioPoliza: ObjComp.ObtenerReglaFolio(DdlTipoTransaccion.SelectedValue, null, UsuarioActual.CveEmpresa), CveTipoPoliza: ObjMov.ObtenerTipoPoliza(DdlTipoTransaccion.SelectedValue, "-1", UsuarioActual.CveEmpresa)); + CvePrePoliza = ObjMov.AddPrePolizas("Bancos/IE PAGO ACRREDORES", CvePlantillaPoliza, TxtImporte.Text.Trim().ToDouble(), TxtImporte.Text.Trim().ToDouble(), CveMonedaPago, TxtFechaDocumento.Text.ToDate(), DdlProveedores.SelectedText.ToString(), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, FolioFijo: FolioFijo, ReglaFolioPoliza: ObjComp.ObtenerReglaFolio(DdlTipoTransaccion.SelectedValue, null, UsuarioActual.CveEmpresa), CveTipoPoliza: ObjMov.ObtenerTipoPoliza(DdlTipoTransaccion.SelectedValue, "-1", UsuarioActual.CveEmpresa)); if (CvePrePoliza > 0) { @@ -311,7 +311,7 @@ public partial class Bancos_PagoAcreedor : ClsPaginas string Conc = TxtObservaciones.Text == "" ? TxtFolio.Text : TxtObservaciones.Text; string Ref = TxtObservaciones.Text == "" ? TxtFolio.Text : TxtObservaciones.Text; - CveIE = ObjIE.AddBancos_IE(DdlCuenta.SelectedValue.ToEntero(), DdlTipoTransaccion.SelectedValue.ToEntero(), TxtFechaDocumento.Text.Trim().ToDate(), TxtFolio.Text.Trim(), DdlProveedores.SelectedText.ToString(), ImporteBanco.ToString().ToDouble(), CveMoneda, + CveIE = ObjIE.AddBancos_IE(DdlCuenta.SelectedValue.ToEntero(), DdlTipoTransaccion.SelectedValue.ToEntero(), TxtFechaDocumento.Text.Trim().ToDate(), TxtFolio.Text.Trim(), DdlProveedores.SelectedText.ToString(), ImporteBanco.ToString().ToDouble(), CveMonedaPago, TCPago.ToString().ToDouble(), TxtObservaciones.Text.Trim(), "", ChkAbonoCuenta.Checked, false, -1, CvePrePoliza, Comprobante, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa); @@ -327,6 +327,7 @@ public partial class Bancos_PagoAcreedor : ClsPaginas decimal ImporteMN; decimal ImporteComision; decimal ImporteComisionMN; + decimal AcumImporteMN = 0; bool TipoMovtoComision = false; int IdCtaContableOtrosGastos = 0; @@ -364,18 +365,18 @@ public partial class Bancos_PagoAcreedor : ClsPaginas if (gvr.FCCheckBox("Chk").Checked) { int tCveMoneda = gvr.DataKey("CveMoneda").ToEntero(); - if (CveMoneda == 1 && tCveMoneda == 1) + if (CveMonedaPago == 1 && tCveMoneda == 1) { ImporteMN = Importe; ImporteComisionMN = ImporteComision; } - else if (CveMoneda == 1 && tCveMoneda == 2) + else if (CveMonedaPago == 1 && tCveMoneda == 2) { ImporteComisionMN = ImporteComision; if (UsaComplementaria) { ImporteMN = Importe; - ImporteComplementaria = Importe * TC - Importe; + ImporteComplementaria = (Importe * TC - Importe).RoundSQL(); } else { @@ -383,33 +384,32 @@ public partial class Bancos_PagoAcreedor : ClsPaginas ImporteComplementaria = 0; } } - else if (CveMoneda == 2 && tCveMoneda == 1) + else if (CveMonedaPago == 2 && tCveMoneda == 1) { ImporteMN = Importe; ImporteComisionMN = ImporteComision; } - else if (CveMoneda == 2 && tCveMoneda == 2) + else if (CveMonedaPago == 2 && tCveMoneda == 2) { ImporteComisionMN = ImporteComision; if (UsaComplementaria) { ImporteMN = Importe; - ImporteComplementaria = Importe * TC - Importe; + ImporteComplementaria = (Importe * TC - Importe).RoundSQL(); } else { - ImporteMN = Importe * TC; + ImporteMN = (Importe * TC).RoundSQL(); ImporteComplementaria = 0; } } - ImporteMN = Math.Round(ImporteMN, 2, MidpointRounding.AwayFromZero); - ImporteComplementaria = Math.Round(ImporteComplementaria, 2, MidpointRounding.AwayFromZero); - ImporteComisionMN = Math.Round(ImporteComisionMN, 2, MidpointRounding.AwayFromZero); - ImporteComision = Math.Round(ImporteComision, 2, MidpointRounding.AwayFromZero); - - + ImporteMN = ImporteMN.RoundSQL(); + ImporteComplementaria = ImporteComplementaria.RoundSQL(); + ImporteComisionMN = ImporteComisionMN.RoundSQL(); + ImporteComision = ImporteComision.RoundSQL(); + AcumImporteMN += ImporteMN; if (tCveMoneda != 1) { @@ -477,18 +477,19 @@ public partial class Bancos_PagoAcreedor : ClsPaginas } - if (CveMoneda != 1) + if (CveMonedaPago != 1) { if (UsaComplementaria) { ImporteMNBanco = ImporteBanco; - ImporteComplementaria = ImporteBanco * TCPago - ImporteBanco; + ImporteComplementaria = (ImporteBanco * TCPago - ImporteBanco).RoundSQL(); } else { - ImporteMNBanco = ImporteBanco * TCPago; + ImporteMNBanco = (ImporteBanco * TCPago).RoundSQL(); ImporteComplementaria = 0; - } + } + } if (!ObjMov.AddPrePolizasDetalle(CvePrePoliza, true, ImporteBanco, Ref, CveConceptoContableBanco, Conc, DateTime.Now, IDCtaContableBancos, -1, CveIE, CveProveedor: DdlProveedores.SelectedValue.ToEntero(), ImporteMX: ImporteMNBanco, ImporteME: ImporteBanco, TipoCambio: TCPago, TipoCambioPago: TCPago, CveSubProyecto: DdlSubProyecto.SelectedValue.ToEntero())) @@ -496,12 +497,30 @@ public partial class Bancos_PagoAcreedor : ClsPaginas MsgError = "No se pudo insertar concepto de bancos"; } - if (CveMoneda != 1 && UsaComplementaria) + if (CveMonedaPago != 1 && UsaComplementaria) { if (!ObjMov.AddPrePolizasDetalle(CvePrePoliza, true, ImporteBanco, Ref, CveConceptoContableBancoComplementario, Conc, DateTime.Now, IDCtaContableBancosComplementario, -1, CveIE, CveProveedor: DdlProveedores.SelectedValue.ToEntero(), ImporteMX: ImporteComplementaria, ImporteME: ImporteBanco, TipoCambio: TCPago, TipoCambioPago: TCPago, CveSubProyecto: DdlSubProyecto.SelectedValue.ToEntero())) { MsgError = "No se pudo insertar concepto de bancos complementaria"; } + if (AcumImporteMN!=(ImporteBanco + ImporteComplementaria)) { + int tCveConceptoOtIngresos = 0; + bool TipoMovtoOt = false; + decimal Dif = AcumImporteMN - (ImporteBanco + ImporteComplementaria); + if (Dif < 0) + { + tCveConceptoOtIngresos = 211; TipoMovtoOt = false; + } + else + { + tCveConceptoOtIngresos = 78; TipoMovtoOt = true; + } + + if (!ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovtoOt, Dif.Abs(), Ref, tCveConceptoOtIngresos, Conc, DateTime.Now, 0, -1, CveIE, CveProveedor: DdlProveedores.SelectedValue.ToEntero(), ImporteMX: Dif.Abs(), ImporteME: Dif.Abs(), TipoCambio: TCPago, TipoCambioPago: TCPago, CveSubProyecto: DdlSubProyecto.SelectedValue.ToEntero())) + { + MsgError = "No se pudo insertar concepto de ajuste en redondeo"; + } + } } } @@ -556,7 +575,8 @@ public partial class Bancos_PagoAcreedor : ClsPaginas { if (Msg.ToString().Equals("")) { - Msg.Append("El Documento se guardo correctamente"); + Msg.AppendFormat("El Documento se guardo correctamente. Folio {1}
", CveIE, ObjIE.Folio); + } System.IO.FileInfo archivo = null; diff --git a/Bancos/Transferencias.aspx b/Bancos/Transferencias.aspx index 97258648e..f54a0a1ee 100644 --- a/Bancos/Transferencias.aspx +++ b/Bancos/Transferencias.aspx @@ -124,6 +124,11 @@ + + Paguese + + + Observaciones: diff --git a/Bancos/Transferencias.aspx.vb b/Bancos/Transferencias.aspx.vb index 1cdd89b8e..adcf61749 100644 --- a/Bancos/Transferencias.aspx.vb +++ b/Bancos/Transferencias.aspx.vb @@ -283,6 +283,14 @@ Partial Class Bancos_Transferencias CveIE = ObjIE.AddBancos_IE(DdlCuentaDestino.SelectedValue.ToEntero, DdlTipoMovto.SelectedValue.ToEntero, TxtFechaDocumento.Text.Trim.ToDate, TxtFolio.Text.Trim, CuentaDestino, ImporteMXOrigen, CveMonedaOrigen, TipoCambio, Observaciones, "", False, False, -1, CvePrePoliza, Comprobante, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) CveIEDestino = CveIE Else + If UsuarioActual.Empresa.Funcionalidad(558) = "1" Then + FolioDestino = TxtFolio.Text.Trim + If TxtPaguese.Text.Trim <> "" Then + CuentaDestino = TxtPaguese.Text.Trim + End If + + End If + CveIE = ObjIE.AddBancos_IE(DdlCuentaOrigen.SelectedValue.ToEntero, DdlTipoMovto.SelectedValue.ToEntero, TxtFechaDocumento.Text.Trim.ToDate, TxtFolio.Text.Trim, CuentaDestino, TxtImporte.Text.Trim.ToDouble, CveMonedaOrigen, TipoCambio, TxtObservaciones.Text.Trim, "", False, False, -1, CvePrePoliza, Comprobante, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) CveIEDestino = ObjIE.AddBancos_IE(DdlCuentaDestino.SelectedValue.ToEntero, If(DdlTipoMovto.SelectedValue = "2", 8, 3), TxtFechaDocumento.Text.Trim.ToDate, FolioDestino, String.Format("Transferencia Cta: {0}", DdlCuentaOrigen.SelectedItem.Text), ImporteDestino, CveMonedaDestino, TipoCambio, TxtObservaciones.Text.Trim, "", False, False, -1, CvePrePoliza, Comprobante, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) End If diff --git a/Bin/GoCfdi.dll b/Bin/GoCfdi.dll index 84f2dafe4..c94459330 100644 Binary files a/Bin/GoCfdi.dll and b/Bin/GoCfdi.dll differ diff --git a/Contabilidad/FiltraPolizas.aspx b/Contabilidad/FiltraPolizas.aspx index 9718d46b2..155ba2d57 100644 --- a/Contabilidad/FiltraPolizas.aspx +++ b/Contabilidad/FiltraPolizas.aspx @@ -21,8 +21,7 @@
  • Paquete Egresos
  • - - + @@ -71,7 +70,7 @@
    - +
    diff --git a/Contabilidad/FiltraPolizas.aspx.vb b/Contabilidad/FiltraPolizas.aspx.vb index 08d83a34f..b1477c7c3 100644 --- a/Contabilidad/FiltraPolizas.aspx.vb +++ b/Contabilidad/FiltraPolizas.aspx.vb @@ -45,14 +45,8 @@ Partial Class Contabilidad_FiltraPolizas Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load - - If Not Page.IsPostBack Then - - ContabilidadSIG = UsuarioActual.Empresa.UsaContabilidadSIG - - ViewState("Orden") = "" DdlPeriodo.SelectedValue = Now.Month.ToString TxtFechaICredito.Text = Now.FirstDayOfMonth.ToShortDateString @@ -87,9 +81,6 @@ Partial Class Contabilidad_FiltraPolizas Dim Ejercicio As Integer = DdlEjercicio.SelectedValue.ToString().ToEntero() Dim Periodo As Integer = DdlPeriodo.SelectedValue.ToString().ToEntero() - - - If ContabilidadSIG Then Dim ObjConta As New ClsContabilidad @@ -103,7 +94,6 @@ Partial Class Contabilidad_FiltraPolizas ObjConta.Dispose() - Else Dim ObjConta As New ClsContPAQi(UsuarioActual.Empresa) @@ -125,8 +115,6 @@ Partial Class Contabilidad_FiltraPolizas End If - - Gv.DataBind() UpDatos.Update() End Sub @@ -151,7 +139,6 @@ Partial Class Contabilidad_FiltraPolizas End If - DdlSegmentoNeg.DataBind() DdlSegmentoNeg.Items.Insert(0, New ListItem("Todos", "-1")) @@ -183,7 +170,6 @@ Partial Class Contabilidad_FiltraPolizas End If - DdlEjercicio.DataBind() DdlEjercicio.SelectedValueExist(UsuarioActual.Empresa.EjercicioActual.ToString) @@ -621,11 +607,12 @@ Partial Class Contabilidad_FiltraPolizas e.Row.Cells(2).Text = $"{e.Row.DataKey("Folio")}" e.Row.Cells(6).Text = $"" + Else + e.Row.Cells(2).Text = $"{e.Row.DataKey("Folio")}" + e.Row.Cells(6).Text = $"" End If - - End If End Sub diff --git a/Contabilidad/PolizasImpresion.aspx.vb b/Contabilidad/PolizasImpresion.aspx.vb index 900c7af9d..ad1f7f81f 100644 --- a/Contabilidad/PolizasImpresion.aspx.vb +++ b/Contabilidad/PolizasImpresion.aspx.vb @@ -9,8 +9,6 @@ Imports Microsoft.Reporting.WebForms Partial Class Contabilidad_PolizasImpresion Inherits ClsPaginas - - Public Property ContabilidadSIG As Boolean Get If ViewState("ContabilidadSIG") Is Nothing Then @@ -53,26 +51,22 @@ Partial Class Contabilidad_PolizasImpresion CargaCuentas() End If - - End If End Sub Private Sub BtnConsultar_click(sender As Object, args As EventArgs) Handles BtnConsultar.Click If ContabilidadSIG Then - ConsultaSIIG() + ConsultaSIG() Else ConsultaCONTPAQi() End If End Sub +#Region "SIG" - -#Region "SIIG" - - Private Sub ConsultaSIIG() + Private Sub ConsultaSIG() Dim foli As Integer = -1 Dim folf As Integer = -1 @@ -129,9 +123,7 @@ Partial Class Contabilidad_PolizasImpresion End Sub - - - Private Sub cargaddlpolizasSIG() + Private Sub CargaDdlPolizasSIG() Dim objcont As New ClsContabilidad If objcont.GetTiposPoliza(-1, "-1", UsuarioActual.CveEmpresa) Then ddlTipoPoliza.DataSource = objcont.DtResultados @@ -159,8 +151,6 @@ Partial Class Contabilidad_PolizasImpresion DdlCuenta.DataValueField = "CveCuenta" DdlCuenta.DataTextField = "CtaCodigo" - - Dim objconta As New ClsContabilidad If objconta.GetCuentas(-1, "-1", -1, UsuarioActual.CveEmpresa) Then DdlCuenta.DataSource = objconta.DtResultados @@ -276,7 +266,4 @@ Partial Class Contabilidad_PolizasImpresion #End Region - - - End Class diff --git a/Contabilidad/RepOrigenAplicacion.aspx b/Contabilidad/RepOrigenAplicacion.aspx index a5a43cbde..5e47e1b03 100644 --- a/Contabilidad/RepOrigenAplicacion.aspx +++ b/Contabilidad/RepOrigenAplicacion.aspx @@ -1,6 +1,16 @@ <%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="RepOrigenAplicacion.aspx.vb" Inherits="Contabilidad_RepOrigenAplicacion" %> + + +
  • + +
  • +
    + + + +
    @@ -233,6 +243,22 @@ + + + + + + + + + + + + + + + + diff --git a/Contabilidad/RepOrigenAplicacion.aspx.vb b/Contabilidad/RepOrigenAplicacion.aspx.vb index 8da89fb33..857ac42b4 100644 --- a/Contabilidad/RepOrigenAplicacion.aspx.vb +++ b/Contabilidad/RepOrigenAplicacion.aspx.vb @@ -81,6 +81,16 @@ Partial Class Contabilidad_RepOrigenAplicacion TabContainer_ActiveTabChanged(TabContainer, EventArgs.Empty) + + If UsuarioActual.Empresa.UsaContabilidadSIG Then + + TabMensual.Enabled = False + TabAnual.Enabled = False + TdFI.Visible = False + tdTipoReporte.Visible = False + + End If + End If End Sub @@ -139,23 +149,62 @@ Partial Class Contabilidad_RepOrigenAplicacion #Region " NORMAL " Private Sub CargaDatos() - Dim ObjConta As New ClsContPAQi(UsuarioActual.Empresa) - Dim FechaInicio = If(TxtFechaDel.Text = "" Or TxtFechaDel.Text = "__/__/____", Date.Now, TxtFechaDel.Text.ToDate) - Dim FechaFin = If(TxtFechaAl.Text = "" Or TxtFechaAl.Text = "__/__/____", Date.Now, TxtFechaAl.Text.ToDate) - If ObjConta.GetOrigenAplicacion(FechaInicio, FechaFin) Then - DtDatos = ObjConta.DtResultados + LnkExcel.Visible = False + + + + + If UsuarioActual.Empresa.UsaContabilidadSIG Then + + Dim AnioActual As Integer = TxtFechaAl.Text.ToDate.Year + Dim AnioAnteior As Integer = AnioActual - 1 + + + GvDatos.Columns(1).Visible = True + GvDatos.Columns(2).Visible = True + + GvDatos.Columns(1).HeaderText = AnioAnteior.ToString + GvDatos.Columns(2).HeaderText = AnioActual.ToString + + Dim ObjConta As New ClsContabilidad + + If ObjConta.GetRepOrigenAplicacion(TxtFechaAl.Text.ToDate, UsuarioActual.CveEmpresa) Then + GvDatos.DataSource = ObjConta.DtResultados + + If ObjConta.DtResultados.Rows.Count > 0 Then + LnkExcel.Visible = True + End If + Else + GvDatos.DataSource = Nothing + End If + ObjConta.Dispose() + GvDatos.DataBind() + Else - DtDatos = Nothing - Alert("Ocurrio un error al cargar los datos de origen y aplicación", TipoMensaje.MsgError) - End If - ObjConta.Dispose() + + Dim ObjConta As New ClsContPAQi(UsuarioActual.Empresa) + + Dim FechaInicio = If(TxtFechaDel.Text = "" Or TxtFechaDel.Text = "__/__/____", Date.Now, TxtFechaDel.Text.ToDate) + Dim FechaFin = If(TxtFechaAl.Text = "" Or TxtFechaAl.Text = "__/__/____", Date.Now, TxtFechaAl.Text.ToDate) + + If ObjConta.GetOrigenAplicacion(FechaInicio, FechaFin) Then + DtDatos = ObjConta.DtResultados - If DtDatos IsNot Nothing Then - CargaGrid() + Else + DtDatos = Nothing + Alert("Ocurrio un error al cargar los datos de origen y aplicación", TipoMensaje.MsgError) + End If + ObjConta.Dispose() + + + If DtDatos IsNot Nothing Then + CargaGrid() + End If End If + End Sub Private Sub CargaGrid() @@ -334,4 +383,7 @@ Partial Class Contabilidad_RepOrigenAplicacion #End Region + Protected Sub LnkExcel_Click(sender As Object, e As EventArgs) + GvDatos.ExportToExcel2("RepOrigenAplicacion.xlsx") + End Sub End Class diff --git a/Contabilidad2/PolizasImpresion.aspx b/Contabilidad2/PolizasImpresion.aspx deleted file mode 100644 index 7664693c0..000000000 --- a/Contabilidad2/PolizasImpresion.aspx +++ /dev/null @@ -1,116 +0,0 @@ -<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="PolizasImpresion.aspx.vb" Inherits="Contabilidad2_PolizasImpresion" %> - - - - - - - - - - - - - -
    -
    -
    - -
    -
    -
    - -
    - -
    - - - - - - - - - - -
    -
    - -
    - -
    - - - - - - - - - - -
    -
    - -
    - -
    -
    -
    -
    -
    - -
    - -
    - -
    - -
    - -
    - -
    - -
    - -
    - -
    -
    - -
    - -
    - -
    - -
    - - - - - - - -
    - - -
    - - - - - -
    - -
    - -
    -
    -
    - -
    - - - diff --git a/Contabilidad2/PolizasImpresion.aspx.vb b/Contabilidad2/PolizasImpresion.aspx.vb deleted file mode 100644 index 1260c2550..000000000 --- a/Contabilidad2/PolizasImpresion.aspx.vb +++ /dev/null @@ -1,111 +0,0 @@ -Option Explicit On -Option Strict On - -Imports System.Data -Imports Extensiones -Imports System.Activities.Statements -Imports Microsoft.Reporting.WebForms - -Partial Class Contabilidad2_PolizasImpresion - Inherits ClsPaginas - - - Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.LoadComplete - If Not IsPostBack Then - TxtFechaInicio.Text = Now.AddDays(-1).ToShortDateString - TxtFechaFin.Text = Now.ToShortDateString - - DdlUsuarioRegistro.DataSource = GlobalDTUsuarios(CveEmpresa:=UsuarioActual.CveEmpresa) - DdlUsuarioRegistro.DataBind() - cargaddlpolizas() - CargaSubProyectos() - CargaCuentas() - End If - End Sub - Private Sub BtnConsultar_click(sender As Object, args As EventArgs) Handles BtnConsultar.Click - Dim foli As Integer = -1 - Dim folf As Integer = -1 - If Not FolioInicio.Text = "" Then - foli = FolioInicio.Text.ToEntero() - End If - If Not FolioFin.Text = "" Then - folf = FolioFin.Text.ToEntero() - End If - - Dim ArchivoReporte As String = "Empresas/Grales/Formatos/Polizas.rdlc" - - If IO.File.Exists(String.Format("{0}Formatos/Polizas.rdlc", UsuarioActual.Empresa.Ruta)) Then - ArchivoReporte = String.Format("{0}Formatos/Polizas.rdlc", UsuarioActual.Empresa.Ruta) - End If - - Dim ObjConta As New ClsContabilidad - If ObjConta.GetPrePolizasImpresion(UsuarioActual.CveEmpresa, TxtFechaInicio.Text.ToDate, TxtFechaFin.Text.ToDate, CveTipoPoliza:=ddlTipoPoliza.SelectedValue.ToEntero, FolioI:=foli, - FolioF:=folf, CveUsuario:=DdlUsuarioRegistro.SelectedValue.ToEntero, CveSubProyecto:=DdlSubProyectos.SelectedValue.ToEntero, - CveCuenta:=DdlCuenta.SelectedValue.ToEntero, CvePlantillaPoliza:=DdlGrupoPlantilla.SelectedValue.ToEntero, - CveTipoProveedor:=DdlTipoProveedor.SelectedValue.ToEntero) Then - If ObjConta.DtResultados.Rows.Count < 10000 Then - - If ObjConta.DtResultados.Rows.Count > 0 Then - Dim dr As DataRow - dr = ObjConta.DtResultados.Rows(0) - Dim params As New List(Of ReportParameter) - params.Add(New ReportParameter("Empresa", UsuarioActual.Empresa.Empresa)) - params.Add(New ReportParameter("TipoPoliza", dr("TipoPoliza").ToString)) - params.Add(New ReportParameter("Finicio", TxtFechaInicio.Text)) - params.Add(New ReportParameter("FFin", TxtFechaFin.Text)) - params.Add(New ReportParameter("Fecha", dr("Fecha").ToString.ToDate.ToShortDateString)) - 'params.Add(New ReportParameter("Nombre", dr("Cuenta").ToString)) - 'params.Add(New ReportParameter("Cuenta", dr("Codigo").ToString)) - params.Add(New ReportParameter("Numero", dr("Folio").ToString)) - params.Add(New ReportParameter("Moneda", "")) - params.Add(New ReportParameter("CodigoPostal", "")) - - If UsuarioActual.CveEmpresa = 119 Then - params.Add(New ReportParameter("UsuarioRegistro", dr("NombreUsuario").ToString)) - End If - - ImprimirPDF(ArchivoReporte, ObjConta.DtResultados, params) - - Else - Alert("Los Filtros Actuales no contienen datos") - End If - - Else - Alert("Los Filtros Actuales contienen muchos datos") - End If - End If - ObjConta.Dispose() - - End Sub - Private Sub cargaddlpolizas() - Dim objcont As New ClsContabilidad - If objcont.GetTiposPoliza(-1, "-1", UsuarioActual.CveEmpresa) Then - ddlTipoPoliza.DataSource = objcont.DtResultados - ddlTipoPoliza.DataBind() - ddlTipoPoliza.Items.Insert(0, New ListItem("Todos", "-1")) - - End If - objcont.Dispose() - DdlUsuarioRegistro.Items.Insert(0, New ListItem("Todos", "-1")) - End Sub - - Private Sub CargaSubProyectos() - DdlSubProyectos.DataSource = GlobalDTSubProyectos(UsuarioActual.CveEmpresa) - DdlSubProyectos.DataBind() - DdlSubProyectos.Items.Insert(0, New ListItem("Todos", "-1")) - DdlSubProyectos.Items.Insert(1, New ListItem("Sin Asignar", "-2")) - End Sub - - Private Sub CargaCuentas() - - Dim objconta As New ClsContabilidad - If objconta.GetCuentas(-1, "-1", -1, UsuarioActual.CveEmpresa) Then - DdlCuenta.DataSource = objconta.DtResultados - End If - objconta.Dispose() - DdlCuenta.DataBind() - - DdlCuenta.Items.Insert(0, New ListItem("Todos", "-1")) - End Sub - -End Class diff --git a/Documentacion/TableroMaterialidad.aspx b/Documentacion/TableroMaterialidad.aspx index b5874d606..69fbb1c06 100644 --- a/Documentacion/TableroMaterialidad.aspx +++ b/Documentacion/TableroMaterialidad.aspx @@ -1,92 +1,19 @@ <%@ Page Title="" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeFile="TableroMaterialidad.aspx.cs" Inherits="Documentacion_TableroMaterialidad" %> - + - - + - - Materialidad + - + - - - - -
  • - -
  • -
  • - Cargar Doctos - <%--Cargar Doctos--%> -
  • -
  • - Cargar XML PDF - <%--Cargar XML PDF--%> -
  • -
  • Enviar
  • -
    -
    + - + - - - + +
    @@ -98,13 +25,18 @@
    +
    Cliente:
    +
    + +
    Año:
    - +
    +
    MES:
    +
    -
    Mes:
    -
    @@ -130,707 +62,121 @@
    - - -
    - - - - - - - - - - - - - - <%-- class='Modulo5' - - - - - - - - - --%> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    Cliente><%# DataBinder.Eval(Container.DataItem, "Documentacion") %>
    <%# String.Format("{0:dd/MM/yyyy} - {1:dd/MM/yyyy}", DataBinder.Eval(Container.DataItem, "InicioPeriodo"), DataBinder.Eval(Container.DataItem, "FinPeriodo")) %> <%# DataBinder.Eval(Container.DataItem, "Antiguedad") %> <%# DataBinder.Eval(Container.DataItem, "DiasVacaciones") %> <%# DataBinder.Eval(Container.DataItem, "Dias") %> <%# DataBinder.Eval(Container.DataItem, "DiasDisfrutados") %> <%# DataBinder.Eval(Container.DataItem, "DiasPrima") %>
    XML TimbradosPDF Timbrados - - - - - - -
    <%# string.Format("{1}",DataBinder.Eval(Container.DataItem, "CveCliente"),DataBinder.Eval(Container.DataItem, "NombreComercial")) %><%# - DataBinder.Eval( ((RepeaterItem)Container.Parent.Parent).DataItem ,string.Format("V_{0}",DataBinder.Eval(Container.DataItem, "CveDocumentacion"))).ToString() =="-1" ? "N/A": - string.Format("{0}", - (DataBinder.Eval( ((RepeaterItem)Container.Parent.Parent).DataItem ,string.Format("V_{0}",DataBinder.Eval(Container.DataItem, "CveDocumentacion"))).ToString() =="0"? - - - "No": - - - "Si") - - ,DataBinder.Eval(Container.DataItem, "CveDocumentacion"),DataBinder.Eval(((RepeaterItem)Container.Parent.Parent).DataItem, "CveCliente") - ,DataBinder.Eval(Container.DataItem, "Documentacion"),DataBinder.Eval(((RepeaterItem)Container.Parent.Parent).DataItem, "NombreComercial") - ) - - - %> - <%# string.Format("{1}/{0}",DataBinder.Eval(Container.DataItem, "Personal"),DataBinder.Eval(Container.DataItem, "PersonalXML"),DataBinder.Eval(Container.DataItem, "CveCliente"),anio,mes) %> - - <%# string.Format("{1}/{0}",DataBinder.Eval(Container.DataItem, "Personal"),DataBinder.Eval(Container.DataItem, "PersonalPDF"),DataBinder.Eval(Container.DataItem, "CveCliente"),anio,mes) %> - - - <%-- <%# string.Format("Enviar",DataBinder.Eval(Container.DataItem, "CveCliente"),anio,mes) %>--%> -
    - -
    +
    -
    - - Historial de envio +
    + + Materialidad informacion del periodo
    +
    + +
    +
    +
    +
    +
    +
    + +
    -
    - - - - - - - - - - - - - - - - - - - - - - -
    -
    - - - - - -