update many things i dont remember whats things but reading all files i concluse this comit have many changes
This commit is contained in:
10
ADSUtilService-borrar/ADSTimbrado/ADSSLib2.cs
Normal file
10
ADSUtilService-borrar/ADSTimbrado/ADSSLib2.cs
Normal file
@@ -0,0 +1,10 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace ADSTimbradoLibreria
|
||||
{
|
||||
class ADSSLib2
|
||||
{
|
||||
}
|
||||
}
|
||||
37
ADSUtilService-borrar/ADSTimbrado/ADSTimbrado.csproj
Normal file
37
ADSUtilService-borrar/ADSTimbrado/ADSTimbrado.csproj
Normal file
@@ -0,0 +1,37 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netstandard2.0</TargetFramework>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Reference Include="ClbNegBICFDv3">
|
||||
<HintPath>Dlls\ClbNegBICFDv3.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="ClbNegBICFDv3_2">
|
||||
<HintPath>Dlls\ClbNegBICFDv3_2.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="ClbNegBICFDv3_3">
|
||||
<HintPath>Dlls\ClbNegBICFDv3_3.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="clbNegCFDi">
|
||||
<HintPath>Dlls\clbNegCFDi.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="ClbUtiBIInform">
|
||||
<HintPath>Dlls\ClbUtiBIInform.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="GoCfdi">
|
||||
<HintPath>Dlls\GoCfdi.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Profact.TimbraCFDI">
|
||||
<HintPath>Dlls\Profact.TimbraCFDI.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="RVCFDI">
|
||||
<HintPath>Dlls\RVCFDI.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="RVCFDI33">
|
||||
<HintPath>Dlls\RVCFDI33.dll</HintPath>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
604
ADSUtilService-borrar/ADSTimbrado/CFDITimbre.cs
Normal file
604
ADSUtilService-borrar/ADSTimbrado/CFDITimbre.cs
Normal file
@@ -0,0 +1,604 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace ADSTimbrado
|
||||
{
|
||||
|
||||
[Serializable]
|
||||
public class CFDITimbre
|
||||
{
|
||||
private StringBuilder StrMsg;
|
||||
public CFDIComprobante Comprobante { get; set; }
|
||||
public CFDIRelacionados CFDIRelacionados { get; set; }
|
||||
public CFDIEmisor Emisor { get; set; }
|
||||
public CFDIReceptor Receptor { get; set; }
|
||||
public List<CFDIConceptos> Conceptos { get; set; }
|
||||
public List<CFDIRetencionesLocales> RetencionesLocales { get; set; }
|
||||
public List<CFDITrasladosLocales> TrasladosLocales { get; set; }
|
||||
public CFDINomina Nomina { get; set; }
|
||||
public CFDIComplementoPagos ComplementoPagos { get; set; }
|
||||
public CFDIComplementos Complementos { get; set; }
|
||||
public decimal TotalImpuestosRetenidos
|
||||
{
|
||||
get
|
||||
{
|
||||
return (from c in Conceptos
|
||||
select c.Impuestos.Where(ret => ret.TrasladooRetencion == "R").Sum(ret => ret.Importe)).Sum();
|
||||
}
|
||||
}
|
||||
|
||||
public decimal TotalImpuestosTrasladados
|
||||
{
|
||||
get
|
||||
{
|
||||
return (from c in Conceptos
|
||||
select c.Impuestos.Where(tra => tra.TrasladooRetencion == "T").Sum(tra => tra.Importe)).Sum();
|
||||
}
|
||||
}
|
||||
|
||||
public List<CFDIRetenciones> Retenciones
|
||||
{
|
||||
get
|
||||
{
|
||||
List<CFDIRetenciones> tRetorno = new List<CFDIRetenciones>();
|
||||
List<CFDIRetenciones> TRetenciones = new List<CFDIRetenciones>();
|
||||
// Dim RetencionIVA As Decimal = 0
|
||||
// Dim RetencionIEPS As Decimal = 0
|
||||
// Dim RetencionISR As Decimal = 0
|
||||
foreach (CFDIConceptos c in Conceptos)
|
||||
{
|
||||
foreach (CFDIConceptosImpuestos imp in c.Impuestos)
|
||||
{
|
||||
if (imp.TrasladooRetencion == "R")
|
||||
tRetorno.Add(new CFDIRetenciones() { Impuesto = imp.Impuesto, Importe = imp.Importe });
|
||||
}
|
||||
}
|
||||
if (tRetorno.Count > 0)
|
||||
TRetenciones = tRetorno.GroupBy(t => new { t.Impuesto })
|
||||
.Select(t => new CFDIRetenciones() { Impuesto = t.Key.Impuesto, Importe = t.Sum(tt => tt.Importe) })
|
||||
.OrderBy(x => x.Impuesto).ToList();
|
||||
// If RetencionISR > 0 Then Retorno.Add(New CFDIRetenciones With {.Impuesto = "001", .Importe = RetencionISR})
|
||||
// if RetencionIVA > 0 Then Retorno.Add(New CFDIRetenciones With {.Impuesto = "002", .Importe = RetencionIVA})
|
||||
// If RetencionIEPS > 0 Then Retorno.Add(New CFDIRetenciones With {.Impuesto = "003", .Importe = RetencionIEPS})
|
||||
tRetorno = null;
|
||||
return TRetenciones;
|
||||
}
|
||||
}
|
||||
|
||||
public List<CFDITraslados> Traslados
|
||||
{
|
||||
get
|
||||
{
|
||||
List<CFDITraslados> tRetorno = new List<CFDITraslados>();
|
||||
List<CFDITraslados> TTraslados = new List<CFDITraslados>();
|
||||
foreach (CFDIConceptos c in Conceptos)
|
||||
{
|
||||
foreach (CFDIConceptosImpuestos imp in c.Impuestos)
|
||||
{
|
||||
if (imp.TrasladooRetencion == "T")
|
||||
tRetorno.Add(new CFDITraslados() { Impuesto = imp.Impuesto, Importe = imp.Importe, TasaOCuota = imp.TasaOCuota, TipoFactor = imp.TipoFactor });
|
||||
}
|
||||
}
|
||||
// ya generado todos los registros posibles, los agrupo y los sumo
|
||||
if (tRetorno.Count > 0)
|
||||
TTraslados = tRetorno.GroupBy(t => new { t.TipoFactor, t.Impuesto, t.TasaOCuota })
|
||||
.Select(t => new CFDITraslados() { Impuesto = t.Key.Impuesto, TipoFactor = t.Key.TipoFactor, TasaOCuota = t.Key.TasaOCuota, Importe = t.Sum(tt => tt.Importe) })
|
||||
.OrderBy(x => x.Impuesto).ToList();
|
||||
tRetorno = null;
|
||||
return TTraslados;
|
||||
}
|
||||
}
|
||||
public string Mensaje
|
||||
{
|
||||
get
|
||||
{
|
||||
return StrMsg.ToString();
|
||||
}
|
||||
}
|
||||
public CFDITimbre()
|
||||
{
|
||||
StrMsg = new StringBuilder();
|
||||
Comprobante = new CFDIComprobante();
|
||||
CFDIRelacionados = new CFDIRelacionados();
|
||||
Conceptos = new List<CFDIConceptos>();
|
||||
Emisor = new CFDIEmisor();
|
||||
Receptor = new CFDIReceptor();
|
||||
RetencionesLocales = new List<CFDIRetencionesLocales>();
|
||||
TrasladosLocales = new List<CFDITrasladosLocales>();
|
||||
ComplementoPagos = new CFDIComplementoPagos();
|
||||
Complementos = new CFDIComplementos();
|
||||
}
|
||||
|
||||
public void AddMsg(string Msg)
|
||||
{
|
||||
StrMsg.AppendLine(Msg);
|
||||
}
|
||||
}
|
||||
|
||||
[Serializable]
|
||||
public class CFDINomina
|
||||
{
|
||||
|
||||
public bool Contiene(int Valor, params int[] Valores)
|
||||
{
|
||||
return Array.IndexOf(Valores, Valor) >= 0;
|
||||
}
|
||||
public bool Contiene(string Valor, params string[] Valores)
|
||||
{
|
||||
return Array.IndexOf(Valores, Valor) >= 0;
|
||||
}
|
||||
public string Version { get; set; }
|
||||
public string TipoNomina { get; set; }
|
||||
public DateTime FechaPago { get; set; }
|
||||
public string FechaInicio { get; set; }
|
||||
public string FechaFin { get; set; }
|
||||
public int NumDiasPagados { get; set; }
|
||||
public CFDINominaReceptor Receptor { get; set; }
|
||||
public List<CFDINominaPercepciones> Percepciones { get; set; }
|
||||
public List<CFDINominaDeducciones> Deducciones { get; set; }
|
||||
public List<CFDINominaIncapacidades> Incapacidades { get; set; }
|
||||
public List<CFDINominaOtrosPagos> OtrosPagos { get; set; }
|
||||
public List<CFDINominaHorasExtras> HorasExtras { get; set; }
|
||||
public int CveNomina { get; set; }
|
||||
|
||||
public decimal TotalPercepciones
|
||||
{
|
||||
get
|
||||
{
|
||||
return TotalSueldos + TotalIndemnizacion + TotalJubilacion;
|
||||
}
|
||||
}
|
||||
|
||||
public decimal TotalDeducciones
|
||||
{
|
||||
get
|
||||
{
|
||||
return Math.Round(TotalDeduccionesOtras + TotalDeduccionesImpuestosRetenidos, 2);
|
||||
}
|
||||
}
|
||||
|
||||
public decimal TotalOtrosPagos
|
||||
{
|
||||
get
|
||||
{
|
||||
return OtrosPagos.Sum(item => item.Importe);
|
||||
}
|
||||
}
|
||||
public decimal TotalSueldos
|
||||
{
|
||||
get
|
||||
{
|
||||
return Percepciones.Where(per => !Contiene(per.TipoPercepcion, new string[] { "022", "023", "025", "039", "044" })).Sum(per => per.ImporteGravado + per.ImporteExento);
|
||||
}
|
||||
}
|
||||
public decimal TotalIndemnizacion
|
||||
{
|
||||
get
|
||||
{
|
||||
return Percepciones.Where(per => Contiene(per.TipoPercepcion, new string[] { "022", "023", "025" })).Sum(per => per.ImporteGravado + per.ImporteExento);
|
||||
}
|
||||
}
|
||||
|
||||
public decimal TotalJubilacion
|
||||
{
|
||||
get
|
||||
{
|
||||
return Percepciones.Where(per => Contiene(per.TipoPercepcion, new string[] { "039", "044" })).Sum(per => per.ImporteGravado + per.ImporteExento);
|
||||
}
|
||||
}
|
||||
public decimal TotalPercepcionesGravado
|
||||
{
|
||||
get
|
||||
{
|
||||
// nota especificar claves
|
||||
return Percepciones.Sum(item => item.ImporteGravado);
|
||||
}
|
||||
}
|
||||
public decimal TotalPercepcionesExento
|
||||
{
|
||||
get
|
||||
{
|
||||
// nota especificar claves
|
||||
return Percepciones.Sum(item => item.ImporteExento);
|
||||
}
|
||||
}
|
||||
|
||||
public decimal TotalDeduccionesOtras
|
||||
{
|
||||
get
|
||||
{
|
||||
// DEDUCCIONES SE LE QUITAN LOS CENTAVOS
|
||||
return Math.Round(Deducciones.Where(ded => !Contiene(ded.TipoDeduccion, new string[] { "002" })).Sum(ded => ded.Importe), 2);
|
||||
}
|
||||
}
|
||||
|
||||
public decimal TotalDeduccionesImpuestosRetenidos
|
||||
{
|
||||
get
|
||||
{
|
||||
// nota especificar claves
|
||||
return Math.Round(Deducciones.Where(ded => Contiene(ded.TipoDeduccion, new string[] { "002" })).Sum(ded => ded.Importe), 2);
|
||||
}
|
||||
}
|
||||
|
||||
public CFDINomina()
|
||||
{
|
||||
Receptor = new CFDINominaReceptor();
|
||||
Percepciones = new List<CFDINominaPercepciones>();
|
||||
Deducciones = new List<CFDINominaDeducciones>();
|
||||
Incapacidades = new List<CFDINominaIncapacidades>();
|
||||
OtrosPagos = new List<CFDINominaOtrosPagos>();
|
||||
HorasExtras = new List<CFDINominaHorasExtras>();
|
||||
}
|
||||
}
|
||||
|
||||
[Serializable]
|
||||
public class CFDIComprobante
|
||||
{
|
||||
public string Version { get; set; }
|
||||
public string Serie { get; set; } = "";
|
||||
public string Folio { get; set; } = "";
|
||||
public string SerieFolio
|
||||
{
|
||||
get
|
||||
{
|
||||
// sino tiene serie no pone el guión
|
||||
return Serie == "" ? Folio : $"{Serie}-{Folio}";
|
||||
}
|
||||
}
|
||||
public string TipoDocto { get; set; }
|
||||
public string FormadePago { get; set; }
|
||||
public string CondicionesdePago { get; set; }
|
||||
public DateTime Fecha { get; set; }
|
||||
public decimal Subtotal { get; set; } = 0;
|
||||
public decimal Descuentos { get; set; } = 0;
|
||||
public string MotivoDescuento { get; set; } = "";
|
||||
public string TipoCambio { get; set; } = "1";
|
||||
public string Moneda { get; set; } = "";
|
||||
public string TipoComprobante { get; set; } = "";
|
||||
public string MetodoPago { get; set; } = "";
|
||||
public decimal Total { get; set; } = 0;
|
||||
public string LugarExpedicion { get; set; } = "";
|
||||
public string NumCuentaPago { get; set; } = "";
|
||||
public string Confirmacion { get; set; } = "";
|
||||
}
|
||||
|
||||
[Serializable]
|
||||
public class CFDIComplementos
|
||||
{
|
||||
public CFDIComercioExterior11 ComercioExterior11 { get; set; }
|
||||
|
||||
public CFDIComplementos()
|
||||
{
|
||||
ComercioExterior11 = new CFDIComercioExterior11();
|
||||
}
|
||||
}
|
||||
|
||||
[Serializable]
|
||||
public class CFDIRelacionados
|
||||
{
|
||||
public string TipoRelacion { get; set; }
|
||||
public string TipoRelacionTexto { get; set; }
|
||||
public List<string> UUID { get; set; }
|
||||
public CFDIRelacionados()
|
||||
{
|
||||
UUID = new List<string>();
|
||||
}
|
||||
}
|
||||
|
||||
[Serializable]
|
||||
public class CFDIEmisor
|
||||
{
|
||||
public string RFC { get; set; }
|
||||
public string Nombre { get; set; }
|
||||
public string RegimenFiscal { get; set; }
|
||||
public string RegistroPatronal { get; set; }
|
||||
public string CURP { get; set; } = "";
|
||||
}
|
||||
|
||||
[Serializable]
|
||||
public class CFDIReceptor
|
||||
{
|
||||
public string RFC { get; set; }
|
||||
public string Nombre { get; set; }
|
||||
public string ResidenciaFiscal { get; set; } = "";
|
||||
public string NumeroRegistroTributario { get; set; } = "";
|
||||
public string UsoCFDI { get; set; }
|
||||
}
|
||||
|
||||
[Serializable]
|
||||
public class CFDINominaReceptor
|
||||
{
|
||||
public string CURP { get; set; } = "";
|
||||
public string NSS { get; set; } = "";
|
||||
public string RegimenFiscal { get; set; } = "";
|
||||
public string FechaInicioContrato { get; set; } = "";
|
||||
public string Antiguedad { get; set; } = "";
|
||||
public string TipoContrato { get; set; } = "";
|
||||
public string Sindicalizado { get; set; } = "";
|
||||
public string CodigoTipoJornada { get; set; } = "";
|
||||
public string CodigoRegimenContratacion { get; set; } = "";
|
||||
public string CodigoEmpleado { get; set; } = "";
|
||||
public string Departamento { get; set; } = "";
|
||||
public string Puesto { get; set; } = "";
|
||||
public string CodigoRiesgoPuesto { get; set; } = "";
|
||||
public string TipoPeriodo { get; set; } = "";
|
||||
public string CodigoBanco { get; set; } = "";
|
||||
public string NumeroCuenta { get; set; } = "";
|
||||
public decimal SDI { get; set; } = 0;
|
||||
public decimal SBC { get; set; } = 0;
|
||||
public string CodigoEntidadFederativa { get; set; } = "";
|
||||
}
|
||||
|
||||
[Serializable]
|
||||
public class CFDIConceptos
|
||||
{
|
||||
public decimal Cantidad { get; set; } = 0.00M;
|
||||
public string Unidad { get; set; } = "";
|
||||
public string Noidentificacion { get; set; } = "";
|
||||
public string Descripcion { get; set; } = "";
|
||||
public decimal ValorUnitario { get; set; } = 0.00M;
|
||||
public decimal Importe { get; set; } = 0.00M;
|
||||
public string CuentaPredial { get; set; } = "";
|
||||
public string ClaveProdServ { get; set; } = "";
|
||||
public string ClaveUnidad { get; set; } = "";
|
||||
public List<CFDIConceptosImpuestos> Impuestos { get; set; }
|
||||
public decimal Descuento { get; set; } = 0.00M;
|
||||
public decimal ImporteGravaIVAAdicional { get; set; } = 0.00M; // caso IEPS
|
||||
|
||||
public CFDIConceptos()
|
||||
{
|
||||
Impuestos = new List<CFDIConceptosImpuestos>();
|
||||
}
|
||||
}
|
||||
|
||||
[Serializable]
|
||||
public class CFDIConceptosImpuestos
|
||||
{
|
||||
public string TrasladooRetencion { get; set; } = "T";
|
||||
public decimal Base { get; set; } = 0.00M;
|
||||
public string Impuesto { get; set; } = "";
|
||||
public string TipoFactor { get; set; } = "Tasa";
|
||||
public decimal TasaOCuota { get; set; } = 0.00M;
|
||||
public decimal Importe { get; set; } = 0.00M; // propiedad utilizada solo para hacer ajustes, por default toma la multiplicación de base * tasa
|
||||
}
|
||||
|
||||
[Serializable]
|
||||
public class CFDINominaPercepciones
|
||||
{
|
||||
public string TipoPercepcion { get; set; }
|
||||
public string Clave { get; set; }
|
||||
public string Concepto { get; set; }
|
||||
public decimal ImporteGravado { get; set; }
|
||||
public decimal ImporteExento { get; set; }
|
||||
}
|
||||
|
||||
[Serializable]
|
||||
public class CFDINominaDeducciones
|
||||
{
|
||||
public string TipoDeduccion { get; set; }
|
||||
public string Clave { get; set; }
|
||||
public string Concepto { get; set; }
|
||||
public decimal Importe { get; set; }
|
||||
}
|
||||
|
||||
[Serializable]
|
||||
public class CFDINominaIncapacidades
|
||||
{
|
||||
public string DiasIncapacidad { get; set; }
|
||||
public string TipoIncapacidad { get; set; }
|
||||
public decimal Importe { get; set; }
|
||||
}
|
||||
|
||||
[Serializable]
|
||||
public class CFDINominaOtrosPagos
|
||||
{
|
||||
public string TipoOtroPago { get; set; }
|
||||
public string Clave { get; set; }
|
||||
public string Concepto { get; set; }
|
||||
public decimal Importe { get; set; }
|
||||
}
|
||||
|
||||
[Serializable]
|
||||
public class CFDIRetenciones
|
||||
{
|
||||
public string Impuesto { get; set; }
|
||||
public decimal Importe { get; set; }
|
||||
}
|
||||
|
||||
[Serializable]
|
||||
public class CFDIRetencionesLocales
|
||||
{
|
||||
public string ImpuestoLocalRetenido { get; set; }
|
||||
public decimal TasaRetencion { get; set; }
|
||||
public decimal Importe { get; set; }
|
||||
}
|
||||
|
||||
[Serializable]
|
||||
public class CFDITrasladosLocales
|
||||
{
|
||||
public string ImpuestoLocalTraslado { get; set; }
|
||||
public decimal TasaTraslado { get; set; }
|
||||
public decimal Importe { get; set; }
|
||||
}
|
||||
|
||||
[Serializable]
|
||||
public class CFDITraslados
|
||||
{
|
||||
public string Impuesto { get; set; }
|
||||
public decimal Tasa { get; set; }
|
||||
public string TipoFactor { get; set; }
|
||||
public decimal TasaOCuota { get; set; }
|
||||
public decimal Importe { get; set; }
|
||||
}
|
||||
|
||||
[Serializable]
|
||||
public class CFDINominaHorasExtras
|
||||
{
|
||||
public string Dias { get; set; }
|
||||
public string TipoHoras { get; set; }
|
||||
public int HorasExtra { get; set; }
|
||||
public decimal ImportePagado { get; set; }
|
||||
}
|
||||
|
||||
[Serializable]
|
||||
public class CFDIComplementoPagos
|
||||
{
|
||||
public DateTime FechaPago { get; set; }
|
||||
public string FormaDePagoP { get; set; } = "";
|
||||
public string MonedaP { get; set; } = "";
|
||||
public string NumOperacion { get; set; } = "";
|
||||
public decimal TipoCambioP { get; set; } = 0;
|
||||
public decimal Monto { get; set; }
|
||||
public string RfcEmisorCtaOrd { get; set; } = "";
|
||||
public string NomBancoOrdExt { get; set; } = "";
|
||||
public string CtaOrdenante { get; set; } = "";
|
||||
public string RfcEmisorCtaBen { get; set; } = "";
|
||||
public string CtaBeneficiario { get; set; } = "";
|
||||
public string TipoCadPago { get; set; } = "";
|
||||
public string CertPago { get; set; } = "";
|
||||
public string CadPago { get; set; } = "";
|
||||
public string SelloPago { get; set; } = "";
|
||||
public List<CFDIComplementoPagosDocsRelacionados> DocumentosRelacionados { get; set; }
|
||||
public List<CFDIConceptosImpuestos> Impuestos { get; set; }
|
||||
|
||||
public decimal TotalImpuestosRetenidos
|
||||
{
|
||||
get
|
||||
{
|
||||
return (from c in Impuestos
|
||||
where c.TrasladooRetencion == "R"
|
||||
select c.Importe).Sum();
|
||||
}
|
||||
}
|
||||
|
||||
public decimal TotalImpuestosTrasladados
|
||||
{
|
||||
get
|
||||
{
|
||||
return (from c in Impuestos
|
||||
where c.TrasladooRetencion == "T"
|
||||
select c.Importe).Sum();
|
||||
}
|
||||
}
|
||||
|
||||
public CFDIComplementoPagos()
|
||||
{
|
||||
DocumentosRelacionados = new List<CFDIComplementoPagosDocsRelacionados>();
|
||||
Impuestos = new List<CFDIConceptosImpuestos>();
|
||||
}
|
||||
}
|
||||
|
||||
[Serializable]
|
||||
public class CFDIComplementoPagosDocsRelacionados
|
||||
{
|
||||
public string IdDocumento { get; set; } = "";
|
||||
public string Serie { get; set; } = "";
|
||||
public string Folio { get; set; } = "";
|
||||
public string MonedaDR { get; set; } = "";
|
||||
public string MetodoDePagoDR { get; set; } = "";
|
||||
public decimal TipoCambioDR { get; set; }
|
||||
public int NumParcialidad { get; set; } = 1;
|
||||
public decimal ImpSaldoAnt { get; set; }
|
||||
public decimal ImpPagado { get; set; }
|
||||
public decimal ImpSaldoInsoluto { get; set; }
|
||||
}
|
||||
|
||||
[Serializable]
|
||||
public class CFDIComercioExterior11
|
||||
{
|
||||
public string MotivoTraslado { get; set; }
|
||||
public string TipoOperacion { get; set; } = "";
|
||||
public string ClavedePedimento { get; set; } = "";
|
||||
public string CertificadoOrigen { get; set; } = "";
|
||||
public string Incoterm { get; set; } = "";
|
||||
public string Subdivision { get; set; } = "";
|
||||
public decimal TipoCambioUSD { get; set; }
|
||||
public string NumCertificadoOrigen { get; set; } = "";
|
||||
public string NumeroExportadorConfiable { get; set; } = "";
|
||||
public string Observaciones { get; set; } = "";
|
||||
public CFDIComercioExterior11Emisor Emisor { get; set; }
|
||||
public CFDIComercioExterior11Receptor Receptor { get; set; }
|
||||
public CFDIComercioExterior11Receptor Destinatario { get; set; }
|
||||
public List<CFDIComercioExterior11Mercancias> Mercancias { get; set; }
|
||||
public bool AplicaComercioExteriorSubProyecto { get; set; }
|
||||
|
||||
public decimal TotalUSD
|
||||
{
|
||||
get
|
||||
{
|
||||
return (from c in Mercancias
|
||||
select c.ValorDolares).Sum();
|
||||
}
|
||||
}
|
||||
public CFDIComercioExterior11()
|
||||
{
|
||||
Emisor = new CFDIComercioExterior11Emisor();
|
||||
Receptor = new CFDIComercioExterior11Receptor();
|
||||
Destinatario = new CFDIComercioExterior11Receptor();
|
||||
Mercancias = new List<CFDIComercioExterior11Mercancias>();
|
||||
}
|
||||
}
|
||||
|
||||
[Serializable]
|
||||
public class CFDIComercioExterior11Emisor
|
||||
{
|
||||
public string CURP { get; set; } = "";
|
||||
public string Calle { get; set; } = "";
|
||||
public string NumeroExterior { get; set; } = "";
|
||||
public string NumeroInterior { get; set; } = "";
|
||||
public string Colonia { get; set; } = "";
|
||||
public string Localidad { get; set; } = "";
|
||||
public string Referencia { get; set; } = "";
|
||||
public string Municipio { get; set; } = "";
|
||||
public string Estado { get; set; } = "";
|
||||
public string Pais { get; set; } = "";
|
||||
public string CP { get; set; } = "";
|
||||
}
|
||||
|
||||
public class CFDIComercioExterior11Propietario
|
||||
{
|
||||
public string NumRegIdTrib { get; set; } = "";
|
||||
public string ResidenciaFiscal { get; set; } = "";
|
||||
}
|
||||
|
||||
[Serializable]
|
||||
public class CFDIComercioExterior11Receptor
|
||||
{
|
||||
public string NumRegIdTrib { get; set; } = "";
|
||||
public string Nombre { get; set; } = "";
|
||||
public string Calle { get; set; } = "";
|
||||
public string NumeroExterior { get; set; } = "";
|
||||
public string NumeroInterior { get; set; } = "";
|
||||
public string Colonia { get; set; } = "";
|
||||
public string Localidad { get; set; } = "";
|
||||
public string Referencia { get; set; } = "";
|
||||
public string Municipio { get; set; } = "";
|
||||
public string Estado { get; set; } = "";
|
||||
public string CP { get; set; } = "";
|
||||
public string Pais { get; set; } = "";
|
||||
}
|
||||
|
||||
[Serializable]
|
||||
public class CFDIComercioExterior11Mercancias
|
||||
{
|
||||
public string NoIdentificacion { get; set; } = "";
|
||||
public string FraccionArancelaria { get; set; } = "";
|
||||
public string UnidadAduana { get; set; } = "";
|
||||
public decimal CantidadAduana { get; set; }
|
||||
public decimal ValorUnitarioAduana { get; set; }
|
||||
public decimal ValorDolares { get; set; }
|
||||
public CFDIComercioExterior11MercanciasDescripcionesEspecificas DescripcionesEspecificas { get; set; } = new CFDIComercioExterior11MercanciasDescripcionesEspecificas();
|
||||
}
|
||||
|
||||
[Serializable]
|
||||
public class CFDIComercioExterior11MercanciasDescripcionesEspecificas
|
||||
{
|
||||
public string Marca { get; set; } = "";
|
||||
public string Modelo { get; set; } = "";
|
||||
public string SubModelo { get; set; } = "";
|
||||
public string NumeroSerie { get; set; } = "";
|
||||
}
|
||||
}
|
||||
10
ADSUtilService-borrar/ADSTimbrado/Class1.cs
Normal file
10
ADSUtilService-borrar/ADSTimbrado/Class1.cs
Normal file
@@ -0,0 +1,10 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace ADSTimbrado
|
||||
{
|
||||
class Class1
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<configuration>
|
||||
<configSections>
|
||||
<sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
|
||||
<section name="ClbNegBICFDv3_2.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
|
||||
</sectionGroup>
|
||||
</configSections>
|
||||
<applicationSettings>
|
||||
<ClbNegBICFDv3_2.Properties.Settings>
|
||||
<setting name="ClbNegBICFDv3_2_WebReference_Service1" serializeAs="String">
|
||||
<value>http://localhost:4210/Service1.asmx</value>
|
||||
</setting>
|
||||
<setting name="ClbNegBICFD_WebReference_Service1" serializeAs="String">
|
||||
<value>http://205.251.132.234/TimbreCFDi/service1.asmx</value>
|
||||
</setting>
|
||||
</ClbNegBICFDv3_2.Properties.Settings>
|
||||
</applicationSettings>
|
||||
</configuration>
|
||||
1030
ADSUtilService-borrar/ADSTimbrado/Factura.cs
Normal file
1030
ADSUtilService-borrar/ADSTimbrado/Factura.cs
Normal file
File diff suppressed because it is too large
Load Diff
463
ADSUtilService-borrar/ADSTimbrado/Timbrado.cs
Normal file
463
ADSUtilService-borrar/ADSTimbrado/Timbrado.cs
Normal file
@@ -0,0 +1,463 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Linq;
|
||||
namespace ADSTimbrado
|
||||
{
|
||||
|
||||
public enum PacTimbrado { BIInform = 1, RealVirtualv = 2, ProFact = 3, GoCFDIv = 4, PADEv = 5 }
|
||||
public class Timbrado
|
||||
{
|
||||
private static string comentadobymeborrarparaencontrar = "";
|
||||
private static string vbLf="\n";
|
||||
#region Propiedades
|
||||
//private List<string> _errorLog;
|
||||
//public List<string> errorLog { get { return _errorLog == null ? new List<string>() : _errorLog; } }
|
||||
//public string lastError { get { if (_errorLog != null && _errorLog.Count > 0) { return _errorLog[_errorLog.Count - 1]; } else { return ""; } } }
|
||||
|
||||
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
//VerificarVigenciaSAT
|
||||
//CFDICancelar
|
||||
//PreparaTimbrePago
|
||||
|
||||
#region Timbrado
|
||||
//TimbrarFactura
|
||||
|
||||
/// <summary>
|
||||
/// Timbrar Factura
|
||||
/// </summary>
|
||||
/// <param name="facturaCFDI">Factura a timbrar</param>
|
||||
/// <param name="CvePac">Pac a Timbrar
|
||||
/// 1:
|
||||
/// 2:
|
||||
/// 3:
|
||||
/// 4:
|
||||
/// 5:</param>
|
||||
/// <returns></returns>
|
||||
public static TimbradoResult TimbrarFactura(Factura facturaCFDI, TimbradoEmpresa empresa, PacTimbrado pacTimbre)
|
||||
{
|
||||
TimbradoResult Retorno = new TimbradoResult();
|
||||
switch (pacTimbre)
|
||||
{
|
||||
case PacTimbrado.BIInform:
|
||||
{
|
||||
Retorno = TimbrarFacturaBIInform33(facturaCFDI, empresa);
|
||||
break;
|
||||
}
|
||||
case PacTimbrado.RealVirtualv:
|
||||
{
|
||||
Retorno = TimbrarFacturaRealVirtualv33(facturaCFDI, empresa);
|
||||
break;
|
||||
}
|
||||
case PacTimbrado.ProFact:
|
||||
{
|
||||
Retorno = TimbrarFacturaProFact(facturaCFDI, empresa);
|
||||
break;
|
||||
}
|
||||
case PacTimbrado.GoCFDIv:
|
||||
{
|
||||
Retorno = TimbrarFacturaGoCFDIv33(facturaCFDI, empresa);
|
||||
break;
|
||||
}
|
||||
case PacTimbrado.PADEv: { Retorno = TimbrarFacturaPADEv33(facturaCFDI, empresa); break; }
|
||||
}
|
||||
return Retorno;
|
||||
}
|
||||
|
||||
public static TimbradoResult TimbrarFacturaBIInform33(Factura facturaCFDI, TimbradoEmpresa empresa)
|
||||
{
|
||||
TimbradoResult Retorno = new TimbradoResult();
|
||||
|
||||
CFDITimbre ObjCFDITimbre = facturaCFDI.Timbre;
|
||||
string ArchivoLLave = empresa.ArchivoLLaveGET;
|
||||
string ArchivoCertificado = empresa.ArchivoCertificado;
|
||||
string ArchivoPFX = empresa.ArchivoPFX;
|
||||
string UsuarioServicio = empresa.EmisorRFC;
|
||||
string ClaveServicio = empresa.EmisorRFC.ToLower();
|
||||
string Clave = empresa.ArchivoCertificadoClave;
|
||||
string EmisorRFC = empresa.EmisorRFC;
|
||||
string UrlServicio = empresa.UrlServicioBIInform33;
|
||||
string RutaArchivo = empresa.RutaArchivoXML;
|
||||
string NombreArchivoXML = empresa.NombreArchivoXML;
|
||||
bool TimbraProduccion = true;
|
||||
if (empresa.FacturaProduccion)
|
||||
{
|
||||
UsuarioServicio = empresa.UsuarioServicio;
|
||||
ClaveServicio = empresa.ClaveServicio;
|
||||
Clave = "12345678a";
|
||||
EmisorRFC = "AAA010101AAA";
|
||||
UrlServicio = "http://portalmacropro.com.mx/srvCFDi33prueba/service1.asmx";
|
||||
TimbraProduccion = false;
|
||||
|
||||
}
|
||||
|
||||
ClbNegBICFDv3_3.ClsNegEDI CFDi = new ClbNegBICFDv3_3.ClsNegEDI();
|
||||
ClbNegBICFDv3_3.ClsNegAddFemsa ObjFemsa = new ClbNegBICFDv3_3.ClsNegAddFemsa();
|
||||
ClbNegBICFDv3_3.ClsNegEDICompDet ObjDetallista = new ClbNegBICFDv3_3.ClsNegEDICompDet();
|
||||
ClbNegBICFDv3_3.ClsNegEDICompImplocal ImpLoc = new ClbNegBICFDv3_3.ClsNegEDICompImplocal();
|
||||
string Msg = string.Empty;
|
||||
// Nodo Comprobante
|
||||
ClbNegBICFDv3_3.TipoDeComprobante clbcomp = ObjCFDITimbre.Comprobante.TipoComprobante == "I" ? ClbNegBICFDv3_3.TipoDeComprobante.I : ObjCFDITimbre.Comprobante.TipoComprobante == "E" ? ClbNegBICFDv3_3.TipoDeComprobante.E : ObjCFDITimbre.Comprobante.TipoComprobante == "P" ? ClbNegBICFDv3_3.TipoDeComprobante.P : ClbNegBICFDv3_3.TipoDeComprobante.T;
|
||||
Msg = CFDi.comprobantecfd(0, 0, ObjCFDITimbre.Comprobante.Serie, ObjCFDITimbre.Comprobante.Folio.ToString(), ObjCFDITimbre.Comprobante.Fecha, ObjCFDITimbre.Comprobante.FormadePago, ObjCFDITimbre.Comprobante.CondicionesdePago, ObjCFDITimbre.Comprobante.Subtotal, ObjCFDITimbre.Comprobante.Descuentos, ObjCFDITimbre.Comprobante.TipoCambio.ToDecimal(), ObjCFDITimbre.Comprobante.Moneda, ObjCFDITimbre.Comprobante.Total, ObjCFDITimbre.Comprobante.MetodoPago, clbcomp, ObjCFDITimbre.Comprobante.LugarExpedicion, ObjCFDITimbre.Comprobante.Confirmacion);
|
||||
|
||||
if (string.IsNullOrEmpty(Msg))
|
||||
{
|
||||
// Nodo emisor
|
||||
Msg = CFDi.EmisorCfd(empresa.FacturaProduccion ? empresa.EmisorRFC : "AAA010101AAA", empresa.Empresanombre, empresa.CodigoRegimenFiscal);
|
||||
if (Msg == string.Empty)
|
||||
{
|
||||
|
||||
// Nodo receptor
|
||||
Msg = CFDi.ReceptorCfd(ObjCFDITimbre.Receptor.RFC, ObjCFDITimbre.Receptor.Nombre, "", "",facturaCFDI.ClaveUsoCFDI);
|
||||
if (Msg == string.Empty)
|
||||
{
|
||||
|
||||
// Nodo conceptos, se agregan los PS
|
||||
bool HasErrorConceptos = false;
|
||||
|
||||
if (ObjCFDITimbre.Conceptos != null && ObjCFDITimbre.Conceptos.Count > 0)
|
||||
{
|
||||
foreach (CFDIConceptos concep in ObjCFDITimbre.Conceptos)
|
||||
{
|
||||
CFDi.ConceptosCfd(concep.ClaveProdServ, concep.Cantidad, concep.Unidad, concep.Noidentificacion, concep.Descripcion, concep.ValorUnitario, concep.Importe, concep.ClaveUnidad, concep.Descuento);
|
||||
foreach (CFDIConceptosImpuestos imp in concep.Impuestos)
|
||||
{
|
||||
ClbNegBICFDv3_3.Impuesto clbImp = imp.Impuesto == "002" ? ClbNegBICFDv3_3.Impuesto.IVA : imp.Impuesto == "003" ? ClbNegBICFDv3_3.Impuesto.IEPS : ClbNegBICFDv3_3.Impuesto.ISR;
|
||||
ClbNegBICFDv3_3.TipoFactor clbTipo = imp.TipoFactor == "Tasa" ? ClbNegBICFDv3_3.TipoFactor.Tasa : imp.TipoFactor == "Cuota" ? ClbNegBICFDv3_3.TipoFactor.Cuota : ClbNegBICFDv3_3.TipoFactor.Exento;
|
||||
int Posicion = imp.TasaOCuota.ToString().IndexOf(".");
|
||||
if (imp.TrasladooRetencion == "T")
|
||||
CFDi.ConceptosTrasladosCfd(imp.Base, clbImp, clbTipo, imp.TasaOCuota.ToString().PadRight(imp.TasaOCuota.ToString().Length + (6 - imp.TasaOCuota.ToString().Substring(Posicion, imp.TasaOCuota.ToString().Length - 1).Length + 1), Convert.ToChar("0")), imp.Importe);
|
||||
else
|
||||
CFDi.ConceptosRetencionesCfd(imp.Base, clbImp, clbTipo, imp.TasaOCuota.ToString().PadRight(imp.TasaOCuota.ToString().Length + (6 - imp.TasaOCuota.ToString().Substring(Posicion, imp.TasaOCuota.ToString().Length - 1).Length + 1), Convert.ToChar("0")), imp.Importe);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (!HasErrorConceptos)
|
||||
{
|
||||
// Nodo Impuestos, se agrega el total de impuestos
|
||||
Msg = CFDi.ImpuestosCfd(facturaCFDI.RetIVATC +facturaCFDI.RetISRTC,facturaCFDI.IVATC);
|
||||
if (Msg == string.Empty)
|
||||
{
|
||||
bool HasErrorRetenciones = false;
|
||||
// Nodo Impuestos-retenciones
|
||||
foreach (var Ret in ObjCFDITimbre.Retenciones)
|
||||
{
|
||||
ClbNegBICFDv3_3.Impuesto clbImp = Ret.Impuesto == "002" ? ClbNegBICFDv3_3.Impuesto.IVA : Ret.Impuesto == "003" ? ClbNegBICFDv3_3.Impuesto.IEPS : ClbNegBICFDv3_3.Impuesto.ISR;
|
||||
Msg = CFDi.ImpuestosRetencionesCfd(clbImp, Ret.Importe);
|
||||
}
|
||||
|
||||
if (!HasErrorRetenciones)
|
||||
{
|
||||
// Nodo Impuestos-traslado
|
||||
bool HasErrorIVA = false;
|
||||
// 'se acumulan los importes
|
||||
foreach (var Tras in ObjCFDITimbre.Traslados)
|
||||
{
|
||||
int Posicion = Tras.TasaOCuota.ToString().IndexOf(".");
|
||||
ClbNegBICFDv3_3.TipoFactor tipfact = Tras.TipoFactor == "Tasa" ? ClbNegBICFDv3_3.TipoFactor.Tasa : Tras.TipoFactor == "Cuota" ? ClbNegBICFDv3_3.TipoFactor.Cuota : ClbNegBICFDv3_3.TipoFactor.Exento;
|
||||
Msg = CFDi.ImpuestosTrasladosCfd(ClbNegBICFDv3_3.Impuesto.IVA, Tras.TasaOCuota.ToString().PadRight(Tras.TasaOCuota.ToString().Length + (6 - Tras.TasaOCuota.ToString().Substring(Posicion, Tras.TasaOCuota.ToString().Length - 1).Length + 1), Convert.ToChar("0")), Tras.Importe, tipfact);
|
||||
}
|
||||
if (!HasErrorIVA)
|
||||
{
|
||||
// Nodo Impuestos locales
|
||||
// JJMQ 20150826: Se habilitó de nueva cuenta impuestos locales
|
||||
bool HasErrorImpuestosLocales = false;
|
||||
if (ObjCFDITimbre.RetencionesLocales.Sum(x => x.Importe) > 0)
|
||||
{
|
||||
foreach (CFDIRetencionesLocales ret in ObjCFDITimbre.RetencionesLocales)
|
||||
{
|
||||
if (ret.Importe > 0)
|
||||
{
|
||||
Msg = ImpLoc.RetencionesLocales(ret.ImpuestoLocalRetenido, ret.TasaRetencion, ret.Importe);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
CFDi.CompImplocal = ImpLoc;
|
||||
if (Msg != string.Empty)
|
||||
HasErrorImpuestosLocales = true;
|
||||
|
||||
if (!HasErrorImpuestosLocales)
|
||||
{
|
||||
|
||||
|
||||
|
||||
// Agrega Adenda FEMSA
|
||||
bool HasErrorFEMSA = false;
|
||||
if (facturaCFDI.Cliente.AplicaFEMSA)
|
||||
{
|
||||
Msg = ObjFemsa.Carga(facturaCFDI.FemsaFactura.FEMSA_Version,facturaCFDI.ClaseDoctoSat,facturaCFDI.FemsaFactura.FEMSA_NumSociedad,facturaCFDI.FemsaFactura.FEMSA_NumProveedor,facturaCFDI.FemsaFactura.FEMSA_NumPedido,facturaCFDI.MonedaAbreviatura,facturaCFDI.FemsaFactura.FEMSA_NumEntrada,facturaCFDI.FemsaFactura.FEMSA_NumRemision,facturaCFDI.FemsaFactura.FEMSA_NumSocio,facturaCFDI.FemsaFactura.FEMSA_CentroCosto,facturaCFDI.FemsaFactura.FEMSA_IPeriodoLiquidacion,facturaCFDI.FemsaFactura.FEMSA_FPeriodoLiquidacion,facturaCFDI.FemsaFactura.FEMSA_CodRetencion1,facturaCFDI.FemsaFactura.FEMSA_CodRetencion2,facturaCFDI.FemsaFactura.FEMSA_Mail);
|
||||
if (Msg != string.Empty)
|
||||
HasErrorFEMSA = true;
|
||||
}
|
||||
|
||||
if (!HasErrorFEMSA)
|
||||
{
|
||||
if (facturaCFDI.Cliente.AplicaFEMSA)
|
||||
Msg = CFDi.AddendaFemsa(ObjFemsa);
|
||||
if (Msg == string.Empty)
|
||||
{
|
||||
// Agrega Complemento Detallista
|
||||
bool HasErrorDetallista = false;
|
||||
if (facturaCFDI.Cliente.AplicaDetallista)
|
||||
{
|
||||
// Desarrollar Detallista
|
||||
if (Msg != string.Empty)
|
||||
HasErrorDetallista = true;
|
||||
// 1
|
||||
Msg = ObjDetallista._1_1R_requestForPaymentIdentification(ClbNegBICFDv3_3.CompDetEntityType.INVOICE);
|
||||
if (Msg != string.Empty)
|
||||
HasErrorDetallista = true;
|
||||
// 2
|
||||
List<string> LstInstruccionComercial = new List<string>();
|
||||
LstInstruccionComercial.Add(facturaCFDI.TotalTC.ToString().ToDouble().Texto2Letras().ToUpper());
|
||||
Msg = ObjDetallista._2_1O_SpecialInstruction(ClbNegBICFDv3_3.CompDetCode.ZZZ, LstInstruccionComercial);
|
||||
if (Msg != string.Empty)
|
||||
HasErrorDetallista = true;
|
||||
// 3
|
||||
Msg = ObjDetallista._3_1R_OrderIdentification_ReferenceIdentification("ON",facturaCFDI.Det_OrdenCompra);
|
||||
if (Msg != string.Empty)
|
||||
HasErrorDetallista = true;
|
||||
Msg = ObjDetallista._3_2O_OrderIdentification_ReferenceDate(facturaCFDI.Det_FechaOrdenCompra.ToDate());
|
||||
if (Msg != string.Empty)
|
||||
HasErrorDetallista = true;
|
||||
// 4
|
||||
Msg = ObjDetallista._4_1R_AdditionalInformation_ReferenceIdentification("DQ",facturaCFDI.Det_ContraRecibo);
|
||||
if (Msg != string.Empty)
|
||||
HasErrorDetallista = true;
|
||||
// 5
|
||||
Msg = ObjDetallista._5_1R_DeliveryNote_ReferenceIdentification(facturaCFDI.Det_ContraRecibo);
|
||||
if (Msg != string.Empty)
|
||||
HasErrorDetallista = true;
|
||||
Msg = ObjDetallista._5_2O_DeliveryNote_ReferenceDate(facturaCFDI.Det_FechaOrdenCompra.ToDate());
|
||||
if (Msg != string.Empty)
|
||||
HasErrorDetallista = true;
|
||||
// 6
|
||||
Msg = ObjDetallista._6_1R_Buyer(facturaCFDI.Cliente.Detallista_GLNComprador,facturaCFDI.Cliente.Detallista_Departamento);
|
||||
if (Msg != string.Empty)
|
||||
HasErrorDetallista = true;
|
||||
// 7
|
||||
Msg = ObjDetallista._7_1R_Seller(facturaCFDI.Cliente.Detallista_GLNVendedor, "SELLER_ASSIGNED_IDENTIFIER_FOR_A_PARTY",facturaCFDI.Cliente.Detallista_NumProveedor);
|
||||
if (Msg != string.Empty)
|
||||
HasErrorDetallista = true;
|
||||
// 8
|
||||
Msg = ObjDetallista._8_1O_AllowanceCharge(ClbNegBICFDv3_3.CompDetNetAllowanceChargeType.ALLOWANCE_GLOBAL, ClbNegBICFDv3_3.CompDetNetSettlementType.OFF_INVOICE, "0", ClbNegBICFDv3_3.CompDetNetSpecialServicesType.AJ, ClbNegBICFDv3_3.CompDetNetMonetaryAmountOrPercentageBase.INVOICE_VALUE,facturaCFDI.DescuentoTC > 0 &&facturaCFDI.SubTotalTC > 0 ? (facturaCFDI.DescuentoTC * 100) / facturaCFDI.SubTotalTC : 0);
|
||||
if (Msg != string.Empty)
|
||||
HasErrorDetallista = true;
|
||||
// 9
|
||||
int LineNumber = 1;
|
||||
if (ObjCFDITimbre.Conceptos != null && ObjCFDITimbre.Conceptos.Count > 0)
|
||||
{
|
||||
foreach (DataRow Row in facturaCFDI.DtDetalle.Rows)
|
||||
{
|
||||
string PS = Row["PS"].ToString().Length == 1 ? Row["Obs"].ToString() : Row["PS"].ToString().Length == 0 ? "" : Row["PS"].ToString() + " " + Row["Obs"].ToString() + (Row["Obs"].ToString().Trim().Length > 0 ? vbLf : "" + vbLf);
|
||||
Msg = ObjDetallista._9_1R_LineItem("SimpleInvoidLineItemType", LineNumber, Row["Codigo"].ToString(), ClbNegBICFDv3_3.CompDetAlternateTradeItemIdentification.SUPPLIER_ASSIGNED, Row["Codigo"].ToString(), ClbNegBICFDv3_3.CompDetNetLanguage.ES, (Row["Codigo"].ToString() + (Row["Codigo"].ToString().Length > 0 ? "-" : "") + PS).Length > 35 ? (Row["Codigo"].ToString() + (Row["Codigo"].ToString().Length > 0 ? "-" : "") + PS).Substring(0, 34) : (Row["Codigo"].ToString() + (Row["Codigo"].ToString().Length > 0 ? "-" : "") + PS), (Row["UM"].ToString().ToLower() == "no aplica" ? "NA" : Row["UM"].ToString()), Row["Cantidad"].ToString(), Row["PU"].ToString().ToDecimal(), Row["PU"].ToString().ToDecimal() * (1 + Row["IVA"].ToString().ToDecimal()), Row["Cantidad"].ToString().ToDecimal() * Row["PU"].ToString().ToDecimal(), (Row["Cantidad"].ToString().ToDecimal() * Row["PU"].ToString().ToDecimal()) * (1 + Row["IVA"].ToString().ToDecimal()));
|
||||
LineNumber = LineNumber + 1;
|
||||
}
|
||||
}
|
||||
if (Msg != string.Empty)
|
||||
HasErrorDetallista = true;
|
||||
// 10
|
||||
Msg = ObjDetallista._10_1R_TotalAmount(facturaCFDI.SubTotalTC);
|
||||
if (Msg != string.Empty)
|
||||
HasErrorDetallista = true;
|
||||
// 11
|
||||
Msg = ObjDetallista._11_1R_TotalAllowanceCharge(ClbNegBICFDv3_3.CompDetNetAllowanceOrChargeType.ALLOWANCE, ClbNegBICFDv3_3.CompDetNetSpecialServicesType.AA,facturaCFDI.DescuentoTC);
|
||||
if (Msg != string.Empty)
|
||||
HasErrorDetallista = true;
|
||||
}
|
||||
if (!HasErrorDetallista)
|
||||
{
|
||||
if (facturaCFDI.Cliente.AplicaDetallista)
|
||||
Msg = CFDi.ClomplementoDetallistaCfd(ObjDetallista);
|
||||
if (Msg != string.Empty)
|
||||
HasErrorDetallista = true;
|
||||
// Timbrar
|
||||
|
||||
// Web Services de producción: http://biinform.com.mx/srvCFDi/service1.asmx
|
||||
// Web Services de pruebasd: http://biinform.com.mx/srvCFDiPrueba/service1.asmx
|
||||
|
||||
|
||||
|
||||
|
||||
if (!System.IO.Directory.Exists(empresa.RutaArchivoXML)){
|
||||
|
||||
System.IO.Directory.CreateDirectory(empresa.RutaArchivoXML);
|
||||
}
|
||||
|
||||
// GENERAR TIMBRE
|
||||
CFDi.Generar(ArchivoPFX, empresa.ArchivoCertificadoClave, ArchivoCertificado, $"{RutaArchivo }{NombreArchivoXML}.xml", empresa.EmpresaRutaCertificados, UsuarioServicio, ClaveServicio, UrlServicio, true);
|
||||
|
||||
|
||||
if (CFDi.MsgError != string.Empty)
|
||||
{
|
||||
Retorno.GuardaLogTimbrado("Titulo", $"Ocurrió un error al generar el timbre, el mensaje del SAT fue: {CFDi.MsgError}. Emp:{empresa.CveEmpresa}. MetPag: {facturaCFDI.ClaveMetodoPagoSAT}", 0, (int)PacTimbrado.BIInform);
|
||||
}
|
||||
else
|
||||
{
|
||||
ClbNegBICFDv3_3.ClsNegCBBGenerar CBB = new ClbNegBICFDv3_3.ClsNegCBBGenerar();
|
||||
DateTime FechaCertificacion;
|
||||
string FolioFiscal, NoSerieCertificado, NoSerieCertificadoContribuyente, SelloCFDi, SelloSAT;
|
||||
|
||||
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;
|
||||
|
||||
|
||||
empresa.UpdateEstatusFactura(FolioFiscal, ObjCFDITimbre, facturaCFDI, (int)PacTimbrado.BIInform);
|
||||
comentadobymeborrarparaencontrar="";
|
||||
//CBB.GenerarCBB(empresa.EmisorRFC, ObjCFDITimbre.Receptor.RFC, facturaCFDI.TotalTC, FolioFiscal, empresa.RutaCBB);
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Retorno.GuardaLogTimbrado("Titulo", "El SAT regresó el siguiente mensaje: " + Msg + ". Objeto: Complemento ", 0, (int)PacTimbrado.BIInform);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Retorno.GuardaLogTimbrado("Titulo", "El SAT regresó el siguiente mensaje: " + Msg + ". Objeto: AddendaFemsa", 0, (int)PacTimbrado.BIInform);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Retorno.GuardaLogTimbrado("Titulo", "El SAT regresó el siguiente mensaje: " + Msg + ". Objeto: AddendaFemsa", 0, (int)PacTimbrado.BIInform);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Retorno.GuardaLogTimbrado("Titulo", "El SAT regresó el siguiente mensaje: " + Msg + ". Objeto: RetencionesLocales", 0, (int)PacTimbrado.BIInform);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Retorno.GuardaLogTimbrado("Titulo", "El SAT regresó el siguiente mensaje: " + Msg + ". Objeto: ImpuestosTrasladoCfd", 0, (int)PacTimbrado.BIInform);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Retorno.GuardaLogTimbrado("Titulo", "El SAT regresó el siguiente mensaje: " + Msg + ". Objeto: ImpuestosRetencionesCfd ", 0, (int)PacTimbrado.BIInform);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Retorno.GuardaLogTimbrado("Titulo", "El SAT regresó el siguiente mensaje: " + Msg + ". Objeto: ImpuestosCfd", 0, (int)PacTimbrado.BIInform);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Retorno.GuardaLogTimbrado("Titulo", "El SAT regresó el siguiente mensaje: " + Msg + ". Objeto: ConceptosCfd" , 0, (int)PacTimbrado.BIInform);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Retorno.GuardaLogTimbrado("Titulo", "El SAT regresó el siguiente mensaje: " + Msg + ". Objeto: ReceptorCfd", 0, (int)PacTimbrado.BIInform);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Retorno.GuardaLogTimbrado("Titulo", "El SAT regresó el siguiente mensaje: " + Msg + ". Objeto: EmisorCfd", 0, (int)PacTimbrado.BIInform);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Retorno.GuardaLogTimbrado("Titulo", "El SAT regresó el siguiente mensaje: " + Msg + ". Objeto: Comprobante", 0, (int)PacTimbrado.BIInform);
|
||||
}
|
||||
|
||||
Retorno._isOK =Retorno._errorLog.Count==0;
|
||||
return Retorno;
|
||||
}
|
||||
|
||||
public static TimbradoResult TimbrarFacturaRealVirtualv33(Factura facturaCFDI, TimbradoEmpresa empresa)
|
||||
{
|
||||
TimbradoResult Retorno = new TimbradoResult();
|
||||
|
||||
return Retorno;
|
||||
}
|
||||
public static TimbradoResult TimbrarFacturaProFact(Factura facturaCFDI, TimbradoEmpresa empresa)
|
||||
{
|
||||
TimbradoResult Retorno = new TimbradoResult();
|
||||
|
||||
return Retorno;
|
||||
}
|
||||
public static TimbradoResult TimbrarFacturaGoCFDIv33(Factura facturaCFDI, TimbradoEmpresa empresa)
|
||||
{
|
||||
TimbradoResult Retorno = new TimbradoResult();
|
||||
|
||||
return Retorno;
|
||||
}
|
||||
public static TimbradoResult TimbrarFacturaPADEv33(Factura facturaCFDI, TimbradoEmpresa empresa)
|
||||
{
|
||||
TimbradoResult Retorno = new TimbradoResult();
|
||||
|
||||
return Retorno;
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//obtenerAtributo
|
||||
//TimbrarFacturaProFact
|
||||
//GeneraAddenda7Eleven
|
||||
//GeneraAddendaFord
|
||||
//GeneraAddendaFord
|
||||
//DecodeBase64
|
||||
//CodificarABase64
|
||||
//
|
||||
//
|
||||
|
||||
}
|
||||
|
||||
public class TimbradoResult
|
||||
{
|
||||
public TimbradoResult()
|
||||
{
|
||||
_isOK = false;
|
||||
_errorLog = new List<string>();
|
||||
xmlCFDI = "";
|
||||
uuid = "";
|
||||
}
|
||||
public bool _isOK { get; set; }
|
||||
public bool isOK { get { return _isOK; } }
|
||||
public List<string> _errorLog { get; set; }
|
||||
public List<string> errorLog { get { return _errorLog; } }
|
||||
/// <summary>
|
||||
/// XML generado, puede que se muestre incluso sin que se haya timbrado la factura, esto para efecto de revisión
|
||||
/// </summary>
|
||||
public string xmlCFDI { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Folio Fiscal factura
|
||||
/// </summary>
|
||||
public string uuid { get; set; }
|
||||
|
||||
public string lastError { get { if (_errorLog != null && _errorLog.Count > 0) { return _errorLog[_errorLog.Count - 1]; } else { return ""; } } }
|
||||
|
||||
public void GuardaLogTimbrado(string titulo, string message, int codigo, int cvepac)
|
||||
{
|
||||
_errorLog.Add(string.Format("{1}({2}){0}{5:dd-MM-yyyy HH:mm} [pac:{4}]{0}{3}{0}", "/r/n", titulo, codigo, message, cvepac, DateTime.Now));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
4163
ADSUtilService-borrar/ADSTimbrado/TimbradoDll.cs
Normal file
4163
ADSUtilService-borrar/ADSTimbrado/TimbradoDll.cs
Normal file
File diff suppressed because it is too large
Load Diff
130
ADSUtilService-borrar/ADSTimbrado/TimbradoEmpresa.cs
Normal file
130
ADSUtilService-borrar/ADSTimbrado/TimbradoEmpresa.cs
Normal file
@@ -0,0 +1,130 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace ADSTimbrado
|
||||
{
|
||||
public abstract class TimbradoEmpresa
|
||||
{
|
||||
private TimbradoEmpresa() { }
|
||||
|
||||
/// <summary>
|
||||
/// </summary>
|
||||
/// <param name="ArchivoLLaveGET"> $@"{UsuarioActual.Empresa.Ruta}Certificados\{UsuarioActual.Empresa.ArchivoKey}";
|
||||
/// ArchivoLLave = $@"{UsuarioActual.Empresa.Ruta}Certificados\CSD01_AAA010101AAA.key";
|
||||
/// </param>
|
||||
/// <param name="ArchivoCertificado">$@"{UsuarioActual.Empresa.Ruta}Certificados\{UsuarioActual.Empresa.ArchivoCer}";
|
||||
/// ArchivoLLave = $@"{UsuarioActual.Empresa.Ruta}Certificados\CSD01_AAA010101AAA.cer";</param>
|
||||
/// <param name="ArchivoPFX">$@"{UsuarioActual.Empresa.Ruta}Certificados\{UsuarioActual.Empresa.ArchivoPfx}";</param>
|
||||
/// <param name="ArchivoCertificadoClave">UsuarioActual.Empresa.ContraseñaKey;</param>
|
||||
/// <param name="EmisorRFC">UsuarioActual.Empresa.RFC;</param>
|
||||
/// <param name="UrlServicioBIInform33">"http://portalbiinform.com.mx/srvCFDi33/service1.asmx"; </param>
|
||||
/// <param name="RutaArchivoXML">$@"{UsuarioActual.Empresa.Ruta}XML\{Ventas.TipoDocto}\";</param>
|
||||
/// <param name="NombreArchivoXML">$"{ObjCFDITimbre.Comprobante.SerieFolio}";</param>
|
||||
/// <param name="UsuarioServicio">UsuarioActual.Empresa.BIUsuario;</param>
|
||||
/// <param name="ClaveServicio">UsuarioActual.Empresa.BIContraseña;</param>
|
||||
/// <param name="FacturaProduccion"> UsuarioActual.Empresa.FacturaProduccion || UsuarioActual.CveEmpresa == 1</param>
|
||||
public TimbradoEmpresa(string ArchivoLLaveGET, string ArchivoCertificado, string ArchivoPFX, string ArchivoCertificadoClave, string EmisorRFC, string UrlServicioBIInform33,
|
||||
string RutaArchivoXML, string NombreArchivoXML, string UsuarioServicio, string ClaveServicio, bool FacturaProduccion)
|
||||
{
|
||||
}
|
||||
/// <summary>
|
||||
/// Return $@"{UsuarioActual.Empresa.Ruta}Certificados\{UsuarioActual.Empresa.ArchivoKey}";
|
||||
/// Return ArchivoLLave = $@"{UsuarioActual.Empresa.Ruta}Certificados\CSD01_AAA010101AAA.key";
|
||||
/// </summary>
|
||||
public string ArchivoLLaveGET { get; set; }
|
||||
/// <summary>
|
||||
/// Return $@"{UsuarioActual.Empresa.Ruta}Certificados\{UsuarioActual.Empresa.ArchivoCer}";
|
||||
/// Return ArchivoLLave = $@"{UsuarioActual.Empresa.Ruta}Certificados\CSD01_AAA010101AAA.cer";
|
||||
/// </summary>
|
||||
public string ArchivoCertificado { get; set; }
|
||||
/// <summary>
|
||||
/// Return $@"{UsuarioActual.Empresa.Ruta}Certificados\{UsuarioActual.Empresa.ArchivoPfx}";
|
||||
/// </summary>
|
||||
public string ArchivoPFX { get; set; }
|
||||
/// <summary>
|
||||
/// Return UsuarioActual.Empresa.ContraseñaKey;
|
||||
/// </summary>
|
||||
public string ArchivoCertificadoClave { get; set; }
|
||||
/// <summary>
|
||||
/// Return UsuarioActual.Empresa.RFC;;
|
||||
/// </summary>
|
||||
public string EmisorRFC { get; set; }
|
||||
/// <summary>
|
||||
/// Return "http://portalbiinform.com.mx/srvCFDi33/service1.asmx";
|
||||
/// </summary>
|
||||
public string UrlServicioBIInform33 { get; set; }
|
||||
/// <summary>
|
||||
/// Return $@"{UsuarioActual.Empresa.Ruta}XML\{Ventas.TipoDocto}\";
|
||||
/// </summary>
|
||||
public string RutaArchivoXML { get; set; }
|
||||
/// <summary>
|
||||
/// Return $"{ObjCFDITimbre.Comprobante.SerieFolio}";
|
||||
/// </summary>
|
||||
public string NombreArchivoXML { get; set; }
|
||||
/// <summary>
|
||||
/// Return UsuarioActual.Empresa.BIUsuario;
|
||||
/// </summary>
|
||||
public string UsuarioServicio { get; set; }
|
||||
/// <summary>
|
||||
/// Return UsuarioActual.Empresa.BIContraseña;
|
||||
/// </summary>
|
||||
public string ClaveServicio { get; set; }
|
||||
/// <summary>
|
||||
/// Return UsuarioActual.Empresa.FacturaProduccion || UsuarioActual.CveEmpresa == 1
|
||||
/// </summary>
|
||||
public bool FacturaProduccion { get; set; }
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Return UsuarioActual.Empresa.Empresa;
|
||||
/// </summary>
|
||||
public string Empresanombre { get; set; }
|
||||
/// <summary>
|
||||
/// Return UsuarioActual.Empresa.CodigoRegimenFiscal
|
||||
/// </summary>
|
||||
public string CodigoRegimenFiscal { get; set; }
|
||||
/// <summary>
|
||||
/// Return $@"{UsuarioActual.Empresa.Ruta}CBB\{ObjCFDITimbre.Comprobante.SerieFolio}.jpg";
|
||||
/// </summary>
|
||||
public string RutaCBB { get; set; }
|
||||
/// <summary>
|
||||
/// Return UsuarioActual.Empresa.Ruta+ @"Certificados\"
|
||||
/// </summary>
|
||||
public string EmpresaRutaCertificados { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Return CveEmpresa
|
||||
/// </summary>
|
||||
public int CveEmpresa { get; set; }
|
||||
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// ClsVentas ObjVentas = new ClsVentas();
|
||||
/// if (!ObjVentas.UpdateEstatusFactura(3, FolioFiscal, "", ObjCFDITimbre.Comprobante.Fecha,facturaCFDI.CveVenta, CvePAC: 1))
|
||||
/// Retorno = "No se pudo registrar el folio fiscal";
|
||||
/// ObjVentas.Dispose();
|
||||
/// CBB.GenerarCBB(empresa.EmisorRFC, ObjCFDITimbre.Receptor.RFC, facturaCFDI.TotalTC, FolioFiscal, empresa.RutaCBB);
|
||||
/// if (facturaCFDI.Cliente.Ford_GSDB != "")
|
||||
//{
|
||||
/// string RutaCadena = string.Format("{0}{1}.xml", RutaArchivo, NombreArchivoXML); // If(UsuarioActual.Empresa.FacturaProduccion, String.Format("{0}XML\{1}\{2}.xml", Ruta, Ventas.SerieFolio), String.Format("{0}XML\{1}\{2}.xml", Ruta, Ventas.TipoDocto, Ventas.SerieFolio))
|
||||
/// string FolioFactura = "";
|
||||
/// if (UsuarioActual.CveEmpresa == 8)
|
||||
/// FolioFactura = facturaCFDI.Folio.ToString(); // sogo, pordefault manda el folio de la factura
|
||||
/// GeneraAddendaFord(RutaCadena, FolioFactura, facturaCFDI.FordASN, facturaCFDI.FordGSDB);
|
||||
///}
|
||||
/// </summary>
|
||||
public abstract string UpdateEstatusFactura(string FolioFiscal,CFDITimbre ObjCFDITimbre, Factura facturaCFDI, int CvePAC);
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Return ;
|
||||
/// </summary>
|
||||
///
|
||||
public abstract string Timbre();
|
||||
}
|
||||
}
|
||||
812
ADSUtilService-borrar/ADSTimbrado/modExtensiones.cs
Normal file
812
ADSUtilService-borrar/ADSTimbrado/modExtensiones.cs
Normal file
@@ -0,0 +1,812 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace ADSTimbrado
|
||||
{
|
||||
enum requestMethod
|
||||
{
|
||||
POST = 1,
|
||||
GET = 2
|
||||
}
|
||||
|
||||
static class Mod
|
||||
{
|
||||
static public object GetValObjDy(this object obj, string propertyName)
|
||||
{
|
||||
return obj.GetType().GetProperty(propertyName).GetValue(obj, null);
|
||||
}
|
||||
public static string FormatoNumero(this string Str, int Decimales = 2)
|
||||
{
|
||||
decimal numero = 0;
|
||||
decimal.TryParse(Str, out numero);
|
||||
StringBuilder zeros = new StringBuilder();
|
||||
for (int i = 0; i < Decimales; i++)
|
||||
{
|
||||
zeros.Append("0");
|
||||
}
|
||||
if (zeros.Length > 0)
|
||||
{
|
||||
zeros.Insert(0, ".");
|
||||
}
|
||||
string Tmp = string.Format("{0:#,0.00}", numero);
|
||||
return Tmp;
|
||||
}
|
||||
|
||||
public static bool Contiene(this int Valor, params int[] Valores)
|
||||
{
|
||||
return Array.IndexOf(Valores, Valor) >= 0;
|
||||
}
|
||||
public static bool Contiene(this string Valor, params string[] Valores)
|
||||
{
|
||||
return Array.IndexOf(Valores, Valor) >= 0;
|
||||
}
|
||||
public static string Mid(string input, int index, char newChar)
|
||||
|
||||
{
|
||||
|
||||
if (input == null)
|
||||
|
||||
{
|
||||
|
||||
throw new ArgumentNullException("input");
|
||||
|
||||
}
|
||||
|
||||
char[] chars = input.ToCharArray();
|
||||
|
||||
chars[index - 1] = newChar;
|
||||
|
||||
return new string(chars);
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// This is equivalent to Mid Function in VB6
|
||||
/// </summary>
|
||||
/// <param name="s"> String to Check.</param>
|
||||
/// <param name="a">Position of Character</param>
|
||||
/// <param name="b">Length </param>
|
||||
/// <returns></returns> ]
|
||||
public static string Mid(string s, int a, int b)
|
||||
|
||||
{
|
||||
|
||||
string temp = s.Substring(a - 1, b);
|
||||
|
||||
return temp;
|
||||
|
||||
}
|
||||
|
||||
public static System.Data.DataTable FiltraParametros(this System.Data.DataTable dt, string RowFilter, string Orderby = "", string[] DistinctColumns = null)
|
||||
{
|
||||
System.Data.DataTable TmpDt = new System.Data.DataTable();
|
||||
if (dt != null && dt.Rows.Count > 0)
|
||||
{
|
||||
System.Data.DataView Dv = new System.Data.DataView(dt, RowFilter, Orderby, System.Data.DataViewRowState.CurrentRows);
|
||||
if (DistinctColumns != null)
|
||||
TmpDt = Dv.ToTable(true, DistinctColumns);
|
||||
else
|
||||
try
|
||||
{
|
||||
TmpDt = Dv.ToTable();
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
TmpDt = null;
|
||||
}
|
||||
|
||||
Dv.Dispose();
|
||||
}
|
||||
else { TmpDt = dt; }
|
||||
return TmpDt;
|
||||
}
|
||||
|
||||
public static System.Data.DataRow FiltroPrimero(this System.Data.DataTable dt, string RowFilter, string Orderby = "")
|
||||
{
|
||||
System.Data.DataRow TmpDr = null;
|
||||
if (dt != null && dt.Rows.Count > 0)
|
||||
{
|
||||
if (RowFilter != "")
|
||||
{
|
||||
System.Data.DataView Dv = new System.Data.DataView(dt, RowFilter, Orderby, System.Data.DataViewRowState.CurrentRows);
|
||||
if (Dv.ToTable().Rows.Count > 0)
|
||||
TmpDr = Dv.ToTable().Rows[0];
|
||||
Dv.Dispose();
|
||||
}
|
||||
else
|
||||
TmpDr = dt.Rows[0];
|
||||
}
|
||||
return TmpDr;
|
||||
}
|
||||
public static bool HasRows(this System.Data.DataTable dt)
|
||||
{
|
||||
if (dt != null && dt.Rows.Count > 0)
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
}
|
||||
public static string Texto2Letras(this double Importe, int CveMoneda = 1)
|
||||
{
|
||||
string Moneda, AbrevMoneda;
|
||||
switch (CveMoneda)
|
||||
{
|
||||
case 2:
|
||||
{
|
||||
Moneda = "Dólares"; AbrevMoneda = "USD";
|
||||
break;
|
||||
}
|
||||
|
||||
case 3:
|
||||
{
|
||||
Moneda = "Euro"; AbrevMoneda = "EUR";
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
{
|
||||
Moneda = "pesos"; AbrevMoneda = "M.N.";
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (Importe == 0)
|
||||
return string.Format("cero {0} 00/100 {1}", Moneda, AbrevMoneda);
|
||||
|
||||
string Retorno;
|
||||
string Numero = Importe.ToString("F2"); // no se usa N2,porque pone comma, y F2, no la pone
|
||||
// ********Declara variables de tipo cadena************
|
||||
string entero, dec, flag;
|
||||
StringBuilder palabras = new StringBuilder();
|
||||
dec = "";
|
||||
entero = "";
|
||||
|
||||
// ********Declara variables de tipo entero***********
|
||||
int num, x, y;
|
||||
|
||||
flag = "N";
|
||||
|
||||
// **********Número Negativo***********
|
||||
if (Mid(Numero, 1, 1) == "-")
|
||||
{
|
||||
Numero = Mid(Numero, 2, Numero.ToString().Length - 1).ToString();
|
||||
palabras.Append("menos ");
|
||||
}
|
||||
|
||||
// **********Si tiene ceros a la izquierda*************
|
||||
for (x = 1; x <= Numero.ToString().Length; x++)
|
||||
{
|
||||
if (Mid(Numero, 1, 1) == "0")
|
||||
{
|
||||
Numero = Mid(Numero, 2, Numero.ToString().Length).ToString().Trim();
|
||||
if (Numero.ToString().Length == 0)
|
||||
palabras.Clear();
|
||||
}
|
||||
else
|
||||
break;
|
||||
}
|
||||
|
||||
// *********Dividir parte entera y decimal************
|
||||
for (y = 1; y <= Numero.Length; y++)
|
||||
{
|
||||
if (Mid(Numero, y, 1) == ".")
|
||||
flag = "S";
|
||||
else if (flag == "N")
|
||||
entero = entero + Mid(Numero, y, 1);
|
||||
else
|
||||
dec = dec + Mid(Numero, y, 1);
|
||||
}
|
||||
|
||||
// If Len(dec) = 1 Then dec = dec & "0"
|
||||
dec = dec.PadRight(2, '0');
|
||||
|
||||
// **********proceso de conversión***********
|
||||
flag = "N";
|
||||
|
||||
if (Convert.ToDouble(Numero) <= 999999999)
|
||||
{
|
||||
for (y = entero.Length; y >= 1; y += -1)
|
||||
{
|
||||
num = entero.Length - (y - 1);
|
||||
switch (y)
|
||||
{
|
||||
case 3:
|
||||
case 6:
|
||||
case 9:
|
||||
{
|
||||
// **********Asigna las palabras para las centenas***********
|
||||
switch (Mid(entero, num, 1))
|
||||
{
|
||||
case "1":
|
||||
{
|
||||
if (Mid(entero, num + 1, 1) == "0" & Mid(entero, num + 2, 1) == "0")
|
||||
palabras.Append("cien ");
|
||||
else
|
||||
palabras.Append("ciento ");
|
||||
break;
|
||||
}
|
||||
|
||||
case "2":
|
||||
{
|
||||
palabras.Append("doscientos ");
|
||||
break;
|
||||
}
|
||||
|
||||
case "3":
|
||||
{
|
||||
palabras.Append("trescientos ");
|
||||
break;
|
||||
}
|
||||
|
||||
case "4":
|
||||
{
|
||||
palabras.Append("cuatrocientos ");
|
||||
break;
|
||||
}
|
||||
|
||||
case "5":
|
||||
{
|
||||
palabras.Append("quinientos ");
|
||||
break;
|
||||
}
|
||||
|
||||
case "6":
|
||||
{
|
||||
palabras.Append("seiscientos ");
|
||||
break;
|
||||
}
|
||||
|
||||
case "7":
|
||||
{
|
||||
palabras.Append("setecientos ");
|
||||
break;
|
||||
}
|
||||
|
||||
case "8":
|
||||
{
|
||||
palabras.Append("ochocientos ");
|
||||
break;
|
||||
}
|
||||
|
||||
case "9":
|
||||
{
|
||||
palabras.Append("novecientos ");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
case 2:
|
||||
case 5:
|
||||
case 8:
|
||||
{
|
||||
// *********Asigna las palabras para las decenas************
|
||||
switch (Mid(entero, num, 1))
|
||||
{
|
||||
case "0":
|
||||
{
|
||||
// CASO:260,505.81
|
||||
flag = "N";
|
||||
break;
|
||||
}
|
||||
|
||||
case "1":
|
||||
{
|
||||
if (Mid(entero, num + 1, 1) == "0")
|
||||
{
|
||||
flag = "S";
|
||||
palabras.Append("diez ");
|
||||
}
|
||||
if (Mid(entero, num + 1, 1) == "1")
|
||||
{
|
||||
flag = "S";
|
||||
palabras.Append("once ");
|
||||
}
|
||||
if (Mid(entero, num + 1, 1) == "2")
|
||||
{
|
||||
flag = "S";
|
||||
palabras.Append("doce ");
|
||||
}
|
||||
if (Mid(entero, num + 1, 1) == "3")
|
||||
{
|
||||
flag = "S";
|
||||
palabras.Append("trece ");
|
||||
}
|
||||
if (Mid(entero, num + 1, 1) == "4")
|
||||
{
|
||||
flag = "S";
|
||||
palabras.Append("catorce ");
|
||||
}
|
||||
if (Mid(entero, num + 1, 1) == "5")
|
||||
{
|
||||
flag = "S";
|
||||
palabras.Append("quince ");
|
||||
}
|
||||
if (Mid(entero, num + 1, 1).ToEntero() > 5)
|
||||
{
|
||||
flag = "N";
|
||||
palabras.Append("dieci");
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
case "2":
|
||||
{
|
||||
if (Mid(entero, num + 1, 1) == "0")
|
||||
{
|
||||
palabras.Append("veinte ");
|
||||
flag = "S";
|
||||
}
|
||||
else
|
||||
{
|
||||
palabras.Append("veinti");
|
||||
flag = "N";
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
case "3":
|
||||
{
|
||||
if (Mid(entero, num + 1, 1) == "0")
|
||||
{
|
||||
palabras.Append("treinta ");
|
||||
flag = "S";
|
||||
}
|
||||
else
|
||||
{
|
||||
palabras.Append("treinta y ");
|
||||
flag = "N";
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
case "4":
|
||||
{
|
||||
if (Mid(entero, num + 1, 1) == "0")
|
||||
{
|
||||
palabras.Append("cuarenta ");
|
||||
flag = "S";
|
||||
}
|
||||
else
|
||||
{
|
||||
palabras.Append("cuarenta y ");
|
||||
flag = "N";
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
case "5":
|
||||
{
|
||||
if (Mid(entero, num + 1, 1) == "0")
|
||||
{
|
||||
palabras.Append("cincuenta ");
|
||||
flag = "S";
|
||||
}
|
||||
else
|
||||
{
|
||||
palabras.Append("cincuenta y ");
|
||||
flag = "N";
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
case "6":
|
||||
{
|
||||
if (Mid(entero, num + 1, 1) == "0")
|
||||
{
|
||||
palabras.Append("sesenta ");
|
||||
flag = "S";
|
||||
}
|
||||
else
|
||||
{
|
||||
palabras.Append("sesenta y ");
|
||||
flag = "N";
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
case "7":
|
||||
{
|
||||
if (Mid(entero, num + 1, 1) == "0")
|
||||
{
|
||||
palabras.Append("setenta ");
|
||||
flag = "S";
|
||||
}
|
||||
else
|
||||
{
|
||||
palabras.Append("setenta y ");
|
||||
flag = "N";
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
case "8":
|
||||
{
|
||||
if (Mid(entero, num + 1, 1) == "0")
|
||||
{
|
||||
palabras.Append("ochenta ");
|
||||
flag = "S";
|
||||
}
|
||||
else
|
||||
{
|
||||
palabras.Append("ochenta y ");
|
||||
flag = "N";
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
case "9":
|
||||
{
|
||||
if (Mid(entero, num + 1, 1) == "0")
|
||||
{
|
||||
palabras.Append("noventa ");
|
||||
flag = "S";
|
||||
}
|
||||
else
|
||||
{
|
||||
palabras.Append("noventa y ");
|
||||
flag = "N";
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
case 1:
|
||||
case 4:
|
||||
case 7:
|
||||
{
|
||||
// *********Asigna las palabras para las unidades*********
|
||||
switch (Mid(entero, num, 1))
|
||||
{
|
||||
case "1":
|
||||
{
|
||||
if (flag == "N")
|
||||
{
|
||||
if (y == 1)
|
||||
palabras.Append("uno ");
|
||||
else
|
||||
palabras.Append("un ");
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
case "2":
|
||||
{
|
||||
if (flag == "N")
|
||||
palabras.Append("dos ");
|
||||
break;
|
||||
}
|
||||
|
||||
case "3":
|
||||
{
|
||||
if (flag == "N")
|
||||
palabras.Append("tres ");
|
||||
break;
|
||||
}
|
||||
|
||||
case "4":
|
||||
{
|
||||
if (flag == "N")
|
||||
palabras.Append("cuatro ");
|
||||
break;
|
||||
}
|
||||
|
||||
case "5":
|
||||
{
|
||||
if (flag == "N")
|
||||
palabras.Append("cinco ");
|
||||
break;
|
||||
}
|
||||
|
||||
case "6":
|
||||
{
|
||||
if (flag == "N")
|
||||
palabras.Append("seis ");
|
||||
break;
|
||||
}
|
||||
|
||||
case "7":
|
||||
{
|
||||
if (flag == "N")
|
||||
palabras.Append("siete ");
|
||||
break;
|
||||
}
|
||||
|
||||
case "8":
|
||||
{
|
||||
if (flag == "N")
|
||||
palabras.Append("ocho ");
|
||||
break;
|
||||
}
|
||||
|
||||
case "9":
|
||||
{
|
||||
if (flag == "N")
|
||||
palabras.Append("nueve ");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// ***********Asigna la palabra mil***************
|
||||
if (y == 4)
|
||||
{
|
||||
if ((Mid(entero, 4, 1) != "0") | (Mid(entero, 4, 1) == "0" & entero.Length == 4) | (Mid(entero, 5, 1) != "0" & entero.Length == 5) | (Mid(entero, 6, 1) != "0" & entero.Length == 6) | (Mid(entero, 5, 1) == "0" & entero.Length == 7) | (Mid(entero, 5, 1) == "0" & Mid(entero, 4, 1) == "0" & entero.Length <= 5) | (Mid(entero, 6, 1) == "0" & Mid(entero, 5, 1) == "0" & Mid(entero, 4, 1) == "0" & entero.Length <= 6) | (Mid(entero, 7, 1) == "0" & Mid(entero, 6, 1) == "0" & Mid(entero, 5, 1) == "0" & Mid(entero, 4, 1) == "0" & entero.Length < 7) | (Mid(entero, 8, 1) == "0" & Mid(entero, 7, 1) == "0" & Mid(entero, 6, 1) == "0" & Mid(entero, 5, 1) == "0" & Mid(entero, 4, 1) == "0" & entero.Length < 8) | (Mid(entero, 3, 1) != "0" & entero.Length == 7) | (Mid(entero, 3, 1) != "0" & entero.Length == 8) | (Mid(entero, 8, 1) == "0" & Mid(entero, 8, 1) == "0" & Mid(entero, 7, 1) == "0" & Mid(entero, 6, 1) == "0" & Mid(entero, 5, 1) == "0" & Mid(entero, 4, 1) == "0" & entero.Length == 9))
|
||||
palabras.Append("mil ");
|
||||
}
|
||||
|
||||
// **********Asigna la palabra millón*************
|
||||
if (y == 7)
|
||||
{
|
||||
if (entero.Length == 7 & Mid(entero, 1, 1) == "1")
|
||||
palabras.Append("millón ");
|
||||
else
|
||||
palabras.Append("millones ");
|
||||
}
|
||||
}
|
||||
|
||||
// **********Une la parte entera y la parte decimal*************
|
||||
if (dec != "")
|
||||
{
|
||||
palabras.AppendFormat("{0} {1} /100 {2}", Moneda, dec, AbrevMoneda);
|
||||
|
||||
Retorno = palabras.ToString();
|
||||
}
|
||||
else
|
||||
{
|
||||
palabras.AppendFormat("{0} {1} /100 {2}", Moneda, dec, AbrevMoneda);
|
||||
|
||||
Retorno = palabras.ToString();
|
||||
}
|
||||
}
|
||||
else
|
||||
Retorno = "";
|
||||
|
||||
return Retorno;
|
||||
}
|
||||
public static int ToEntero(this string Obj)
|
||||
{
|
||||
int result = 0;
|
||||
// restriccion menor a 10, se quitan ceros a la izquiera primero, porque provoca desbordamiento si pasa mas de una cantidad,Holds signed 32-bit (4-byte) integers that range in value from -2,147,483,648 through 2,147,483,647.
|
||||
Obj = Obj.ToString().Trim().Replace(",", "");
|
||||
int.TryParse(Obj, out result);
|
||||
return result;
|
||||
}
|
||||
public static double ToDouble(this string Str)
|
||||
{
|
||||
double result = 0;
|
||||
Str = Str.Trim().Replace(",", "");
|
||||
if (!string.IsNullOrEmpty(Str))
|
||||
{
|
||||
double.TryParse(Str, out result);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
public static double ToDouble(this string Str, double TipoCambio)
|
||||
{
|
||||
return Str.ToDouble() * TipoCambio;
|
||||
}
|
||||
public static decimal ToDecimal(this string Str)
|
||||
{
|
||||
decimal result = 0;
|
||||
Str = Str.Trim().Replace(",", "");
|
||||
if (!string.IsNullOrEmpty(Str))
|
||||
{
|
||||
Decimal.TryParse(Str, out result);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
public static decimal ToDecimal(this string Str, decimal TipoCambio)
|
||||
{
|
||||
return Str.ToDecimal() * TipoCambio;
|
||||
}
|
||||
public static DateTime ToDateTime(this string Str)
|
||||
{
|
||||
return Str.ToDate();
|
||||
}
|
||||
public static DateTime ToDate(this string Str, IFormatProvider culture = null)
|
||||
{
|
||||
DateTime retorno = DateTime.MinValue;
|
||||
if (Str != null && !string.IsNullOrEmpty(Str.Trim()))
|
||||
{
|
||||
if (culture == null)
|
||||
{
|
||||
DateTime.TryParse(Str, out retorno);
|
||||
//retorno = Convert.ToDateTime(Str.Trim());
|
||||
}
|
||||
else
|
||||
{
|
||||
try
|
||||
{
|
||||
retorno = Convert.ToDateTime(Str.ToString().Trim(), culture);
|
||||
|
||||
}
|
||||
catch (Exception) { }
|
||||
|
||||
}
|
||||
}
|
||||
return retorno;
|
||||
}
|
||||
/// <summary>
|
||||
/// Realizar un request a un Sitio
|
||||
/// </summary>
|
||||
/// <param name="URL">http:sig.adssistemas.mx/inicio2.aspx</param>
|
||||
/// <param name="metodo">post,get,put</param>
|
||||
/// <param name="headers">{"Titulo","Value"} ó {"SOAPAction: actionmethod"}</param>
|
||||
/// <param name="contentType">"text/xml; charset=utf-8"</param>
|
||||
/// <param name="body">body request</param>
|
||||
/// <param name="postData">var1=value1&var2=value2</param>
|
||||
/// <param name="maxTimeMilliseconds"> 120 sec</param>
|
||||
public static string SendRequest(string URL, requestMethod metodo, IEnumerable<string[]> headers, string contentType, string body, string postData, int maxTimeseconds = 120)
|
||||
{
|
||||
string resultado = "";
|
||||
try
|
||||
{
|
||||
|
||||
System.Net.HttpWebRequest request = (System.Net.HttpWebRequest)System.Net.HttpWebRequest.Create(URL);
|
||||
request.Timeout = maxTimeseconds * 1000;
|
||||
request.Method = metodo.ToString("G");
|
||||
request.ContentType = contentType;
|
||||
if (headers != null)
|
||||
{
|
||||
foreach (string[] item in headers)
|
||||
{
|
||||
if (item.Length > 1)
|
||||
{
|
||||
request.Headers.Add(item[0], item[1]);
|
||||
}
|
||||
else
|
||||
{
|
||||
request.Headers.Add(item[0]);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
using (System.IO.Stream stream = request.GetRequestStream())
|
||||
using (System.IO.StreamWriter stmw = new System.IO.StreamWriter(stream))
|
||||
{
|
||||
stmw.Write(body);
|
||||
}
|
||||
System.Net.WebResponse response = (System.Net.WebResponse)request.GetResponse();
|
||||
System.IO.StreamReader sr = new System.IO.StreamReader(response.GetResponseStream());
|
||||
resultado = sr.ReadToEnd();
|
||||
sr.Close();
|
||||
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
//Extenciones.ApplicationParameter.GuardaLogEx(ex, $"SOAPAction : {SOAPAction} XML : {xml}");
|
||||
}
|
||||
return resultado;
|
||||
}
|
||||
#region Encripta desencripta
|
||||
|
||||
private static byte[] _Key = new byte[] { };
|
||||
private readonly static byte[] _IV = new byte[] { 0x12, 0x34, 0x56, 0x78, 0x90, 0xAB, 0xCD, 0xEF };
|
||||
private readonly static byte[] _IVAES = new byte[] { 0x12, 0x34, 0x56, 0x78, 0x90, 0xAB, 0xCD, 0xEF, 0x12, 0x34, 0x56, 0x78, 0x90, 0xAB, 0xCD, 0xEF };
|
||||
private static string SEncryptionKey = "$Ap7+5&z";
|
||||
//private static string SEncryptionKeyAES = "$Ap7+5&z$Ap7+5&z$Ap7+5&z$Ap7+5&z";
|
||||
public static string Decripta(string stringToDecrypt, string TipoEncryption = "DES")
|
||||
{
|
||||
string Salida;
|
||||
|
||||
if (stringToDecrypt != "")
|
||||
{
|
||||
Salida = stringToDecrypt.Replace(" ", "+");
|
||||
byte[] inputByteArray = new byte[Salida.Length + 1];
|
||||
|
||||
try
|
||||
{
|
||||
switch (TipoEncryption)
|
||||
{
|
||||
case "DES":
|
||||
{
|
||||
_Key = System.Text.Encoding.UTF8.GetBytes(Left(SEncryptionKey, 8));
|
||||
using (System.Security.Cryptography.DESCryptoServiceProvider des = new System.Security.Cryptography.DESCryptoServiceProvider())
|
||||
using (System.IO.MemoryStream ms = new System.IO.MemoryStream())
|
||||
using (System.Security.Cryptography.CryptoStream cs = new System.Security.Cryptography.CryptoStream(ms, des.CreateDecryptor(_Key, _IV), System.Security.Cryptography.CryptoStreamMode.Write))
|
||||
{
|
||||
inputByteArray = Convert.FromBase64String(Salida);
|
||||
cs.Write(inputByteArray, 0, inputByteArray.Length);
|
||||
cs.FlushFinalBlock();
|
||||
Encoding encoding = System.Text.Encoding.UTF8;
|
||||
Salida = encoding.GetString(ms.ToArray());
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case "AES":
|
||||
{
|
||||
//_Key = System.Text.Encoding.UTF8.GetBytes(Left(SEncryptionKeyAES, 32));
|
||||
//AesCryptoServiceProvider aes = new AesCryptoServiceProvider();
|
||||
//inputByteArray = Convert.FromBase64String(Salida);
|
||||
|
||||
//MemoryStream ms = new MemoryStream();
|
||||
//CryptoStream cs = new CryptoStream(ms, aes.CreateDecryptor(_Key, _IVAES), CryptoStreamMode.Write);
|
||||
//cs.Write(inputByteArray, 0, inputByteArray.Length);
|
||||
//cs.FlushFinalBlock();
|
||||
//Encoding encoding = System.Text.Encoding.UTF8;
|
||||
|
||||
//Salida = encoding.GetString(ms.ToArray());
|
||||
//aes.Dispose(); ms.Dispose(); cs.Dispose();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
// Alert("Parametros incorrectos", TipoMensaje.MsgError)
|
||||
return "";
|
||||
}
|
||||
}
|
||||
else
|
||||
return "";
|
||||
|
||||
return Salida;
|
||||
}
|
||||
public static string Encripta(string stringToEncrypt, string TipoEncryption = "DES")
|
||||
{
|
||||
string Retorno = "";
|
||||
switch (TipoEncryption)
|
||||
{
|
||||
case "DES":
|
||||
{
|
||||
_Key = Encoding.UTF8.GetBytes(Left(SEncryptionKey, 8));
|
||||
using (System.Security.Cryptography.DESCryptoServiceProvider des = new System.Security.Cryptography.DESCryptoServiceProvider())
|
||||
using (System.IO.MemoryStream ms = new System.IO.MemoryStream())
|
||||
using (System.Security.Cryptography.CryptoStream cs = new System.Security.Cryptography.CryptoStream(ms, des.CreateEncryptor(_Key, _IV), System.Security.Cryptography.CryptoStreamMode.Write))
|
||||
{
|
||||
byte[] inputByteArray = Encoding.UTF8.GetBytes(stringToEncrypt);
|
||||
cs.Write(inputByteArray, 0, inputByteArray.Length);
|
||||
cs.FlushFinalBlock();
|
||||
Retorno = Convert.ToBase64String(ms.ToArray());
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case "AES":
|
||||
{
|
||||
//_Key = Encoding.UTF8.GetBytes(Left(SEncryptionKeyAES, 32));
|
||||
//AesCryptoServiceProvider aes = new AesCryptoServiceProvider();
|
||||
//byte[] inputByteArray = Encoding.UTF8.GetBytes(stringToEncrypt);
|
||||
//MemoryStream ms = new MemoryStream();
|
||||
//CryptoStream cs = new CryptoStream(ms, aes.CreateEncryptor(_Key, _IVAES), CryptoStreamMode.Write);
|
||||
//cs.Write(inputByteArray, 0, inputByteArray.Length);
|
||||
//cs.FlushFinalBlock();
|
||||
//Retorno = Convert.ToBase64String(ms.ToArray());
|
||||
//aes.Dispose(); ms.Dispose(); cs.Dispose();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return Retorno;
|
||||
}
|
||||
public static string Left(this string value, int maxLength)
|
||||
{
|
||||
if (string.IsNullOrEmpty(value)) return value;
|
||||
maxLength = Math.Abs(maxLength);
|
||||
return (value.Length <= maxLength ? value : value.Substring(0, maxLength));
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
200
ADSUtilService-borrar/ADSTimbradoLibrary/ADSTimbrado.csproj
Normal file
200
ADSUtilService-borrar/ADSTimbradoLibrary/ADSTimbrado.csproj
Normal file
@@ -0,0 +1,200 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid>{948075AB-24C5-4F4B-A983-2266BEB5C7BA}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>ADSTimbrado</RootNamespace>
|
||||
<AssemblyName>ADSTimbrado</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<Deterministic>true</Deterministic>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="ClbNegBICFDv3, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>Dlls\ClbNegBICFDv3.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="ClbNegBICFDv3_2, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>Dlls\ClbNegBICFDv3_2.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="ClbNegBICFDv3_3, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>Dlls\ClbNegBICFDv3_3.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="clbNegCFDi, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>Dlls\clbNegCFDi.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="ClbUtiBIInform, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>Dlls\ClbUtiBIInform.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="GoCfdi, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>Dlls\GoCfdi.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Profact.TimbraCFDI, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>Dlls\Profact.TimbraCFDI.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="RVCFDI, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>Dlls\RVCFDI.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="RVCFDI33, Version=1.1.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>Dlls\RVCFDI33.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Drawing" />
|
||||
<Reference Include="System.Runtime.Serialization" />
|
||||
<Reference Include="System.ServiceModel" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Net.Http" />
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="AlertMensaje.cs" />
|
||||
<Compile Include="CFDITimbre.cs" />
|
||||
<Compile Include="Connected Services\Cancelacion\Reference.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DesignTime>True</DesignTime>
|
||||
<DependentUpon>Reference.svcmap</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Factura.cs" />
|
||||
<Compile Include="facturainterface.cs" />
|
||||
<Compile Include="Modelos\SAT\AcuseCancelacionSAT.cs" />
|
||||
<Compile Include="Modelos\SAT\CFDIComercioExterior11.cs" />
|
||||
<Compile Include="Modelos\SAT\CFDIComercioExterior11Emisor.cs" />
|
||||
<Compile Include="Modelos\SAT\CFDIComercioExterior11Mercancias.cs" />
|
||||
<Compile Include="Modelos\SAT\CFDIComercioExterior11MercanciasDescripcionesEspecificas.cs" />
|
||||
<Compile Include="Modelos\SAT\CFDIComercioExterior11Propietario.cs" />
|
||||
<Compile Include="Modelos\SAT\CFDIComercioExterior11Receptor.cs" />
|
||||
<Compile Include="Modelos\SAT\CFDIComplementoPagos.cs" />
|
||||
<Compile Include="Modelos\SAT\CFDIComplementoPagosDocsRelacionados.cs" />
|
||||
<Compile Include="Modelos\SAT\CFDIComplementos.cs" />
|
||||
<Compile Include="Modelos\SAT\CFDIComprobante.cs" />
|
||||
<Compile Include="Modelos\SAT\CFDIConceptos.cs" />
|
||||
<Compile Include="Modelos\SAT\CFDIConceptosImpuestos.cs" />
|
||||
<Compile Include="Modelos\SAT\CFDIEmisor.cs" />
|
||||
<Compile Include="Modelos\SAT\CFDINomina.cs" />
|
||||
<Compile Include="Modelos\SAT\CFDINominaDeducciones.cs" />
|
||||
<Compile Include="Modelos\SAT\CFDINominaHorasExtras.cs" />
|
||||
<Compile Include="Modelos\SAT\CFDINominaIncapacidades.cs" />
|
||||
<Compile Include="Modelos\SAT\CFDINominaOtrosPagos.cs" />
|
||||
<Compile Include="Modelos\SAT\CFDINominaPercepciones.cs" />
|
||||
<Compile Include="Modelos\SAT\CFDINominaReceptor.cs" />
|
||||
<Compile Include="Modelos\SAT\CFDIReceptor.cs" />
|
||||
<Compile Include="Modelos\SAT\CFDIRelacionados.cs" />
|
||||
<Compile Include="Modelos\SAT\CFDIRetenciones.cs" />
|
||||
<Compile Include="Modelos\SAT\CFDIRetencionesLocales.cs" />
|
||||
<Compile Include="Modelos\SAT\CFDITimbre.cs" />
|
||||
<Compile Include="Modelos\SAT\CFDITraslados.cs" />
|
||||
<Compile Include="Modelos\SAT\CFDITrasladosLocales.cs" />
|
||||
<Compile Include="Modelos\SAT\PacTimbrado.cs" />
|
||||
<Compile Include="Modelos\SAT\SATEmpresa.cs" />
|
||||
<Compile Include="Modelos\SAT\TimbradoResult.cs" />
|
||||
<Compile Include="modExtensiones.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="Logic\LogicSat.cs" />
|
||||
<Compile Include="Timbrado.cs" />
|
||||
<Compile Include="TimbradoDll.cs" />
|
||||
<Compile Include="TimbradoEmpresa.cs" />
|
||||
<Compile Include="TipoMensaje.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="Connected Services\Cancelacion\ADSTimbrado.Cancelacion.AceptaRechazaResponse.datasource">
|
||||
<DependentUpon>Reference.svcmap</DependentUpon>
|
||||
</None>
|
||||
<None Include="Connected Services\Cancelacion\ADSTimbrado.Cancelacion.AceptaRechazaTestResponse.datasource">
|
||||
<DependentUpon>Reference.svcmap</DependentUpon>
|
||||
</None>
|
||||
<None Include="Connected Services\Cancelacion\ADSTimbrado.Cancelacion.AcuseSat.datasource">
|
||||
<DependentUpon>Reference.svcmap</DependentUpon>
|
||||
</None>
|
||||
<None Include="Connected Services\Cancelacion\ADSTimbrado.Cancelacion.CancelTestResponse.datasource">
|
||||
<DependentUpon>Reference.svcmap</DependentUpon>
|
||||
</None>
|
||||
<None Include="Connected Services\Cancelacion\ADSTimbrado.Cancelacion.ConsultaVigenciaResponse.datasource">
|
||||
<DependentUpon>Reference.svcmap</DependentUpon>
|
||||
</None>
|
||||
<None Include="Connected Services\Cancelacion\ADSTimbrado.Cancelacion.ConsultaVigenciaTestResponse.datasource">
|
||||
<DependentUpon>Reference.svcmap</DependentUpon>
|
||||
</None>
|
||||
<None Include="Connected Services\Cancelacion\ADSTimbrado.Cancelacion.ObtienePendientesResponse.datasource">
|
||||
<DependentUpon>Reference.svcmap</DependentUpon>
|
||||
</None>
|
||||
<None Include="Connected Services\Cancelacion\ADSTimbrado.Cancelacion.ObtienePendientesTestResponse.datasource">
|
||||
<DependentUpon>Reference.svcmap</DependentUpon>
|
||||
</None>
|
||||
<None Include="Connected Services\Cancelacion\ADSTimbrado.Cancelacion.ObtieneRelacionadosResponse.datasource">
|
||||
<DependentUpon>Reference.svcmap</DependentUpon>
|
||||
</None>
|
||||
<None Include="Connected Services\Cancelacion\ADSTimbrado.Cancelacion.ObtieneRelacionadosTestResponse.datasource">
|
||||
<DependentUpon>Reference.svcmap</DependentUpon>
|
||||
</None>
|
||||
<None Include="Connected Services\Cancelacion\ADSTimbrado.Cancelacion.StructCancel.datasource">
|
||||
<DependentUpon>Reference.svcmap</DependentUpon>
|
||||
</None>
|
||||
<None Include="Connected Services\Cancelacion\ADSTimbrado.Cancelacion.StructRelations.datasource">
|
||||
<DependentUpon>Reference.svcmap</DependentUpon>
|
||||
</None>
|
||||
<None Include="Connected Services\Cancelacion\Cancelacion.disco" />
|
||||
<None Include="Connected Services\Cancelacion\configuration91.svcinfo" />
|
||||
<None Include="Connected Services\Cancelacion\configuration.svcinfo" />
|
||||
<None Include="Connected Services\Cancelacion\Reference.svcmap">
|
||||
<Generator>WCF Proxy Generator</Generator>
|
||||
<LastGenOutput>Reference.cs</LastGenOutput>
|
||||
</None>
|
||||
<Content Include="Dlls\ClbNegBICFDv3.dll" />
|
||||
<Content Include="Dlls\ClbNegBICFDv3_2.dll" />
|
||||
<Content Include="Dlls\ClbNegBICFDv3_3.dll" />
|
||||
<Content Include="Dlls\clbNegCFDi.dll" />
|
||||
<Content Include="Dlls\ClbUtiBIInform.dll" />
|
||||
<Content Include="Dlls\GoCfdi.dll" />
|
||||
<Content Include="Dlls\Profact.TimbraCFDI.dll" />
|
||||
<Content Include="Dlls\RVCFDI.dll" />
|
||||
<Content Include="Dlls\RVCFDI33.dll" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="app.config" />
|
||||
<None Include="Connected Services\Cancelacion\Cancelacion.wsdl" />
|
||||
<None Include="Dlls\ClbNegBICFDv3_2.dll.config" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Folder Include="SAT\" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<WCFMetadata Include="Connected Services\" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<WCFMetadataStorage Include="Connected Services\Cancelacion\" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
</Project>
|
||||
14
ADSUtilService-borrar/ADSTimbradoLibrary/AlertMensaje.cs
Normal file
14
ADSUtilService-borrar/ADSTimbradoLibrary/AlertMensaje.cs
Normal file
@@ -0,0 +1,14 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ADSTimbrado
|
||||
{
|
||||
public class AlertMensaje
|
||||
{
|
||||
public string mensaje { get; set; }
|
||||
public int tipoMensaje { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
This file is automatically generated by Visual Studio .Net. It is
|
||||
used to store generic object data source configuration information.
|
||||
Renaming the file extension or editing the content of this file may
|
||||
cause the file to be unrecognizable by the program.
|
||||
-->
|
||||
<GenericObjectDataSource DisplayName="AceptaRechazaResponse" Version="1.0" xmlns="urn:schemas-microsoft-com:xml-msdatasource">
|
||||
<TypeInfo>ADSTimbrado.Cancelacion.AceptaRechazaResponse, Connected Services.Cancelacion.Reference.cs.dll, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null</TypeInfo>
|
||||
</GenericObjectDataSource>
|
||||
@@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
This file is automatically generated by Visual Studio .Net. It is
|
||||
used to store generic object data source configuration information.
|
||||
Renaming the file extension or editing the content of this file may
|
||||
cause the file to be unrecognizable by the program.
|
||||
-->
|
||||
<GenericObjectDataSource DisplayName="AceptaRechazaTestResponse" Version="1.0" xmlns="urn:schemas-microsoft-com:xml-msdatasource">
|
||||
<TypeInfo>ADSTimbrado.Cancelacion.AceptaRechazaTestResponse, Connected Services.Cancelacion.Reference.cs.dll, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null</TypeInfo>
|
||||
</GenericObjectDataSource>
|
||||
@@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
This file is automatically generated by Visual Studio .Net. It is
|
||||
used to store generic object data source configuration information.
|
||||
Renaming the file extension or editing the content of this file may
|
||||
cause the file to be unrecognizable by the program.
|
||||
-->
|
||||
<GenericObjectDataSource DisplayName="AcuseSat" Version="1.0" xmlns="urn:schemas-microsoft-com:xml-msdatasource">
|
||||
<TypeInfo>ADSTimbrado.Cancelacion.AcuseSat, Connected Services.Cancelacion.Reference.cs.dll, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null</TypeInfo>
|
||||
</GenericObjectDataSource>
|
||||
@@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
This file is automatically generated by Visual Studio .Net. It is
|
||||
used to store generic object data source configuration information.
|
||||
Renaming the file extension or editing the content of this file may
|
||||
cause the file to be unrecognizable by the program.
|
||||
-->
|
||||
<GenericObjectDataSource DisplayName="CancelTestResponse" Version="1.0" xmlns="urn:schemas-microsoft-com:xml-msdatasource">
|
||||
<TypeInfo>ADSTimbrado.Cancelacion.CancelTestResponse, Connected Services.Cancelacion.Reference.cs.dll, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null</TypeInfo>
|
||||
</GenericObjectDataSource>
|
||||
@@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
This file is automatically generated by Visual Studio .Net. It is
|
||||
used to store generic object data source configuration information.
|
||||
Renaming the file extension or editing the content of this file may
|
||||
cause the file to be unrecognizable by the program.
|
||||
-->
|
||||
<GenericObjectDataSource DisplayName="ConsultaVigenciaResponse" Version="1.0" xmlns="urn:schemas-microsoft-com:xml-msdatasource">
|
||||
<TypeInfo>ADSTimbrado.Cancelacion.ConsultaVigenciaResponse, Connected Services.Cancelacion.Reference.cs.dll, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null</TypeInfo>
|
||||
</GenericObjectDataSource>
|
||||
@@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
This file is automatically generated by Visual Studio .Net. It is
|
||||
used to store generic object data source configuration information.
|
||||
Renaming the file extension or editing the content of this file may
|
||||
cause the file to be unrecognizable by the program.
|
||||
-->
|
||||
<GenericObjectDataSource DisplayName="ConsultaVigenciaTestResponse" Version="1.0" xmlns="urn:schemas-microsoft-com:xml-msdatasource">
|
||||
<TypeInfo>ADSTimbrado.Cancelacion.ConsultaVigenciaTestResponse, Connected Services.Cancelacion.Reference.cs.dll, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null</TypeInfo>
|
||||
</GenericObjectDataSource>
|
||||
@@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
This file is automatically generated by Visual Studio .Net. It is
|
||||
used to store generic object data source configuration information.
|
||||
Renaming the file extension or editing the content of this file may
|
||||
cause the file to be unrecognizable by the program.
|
||||
-->
|
||||
<GenericObjectDataSource DisplayName="ObtienePendientesResponse" Version="1.0" xmlns="urn:schemas-microsoft-com:xml-msdatasource">
|
||||
<TypeInfo>ADSTimbrado.Cancelacion.ObtienePendientesResponse, Connected Services.Cancelacion.Reference.cs.dll, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null</TypeInfo>
|
||||
</GenericObjectDataSource>
|
||||
@@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
This file is automatically generated by Visual Studio .Net. It is
|
||||
used to store generic object data source configuration information.
|
||||
Renaming the file extension or editing the content of this file may
|
||||
cause the file to be unrecognizable by the program.
|
||||
-->
|
||||
<GenericObjectDataSource DisplayName="ObtienePendientesTestResponse" Version="1.0" xmlns="urn:schemas-microsoft-com:xml-msdatasource">
|
||||
<TypeInfo>ADSTimbrado.Cancelacion.ObtienePendientesTestResponse, Connected Services.Cancelacion.Reference.cs.dll, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null</TypeInfo>
|
||||
</GenericObjectDataSource>
|
||||
@@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
This file is automatically generated by Visual Studio .Net. It is
|
||||
used to store generic object data source configuration information.
|
||||
Renaming the file extension or editing the content of this file may
|
||||
cause the file to be unrecognizable by the program.
|
||||
-->
|
||||
<GenericObjectDataSource DisplayName="ObtieneRelacionadosResponse" Version="1.0" xmlns="urn:schemas-microsoft-com:xml-msdatasource">
|
||||
<TypeInfo>ADSTimbrado.Cancelacion.ObtieneRelacionadosResponse, Connected Services.Cancelacion.Reference.cs.dll, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null</TypeInfo>
|
||||
</GenericObjectDataSource>
|
||||
@@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
This file is automatically generated by Visual Studio .Net. It is
|
||||
used to store generic object data source configuration information.
|
||||
Renaming the file extension or editing the content of this file may
|
||||
cause the file to be unrecognizable by the program.
|
||||
-->
|
||||
<GenericObjectDataSource DisplayName="ObtieneRelacionadosTestResponse" Version="1.0" xmlns="urn:schemas-microsoft-com:xml-msdatasource">
|
||||
<TypeInfo>ADSTimbrado.Cancelacion.ObtieneRelacionadosTestResponse, Connected Services.Cancelacion.Reference.cs.dll, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null</TypeInfo>
|
||||
</GenericObjectDataSource>
|
||||
@@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
This file is automatically generated by Visual Studio .Net. It is
|
||||
used to store generic object data source configuration information.
|
||||
Renaming the file extension or editing the content of this file may
|
||||
cause the file to be unrecognizable by the program.
|
||||
-->
|
||||
<GenericObjectDataSource DisplayName="StructCancel" Version="1.0" xmlns="urn:schemas-microsoft-com:xml-msdatasource">
|
||||
<TypeInfo>ADSTimbrado.Cancelacion.StructCancel, Connected Services.Cancelacion.Reference.cs.dll, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null</TypeInfo>
|
||||
</GenericObjectDataSource>
|
||||
@@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
This file is automatically generated by Visual Studio .Net. It is
|
||||
used to store generic object data source configuration information.
|
||||
Renaming the file extension or editing the content of this file may
|
||||
cause the file to be unrecognizable by the program.
|
||||
-->
|
||||
<GenericObjectDataSource DisplayName="StructRelations" Version="1.0" xmlns="urn:schemas-microsoft-com:xml-msdatasource">
|
||||
<TypeInfo>ADSTimbrado.Cancelacion.StructRelations, Connected Services.Cancelacion.Reference.cs.dll, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null</TypeInfo>
|
||||
</GenericObjectDataSource>
|
||||
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<discovery xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://schemas.xmlsoap.org/disco/">
|
||||
<contractRef ref="http://cancel.gofac.com.mx/Cancelacion.asmx?wsdl" docRef="http://cancel.gofac.com.mx/Cancelacion.asmx" xmlns="http://schemas.xmlsoap.org/disco/scl/" />
|
||||
<soap address="http://cancel.gofac.com.mx/Cancelacion.asmx" xmlns:q1="http://tempuri.org/" binding="q1:CancelacionSoap" xmlns="http://schemas.xmlsoap.org/disco/soap/" />
|
||||
<soap address="http://cancel.gofac.com.mx/Cancelacion.asmx" xmlns:q2="http://tempuri.org/" binding="q2:CancelacionSoap12" xmlns="http://schemas.xmlsoap.org/disco/soap/" />
|
||||
</discovery>
|
||||
@@ -0,0 +1,496 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<wsdl:definitions xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:tns="http://tempuri.org/" xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:s1="http://microsoft.com/wsdl/types/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" targetNamespace="http://tempuri.org/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
|
||||
<wsdl:types>
|
||||
<s:schema elementFormDefault="qualified" targetNamespace="http://tempuri.org/">
|
||||
<s:import namespace="http://microsoft.com/wsdl/types/" />
|
||||
<s:element name="CancelTest">
|
||||
<s:complexType>
|
||||
<s:sequence>
|
||||
<s:element minOccurs="0" maxOccurs="1" name="Usuario" type="s:string" />
|
||||
<s:element minOccurs="0" maxOccurs="1" name="Clave" type="s:string" />
|
||||
<s:element minOccurs="0" maxOccurs="1" name="CancelB64" type="s:string" />
|
||||
</s:sequence>
|
||||
</s:complexType>
|
||||
</s:element>
|
||||
<s:element name="CancelTestResponse">
|
||||
<s:complexType>
|
||||
<s:sequence>
|
||||
<s:element minOccurs="0" maxOccurs="1" name="CancelTestResult" type="tns:StructCancel" />
|
||||
</s:sequence>
|
||||
</s:complexType>
|
||||
</s:element>
|
||||
<s:complexType name="StructCancel">
|
||||
<s:sequence>
|
||||
<s:element minOccurs="1" maxOccurs="1" name="Estado" type="s:int" />
|
||||
<s:element minOccurs="0" maxOccurs="1" name="Descripcion" type="s:string" />
|
||||
<s:element minOccurs="0" maxOccurs="1" name="Xml" type="s:string" />
|
||||
</s:sequence>
|
||||
</s:complexType>
|
||||
<s:element name="ConsultaVigencia">
|
||||
<s:complexType>
|
||||
<s:sequence>
|
||||
<s:element minOccurs="0" maxOccurs="1" name="RfcEmisor" type="s:string" />
|
||||
<s:element minOccurs="0" maxOccurs="1" name="Usuario" type="s:string" />
|
||||
<s:element minOccurs="0" maxOccurs="1" name="Clave" type="s:string" />
|
||||
<s:element minOccurs="0" maxOccurs="1" name="Uuid" type="s:string" />
|
||||
<s:element minOccurs="0" maxOccurs="1" name="RfcReceptor" type="s:string" />
|
||||
<s:element minOccurs="0" maxOccurs="1" name="Total" type="s:string" />
|
||||
</s:sequence>
|
||||
</s:complexType>
|
||||
</s:element>
|
||||
<s:element name="ConsultaVigenciaResponse">
|
||||
<s:complexType>
|
||||
<s:sequence>
|
||||
<s:element minOccurs="0" maxOccurs="1" name="ConsultaVigenciaResult" type="tns:AcuseSat" />
|
||||
</s:sequence>
|
||||
</s:complexType>
|
||||
</s:element>
|
||||
<s:complexType name="AcuseSat">
|
||||
<s:sequence>
|
||||
<s:element minOccurs="0" maxOccurs="1" name="CodigoEstatus" type="s:string" />
|
||||
<s:element minOccurs="0" maxOccurs="1" name="Estado" type="s:string" />
|
||||
<s:element minOccurs="0" maxOccurs="1" name="EsCancelable" type="s:string" />
|
||||
<s:element minOccurs="0" maxOccurs="1" name="EstatusCancelacion" type="s:string" />
|
||||
</s:sequence>
|
||||
</s:complexType>
|
||||
<s:element name="ConsultaVigenciaTest">
|
||||
<s:complexType>
|
||||
<s:sequence>
|
||||
<s:element minOccurs="0" maxOccurs="1" name="RfcEmisor" type="s:string" />
|
||||
<s:element minOccurs="0" maxOccurs="1" name="Usuario" type="s:string" />
|
||||
<s:element minOccurs="0" maxOccurs="1" name="Clave" type="s:string" />
|
||||
<s:element minOccurs="0" maxOccurs="1" name="Uuid" type="s:string" />
|
||||
<s:element minOccurs="0" maxOccurs="1" name="RfcReceptor" type="s:string" />
|
||||
<s:element minOccurs="0" maxOccurs="1" name="Total" type="s:string" />
|
||||
</s:sequence>
|
||||
</s:complexType>
|
||||
</s:element>
|
||||
<s:element name="ConsultaVigenciaTestResponse">
|
||||
<s:complexType>
|
||||
<s:sequence>
|
||||
<s:element minOccurs="0" maxOccurs="1" name="ConsultaVigenciaTestResult" type="tns:AcuseSat" />
|
||||
</s:sequence>
|
||||
</s:complexType>
|
||||
</s:element>
|
||||
<s:element name="ObtienePendientes">
|
||||
<s:complexType>
|
||||
<s:sequence>
|
||||
<s:element minOccurs="0" maxOccurs="1" name="RfcReceptor" type="s:string" />
|
||||
<s:element minOccurs="0" maxOccurs="1" name="Usuario" type="s:string" />
|
||||
<s:element minOccurs="0" maxOccurs="1" name="Clave" type="s:string" />
|
||||
</s:sequence>
|
||||
</s:complexType>
|
||||
</s:element>
|
||||
<s:element name="ObtienePendientesResponse">
|
||||
<s:complexType>
|
||||
<s:sequence>
|
||||
<s:element minOccurs="0" maxOccurs="1" name="ObtienePendientesResult" type="tns:StructCancel" />
|
||||
</s:sequence>
|
||||
</s:complexType>
|
||||
</s:element>
|
||||
<s:element name="ObtienePendientesTest">
|
||||
<s:complexType>
|
||||
<s:sequence>
|
||||
<s:element minOccurs="0" maxOccurs="1" name="RfcReceptor" type="s:string" />
|
||||
<s:element minOccurs="0" maxOccurs="1" name="Usuario" type="s:string" />
|
||||
<s:element minOccurs="0" maxOccurs="1" name="Clave" type="s:string" />
|
||||
</s:sequence>
|
||||
</s:complexType>
|
||||
</s:element>
|
||||
<s:element name="ObtienePendientesTestResponse">
|
||||
<s:complexType>
|
||||
<s:sequence>
|
||||
<s:element minOccurs="0" maxOccurs="1" name="ObtienePendientesTestResult" type="tns:StructCancel" />
|
||||
</s:sequence>
|
||||
</s:complexType>
|
||||
</s:element>
|
||||
<s:element name="AceptaRechaza">
|
||||
<s:complexType>
|
||||
<s:sequence>
|
||||
<s:element minOccurs="0" maxOccurs="1" name="RfcReceptor" type="s:string" />
|
||||
<s:element minOccurs="0" maxOccurs="1" name="Usuario" type="s:string" />
|
||||
<s:element minOccurs="0" maxOccurs="1" name="Clave" type="s:string" />
|
||||
<s:element minOccurs="0" maxOccurs="1" name="CertB64" type="s:string" />
|
||||
<s:element minOccurs="0" maxOccurs="1" name="KeyB64" type="s:string" />
|
||||
<s:element minOccurs="0" maxOccurs="1" name="ClaveLlave" type="s:string" />
|
||||
<s:element minOccurs="0" maxOccurs="1" name="Uuid" type="s:string" />
|
||||
<s:element minOccurs="0" maxOccurs="1" name="Accion" type="s:string" />
|
||||
</s:sequence>
|
||||
</s:complexType>
|
||||
</s:element>
|
||||
<s:element name="AceptaRechazaResponse">
|
||||
<s:complexType>
|
||||
<s:sequence>
|
||||
<s:element minOccurs="0" maxOccurs="1" name="AceptaRechazaResult" type="tns:StructCancel" />
|
||||
</s:sequence>
|
||||
</s:complexType>
|
||||
</s:element>
|
||||
<s:element name="AceptaRechazaTest">
|
||||
<s:complexType>
|
||||
<s:sequence>
|
||||
<s:element minOccurs="0" maxOccurs="1" name="RfcReceptor" type="s:string" />
|
||||
<s:element minOccurs="0" maxOccurs="1" name="Usuario" type="s:string" />
|
||||
<s:element minOccurs="0" maxOccurs="1" name="Clave" type="s:string" />
|
||||
<s:element minOccurs="0" maxOccurs="1" name="CertB64" type="s:string" />
|
||||
<s:element minOccurs="0" maxOccurs="1" name="KeyB64" type="s:string" />
|
||||
<s:element minOccurs="0" maxOccurs="1" name="ClaveLlave" type="s:string" />
|
||||
<s:element minOccurs="0" maxOccurs="1" name="Uuid" type="s:string" />
|
||||
<s:element minOccurs="0" maxOccurs="1" name="Accion" type="s:string" />
|
||||
</s:sequence>
|
||||
</s:complexType>
|
||||
</s:element>
|
||||
<s:element name="AceptaRechazaTestResponse">
|
||||
<s:complexType>
|
||||
<s:sequence>
|
||||
<s:element minOccurs="0" maxOccurs="1" name="AceptaRechazaTestResult" type="tns:StructCancel" />
|
||||
</s:sequence>
|
||||
</s:complexType>
|
||||
</s:element>
|
||||
<s:element name="ObtieneRelacionadosTest">
|
||||
<s:complexType>
|
||||
<s:sequence>
|
||||
<s:element minOccurs="0" maxOccurs="1" name="RfcEmisor" type="s:string" />
|
||||
<s:element minOccurs="0" maxOccurs="1" name="Usuario" type="s:string" />
|
||||
<s:element minOccurs="0" maxOccurs="1" name="Clave" type="s:string" />
|
||||
<s:element minOccurs="0" maxOccurs="1" name="CertB64" type="s:string" />
|
||||
<s:element minOccurs="0" maxOccurs="1" name="KeyB64" type="s:string" />
|
||||
<s:element minOccurs="0" maxOccurs="1" name="ClaveLlave" type="s:string" />
|
||||
<s:element minOccurs="0" maxOccurs="1" name="Uuid" type="s:string" />
|
||||
</s:sequence>
|
||||
</s:complexType>
|
||||
</s:element>
|
||||
<s:element name="ObtieneRelacionadosTestResponse">
|
||||
<s:complexType>
|
||||
<s:sequence>
|
||||
<s:element minOccurs="0" maxOccurs="1" name="ObtieneRelacionadosTestResult" type="tns:StructRelations" />
|
||||
</s:sequence>
|
||||
</s:complexType>
|
||||
</s:element>
|
||||
<s:complexType name="StructRelations">
|
||||
<s:sequence>
|
||||
<s:element minOccurs="1" maxOccurs="1" name="Codigo" type="s:int" />
|
||||
<s:element minOccurs="0" maxOccurs="1" name="Mensaje" type="s:string" />
|
||||
<s:element minOccurs="0" maxOccurs="1" name="Resultado" type="s:string" />
|
||||
<s:element minOccurs="0" maxOccurs="1" name="RelacionadosPadre" type="tns:ArrayOfFactura" />
|
||||
<s:element minOccurs="0" maxOccurs="1" name="RelacionadosHijo" type="tns:ArrayOfFactura" />
|
||||
</s:sequence>
|
||||
</s:complexType>
|
||||
<s:complexType name="ArrayOfFactura">
|
||||
<s:sequence>
|
||||
<s:element minOccurs="0" maxOccurs="unbounded" name="Factura" nillable="true" type="tns:Factura" />
|
||||
</s:sequence>
|
||||
</s:complexType>
|
||||
<s:complexType name="Factura">
|
||||
<s:sequence>
|
||||
<s:element minOccurs="1" maxOccurs="1" name="Uuid" type="s1:guid" />
|
||||
<s:element minOccurs="0" maxOccurs="1" name="RfcEmisor" type="s:string" />
|
||||
<s:element minOccurs="0" maxOccurs="1" name="RfcReceptor" type="s:string" />
|
||||
</s:sequence>
|
||||
</s:complexType>
|
||||
<s:element name="ObtieneRelacionados">
|
||||
<s:complexType>
|
||||
<s:sequence>
|
||||
<s:element minOccurs="0" maxOccurs="1" name="RfcEmisor" type="s:string" />
|
||||
<s:element minOccurs="0" maxOccurs="1" name="Usuario" type="s:string" />
|
||||
<s:element minOccurs="0" maxOccurs="1" name="Clave" type="s:string" />
|
||||
<s:element minOccurs="0" maxOccurs="1" name="CertB64" type="s:string" />
|
||||
<s:element minOccurs="0" maxOccurs="1" name="KeyB64" type="s:string" />
|
||||
<s:element minOccurs="0" maxOccurs="1" name="ClaveLlave" type="s:string" />
|
||||
<s:element minOccurs="0" maxOccurs="1" name="Uuid" type="s:string" />
|
||||
</s:sequence>
|
||||
</s:complexType>
|
||||
</s:element>
|
||||
<s:element name="ObtieneRelacionadosResponse">
|
||||
<s:complexType>
|
||||
<s:sequence>
|
||||
<s:element minOccurs="0" maxOccurs="1" name="ObtieneRelacionadosResult" type="tns:StructRelations" />
|
||||
</s:sequence>
|
||||
</s:complexType>
|
||||
</s:element>
|
||||
</s:schema>
|
||||
<s:schema elementFormDefault="qualified" targetNamespace="http://microsoft.com/wsdl/types/">
|
||||
<s:simpleType name="guid">
|
||||
<s:restriction base="s:string">
|
||||
<s:pattern value="[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}" />
|
||||
</s:restriction>
|
||||
</s:simpleType>
|
||||
</s:schema>
|
||||
</wsdl:types>
|
||||
<wsdl:message name="CancelTestSoapIn">
|
||||
<wsdl:part name="parameters" element="tns:CancelTest" />
|
||||
</wsdl:message>
|
||||
<wsdl:message name="CancelTestSoapOut">
|
||||
<wsdl:part name="parameters" element="tns:CancelTestResponse" />
|
||||
</wsdl:message>
|
||||
<wsdl:message name="ConsultaVigenciaSoapIn">
|
||||
<wsdl:part name="parameters" element="tns:ConsultaVigencia" />
|
||||
</wsdl:message>
|
||||
<wsdl:message name="ConsultaVigenciaSoapOut">
|
||||
<wsdl:part name="parameters" element="tns:ConsultaVigenciaResponse" />
|
||||
</wsdl:message>
|
||||
<wsdl:message name="ConsultaVigenciaTestSoapIn">
|
||||
<wsdl:part name="parameters" element="tns:ConsultaVigenciaTest" />
|
||||
</wsdl:message>
|
||||
<wsdl:message name="ConsultaVigenciaTestSoapOut">
|
||||
<wsdl:part name="parameters" element="tns:ConsultaVigenciaTestResponse" />
|
||||
</wsdl:message>
|
||||
<wsdl:message name="ObtienePendientesSoapIn">
|
||||
<wsdl:part name="parameters" element="tns:ObtienePendientes" />
|
||||
</wsdl:message>
|
||||
<wsdl:message name="ObtienePendientesSoapOut">
|
||||
<wsdl:part name="parameters" element="tns:ObtienePendientesResponse" />
|
||||
</wsdl:message>
|
||||
<wsdl:message name="ObtienePendientesTestSoapIn">
|
||||
<wsdl:part name="parameters" element="tns:ObtienePendientesTest" />
|
||||
</wsdl:message>
|
||||
<wsdl:message name="ObtienePendientesTestSoapOut">
|
||||
<wsdl:part name="parameters" element="tns:ObtienePendientesTestResponse" />
|
||||
</wsdl:message>
|
||||
<wsdl:message name="AceptaRechazaSoapIn">
|
||||
<wsdl:part name="parameters" element="tns:AceptaRechaza" />
|
||||
</wsdl:message>
|
||||
<wsdl:message name="AceptaRechazaSoapOut">
|
||||
<wsdl:part name="parameters" element="tns:AceptaRechazaResponse" />
|
||||
</wsdl:message>
|
||||
<wsdl:message name="AceptaRechazaTestSoapIn">
|
||||
<wsdl:part name="parameters" element="tns:AceptaRechazaTest" />
|
||||
</wsdl:message>
|
||||
<wsdl:message name="AceptaRechazaTestSoapOut">
|
||||
<wsdl:part name="parameters" element="tns:AceptaRechazaTestResponse" />
|
||||
</wsdl:message>
|
||||
<wsdl:message name="ObtieneRelacionadosTestSoapIn">
|
||||
<wsdl:part name="parameters" element="tns:ObtieneRelacionadosTest" />
|
||||
</wsdl:message>
|
||||
<wsdl:message name="ObtieneRelacionadosTestSoapOut">
|
||||
<wsdl:part name="parameters" element="tns:ObtieneRelacionadosTestResponse" />
|
||||
</wsdl:message>
|
||||
<wsdl:message name="ObtieneRelacionadosSoapIn">
|
||||
<wsdl:part name="parameters" element="tns:ObtieneRelacionados" />
|
||||
</wsdl:message>
|
||||
<wsdl:message name="ObtieneRelacionadosSoapOut">
|
||||
<wsdl:part name="parameters" element="tns:ObtieneRelacionadosResponse" />
|
||||
</wsdl:message>
|
||||
<wsdl:portType name="CancelacionSoap">
|
||||
<wsdl:operation name="CancelTest">
|
||||
<wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">Cancela un Cfdi en pruebas</wsdl:documentation>
|
||||
<wsdl:input message="tns:CancelTestSoapIn" />
|
||||
<wsdl:output message="tns:CancelTestSoapOut" />
|
||||
</wsdl:operation>
|
||||
<wsdl:operation name="ConsultaVigencia">
|
||||
<wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">Obtiene el estatus de un Cfdi en producción</wsdl:documentation>
|
||||
<wsdl:input message="tns:ConsultaVigenciaSoapIn" />
|
||||
<wsdl:output message="tns:ConsultaVigenciaSoapOut" />
|
||||
</wsdl:operation>
|
||||
<wsdl:operation name="ConsultaVigenciaTest">
|
||||
<wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">Obtiene el estatus de un Cfdi en pruebas</wsdl:documentation>
|
||||
<wsdl:input message="tns:ConsultaVigenciaTestSoapIn" />
|
||||
<wsdl:output message="tns:ConsultaVigenciaTestSoapOut" />
|
||||
</wsdl:operation>
|
||||
<wsdl:operation name="ObtienePendientes">
|
||||
<wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">Obtiene los Uuid pendientes de aceptar/rechazar de un Receptor (Producción)</wsdl:documentation>
|
||||
<wsdl:input message="tns:ObtienePendientesSoapIn" />
|
||||
<wsdl:output message="tns:ObtienePendientesSoapOut" />
|
||||
</wsdl:operation>
|
||||
<wsdl:operation name="ObtienePendientesTest">
|
||||
<wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">Obtiene los Uuid pendientes de aceptar/rechazar de un Receptor (Pruebas)</wsdl:documentation>
|
||||
<wsdl:input message="tns:ObtienePendientesTestSoapIn" />
|
||||
<wsdl:output message="tns:ObtienePendientesTestSoapOut" />
|
||||
</wsdl:operation>
|
||||
<wsdl:operation name="AceptaRechaza">
|
||||
<wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">Acepta/Rechaza una solicitud pendiente de cancelación (Producción)</wsdl:documentation>
|
||||
<wsdl:input message="tns:AceptaRechazaSoapIn" />
|
||||
<wsdl:output message="tns:AceptaRechazaSoapOut" />
|
||||
</wsdl:operation>
|
||||
<wsdl:operation name="AceptaRechazaTest">
|
||||
<wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">Acepta/Rechaza una solicitud pendiente de cancelación (Pruebas)</wsdl:documentation>
|
||||
<wsdl:input message="tns:AceptaRechazaTestSoapIn" />
|
||||
<wsdl:output message="tns:AceptaRechazaTestSoapOut" />
|
||||
</wsdl:operation>
|
||||
<wsdl:operation name="ObtieneRelacionadosTest">
|
||||
<wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">Obtiene el/los Cfdi(s) relacionado(s) de un UUID de un RFC (Pruebas)</wsdl:documentation>
|
||||
<wsdl:input message="tns:ObtieneRelacionadosTestSoapIn" />
|
||||
<wsdl:output message="tns:ObtieneRelacionadosTestSoapOut" />
|
||||
</wsdl:operation>
|
||||
<wsdl:operation name="ObtieneRelacionados">
|
||||
<wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">Obtiene el/los Cfdi(s) relacionado(s) de un UUID de un RFC</wsdl:documentation>
|
||||
<wsdl:input message="tns:ObtieneRelacionadosSoapIn" />
|
||||
<wsdl:output message="tns:ObtieneRelacionadosSoapOut" />
|
||||
</wsdl:operation>
|
||||
</wsdl:portType>
|
||||
<wsdl:binding name="CancelacionSoap" type="tns:CancelacionSoap">
|
||||
<soap:binding transport="http://schemas.xmlsoap.org/soap/http" />
|
||||
<wsdl:operation name="CancelTest">
|
||||
<soap:operation soapAction="http://tempuri.org/CancelTest" style="document" />
|
||||
<wsdl:input>
|
||||
<soap:body use="literal" />
|
||||
</wsdl:input>
|
||||
<wsdl:output>
|
||||
<soap:body use="literal" />
|
||||
</wsdl:output>
|
||||
</wsdl:operation>
|
||||
<wsdl:operation name="ConsultaVigencia">
|
||||
<soap:operation soapAction="http://tempuri.org/ConsultaVigencia" style="document" />
|
||||
<wsdl:input>
|
||||
<soap:body use="literal" />
|
||||
</wsdl:input>
|
||||
<wsdl:output>
|
||||
<soap:body use="literal" />
|
||||
</wsdl:output>
|
||||
</wsdl:operation>
|
||||
<wsdl:operation name="ConsultaVigenciaTest">
|
||||
<soap:operation soapAction="http://tempuri.org/ConsultaVigenciaTest" style="document" />
|
||||
<wsdl:input>
|
||||
<soap:body use="literal" />
|
||||
</wsdl:input>
|
||||
<wsdl:output>
|
||||
<soap:body use="literal" />
|
||||
</wsdl:output>
|
||||
</wsdl:operation>
|
||||
<wsdl:operation name="ObtienePendientes">
|
||||
<soap:operation soapAction="http://tempuri.org/ObtienePendientes" style="document" />
|
||||
<wsdl:input>
|
||||
<soap:body use="literal" />
|
||||
</wsdl:input>
|
||||
<wsdl:output>
|
||||
<soap:body use="literal" />
|
||||
</wsdl:output>
|
||||
</wsdl:operation>
|
||||
<wsdl:operation name="ObtienePendientesTest">
|
||||
<soap:operation soapAction="http://tempuri.org/ObtienePendientesTest" style="document" />
|
||||
<wsdl:input>
|
||||
<soap:body use="literal" />
|
||||
</wsdl:input>
|
||||
<wsdl:output>
|
||||
<soap:body use="literal" />
|
||||
</wsdl:output>
|
||||
</wsdl:operation>
|
||||
<wsdl:operation name="AceptaRechaza">
|
||||
<soap:operation soapAction="http://tempuri.org/AceptaRechaza" style="document" />
|
||||
<wsdl:input>
|
||||
<soap:body use="literal" />
|
||||
</wsdl:input>
|
||||
<wsdl:output>
|
||||
<soap:body use="literal" />
|
||||
</wsdl:output>
|
||||
</wsdl:operation>
|
||||
<wsdl:operation name="AceptaRechazaTest">
|
||||
<soap:operation soapAction="http://tempuri.org/AceptaRechazaTest" style="document" />
|
||||
<wsdl:input>
|
||||
<soap:body use="literal" />
|
||||
</wsdl:input>
|
||||
<wsdl:output>
|
||||
<soap:body use="literal" />
|
||||
</wsdl:output>
|
||||
</wsdl:operation>
|
||||
<wsdl:operation name="ObtieneRelacionadosTest">
|
||||
<soap:operation soapAction="http://tempuri.org/ObtieneRelacionadosTest" style="document" />
|
||||
<wsdl:input>
|
||||
<soap:body use="literal" />
|
||||
</wsdl:input>
|
||||
<wsdl:output>
|
||||
<soap:body use="literal" />
|
||||
</wsdl:output>
|
||||
</wsdl:operation>
|
||||
<wsdl:operation name="ObtieneRelacionados">
|
||||
<soap:operation soapAction="http://tempuri.org/ObtieneRelacionados" style="document" />
|
||||
<wsdl:input>
|
||||
<soap:body use="literal" />
|
||||
</wsdl:input>
|
||||
<wsdl:output>
|
||||
<soap:body use="literal" />
|
||||
</wsdl:output>
|
||||
</wsdl:operation>
|
||||
</wsdl:binding>
|
||||
<wsdl:binding name="CancelacionSoap12" type="tns:CancelacionSoap">
|
||||
<soap12:binding transport="http://schemas.xmlsoap.org/soap/http" />
|
||||
<wsdl:operation name="CancelTest">
|
||||
<soap12:operation soapAction="http://tempuri.org/CancelTest" style="document" />
|
||||
<wsdl:input>
|
||||
<soap12:body use="literal" />
|
||||
</wsdl:input>
|
||||
<wsdl:output>
|
||||
<soap12:body use="literal" />
|
||||
</wsdl:output>
|
||||
</wsdl:operation>
|
||||
<wsdl:operation name="ConsultaVigencia">
|
||||
<soap12:operation soapAction="http://tempuri.org/ConsultaVigencia" style="document" />
|
||||
<wsdl:input>
|
||||
<soap12:body use="literal" />
|
||||
</wsdl:input>
|
||||
<wsdl:output>
|
||||
<soap12:body use="literal" />
|
||||
</wsdl:output>
|
||||
</wsdl:operation>
|
||||
<wsdl:operation name="ConsultaVigenciaTest">
|
||||
<soap12:operation soapAction="http://tempuri.org/ConsultaVigenciaTest" style="document" />
|
||||
<wsdl:input>
|
||||
<soap12:body use="literal" />
|
||||
</wsdl:input>
|
||||
<wsdl:output>
|
||||
<soap12:body use="literal" />
|
||||
</wsdl:output>
|
||||
</wsdl:operation>
|
||||
<wsdl:operation name="ObtienePendientes">
|
||||
<soap12:operation soapAction="http://tempuri.org/ObtienePendientes" style="document" />
|
||||
<wsdl:input>
|
||||
<soap12:body use="literal" />
|
||||
</wsdl:input>
|
||||
<wsdl:output>
|
||||
<soap12:body use="literal" />
|
||||
</wsdl:output>
|
||||
</wsdl:operation>
|
||||
<wsdl:operation name="ObtienePendientesTest">
|
||||
<soap12:operation soapAction="http://tempuri.org/ObtienePendientesTest" style="document" />
|
||||
<wsdl:input>
|
||||
<soap12:body use="literal" />
|
||||
</wsdl:input>
|
||||
<wsdl:output>
|
||||
<soap12:body use="literal" />
|
||||
</wsdl:output>
|
||||
</wsdl:operation>
|
||||
<wsdl:operation name="AceptaRechaza">
|
||||
<soap12:operation soapAction="http://tempuri.org/AceptaRechaza" style="document" />
|
||||
<wsdl:input>
|
||||
<soap12:body use="literal" />
|
||||
</wsdl:input>
|
||||
<wsdl:output>
|
||||
<soap12:body use="literal" />
|
||||
</wsdl:output>
|
||||
</wsdl:operation>
|
||||
<wsdl:operation name="AceptaRechazaTest">
|
||||
<soap12:operation soapAction="http://tempuri.org/AceptaRechazaTest" style="document" />
|
||||
<wsdl:input>
|
||||
<soap12:body use="literal" />
|
||||
</wsdl:input>
|
||||
<wsdl:output>
|
||||
<soap12:body use="literal" />
|
||||
</wsdl:output>
|
||||
</wsdl:operation>
|
||||
<wsdl:operation name="ObtieneRelacionadosTest">
|
||||
<soap12:operation soapAction="http://tempuri.org/ObtieneRelacionadosTest" style="document" />
|
||||
<wsdl:input>
|
||||
<soap12:body use="literal" />
|
||||
</wsdl:input>
|
||||
<wsdl:output>
|
||||
<soap12:body use="literal" />
|
||||
</wsdl:output>
|
||||
</wsdl:operation>
|
||||
<wsdl:operation name="ObtieneRelacionados">
|
||||
<soap12:operation soapAction="http://tempuri.org/ObtieneRelacionados" style="document" />
|
||||
<wsdl:input>
|
||||
<soap12:body use="literal" />
|
||||
</wsdl:input>
|
||||
<wsdl:output>
|
||||
<soap12:body use="literal" />
|
||||
</wsdl:output>
|
||||
</wsdl:operation>
|
||||
</wsdl:binding>
|
||||
<wsdl:service name="Cancelacion">
|
||||
<wsdl:port name="CancelacionSoap" binding="tns:CancelacionSoap">
|
||||
<soap:address location="http://cancel.gofac.com.mx/Cancelacion.asmx" />
|
||||
</wsdl:port>
|
||||
<wsdl:port name="CancelacionSoap12" binding="tns:CancelacionSoap12">
|
||||
<soap12:address location="http://cancel.gofac.com.mx/Cancelacion.asmx" />
|
||||
</wsdl:port>
|
||||
</wsdl:service>
|
||||
</wsdl:definitions>
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,32 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<ReferenceGroup xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" ID="004539b0-6d23-4ee4-993a-75ed70d31f2c" xmlns="urn:schemas-microsoft-com:xml-wcfservicemap">
|
||||
<ClientOptions>
|
||||
<GenerateAsynchronousMethods>false</GenerateAsynchronousMethods>
|
||||
<GenerateTaskBasedAsynchronousMethod>true</GenerateTaskBasedAsynchronousMethod>
|
||||
<EnableDataBinding>true</EnableDataBinding>
|
||||
<ExcludedTypes />
|
||||
<ImportXmlTypes>false</ImportXmlTypes>
|
||||
<GenerateInternalTypes>false</GenerateInternalTypes>
|
||||
<GenerateMessageContracts>false</GenerateMessageContracts>
|
||||
<NamespaceMappings />
|
||||
<CollectionMappings />
|
||||
<GenerateSerializableTypes>true</GenerateSerializableTypes>
|
||||
<Serializer>Auto</Serializer>
|
||||
<UseSerializerForFaults>true</UseSerializerForFaults>
|
||||
<ReferenceAllAssemblies>true</ReferenceAllAssemblies>
|
||||
<ReferencedAssemblies />
|
||||
<ReferencedDataContractTypes />
|
||||
<ServiceContractMappings />
|
||||
</ClientOptions>
|
||||
<MetadataSources>
|
||||
<MetadataSource Address="http://cancel.gofac.com.mx/Cancelacion.asmx" Protocol="http" SourceId="1" />
|
||||
</MetadataSources>
|
||||
<Metadata>
|
||||
<MetadataFile FileName="Cancelacion.wsdl" MetadataType="Wsdl" ID="ff2c95bb-8f32-4eec-9cbc-2d17f26b28e6" SourceId="1" SourceUrl="http://cancel.gofac.com.mx/Cancelacion.asmx?wsdl" />
|
||||
<MetadataFile FileName="Cancelacion.disco" MetadataType="Disco" ID="1ca6b7ff-0c11-4b5e-8d82-85e1208cf711" SourceId="1" SourceUrl="http://cancel.gofac.com.mx/Cancelacion.asmx?disco" />
|
||||
</Metadata>
|
||||
<Extensions>
|
||||
<ExtensionFile FileName="configuration91.svcinfo" Name="configuration91.svcinfo" />
|
||||
<ExtensionFile FileName="configuration.svcinfo" Name="configuration.svcinfo" />
|
||||
</Extensions>
|
||||
</ReferenceGroup>
|
||||
@@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<configurationSnapshot xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="urn:schemas-microsoft-com:xml-wcfconfigurationsnapshot">
|
||||
<behaviors />
|
||||
<bindings>
|
||||
<binding digest="System.ServiceModel.Configuration.BasicHttpBindingElement, System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089:<?xml version="1.0" encoding="utf-16"?><Data name="CancelacionSoap" />" bindingType="basicHttpBinding" name="CancelacionSoap" />
|
||||
</bindings>
|
||||
<endpoints>
|
||||
<endpoint normalizedDigest="<?xml version="1.0" encoding="utf-16"?><Data address="http://cancel.gofac.com.mx/Cancelacion.asmx" binding="basicHttpBinding" bindingConfiguration="CancelacionSoap" contract="Cancelacion.CancelacionSoap" name="CancelacionSoap" />" digest="<?xml version="1.0" encoding="utf-16"?><Data address="http://cancel.gofac.com.mx/Cancelacion.asmx" binding="basicHttpBinding" bindingConfiguration="CancelacionSoap" contract="Cancelacion.CancelacionSoap" name="CancelacionSoap" />" contractName="Cancelacion.CancelacionSoap" name="CancelacionSoap" />
|
||||
</endpoints>
|
||||
</configurationSnapshot>
|
||||
@@ -0,0 +1,201 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<SavedWcfConfigurationInformation xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" Version="9.1" CheckSum="0dWLJQnzofit1ubar4f0hO6z9K9aEYiSHovPW3oJEp8=">
|
||||
<bindingConfigurations>
|
||||
<bindingConfiguration bindingType="basicHttpBinding" name="CancelacionSoap">
|
||||
<properties>
|
||||
<property path="/name" isComplexType="false" isExplicitlyDefined="true" clrType="System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<serializedValue>CancelacionSoap</serializedValue>
|
||||
</property>
|
||||
<property path="/closeTimeout" isComplexType="false" isExplicitlyDefined="true" clrType="System.TimeSpan, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<serializedValue />
|
||||
</property>
|
||||
<property path="/openTimeout" isComplexType="false" isExplicitlyDefined="true" clrType="System.TimeSpan, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<serializedValue />
|
||||
</property>
|
||||
<property path="/receiveTimeout" isComplexType="false" isExplicitlyDefined="true" clrType="System.TimeSpan, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<serializedValue />
|
||||
</property>
|
||||
<property path="/sendTimeout" isComplexType="false" isExplicitlyDefined="true" clrType="System.TimeSpan, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<serializedValue />
|
||||
</property>
|
||||
<property path="/allowCookies" isComplexType="false" isExplicitlyDefined="true" clrType="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<serializedValue />
|
||||
</property>
|
||||
<property path="/bypassProxyOnLocal" isComplexType="false" isExplicitlyDefined="true" clrType="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<serializedValue />
|
||||
</property>
|
||||
<property path="/hostNameComparisonMode" isComplexType="false" isExplicitlyDefined="false" clrType="System.ServiceModel.HostNameComparisonMode, System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<serializedValue>StrongWildcard</serializedValue>
|
||||
</property>
|
||||
<property path="/maxBufferPoolSize" isComplexType="false" isExplicitlyDefined="true" clrType="System.Int64, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<serializedValue />
|
||||
</property>
|
||||
<property path="/maxBufferSize" isComplexType="false" isExplicitlyDefined="false" clrType="System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<serializedValue>65536</serializedValue>
|
||||
</property>
|
||||
<property path="/maxReceivedMessageSize" isComplexType="false" isExplicitlyDefined="true" clrType="System.Int64, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<serializedValue />
|
||||
</property>
|
||||
<property path="/proxyAddress" isComplexType="false" isExplicitlyDefined="false" clrType="System.Uri, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<serializedValue />
|
||||
</property>
|
||||
<property path="/readerQuotas" isComplexType="true" isExplicitlyDefined="false" clrType="System.ServiceModel.Configuration.XmlDictionaryReaderQuotasElement, System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<serializedValue>System.ServiceModel.Configuration.XmlDictionaryReaderQuotasElement</serializedValue>
|
||||
</property>
|
||||
<property path="/readerQuotas/maxDepth" isComplexType="false" isExplicitlyDefined="false" clrType="System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<serializedValue>0</serializedValue>
|
||||
</property>
|
||||
<property path="/readerQuotas/maxStringContentLength" isComplexType="false" isExplicitlyDefined="false" clrType="System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<serializedValue>0</serializedValue>
|
||||
</property>
|
||||
<property path="/readerQuotas/maxArrayLength" isComplexType="false" isExplicitlyDefined="false" clrType="System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<serializedValue>0</serializedValue>
|
||||
</property>
|
||||
<property path="/readerQuotas/maxBytesPerRead" isComplexType="false" isExplicitlyDefined="false" clrType="System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<serializedValue>0</serializedValue>
|
||||
</property>
|
||||
<property path="/readerQuotas/maxNameTableCharCount" isComplexType="false" isExplicitlyDefined="false" clrType="System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<serializedValue>0</serializedValue>
|
||||
</property>
|
||||
<property path="/textEncoding" isComplexType="false" isExplicitlyDefined="false" clrType="System.Text.Encoding, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<serializedValue>System.Text.UTF8Encoding</serializedValue>
|
||||
</property>
|
||||
<property path="/transferMode" isComplexType="false" isExplicitlyDefined="false" clrType="System.ServiceModel.TransferMode, System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<serializedValue>Buffered</serializedValue>
|
||||
</property>
|
||||
<property path="/useDefaultWebProxy" isComplexType="false" isExplicitlyDefined="true" clrType="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<serializedValue />
|
||||
</property>
|
||||
<property path="/messageEncoding" isComplexType="false" isExplicitlyDefined="false" clrType="System.ServiceModel.WSMessageEncoding, System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<serializedValue>Text</serializedValue>
|
||||
</property>
|
||||
<property path="/security" isComplexType="true" isExplicitlyDefined="false" clrType="System.ServiceModel.Configuration.BasicHttpSecurityElement, System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<serializedValue>System.ServiceModel.Configuration.BasicHttpSecurityElement</serializedValue>
|
||||
</property>
|
||||
<property path="/security/mode" isComplexType="false" isExplicitlyDefined="false" clrType="System.ServiceModel.BasicHttpSecurityMode, System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<serializedValue>None</serializedValue>
|
||||
</property>
|
||||
<property path="/security/transport" isComplexType="true" isExplicitlyDefined="false" clrType="System.ServiceModel.Configuration.HttpTransportSecurityElement, System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<serializedValue>System.ServiceModel.Configuration.HttpTransportSecurityElement</serializedValue>
|
||||
</property>
|
||||
<property path="/security/transport/clientCredentialType" isComplexType="false" isExplicitlyDefined="false" clrType="System.ServiceModel.HttpClientCredentialType, System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<serializedValue>None</serializedValue>
|
||||
</property>
|
||||
<property path="/security/transport/proxyCredentialType" isComplexType="false" isExplicitlyDefined="false" clrType="System.ServiceModel.HttpProxyCredentialType, System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<serializedValue>None</serializedValue>
|
||||
</property>
|
||||
<property path="/security/transport/extendedProtectionPolicy" isComplexType="true" isExplicitlyDefined="false" clrType="System.Security.Authentication.ExtendedProtection.Configuration.ExtendedProtectionPolicyElement, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<serializedValue>System.Security.Authentication.ExtendedProtection.Configuration.ExtendedProtectionPolicyElement</serializedValue>
|
||||
</property>
|
||||
<property path="/security/transport/extendedProtectionPolicy/policyEnforcement" isComplexType="false" isExplicitlyDefined="false" clrType="System.Security.Authentication.ExtendedProtection.PolicyEnforcement, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<serializedValue>Never</serializedValue>
|
||||
</property>
|
||||
<property path="/security/transport/extendedProtectionPolicy/protectionScenario" isComplexType="false" isExplicitlyDefined="false" clrType="System.Security.Authentication.ExtendedProtection.ProtectionScenario, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<serializedValue>TransportSelected</serializedValue>
|
||||
</property>
|
||||
<property path="/security/transport/extendedProtectionPolicy/customServiceNames" isComplexType="true" isExplicitlyDefined="false" clrType="System.Security.Authentication.ExtendedProtection.Configuration.ServiceNameElementCollection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<serializedValue>(Collection)</serializedValue>
|
||||
</property>
|
||||
<property path="/security/transport/realm" isComplexType="false" isExplicitlyDefined="false" clrType="System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<serializedValue />
|
||||
</property>
|
||||
<property path="/security/message" isComplexType="true" isExplicitlyDefined="false" clrType="System.ServiceModel.Configuration.BasicHttpMessageSecurityElement, System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<serializedValue>System.ServiceModel.Configuration.BasicHttpMessageSecurityElement</serializedValue>
|
||||
</property>
|
||||
<property path="/security/message/clientCredentialType" isComplexType="false" isExplicitlyDefined="false" clrType="System.ServiceModel.BasicHttpMessageCredentialType, System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<serializedValue>UserName</serializedValue>
|
||||
</property>
|
||||
<property path="/security/message/algorithmSuite" isComplexType="false" isExplicitlyDefined="false" clrType="System.ServiceModel.Security.SecurityAlgorithmSuite, System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<serializedValue>Default</serializedValue>
|
||||
</property>
|
||||
</properties>
|
||||
</bindingConfiguration>
|
||||
</bindingConfigurations>
|
||||
<endpoints>
|
||||
<endpoint name="CancelacionSoap" contract="Cancelacion.CancelacionSoap" bindingType="basicHttpBinding" address="http://cancel.gofac.com.mx/Cancelacion.asmx" bindingConfiguration="CancelacionSoap">
|
||||
<properties>
|
||||
<property path="/address" isComplexType="false" isExplicitlyDefined="true" clrType="System.Uri, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<serializedValue>http://cancel.gofac.com.mx/Cancelacion.asmx</serializedValue>
|
||||
</property>
|
||||
<property path="/behaviorConfiguration" isComplexType="false" isExplicitlyDefined="false" clrType="System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<serializedValue />
|
||||
</property>
|
||||
<property path="/binding" isComplexType="false" isExplicitlyDefined="true" clrType="System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<serializedValue>basicHttpBinding</serializedValue>
|
||||
</property>
|
||||
<property path="/bindingConfiguration" isComplexType="false" isExplicitlyDefined="true" clrType="System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<serializedValue>CancelacionSoap</serializedValue>
|
||||
</property>
|
||||
<property path="/contract" isComplexType="false" isExplicitlyDefined="true" clrType="System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<serializedValue>Cancelacion.CancelacionSoap</serializedValue>
|
||||
</property>
|
||||
<property path="/headers" isComplexType="true" isExplicitlyDefined="false" clrType="System.ServiceModel.Configuration.AddressHeaderCollectionElement, System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<serializedValue>System.ServiceModel.Configuration.AddressHeaderCollectionElement</serializedValue>
|
||||
</property>
|
||||
<property path="/headers/headers" isComplexType="false" isExplicitlyDefined="true" clrType="System.ServiceModel.Channels.AddressHeaderCollection, System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<serializedValue><Header /></serializedValue>
|
||||
</property>
|
||||
<property path="/identity" isComplexType="true" isExplicitlyDefined="false" clrType="System.ServiceModel.Configuration.IdentityElement, System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<serializedValue>System.ServiceModel.Configuration.IdentityElement</serializedValue>
|
||||
</property>
|
||||
<property path="/identity/userPrincipalName" isComplexType="true" isExplicitlyDefined="false" clrType="System.ServiceModel.Configuration.UserPrincipalNameElement, System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<serializedValue>System.ServiceModel.Configuration.UserPrincipalNameElement</serializedValue>
|
||||
</property>
|
||||
<property path="/identity/userPrincipalName/value" isComplexType="false" isExplicitlyDefined="false" clrType="System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<serializedValue />
|
||||
</property>
|
||||
<property path="/identity/servicePrincipalName" isComplexType="true" isExplicitlyDefined="false" clrType="System.ServiceModel.Configuration.ServicePrincipalNameElement, System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<serializedValue>System.ServiceModel.Configuration.ServicePrincipalNameElement</serializedValue>
|
||||
</property>
|
||||
<property path="/identity/servicePrincipalName/value" isComplexType="false" isExplicitlyDefined="false" clrType="System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<serializedValue />
|
||||
</property>
|
||||
<property path="/identity/dns" isComplexType="true" isExplicitlyDefined="false" clrType="System.ServiceModel.Configuration.DnsElement, System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<serializedValue>System.ServiceModel.Configuration.DnsElement</serializedValue>
|
||||
</property>
|
||||
<property path="/identity/dns/value" isComplexType="false" isExplicitlyDefined="false" clrType="System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<serializedValue />
|
||||
</property>
|
||||
<property path="/identity/rsa" isComplexType="true" isExplicitlyDefined="false" clrType="System.ServiceModel.Configuration.RsaElement, System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<serializedValue>System.ServiceModel.Configuration.RsaElement</serializedValue>
|
||||
</property>
|
||||
<property path="/identity/rsa/value" isComplexType="false" isExplicitlyDefined="false" clrType="System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<serializedValue />
|
||||
</property>
|
||||
<property path="/identity/certificate" isComplexType="true" isExplicitlyDefined="false" clrType="System.ServiceModel.Configuration.CertificateElement, System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<serializedValue>System.ServiceModel.Configuration.CertificateElement</serializedValue>
|
||||
</property>
|
||||
<property path="/identity/certificate/encodedValue" isComplexType="false" isExplicitlyDefined="false" clrType="System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<serializedValue />
|
||||
</property>
|
||||
<property path="/identity/certificateReference" isComplexType="true" isExplicitlyDefined="false" clrType="System.ServiceModel.Configuration.CertificateReferenceElement, System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<serializedValue>System.ServiceModel.Configuration.CertificateReferenceElement</serializedValue>
|
||||
</property>
|
||||
<property path="/identity/certificateReference/storeName" isComplexType="false" isExplicitlyDefined="false" clrType="System.Security.Cryptography.X509Certificates.StoreName, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<serializedValue>My</serializedValue>
|
||||
</property>
|
||||
<property path="/identity/certificateReference/storeLocation" isComplexType="false" isExplicitlyDefined="false" clrType="System.Security.Cryptography.X509Certificates.StoreLocation, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<serializedValue>LocalMachine</serializedValue>
|
||||
</property>
|
||||
<property path="/identity/certificateReference/x509FindType" isComplexType="false" isExplicitlyDefined="false" clrType="System.Security.Cryptography.X509Certificates.X509FindType, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<serializedValue>FindBySubjectDistinguishedName</serializedValue>
|
||||
</property>
|
||||
<property path="/identity/certificateReference/findValue" isComplexType="false" isExplicitlyDefined="false" clrType="System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<serializedValue />
|
||||
</property>
|
||||
<property path="/identity/certificateReference/isChainIncluded" isComplexType="false" isExplicitlyDefined="false" clrType="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<serializedValue>False</serializedValue>
|
||||
</property>
|
||||
<property path="/name" isComplexType="false" isExplicitlyDefined="true" clrType="System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<serializedValue>CancelacionSoap</serializedValue>
|
||||
</property>
|
||||
<property path="/kind" isComplexType="false" isExplicitlyDefined="false" clrType="System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<serializedValue />
|
||||
</property>
|
||||
<property path="/endpointConfiguration" isComplexType="false" isExplicitlyDefined="false" clrType="System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<serializedValue />
|
||||
</property>
|
||||
</properties>
|
||||
</endpoint>
|
||||
</endpoints>
|
||||
</SavedWcfConfigurationInformation>
|
||||
@@ -0,0 +1,18 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<configuration>
|
||||
<configSections>
|
||||
<sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
|
||||
<section name="ClbNegBICFDv3_2.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
|
||||
</sectionGroup>
|
||||
</configSections>
|
||||
<applicationSettings>
|
||||
<ClbNegBICFDv3_2.Properties.Settings>
|
||||
<setting name="ClbNegBICFDv3_2_WebReference_Service1" serializeAs="String">
|
||||
<value>http://localhost:4210/Service1.asmx</value>
|
||||
</setting>
|
||||
<setting name="ClbNegBICFD_WebReference_Service1" serializeAs="String">
|
||||
<value>http://205.251.132.234/TimbreCFDi/service1.asmx</value>
|
||||
</setting>
|
||||
</ClbNegBICFDv3_2.Properties.Settings>
|
||||
</applicationSettings>
|
||||
</configuration>
|
||||
3003
ADSUtilService-borrar/ADSTimbradoLibrary/Logic/LogicSat.cs
Normal file
3003
ADSUtilService-borrar/ADSTimbradoLibrary/Logic/LogicSat.cs
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,16 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ADSNetLibrary.PacsTimbrado.SAT
|
||||
{
|
||||
public class AcuseCancelacionSAT
|
||||
{
|
||||
public string CodigoEstatus { get; set; }
|
||||
public string EsCancelable { get; set; }
|
||||
public string Estado { get; set; }
|
||||
public string EstatusCancelacion { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ADSNetLibrary.PacsTimbrado.SAT
|
||||
{
|
||||
[Serializable]
|
||||
public class CFDIComercioExterior11
|
||||
{
|
||||
public string MotivoTraslado { get; set; }
|
||||
public string TipoOperacion { get; set; } = "";
|
||||
public string ClavedePedimento { get; set; } = "";
|
||||
public string CertificadoOrigen { get; set; } = "";
|
||||
public string Incoterm { get; set; } = "";
|
||||
public string Subdivision { get; set; } = "";
|
||||
public decimal TipoCambioUSD { get; set; }
|
||||
public string NumCertificadoOrigen { get; set; } = "";
|
||||
public string NumeroExportadorConfiable { get; set; } = "";
|
||||
public string Observaciones { get; set; } = "";
|
||||
public CFDIComercioExterior11Emisor Emisor { get; set; }
|
||||
public CFDIComercioExterior11Receptor Receptor { get; set; }
|
||||
public CFDIComercioExterior11Receptor Destinatario { get; set; }
|
||||
public List<CFDIComercioExterior11Mercancias> Mercancias { get; set; }
|
||||
public bool AplicaComercioExteriorSubProyecto { get; set; }
|
||||
|
||||
public decimal TotalUSD
|
||||
{
|
||||
get
|
||||
{
|
||||
return (from c in Mercancias
|
||||
select c.ValorDolares).Sum();
|
||||
}
|
||||
}
|
||||
public CFDIComercioExterior11()
|
||||
{
|
||||
Emisor = new CFDIComercioExterior11Emisor();
|
||||
Receptor = new CFDIComercioExterior11Receptor();
|
||||
Destinatario = new CFDIComercioExterior11Receptor();
|
||||
Mercancias = new List<CFDIComercioExterior11Mercancias>();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ADSNetLibrary.PacsTimbrado.SAT
|
||||
{
|
||||
[Serializable]
|
||||
public class CFDIComercioExterior11Emisor
|
||||
{
|
||||
public string CURP { get; set; } = "";
|
||||
public string Calle { get; set; } = "";
|
||||
public string NumeroExterior { get; set; } = "";
|
||||
public string NumeroInterior { get; set; } = "";
|
||||
public string Colonia { get; set; } = "";
|
||||
public string Localidad { get; set; } = "";
|
||||
public string Referencia { get; set; } = "";
|
||||
public string Municipio { get; set; } = "";
|
||||
public string Estado { get; set; } = "";
|
||||
public string Pais { get; set; } = "";
|
||||
public string CP { get; set; } = "";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ADSNetLibrary.PacsTimbrado.SAT
|
||||
{
|
||||
[Serializable]
|
||||
public class CFDIComercioExterior11Mercancias
|
||||
{
|
||||
public string NoIdentificacion { get; set; } = "";
|
||||
public string FraccionArancelaria { get; set; } = "";
|
||||
public string UnidadAduana { get; set; } = "";
|
||||
public decimal CantidadAduana { get; set; }
|
||||
public decimal ValorUnitarioAduana { get; set; }
|
||||
public decimal ValorDolares { get; set; }
|
||||
public CFDIComercioExterior11MercanciasDescripcionesEspecificas DescripcionesEspecificas { get; set; } = new CFDIComercioExterior11MercanciasDescripcionesEspecificas();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ADSNetLibrary.PacsTimbrado.SAT
|
||||
{
|
||||
[Serializable]
|
||||
public class CFDIComercioExterior11MercanciasDescripcionesEspecificas
|
||||
{
|
||||
public string Marca { get; set; } = "";
|
||||
public string Modelo { get; set; } = "";
|
||||
public string SubModelo { get; set; } = "";
|
||||
public string NumeroSerie { get; set; } = "";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ADSNetLibrary.PacsTimbrado.SAT
|
||||
{
|
||||
public class CFDIComercioExterior11Propietario
|
||||
{
|
||||
public string NumRegIdTrib { get; set; } = "";
|
||||
public string ResidenciaFiscal { get; set; } = "";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ADSNetLibrary.PacsTimbrado.SAT
|
||||
{
|
||||
[Serializable]
|
||||
public class CFDIComercioExterior11Receptor
|
||||
{
|
||||
public string NumRegIdTrib { get; set; } = "";
|
||||
public string Nombre { get; set; } = "";
|
||||
public string Calle { get; set; } = "";
|
||||
public string NumeroExterior { get; set; } = "";
|
||||
public string NumeroInterior { get; set; } = "";
|
||||
public string Colonia { get; set; } = "";
|
||||
public string Localidad { get; set; } = "";
|
||||
public string Referencia { get; set; } = "";
|
||||
public string Municipio { get; set; } = "";
|
||||
public string Estado { get; set; } = "";
|
||||
public string CP { get; set; } = "";
|
||||
public string Pais { get; set; } = "";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ADSNetLibrary.PacsTimbrado.SAT
|
||||
{
|
||||
[Serializable]
|
||||
public class CFDIComplementoPagos
|
||||
{
|
||||
public DateTime FechaPago { get; set; }
|
||||
public string FormaDePagoP { get; set; } = "";
|
||||
public string MonedaP { get; set; } = "";
|
||||
public string NumOperacion { get; set; } = "";
|
||||
public decimal TipoCambioP { get; set; } = 0;
|
||||
public decimal Monto { get; set; }
|
||||
public string RfcEmisorCtaOrd { get; set; } = "";
|
||||
public string NomBancoOrdExt { get; set; } = "";
|
||||
public string CtaOrdenante { get; set; } = "";
|
||||
public string RfcEmisorCtaBen { get; set; } = "";
|
||||
public string CtaBeneficiario { get; set; } = "";
|
||||
public string TipoCadPago { get; set; } = "";
|
||||
public string CertPago { get; set; } = "";
|
||||
public string CadPago { get; set; } = "";
|
||||
public string SelloPago { get; set; } = "";
|
||||
public List<CFDIComplementoPagosDocsRelacionados> DocumentosRelacionados { get; set; }
|
||||
public List<CFDIConceptosImpuestos> Impuestos { get; set; }
|
||||
|
||||
public decimal TotalImpuestosRetenidos
|
||||
{
|
||||
get
|
||||
{
|
||||
return (from c in Impuestos
|
||||
where c.TrasladooRetencion == "R"
|
||||
select c.Importe).Sum();
|
||||
}
|
||||
}
|
||||
|
||||
public decimal TotalImpuestosTrasladados
|
||||
{
|
||||
get
|
||||
{
|
||||
return (from c in Impuestos
|
||||
where c.TrasladooRetencion == "T"
|
||||
select c.Importe).Sum();
|
||||
}
|
||||
}
|
||||
|
||||
public CFDIComplementoPagos()
|
||||
{
|
||||
DocumentosRelacionados = new List<CFDIComplementoPagosDocsRelacionados>();
|
||||
Impuestos = new List<CFDIConceptosImpuestos>();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ADSNetLibrary.PacsTimbrado.SAT
|
||||
{
|
||||
[Serializable]
|
||||
public class CFDIComplementoPagosDocsRelacionados
|
||||
{
|
||||
public string IdDocumento { get; set; } = "";
|
||||
public string Serie { get; set; } = "";
|
||||
public string Folio { get; set; } = "";
|
||||
public string MonedaDR { get; set; } = "";
|
||||
public string MetodoDePagoDR { get; set; } = "";
|
||||
public decimal TipoCambioDR { get; set; }
|
||||
public int NumParcialidad { get; set; } = 1;
|
||||
public decimal ImpSaldoAnt { get; set; }
|
||||
public decimal ImpPagado { get; set; }
|
||||
public decimal ImpSaldoInsoluto { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ADSNetLibrary.PacsTimbrado.SAT
|
||||
{
|
||||
[Serializable]
|
||||
public class CFDIComplementos
|
||||
{
|
||||
public CFDIComercioExterior11 ComercioExterior11 { get; set; }
|
||||
|
||||
public CFDIComplementos()
|
||||
{
|
||||
ComercioExterior11 = new CFDIComercioExterior11();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ADSNetLibrary.PacsTimbrado.SAT
|
||||
{
|
||||
[Serializable]
|
||||
public class CFDIComprobante
|
||||
{
|
||||
public string Version { get; set; }
|
||||
public string Serie { get; set; } = "";
|
||||
public string Folio { get; set; } = "";
|
||||
public string SerieFolio
|
||||
{
|
||||
get
|
||||
{
|
||||
// sino tiene serie no pone el guión
|
||||
return Serie == "" ? Folio : $"{Serie}-{Folio}";
|
||||
}
|
||||
}
|
||||
public string TipoDocto { get; set; }
|
||||
public string FormadePago { get; set; }
|
||||
public string CondicionesdePago { get; set; }
|
||||
public DateTime Fecha { get; set; }
|
||||
public decimal Subtotal { get; set; } = 0;
|
||||
public decimal Descuentos { get; set; } = 0;
|
||||
public string MotivoDescuento { get; set; } = "";
|
||||
public string TipoCambio { get; set; } = "1";
|
||||
public string Moneda { get; set; } = "";
|
||||
public string TipoComprobante { get; set; } = "";
|
||||
public string MetodoPago { get; set; } = "";
|
||||
public decimal Total { get; set; } = 0;
|
||||
public string LugarExpedicion { get; set; } = "";
|
||||
public string NumCuentaPago { get; set; } = "";
|
||||
public string Confirmacion { get; set; } = "";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ADSNetLibrary.PacsTimbrado.SAT
|
||||
{
|
||||
[Serializable]
|
||||
public class CFDIConceptos
|
||||
{
|
||||
public decimal Cantidad { get; set; } = 0.00M;
|
||||
public string Unidad { get; set; } = "";
|
||||
public string Noidentificacion { get; set; } = "";
|
||||
public string Descripcion { get; set; } = "";
|
||||
public decimal ValorUnitario { get; set; } = 0.00M;
|
||||
public decimal Importe { get; set; } = 0.00M;
|
||||
public string CuentaPredial { get; set; } = "";
|
||||
public string NumeroPedimento { get; set; } = "";
|
||||
public string ClaveProdServ { get; set; } = "";
|
||||
public string ClaveUnidad { get; set; } = "";
|
||||
public List<CFDIConceptosImpuestos> Impuestos { get; set; }
|
||||
public decimal Descuento { get; set; } = 0.00M;
|
||||
public decimal ImporteGravaIVAAdicional { get; set; } = 0.00M; // caso IEPS
|
||||
|
||||
public CFDIConceptos()
|
||||
{
|
||||
Impuestos = new List<CFDIConceptosImpuestos>();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ADSNetLibrary.PacsTimbrado.SAT
|
||||
{
|
||||
[Serializable]
|
||||
public class CFDIConceptosImpuestos
|
||||
{
|
||||
public string TrasladooRetencion { get; set; } = "T";
|
||||
public decimal Base { get; set; } = 0.00M;
|
||||
public string Impuesto { get; set; } = "";
|
||||
public string TipoFactor { get; set; } = "Tasa";
|
||||
public decimal TasaOCuota { get; set; } = 0.00M;
|
||||
public decimal Importe { get; set; } = 0.00M; // propiedad utilizada solo para hacer ajustes, por default toma la multiplicación de base * tasa
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ADSNetLibrary.PacsTimbrado.SAT
|
||||
{
|
||||
[Serializable]
|
||||
public class CFDIEmisor
|
||||
{
|
||||
public string RFC { get; set; }
|
||||
public string Nombre { get; set; }
|
||||
public string RegimenFiscal { get; set; }
|
||||
public string RegistroPatronal { get; set; }
|
||||
public string CURP { get; set; } = "";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,117 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ADSNetLibrary.PacsTimbrado.SAT
|
||||
{
|
||||
[Serializable]
|
||||
public class CFDINomina
|
||||
{
|
||||
public string Version { get; set; }
|
||||
public string TipoNomina { get; set; }
|
||||
public DateTime FechaPago { get; set; }
|
||||
public string FechaInicio { get; set; }
|
||||
public string FechaFin { get; set; }
|
||||
public int NumDiasPagados { get; set; }
|
||||
public CFDINominaReceptor Receptor { get; set; }
|
||||
public List<CFDINominaPercepciones> Percepciones { get; set; }
|
||||
public List<CFDINominaDeducciones> Deducciones { get; set; }
|
||||
public List<CFDINominaIncapacidades> Incapacidades { get; set; }
|
||||
public List<CFDINominaOtrosPagos> OtrosPagos { get; set; }
|
||||
public List<CFDINominaHorasExtras> HorasExtras { get; set; }
|
||||
public int CveNomina { get; set; }
|
||||
|
||||
public decimal TotalPercepciones
|
||||
{
|
||||
get
|
||||
{
|
||||
return TotalSueldos + TotalIndemnizacion + TotalJubilacion;
|
||||
}
|
||||
}
|
||||
|
||||
public decimal TotalDeducciones
|
||||
{
|
||||
get
|
||||
{
|
||||
return Math.Round(TotalDeduccionesOtras + TotalDeduccionesImpuestosRetenidos, 2);
|
||||
}
|
||||
}
|
||||
|
||||
public decimal TotalOtrosPagos
|
||||
{
|
||||
get
|
||||
{
|
||||
return OtrosPagos.Sum(item => item.Importe);
|
||||
}
|
||||
}
|
||||
public decimal TotalSueldos
|
||||
{
|
||||
get
|
||||
{
|
||||
return Percepciones.Where(per => !per.TipoPercepcion.Contiene("022", "023", "025", "039", "044")).Sum(per => per.ImporteGravado + per.ImporteExento);
|
||||
}
|
||||
}
|
||||
public decimal TotalIndemnizacion
|
||||
{
|
||||
get
|
||||
{
|
||||
return Percepciones.Where(per => per.TipoPercepcion.Contiene("022", "023", "025")).Sum(per => per.ImporteGravado + per.ImporteExento);
|
||||
}
|
||||
}
|
||||
|
||||
public decimal TotalJubilacion
|
||||
{
|
||||
get
|
||||
{
|
||||
return Percepciones.Where(per => per.TipoPercepcion.Contiene("039", "044")).Sum(per => per.ImporteGravado + per.ImporteExento);
|
||||
}
|
||||
}
|
||||
public decimal TotalPercepcionesGravado
|
||||
{
|
||||
get
|
||||
{
|
||||
// nota especificar claves
|
||||
return Percepciones.Sum(item => item.ImporteGravado);
|
||||
}
|
||||
}
|
||||
public decimal TotalPercepcionesExento
|
||||
{
|
||||
get
|
||||
{
|
||||
// nota especificar claves
|
||||
return Percepciones.Sum(item => item.ImporteExento);
|
||||
}
|
||||
}
|
||||
|
||||
public decimal TotalDeduccionesOtras
|
||||
{
|
||||
get
|
||||
{
|
||||
// DEDUCCIONES SE LE QUITAN LOS CENTAVOS
|
||||
return Math.Round(Deducciones.Where(ded => !ded.TipoDeduccion.Contiene("002")).Sum(ded => ded.Importe), 2);
|
||||
}
|
||||
}
|
||||
|
||||
public decimal TotalDeduccionesImpuestosRetenidos
|
||||
{
|
||||
get
|
||||
{
|
||||
// nota especificar claves
|
||||
return Math.Round(Deducciones.Where(ded => ded.TipoDeduccion.Contiene("002")).Sum(ded => ded.Importe), 2);
|
||||
}
|
||||
}
|
||||
|
||||
public CFDINomina()
|
||||
{
|
||||
Receptor = new CFDINominaReceptor();
|
||||
Percepciones = new List<CFDINominaPercepciones>();
|
||||
Deducciones = new List<CFDINominaDeducciones>();
|
||||
Incapacidades = new List<CFDINominaIncapacidades>();
|
||||
OtrosPagos = new List<CFDINominaOtrosPagos>();
|
||||
HorasExtras = new List<CFDINominaHorasExtras>();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ADSNetLibrary.PacsTimbrado.SAT
|
||||
{
|
||||
[Serializable]
|
||||
public class CFDINominaDeducciones
|
||||
{
|
||||
public string TipoDeduccion { get; set; }
|
||||
public string Clave { get; set; }
|
||||
public string Concepto { get; set; }
|
||||
public decimal Importe { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ADSNetLibrary.PacsTimbrado.SAT
|
||||
{
|
||||
[Serializable]
|
||||
public class CFDINominaHorasExtras
|
||||
{
|
||||
public string Dias { get; set; }
|
||||
public string TipoHoras { get; set; }
|
||||
public int HorasExtra { get; set; }
|
||||
public decimal ImportePagado { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ADSNetLibrary.PacsTimbrado.SAT
|
||||
{
|
||||
[Serializable]
|
||||
public class CFDINominaIncapacidades
|
||||
{
|
||||
public string DiasIncapacidad { get; set; }
|
||||
public string TipoIncapacidad { get; set; }
|
||||
public decimal Importe { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ADSNetLibrary.PacsTimbrado.SAT
|
||||
{
|
||||
|
||||
[Serializable]
|
||||
public class CFDINominaOtrosPagos
|
||||
{
|
||||
public string TipoOtroPago { get; set; }
|
||||
public string Clave { get; set; }
|
||||
public string Concepto { get; set; }
|
||||
public decimal Importe { get; set; }
|
||||
public decimal Subsidiocausado { get; set; }
|
||||
public decimal RemanenteSalFav { get; set; }
|
||||
public int ejercicio { get; set; }
|
||||
public decimal SaldoAFavor { get; set; }
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ADSNetLibrary.PacsTimbrado.SAT
|
||||
{
|
||||
[Serializable]
|
||||
public class CFDINominaPercepciones
|
||||
{
|
||||
public string TipoPercepcion { get; set; }
|
||||
public string Clave { get; set; }
|
||||
public string Concepto { get; set; }
|
||||
public decimal ImporteGravado { get; set; }
|
||||
public decimal ImporteExento { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ADSNetLibrary.PacsTimbrado.SAT
|
||||
{
|
||||
|
||||
[Serializable]
|
||||
public class CFDINominaReceptor
|
||||
{
|
||||
public string CURP { get; set; } = "";
|
||||
public string NSS { get; set; } = "";
|
||||
public string RegimenFiscal { get; set; } = "";
|
||||
public string FechaInicioContrato { get; set; } = "";
|
||||
public string Antiguedad { get; set; } = "";
|
||||
public string TipoContrato { get; set; } = "";
|
||||
public string Sindicalizado { get; set; } = "";
|
||||
public string CodigoTipoJornada { get; set; } = "";
|
||||
public string CodigoRegimenContratacion { get; set; } = "";
|
||||
public string CodigoEmpleado { get; set; } = "";
|
||||
public string Departamento { get; set; } = "";
|
||||
public string Puesto { get; set; } = "";
|
||||
public string CodigoRiesgoPuesto { get; set; } = "";
|
||||
public string TipoPeriodo { get; set; } = "";
|
||||
public string CodigoBanco { get; set; } = "";
|
||||
public string NumeroCuenta { get; set; } = "";
|
||||
public decimal SDI { get; set; } = 0;
|
||||
public decimal SBC { get; set; } = 0;
|
||||
public string CodigoEntidadFederativa { get; set; } = "";
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ADSNetLibrary.PacsTimbrado.SAT
|
||||
{
|
||||
|
||||
[Serializable]
|
||||
public class CFDIReceptor
|
||||
{
|
||||
public string RFC { get; set; }
|
||||
public string Nombre { get; set; }
|
||||
public string ResidenciaFiscal { get; set; } = "";
|
||||
public string NumeroRegistroTributario { get; set; } = "";
|
||||
public string UsoCFDI { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ADSNetLibrary.PacsTimbrado.SAT
|
||||
{
|
||||
|
||||
[Serializable]
|
||||
public class CFDIRelacionados
|
||||
{
|
||||
public string TipoRelacion { get; set; }
|
||||
public string TipoRelacionTexto { get; set; }
|
||||
public List<string> UUID { get; set; }
|
||||
public CFDIRelacionados()
|
||||
{
|
||||
UUID = new List<string>();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ADSNetLibrary.PacsTimbrado.SAT
|
||||
{
|
||||
[Serializable]
|
||||
public class CFDIRetenciones
|
||||
{
|
||||
public string Impuesto { get; set; }
|
||||
public decimal Importe { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ADSNetLibrary.PacsTimbrado.SAT
|
||||
{
|
||||
[Serializable]
|
||||
public class CFDIRetencionesLocales
|
||||
{
|
||||
public string ImpuestoLocalRetenido { get; set; }
|
||||
public decimal TasaRetencion { get; set; }
|
||||
public decimal Importe { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,120 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ADSNetLibrary.PacsTimbrado.SAT
|
||||
{
|
||||
|
||||
[Serializable]
|
||||
public class CFDITimbre
|
||||
{
|
||||
private StringBuilder StrMsg;
|
||||
public CFDIComprobante Comprobante { get; set; }
|
||||
public CFDIRelacionados CFDIRelacionados { get; set; }
|
||||
public CFDIEmisor Emisor { get; set; }
|
||||
public CFDIReceptor Receptor { get; set; }
|
||||
public List<CFDIConceptos> Conceptos { get; set; }
|
||||
public List<CFDIRetencionesLocales> RetencionesLocales { get; set; }
|
||||
public List<CFDITrasladosLocales> TrasladosLocales { get; set; }
|
||||
public CFDINomina Nomina { get; set; }
|
||||
public CFDIComplementoPagos ComplementoPagos { get; set; }
|
||||
public CFDIComplementos Complementos { get; set; }
|
||||
public decimal TotalImpuestosRetenidos
|
||||
{
|
||||
get
|
||||
{
|
||||
return (from c in Conceptos
|
||||
select c.Impuestos.Where(ret => ret.TrasladooRetencion == "R").Sum(ret => ret.Importe)).Sum();
|
||||
}
|
||||
}
|
||||
|
||||
public decimal TotalImpuestosTrasladados
|
||||
{
|
||||
get
|
||||
{
|
||||
return (from c in Conceptos
|
||||
select c.Impuestos.Where(tra => tra.TrasladooRetencion == "T").Sum(tra => tra.Importe)).Sum();
|
||||
}
|
||||
}
|
||||
|
||||
public List<CFDIRetenciones> Retenciones
|
||||
{
|
||||
get
|
||||
{
|
||||
List<CFDIRetenciones> tRetorno = new List<CFDIRetenciones>();
|
||||
List<CFDIRetenciones> TRetenciones = new List<CFDIRetenciones>();
|
||||
// Dim RetencionIVA As Decimal = 0
|
||||
// Dim RetencionIEPS As Decimal = 0
|
||||
// Dim RetencionISR As Decimal = 0
|
||||
foreach (CFDIConceptos c in Conceptos)
|
||||
{
|
||||
foreach (CFDIConceptosImpuestos imp in c.Impuestos)
|
||||
{
|
||||
if (imp.TrasladooRetencion == "R")
|
||||
tRetorno.Add(new CFDIRetenciones() { Impuesto = imp.Impuesto, Importe = imp.Importe });
|
||||
}
|
||||
}
|
||||
if (tRetorno.Count > 0)
|
||||
TRetenciones = tRetorno.GroupBy(t => new { t.Impuesto })
|
||||
.Select(t => new CFDIRetenciones() { Impuesto = t.Key.Impuesto, Importe = t.Sum(tt => tt.Importe) })
|
||||
.OrderBy(x => x.Impuesto).ToList();
|
||||
// If RetencionISR > 0 Then Retorno.Add(New CFDIRetenciones With {.Impuesto = "001", .Importe = RetencionISR})
|
||||
// if RetencionIVA > 0 Then Retorno.Add(New CFDIRetenciones With {.Impuesto = "002", .Importe = RetencionIVA})
|
||||
// If RetencionIEPS > 0 Then Retorno.Add(New CFDIRetenciones With {.Impuesto = "003", .Importe = RetencionIEPS})
|
||||
tRetorno = null;
|
||||
return TRetenciones;
|
||||
}
|
||||
}
|
||||
|
||||
public List<CFDITraslados> Traslados
|
||||
{
|
||||
get
|
||||
{
|
||||
List<CFDITraslados> tRetorno = new List<CFDITraslados>();
|
||||
List<CFDITraslados> TTraslados = new List<CFDITraslados>();
|
||||
foreach (CFDIConceptos c in Conceptos)
|
||||
{
|
||||
foreach (CFDIConceptosImpuestos imp in c.Impuestos)
|
||||
{
|
||||
if (imp.TrasladooRetencion == "T")
|
||||
tRetorno.Add(new CFDITraslados() { Impuesto = imp.Impuesto, Importe = imp.Importe, TasaOCuota = imp.TasaOCuota, TipoFactor = imp.TipoFactor });
|
||||
}
|
||||
}
|
||||
// ya generado todos los registros posibles, los agrupo y los sumo
|
||||
if (tRetorno.Count > 0)
|
||||
TTraslados = tRetorno.GroupBy(t => new { t.TipoFactor, t.Impuesto, t.TasaOCuota })
|
||||
.Select(t => new CFDITraslados() { Impuesto = t.Key.Impuesto, TipoFactor = t.Key.TipoFactor, TasaOCuota = t.Key.TasaOCuota, Importe = t.Sum(tt => tt.Importe) })
|
||||
.OrderBy(x => x.Impuesto).ToList();
|
||||
tRetorno = null;
|
||||
return TTraslados;
|
||||
}
|
||||
}
|
||||
public string Mensaje
|
||||
{
|
||||
get
|
||||
{
|
||||
return StrMsg.ToString();
|
||||
}
|
||||
}
|
||||
public CFDITimbre()
|
||||
{
|
||||
StrMsg = new StringBuilder();
|
||||
Comprobante = new CFDIComprobante();
|
||||
CFDIRelacionados = new CFDIRelacionados();
|
||||
Conceptos = new List<CFDIConceptos>();
|
||||
Emisor = new CFDIEmisor();
|
||||
Receptor = new CFDIReceptor();
|
||||
RetencionesLocales = new List<CFDIRetencionesLocales>();
|
||||
TrasladosLocales = new List<CFDITrasladosLocales>();
|
||||
ComplementoPagos = new CFDIComplementoPagos();
|
||||
Complementos = new CFDIComplementos();
|
||||
}
|
||||
|
||||
public void AddMsg(string Msg)
|
||||
{
|
||||
StrMsg.AppendLine(Msg);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ADSNetLibrary.PacsTimbrado.SAT
|
||||
{
|
||||
[Serializable]
|
||||
public class CFDITraslados
|
||||
{
|
||||
public string Impuesto { get; set; }
|
||||
public decimal Tasa { get; set; }
|
||||
public string TipoFactor { get; set; }
|
||||
public decimal TasaOCuota { get; set; }
|
||||
public decimal Importe { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ADSNetLibrary.PacsTimbrado.SAT
|
||||
{
|
||||
[Serializable]
|
||||
public class CFDITrasladosLocales
|
||||
{
|
||||
public string ImpuestoLocalTraslado { get; set; }
|
||||
public decimal TasaTraslado { get; set; }
|
||||
public decimal Importe { get; set; }
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,11 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ADSNetLibrary.PacsTimbrado.SAT
|
||||
{
|
||||
|
||||
public enum PacTimbrado { BIInform = 1, RealVirtualv = 2, ProFact = 3, GoCFDIv = 4, PADEv = 5 }
|
||||
}
|
||||
@@ -0,0 +1,144 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ADSNetLibrary.PacsTimbrado.SAT
|
||||
{
|
||||
|
||||
public abstract class SATEmpresa
|
||||
{
|
||||
private SATEmpresa() { }
|
||||
|
||||
/// <summary>
|
||||
/// </summary>
|
||||
/// <param name="ArchivoLLaveGET"> $@"{UsuarioActual.Empresa.Ruta}Certificados\{UsuarioActual.Empresa.ArchivoKey}";
|
||||
/// ArchivoLLave = $@"{UsuarioActual.Empresa.Ruta}Certificados\CSD01_AAA010101AAA.key";
|
||||
/// </param>
|
||||
/// <param name="ArchivoCertificado">$@"{UsuarioActual.Empresa.Ruta}Certificados\{UsuarioActual.Empresa.ArchivoCer}";
|
||||
/// ArchivoLLave = $@"{UsuarioActual.Empresa.Ruta}Certificados\CSD01_AAA010101AAA.cer";</param>
|
||||
/// <param name="ArchivoPFX">$@"{UsuarioActual.Empresa.Ruta}Certificados\{UsuarioActual.Empresa.ArchivoPfx}";</param>
|
||||
/// <param name="ArchivoCertificadoClave">UsuarioActual.Empresa.ContraseñaKey;</param>
|
||||
/// <param name="EmisorRFC">UsuarioActual.Empresa.RFC;</param>
|
||||
/// <param name="UrlServicioBIInform33">"http://portalbiinform.com.mx/srvCFDi33/service1.asmx"; </param>
|
||||
/// <param name="RutaArchivoXML">$@"{UsuarioActual.Empresa.Ruta}XML\{Ventas.TipoDocto}\";</param>
|
||||
/// <param name="NombreArchivoXML">$"{ObjCFDITimbre.Comprobante.SerieFolio}";</param>
|
||||
/// <param name="UsuarioServicio">UsuarioActual.Empresa.BIUsuario;</param>
|
||||
/// <param name="ClaveServicio">UsuarioActual.Empresa.BIContraseña;</param>
|
||||
/// <param name="FacturaProduccion"> UsuarioActual.Empresa.FacturaProduccion || UsuarioActual.CveEmpresa == 1</param>
|
||||
public SATEmpresa(string ArchivoLLaveGET, string ArchivoCertificado, string ArchivoPFX, string ArchivoCertificadoClave, string EmisorRFC, string UrlServicioBIInform33,
|
||||
string RutaArchivoXML, string NombreArchivoXML, string UsuarioServicio, string ClaveServicio, bool FacturaProduccion)
|
||||
{
|
||||
}
|
||||
/// <summary>
|
||||
/// Return $@"{UsuarioActual.Empresa.Ruta}Certificados\{UsuarioActual.Empresa.ArchivoKey}";
|
||||
/// Return ArchivoLLave = $@"{UsuarioActual.Empresa.Ruta}Certificados\CSD01_AAA010101AAA.key";
|
||||
/// </summary>
|
||||
public string ArchivoLLaveGET { get; set; }
|
||||
/// <summary>
|
||||
/// Return $@"{UsuarioActual.Empresa.Ruta}Certificados\{UsuarioActual.Empresa.ArchivoCer}";
|
||||
/// Return ArchivoLLave = $@"{UsuarioActual.Empresa.Ruta}Certificados\CSD01_AAA010101AAA.cer";
|
||||
/// </summary>
|
||||
public string ArchivoCertificado { get; set; }
|
||||
/// <summary>UsaAC
|
||||
/// Return $@"{UsuarioActual.Empresa.Ruta}Certificados\{UsuarioActual.Empresa.ArchivoPfx}";
|
||||
/// </summary>
|
||||
public string ArchivoPFX { get; set; }
|
||||
/// <summary>
|
||||
/// Return UsuarioActual.Empresa.ContraseñaKey;
|
||||
/// </summary>
|
||||
public string ArchivoCertificadoClave { get; set; }
|
||||
/// <summary>
|
||||
/// Return UsuarioActual.Empresa.RFC;;
|
||||
/// </summary>
|
||||
public string EmisorRFC { get; set; }
|
||||
/// <summary>
|
||||
/// Return "http://portalbiinform.com.mx/srvCFDi33/service1.asmx";
|
||||
/// </summary>
|
||||
public string UrlServicioBIInform33 { get; set; }
|
||||
/// <summary>
|
||||
/// Return "";
|
||||
/// </summary>
|
||||
public string UrlServicioGoCFDIv { get; set; }
|
||||
/// <summary>
|
||||
/// Return $@"{UsuarioActual.Empresa.Ruta}XML\{Ventas.TipoDocto}\";
|
||||
/// </summary>
|
||||
public string RutaArchivoXML { get; set; }
|
||||
/// <summary>
|
||||
/// Return $"{ObjCFDITimbre.Comprobante.SerieFolio}";
|
||||
/// </summary>
|
||||
public string NombreArchivoXML { get; set; }
|
||||
/// <summary>
|
||||
/// Return UsuarioActual.Empresa.BIUsuario;
|
||||
/// </summary>
|
||||
public string UsuarioServicio { get; set; }
|
||||
/// <summary>
|
||||
/// Return UsuarioActual.Empresa.BIContraseña;
|
||||
/// </summary>
|
||||
public string ClaveServicio { get; set; }
|
||||
/// <summary>
|
||||
/// Return UsuarioActual.Empresa.FacturaProduccion || UsuarioActual.CveEmpresa == 1
|
||||
/// </summary>
|
||||
public bool FacturaProduccion { get; set; }
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Return UsuarioActual.Empresa.Empresa;
|
||||
/// </summary>
|
||||
public string Empresanombre { get; set; }
|
||||
/// <summary>
|
||||
/// Return UsuarioActual.Empresa.CodigoRegimenFiscal
|
||||
/// </summary>
|
||||
public string CodigoRegimenFiscal { get; set; }
|
||||
/// <summary>
|
||||
/// Return $@"{UsuarioActual.Empresa.Ruta}CBB\";
|
||||
/// </summary>
|
||||
public string RutaCBBDir { get; set; }
|
||||
/// <summary>
|
||||
/// Return $@"{ObjCFDITimbre.Comprobante.SerieFolio}.jpg";
|
||||
/// </summary>
|
||||
public string RutaCBBName { get; set; }
|
||||
/// <summary>
|
||||
/// Return UsuarioActual.Empresa.Ruta+ @"Certificados\"
|
||||
/// </summary>
|
||||
public string EmpresaRutaCertificados { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Return CveEmpresa
|
||||
/// </summary>
|
||||
public int CveEmpresa { get; set; }
|
||||
|
||||
public bool UsaAC { get; set; }
|
||||
public bool Funcionalidad_529 { get; set; }
|
||||
|
||||
//public PacTimbrado cvePacEspecial { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// ClsVentas ObjVentas = new ClsVentas();
|
||||
/// if (!ObjVentas.UpdateEstatusFactura(3, FolioFiscal, "", ObjCFDITimbre.Comprobante.Fecha,facturaCFDI.CveVenta, CvePAC: 1))
|
||||
/// Retorno = "No se pudo registrar el folio fiscal";
|
||||
/// ObjVentas.Dispose();
|
||||
/// CBB.GenerarCBB(empresa.EmisorRFC, ObjCFDITimbre.Receptor.RFC, facturaCFDI.TotalTC, FolioFiscal, empresa.RutaCBB);
|
||||
/// if (facturaCFDI.Cliente.Ford_GSDB != "")
|
||||
//{
|
||||
/// string RutaCadena = string.Format("{0}{1}.xml", RutaArchivo, NombreArchivoXML); // If(UsuarioActual.Empresa.FacturaProduccion, String.Format("{0}XML\{1}\{2}.xml", Ruta, Ventas.SerieFolio), String.Format("{0}XML\{1}\{2}.xml", Ruta, Ventas.TipoDocto, Ventas.SerieFolio))
|
||||
/// string FolioFactura = "";
|
||||
/// if (UsuarioActual.CveEmpresa == 8)
|
||||
/// FolioFactura = facturaCFDI.Folio.ToString(); // sogo, pordefault manda el folio de la factura
|
||||
/// GeneraAddendaFord(RutaCadena, FolioFactura, facturaCFDI.FordASN, facturaCFDI.FordGSDB);
|
||||
///}
|
||||
/// </summary>
|
||||
public abstract string UpdateEstatusFactura(string FolioFiscal, CFDITimbre ObjCFDITimbre, Factura facturaCFDI, int CvePAC);
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Return ;
|
||||
/// </summary>
|
||||
///
|
||||
public abstract string Timbre();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ADSNetLibrary.PacsTimbrado.SAT
|
||||
{
|
||||
public class TimbradoResult
|
||||
{
|
||||
public TimbradoResult()
|
||||
{
|
||||
_isOK = false;
|
||||
_errorLog = new List<string>();
|
||||
xmlCFDI = "";
|
||||
uuid = "";
|
||||
}
|
||||
public bool _isOK { get; set; }
|
||||
public bool isOK { get { return _isOK; } }
|
||||
public List<string> _errorLog { get; set; }
|
||||
public List<string> errorLog { get { return _errorLog; } }
|
||||
/// <summary>
|
||||
/// XML generado, puede que se muestre incluso sin que se haya timbrado la factura, esto para efecto de revisión
|
||||
/// </summary>
|
||||
public string xmlCFDI { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Folio Fiscal factura
|
||||
/// </summary>
|
||||
public string uuid { get; set; }
|
||||
|
||||
public string lastError { get { if (_errorLog != null && _errorLog.Count > 0) { return _errorLog[_errorLog.Count - 1]; } else { return ""; } } }
|
||||
|
||||
public void GuardaLogTimbrado(string titulo, string message, int codigo, int cvepac)
|
||||
{
|
||||
_errorLog.Add(string.Format("{1}({2}){0}{5:dd-MM-yyyy HH:mm} [pac:{4}]{0}{3}{0}", "/r/n", titulo, codigo, message, cvepac, DateTime.Now));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ADSTimbrado.Modelos.SAT
|
||||
{
|
||||
public class AcuseCancelacionSAT
|
||||
{
|
||||
public string CodigoEstatus { get; set; }
|
||||
public string EsCancelable { get; set; }
|
||||
public string Estado { get; set; }
|
||||
public string EstatusCancelacion { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ADSTimbrado.Modelos.SAT
|
||||
{
|
||||
[Serializable]
|
||||
public class CFDIComercioExterior11
|
||||
{
|
||||
public string MotivoTraslado { get; set; }
|
||||
public string TipoOperacion { get; set; } = "";
|
||||
public string ClavedePedimento { get; set; } = "";
|
||||
public string CertificadoOrigen { get; set; } = "";
|
||||
public string Incoterm { get; set; } = "";
|
||||
public string Subdivision { get; set; } = "";
|
||||
public decimal TipoCambioUSD { get; set; }
|
||||
public string NumCertificadoOrigen { get; set; } = "";
|
||||
public string NumeroExportadorConfiable { get; set; } = "";
|
||||
public string Observaciones { get; set; } = "";
|
||||
public CFDIComercioExterior11Emisor Emisor { get; set; }
|
||||
public CFDIComercioExterior11Receptor Receptor { get; set; }
|
||||
public CFDIComercioExterior11Receptor Destinatario { get; set; }
|
||||
public List<CFDIComercioExterior11Mercancias> Mercancias { get; set; }
|
||||
public bool AplicaComercioExteriorSubProyecto { get; set; }
|
||||
|
||||
public decimal TotalUSD
|
||||
{
|
||||
get
|
||||
{
|
||||
return (from c in Mercancias
|
||||
select c.ValorDolares).Sum();
|
||||
}
|
||||
}
|
||||
public CFDIComercioExterior11()
|
||||
{
|
||||
Emisor = new CFDIComercioExterior11Emisor();
|
||||
Receptor = new CFDIComercioExterior11Receptor();
|
||||
Destinatario = new CFDIComercioExterior11Receptor();
|
||||
Mercancias = new List<CFDIComercioExterior11Mercancias>();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ADSTimbrado.Modelos.SAT
|
||||
{
|
||||
[Serializable]
|
||||
public class CFDIComercioExterior11Emisor
|
||||
{
|
||||
public string CURP { get; set; } = "";
|
||||
public string Calle { get; set; } = "";
|
||||
public string NumeroExterior { get; set; } = "";
|
||||
public string NumeroInterior { get; set; } = "";
|
||||
public string Colonia { get; set; } = "";
|
||||
public string Localidad { get; set; } = "";
|
||||
public string Referencia { get; set; } = "";
|
||||
public string Municipio { get; set; } = "";
|
||||
public string Estado { get; set; } = "";
|
||||
public string Pais { get; set; } = "";
|
||||
public string CP { get; set; } = "";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ADSTimbrado.Modelos.SAT
|
||||
{
|
||||
[Serializable]
|
||||
public class CFDIComercioExterior11Mercancias
|
||||
{
|
||||
public string NoIdentificacion { get; set; } = "";
|
||||
public string FraccionArancelaria { get; set; } = "";
|
||||
public string UnidadAduana { get; set; } = "";
|
||||
public decimal CantidadAduana { get; set; }
|
||||
public decimal ValorUnitarioAduana { get; set; }
|
||||
public decimal ValorDolares { get; set; }
|
||||
public CFDIComercioExterior11MercanciasDescripcionesEspecificas DescripcionesEspecificas { get; set; } = new CFDIComercioExterior11MercanciasDescripcionesEspecificas();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ADSTimbrado.Modelos.SAT
|
||||
{
|
||||
[Serializable]
|
||||
public class CFDIComercioExterior11MercanciasDescripcionesEspecificas
|
||||
{
|
||||
public string Marca { get; set; } = "";
|
||||
public string Modelo { get; set; } = "";
|
||||
public string SubModelo { get; set; } = "";
|
||||
public string NumeroSerie { get; set; } = "";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ADSTimbrado.Modelos.SAT
|
||||
{
|
||||
public class CFDIComercioExterior11Propietario
|
||||
{
|
||||
public string NumRegIdTrib { get; set; } = "";
|
||||
public string ResidenciaFiscal { get; set; } = "";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ADSTimbrado.Modelos.SAT
|
||||
{
|
||||
[Serializable]
|
||||
public class CFDIComercioExterior11Receptor
|
||||
{
|
||||
public string NumRegIdTrib { get; set; } = "";
|
||||
public string Nombre { get; set; } = "";
|
||||
public string Calle { get; set; } = "";
|
||||
public string NumeroExterior { get; set; } = "";
|
||||
public string NumeroInterior { get; set; } = "";
|
||||
public string Colonia { get; set; } = "";
|
||||
public string Localidad { get; set; } = "";
|
||||
public string Referencia { get; set; } = "";
|
||||
public string Municipio { get; set; } = "";
|
||||
public string Estado { get; set; } = "";
|
||||
public string CP { get; set; } = "";
|
||||
public string Pais { get; set; } = "";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ADSTimbrado.Modelos.SAT
|
||||
{
|
||||
[Serializable]
|
||||
public class CFDIComplementoPagos
|
||||
{
|
||||
public DateTime FechaPago { get; set; }
|
||||
public string FormaDePagoP { get; set; } = "";
|
||||
public string MonedaP { get; set; } = "";
|
||||
public string NumOperacion { get; set; } = "";
|
||||
public decimal TipoCambioP { get; set; } = 0;
|
||||
public decimal Monto { get; set; }
|
||||
public string RfcEmisorCtaOrd { get; set; } = "";
|
||||
public string NomBancoOrdExt { get; set; } = "";
|
||||
public string CtaOrdenante { get; set; } = "";
|
||||
public string RfcEmisorCtaBen { get; set; } = "";
|
||||
public string CtaBeneficiario { get; set; } = "";
|
||||
public string TipoCadPago { get; set; } = "";
|
||||
public string CertPago { get; set; } = "";
|
||||
public string CadPago { get; set; } = "";
|
||||
public string SelloPago { get; set; } = "";
|
||||
public List<CFDIComplementoPagosDocsRelacionados> DocumentosRelacionados { get; set; }
|
||||
public List<CFDIConceptosImpuestos> Impuestos { get; set; }
|
||||
|
||||
public decimal TotalImpuestosRetenidos
|
||||
{
|
||||
get
|
||||
{
|
||||
return (from c in Impuestos
|
||||
where c.TrasladooRetencion == "R"
|
||||
select c.Importe).Sum();
|
||||
}
|
||||
}
|
||||
|
||||
public decimal TotalImpuestosTrasladados
|
||||
{
|
||||
get
|
||||
{
|
||||
return (from c in Impuestos
|
||||
where c.TrasladooRetencion == "T"
|
||||
select c.Importe).Sum();
|
||||
}
|
||||
}
|
||||
|
||||
public CFDIComplementoPagos()
|
||||
{
|
||||
DocumentosRelacionados = new List<CFDIComplementoPagosDocsRelacionados>();
|
||||
Impuestos = new List<CFDIConceptosImpuestos>();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ADSTimbrado.Modelos.SAT
|
||||
{
|
||||
[Serializable]
|
||||
public class CFDIComplementoPagosDocsRelacionados
|
||||
{
|
||||
public string IdDocumento { get; set; } = "";
|
||||
public string Serie { get; set; } = "";
|
||||
public string Folio { get; set; } = "";
|
||||
public string MonedaDR { get; set; } = "";
|
||||
public string MetodoDePagoDR { get; set; } = "";
|
||||
public decimal TipoCambioDR { get; set; }
|
||||
public int NumParcialidad { get; set; } = 1;
|
||||
public decimal ImpSaldoAnt { get; set; }
|
||||
public decimal ImpPagado { get; set; }
|
||||
public decimal ImpSaldoInsoluto { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ADSTimbrado.Modelos.SAT
|
||||
{
|
||||
[Serializable]
|
||||
public class CFDIComplementos
|
||||
{
|
||||
public CFDIComercioExterior11 ComercioExterior11 { get; set; }
|
||||
|
||||
public CFDIComplementos()
|
||||
{
|
||||
ComercioExterior11 = new CFDIComercioExterior11();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ADSTimbrado.Modelos.SAT
|
||||
{
|
||||
[Serializable]
|
||||
public class CFDIComprobante
|
||||
{
|
||||
public string Version { get; set; }
|
||||
public string Serie { get; set; } = "";
|
||||
public string Folio { get; set; } = "";
|
||||
public string SerieFolio
|
||||
{
|
||||
get
|
||||
{
|
||||
// sino tiene serie no pone el guión
|
||||
return Serie == "" ? Folio : $"{Serie}-{Folio}";
|
||||
}
|
||||
}
|
||||
public string TipoDocto { get; set; }
|
||||
public string FormadePago { get; set; }
|
||||
public string CondicionesdePago { get; set; }
|
||||
public DateTime Fecha { get; set; }
|
||||
public decimal Subtotal { get; set; } = 0;
|
||||
public decimal Descuentos { get; set; } = 0;
|
||||
public string MotivoDescuento { get; set; } = "";
|
||||
public string TipoCambio { get; set; } = "1";
|
||||
public string Moneda { get; set; } = "";
|
||||
public string TipoComprobante { get; set; } = "";
|
||||
public string MetodoPago { get; set; } = "";
|
||||
public decimal Total { get; set; } = 0;
|
||||
public string LugarExpedicion { get; set; } = "";
|
||||
public string NumCuentaPago { get; set; } = "";
|
||||
public string Confirmacion { get; set; } = "";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ADSTimbrado.Modelos.SAT
|
||||
{
|
||||
[Serializable]
|
||||
public class CFDIConceptos
|
||||
{
|
||||
public decimal Cantidad { get; set; } = 0.00M;
|
||||
public string Unidad { get; set; } = "";
|
||||
public string Noidentificacion { get; set; } = "";
|
||||
public string Descripcion { get; set; } = "";
|
||||
public decimal ValorUnitario { get; set; } = 0.00M;
|
||||
public decimal Importe { get; set; } = 0.00M;
|
||||
public string CuentaPredial { get; set; } = "";
|
||||
public string NumeroPedimento { get; set; } = "";
|
||||
public string ClaveProdServ { get; set; } = "";
|
||||
public string ClaveUnidad { get; set; } = "";
|
||||
public List<CFDIConceptosImpuestos> Impuestos { get; set; }
|
||||
public decimal Descuento { get; set; } = 0.00M;
|
||||
public decimal ImporteGravaIVAAdicional { get; set; } = 0.00M; // caso IEPS
|
||||
|
||||
public CFDIConceptos()
|
||||
{
|
||||
Impuestos = new List<CFDIConceptosImpuestos>();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ADSTimbrado.Modelos.SAT
|
||||
{
|
||||
[Serializable]
|
||||
public class CFDIConceptosImpuestos
|
||||
{
|
||||
public string TrasladooRetencion { get; set; } = "T";
|
||||
public decimal Base { get; set; } = 0.00M;
|
||||
public string Impuesto { get; set; } = "";
|
||||
public string TipoFactor { get; set; } = "Tasa";
|
||||
public decimal TasaOCuota { get; set; } = 0.00M;
|
||||
public decimal Importe { get; set; } = 0.00M; // propiedad utilizada solo para hacer ajustes, por default toma la multiplicación de base * tasa
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ADSTimbrado.Modelos.SAT
|
||||
{
|
||||
[Serializable]
|
||||
public class CFDIEmisor
|
||||
{
|
||||
public string RFC { get; set; }
|
||||
public string Nombre { get; set; }
|
||||
public string RegimenFiscal { get; set; }
|
||||
public string RegistroPatronal { get; set; }
|
||||
public string CURP { get; set; } = "";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,117 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ADSTimbrado.Modelos.SAT
|
||||
{
|
||||
[Serializable]
|
||||
public class CFDINomina
|
||||
{
|
||||
public string Version { get; set; }
|
||||
public string TipoNomina { get; set; }
|
||||
public DateTime FechaPago { get; set; }
|
||||
public string FechaInicio { get; set; }
|
||||
public string FechaFin { get; set; }
|
||||
public int NumDiasPagados { get; set; }
|
||||
public CFDINominaReceptor Receptor { get; set; }
|
||||
public List<CFDINominaPercepciones> Percepciones { get; set; }
|
||||
public List<CFDINominaDeducciones> Deducciones { get; set; }
|
||||
public List<CFDINominaIncapacidades> Incapacidades { get; set; }
|
||||
public List<CFDINominaOtrosPagos> OtrosPagos { get; set; }
|
||||
public List<CFDINominaHorasExtras> HorasExtras { get; set; }
|
||||
public int CveNomina { get; set; }
|
||||
|
||||
public decimal TotalPercepciones
|
||||
{
|
||||
get
|
||||
{
|
||||
return TotalSueldos + TotalIndemnizacion + TotalJubilacion;
|
||||
}
|
||||
}
|
||||
|
||||
public decimal TotalDeducciones
|
||||
{
|
||||
get
|
||||
{
|
||||
return Math.Round(TotalDeduccionesOtras + TotalDeduccionesImpuestosRetenidos, 2);
|
||||
}
|
||||
}
|
||||
|
||||
public decimal TotalOtrosPagos
|
||||
{
|
||||
get
|
||||
{
|
||||
return OtrosPagos.Sum(item => item.Importe);
|
||||
}
|
||||
}
|
||||
public decimal TotalSueldos
|
||||
{
|
||||
get
|
||||
{
|
||||
return Percepciones.Where(per => !per.TipoPercepcion.Contiene("022", "023", "025", "039", "044")).Sum(per => per.ImporteGravado + per.ImporteExento);
|
||||
}
|
||||
}
|
||||
public decimal TotalIndemnizacion
|
||||
{
|
||||
get
|
||||
{
|
||||
return Percepciones.Where(per => per.TipoPercepcion.Contiene("022", "023", "025")).Sum(per => per.ImporteGravado + per.ImporteExento);
|
||||
}
|
||||
}
|
||||
|
||||
public decimal TotalJubilacion
|
||||
{
|
||||
get
|
||||
{
|
||||
return Percepciones.Where(per => per.TipoPercepcion.Contiene("039", "044")).Sum(per => per.ImporteGravado + per.ImporteExento);
|
||||
}
|
||||
}
|
||||
public decimal TotalPercepcionesGravado
|
||||
{
|
||||
get
|
||||
{
|
||||
// nota especificar claves
|
||||
return Percepciones.Sum(item => item.ImporteGravado);
|
||||
}
|
||||
}
|
||||
public decimal TotalPercepcionesExento
|
||||
{
|
||||
get
|
||||
{
|
||||
// nota especificar claves
|
||||
return Percepciones.Sum(item => item.ImporteExento);
|
||||
}
|
||||
}
|
||||
|
||||
public decimal TotalDeduccionesOtras
|
||||
{
|
||||
get
|
||||
{
|
||||
// DEDUCCIONES SE LE QUITAN LOS CENTAVOS
|
||||
return Math.Round(Deducciones.Where(ded => !ded.TipoDeduccion.Contiene("002")).Sum(ded => ded.Importe), 2);
|
||||
}
|
||||
}
|
||||
|
||||
public decimal TotalDeduccionesImpuestosRetenidos
|
||||
{
|
||||
get
|
||||
{
|
||||
// nota especificar claves
|
||||
return Math.Round(Deducciones.Where(ded => ded.TipoDeduccion.Contiene("002")).Sum(ded => ded.Importe), 2);
|
||||
}
|
||||
}
|
||||
|
||||
public CFDINomina()
|
||||
{
|
||||
Receptor = new CFDINominaReceptor();
|
||||
Percepciones = new List<CFDINominaPercepciones>();
|
||||
Deducciones = new List<CFDINominaDeducciones>();
|
||||
Incapacidades = new List<CFDINominaIncapacidades>();
|
||||
OtrosPagos = new List<CFDINominaOtrosPagos>();
|
||||
HorasExtras = new List<CFDINominaHorasExtras>();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ADSTimbrado.Modelos.SAT
|
||||
{
|
||||
[Serializable]
|
||||
public class CFDINominaDeducciones
|
||||
{
|
||||
public string TipoDeduccion { get; set; }
|
||||
public string Clave { get; set; }
|
||||
public string Concepto { get; set; }
|
||||
public decimal Importe { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ADSTimbrado.Modelos.SAT
|
||||
{
|
||||
[Serializable]
|
||||
public class CFDINominaHorasExtras
|
||||
{
|
||||
public string Dias { get; set; }
|
||||
public string TipoHoras { get; set; }
|
||||
public int HorasExtra { get; set; }
|
||||
public decimal ImportePagado { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ADSTimbrado.Modelos.SAT
|
||||
{
|
||||
[Serializable]
|
||||
public class CFDINominaIncapacidades
|
||||
{
|
||||
public string DiasIncapacidad { get; set; }
|
||||
public string TipoIncapacidad { get; set; }
|
||||
public decimal Importe { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ADSTimbrado.Modelos.SAT
|
||||
{
|
||||
|
||||
[Serializable]
|
||||
public class CFDINominaOtrosPagos
|
||||
{
|
||||
public string TipoOtroPago { get; set; }
|
||||
public string Clave { get; set; }
|
||||
public string Concepto { get; set; }
|
||||
public decimal Importe { get; set; }
|
||||
public decimal Subsidiocausado { get; set; }
|
||||
public decimal RemanenteSalFav { get; set; }
|
||||
public int ejercicio { get; set; }
|
||||
public decimal SaldoAFavor { get; set; }
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ADSTimbrado.Modelos.SAT
|
||||
{
|
||||
[Serializable]
|
||||
public class CFDINominaPercepciones
|
||||
{
|
||||
public string TipoPercepcion { get; set; }
|
||||
public string Clave { get; set; }
|
||||
public string Concepto { get; set; }
|
||||
public decimal ImporteGravado { get; set; }
|
||||
public decimal ImporteExento { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ADSTimbrado.Modelos.SAT
|
||||
{
|
||||
|
||||
[Serializable]
|
||||
public class CFDINominaReceptor
|
||||
{
|
||||
public string CURP { get; set; } = "";
|
||||
public string NSS { get; set; } = "";
|
||||
public string RegimenFiscal { get; set; } = "";
|
||||
public string FechaInicioContrato { get; set; } = "";
|
||||
public string Antiguedad { get; set; } = "";
|
||||
public string TipoContrato { get; set; } = "";
|
||||
public string Sindicalizado { get; set; } = "";
|
||||
public string CodigoTipoJornada { get; set; } = "";
|
||||
public string CodigoRegimenContratacion { get; set; } = "";
|
||||
public string CodigoEmpleado { get; set; } = "";
|
||||
public string Departamento { get; set; } = "";
|
||||
public string Puesto { get; set; } = "";
|
||||
public string CodigoRiesgoPuesto { get; set; } = "";
|
||||
public string TipoPeriodo { get; set; } = "";
|
||||
public string CodigoBanco { get; set; } = "";
|
||||
public string NumeroCuenta { get; set; } = "";
|
||||
public decimal SDI { get; set; } = 0;
|
||||
public decimal SBC { get; set; } = 0;
|
||||
public string CodigoEntidadFederativa { get; set; } = "";
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ADSTimbrado.Modelos.SAT
|
||||
{
|
||||
|
||||
[Serializable]
|
||||
public class CFDIReceptor
|
||||
{
|
||||
public string RFC { get; set; }
|
||||
public string Nombre { get; set; }
|
||||
public string ResidenciaFiscal { get; set; } = "";
|
||||
public string NumeroRegistroTributario { get; set; } = "";
|
||||
public string UsoCFDI { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ADSTimbrado.Modelos.SAT
|
||||
{
|
||||
|
||||
[Serializable]
|
||||
public class CFDIRelacionados
|
||||
{
|
||||
public string TipoRelacion { get; set; }
|
||||
public string TipoRelacionTexto { get; set; }
|
||||
public List<string> UUID { get; set; }
|
||||
public CFDIRelacionados()
|
||||
{
|
||||
UUID = new List<string>();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ADSTimbrado.Modelos.SAT
|
||||
{
|
||||
[Serializable]
|
||||
public class CFDIRetenciones
|
||||
{
|
||||
public string Impuesto { get; set; }
|
||||
public decimal Importe { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ADSTimbrado.Modelos.SAT
|
||||
{
|
||||
[Serializable]
|
||||
public class CFDIRetencionesLocales
|
||||
{
|
||||
public string ImpuestoLocalRetenido { get; set; }
|
||||
public decimal TasaRetencion { get; set; }
|
||||
public decimal Importe { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,120 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ADSTimbrado.Modelos.SAT
|
||||
{
|
||||
|
||||
[Serializable]
|
||||
public class CFDITimbre
|
||||
{
|
||||
private StringBuilder StrMsg;
|
||||
public CFDIComprobante Comprobante { get; set; }
|
||||
public CFDIRelacionados CFDIRelacionados { get; set; }
|
||||
public CFDIEmisor Emisor { get; set; }
|
||||
public CFDIReceptor Receptor { get; set; }
|
||||
public List<CFDIConceptos> Conceptos { get; set; }
|
||||
public List<CFDIRetencionesLocales> RetencionesLocales { get; set; }
|
||||
public List<CFDITrasladosLocales> TrasladosLocales { get; set; }
|
||||
public CFDINomina Nomina { get; set; }
|
||||
public CFDIComplementoPagos ComplementoPagos { get; set; }
|
||||
public CFDIComplementos Complementos { get; set; }
|
||||
public decimal TotalImpuestosRetenidos
|
||||
{
|
||||
get
|
||||
{
|
||||
return (from c in Conceptos
|
||||
select c.Impuestos.Where(ret => ret.TrasladooRetencion == "R").Sum(ret => ret.Importe)).Sum();
|
||||
}
|
||||
}
|
||||
|
||||
public decimal TotalImpuestosTrasladados
|
||||
{
|
||||
get
|
||||
{
|
||||
return (from c in Conceptos
|
||||
select c.Impuestos.Where(tra => tra.TrasladooRetencion == "T").Sum(tra => tra.Importe)).Sum();
|
||||
}
|
||||
}
|
||||
|
||||
public List<CFDIRetenciones> Retenciones
|
||||
{
|
||||
get
|
||||
{
|
||||
List<CFDIRetenciones> tRetorno = new List<CFDIRetenciones>();
|
||||
List<CFDIRetenciones> TRetenciones = new List<CFDIRetenciones>();
|
||||
// Dim RetencionIVA As Decimal = 0
|
||||
// Dim RetencionIEPS As Decimal = 0
|
||||
// Dim RetencionISR As Decimal = 0
|
||||
foreach (CFDIConceptos c in Conceptos)
|
||||
{
|
||||
foreach (CFDIConceptosImpuestos imp in c.Impuestos)
|
||||
{
|
||||
if (imp.TrasladooRetencion == "R")
|
||||
tRetorno.Add(new CFDIRetenciones() { Impuesto = imp.Impuesto, Importe = imp.Importe });
|
||||
}
|
||||
}
|
||||
if (tRetorno.Count > 0)
|
||||
TRetenciones = tRetorno.GroupBy(t => new { t.Impuesto })
|
||||
.Select(t => new CFDIRetenciones() { Impuesto = t.Key.Impuesto, Importe = t.Sum(tt => tt.Importe) })
|
||||
.OrderBy(x => x.Impuesto).ToList();
|
||||
// If RetencionISR > 0 Then Retorno.Add(New CFDIRetenciones With {.Impuesto = "001", .Importe = RetencionISR})
|
||||
// if RetencionIVA > 0 Then Retorno.Add(New CFDIRetenciones With {.Impuesto = "002", .Importe = RetencionIVA})
|
||||
// If RetencionIEPS > 0 Then Retorno.Add(New CFDIRetenciones With {.Impuesto = "003", .Importe = RetencionIEPS})
|
||||
tRetorno = null;
|
||||
return TRetenciones;
|
||||
}
|
||||
}
|
||||
|
||||
public List<CFDITraslados> Traslados
|
||||
{
|
||||
get
|
||||
{
|
||||
List<CFDITraslados> tRetorno = new List<CFDITraslados>();
|
||||
List<CFDITraslados> TTraslados = new List<CFDITraslados>();
|
||||
foreach (CFDIConceptos c in Conceptos)
|
||||
{
|
||||
foreach (CFDIConceptosImpuestos imp in c.Impuestos)
|
||||
{
|
||||
if (imp.TrasladooRetencion == "T")
|
||||
tRetorno.Add(new CFDITraslados() { Impuesto = imp.Impuesto, Importe = imp.Importe, TasaOCuota = imp.TasaOCuota, TipoFactor = imp.TipoFactor });
|
||||
}
|
||||
}
|
||||
// ya generado todos los registros posibles, los agrupo y los sumo
|
||||
if (tRetorno.Count > 0)
|
||||
TTraslados = tRetorno.GroupBy(t => new { t.TipoFactor, t.Impuesto, t.TasaOCuota })
|
||||
.Select(t => new CFDITraslados() { Impuesto = t.Key.Impuesto, TipoFactor = t.Key.TipoFactor, TasaOCuota = t.Key.TasaOCuota, Importe = t.Sum(tt => tt.Importe) })
|
||||
.OrderBy(x => x.Impuesto).ToList();
|
||||
tRetorno = null;
|
||||
return TTraslados;
|
||||
}
|
||||
}
|
||||
public string Mensaje
|
||||
{
|
||||
get
|
||||
{
|
||||
return StrMsg.ToString();
|
||||
}
|
||||
}
|
||||
public CFDITimbre()
|
||||
{
|
||||
StrMsg = new StringBuilder();
|
||||
Comprobante = new CFDIComprobante();
|
||||
CFDIRelacionados = new CFDIRelacionados();
|
||||
Conceptos = new List<CFDIConceptos>();
|
||||
Emisor = new CFDIEmisor();
|
||||
Receptor = new CFDIReceptor();
|
||||
RetencionesLocales = new List<CFDIRetencionesLocales>();
|
||||
TrasladosLocales = new List<CFDITrasladosLocales>();
|
||||
ComplementoPagos = new CFDIComplementoPagos();
|
||||
Complementos = new CFDIComplementos();
|
||||
}
|
||||
|
||||
public void AddMsg(string Msg)
|
||||
{
|
||||
StrMsg.AppendLine(Msg);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ADSTimbrado.Modelos.SAT
|
||||
{
|
||||
[Serializable]
|
||||
public class CFDITraslados
|
||||
{
|
||||
public string Impuesto { get; set; }
|
||||
public decimal Tasa { get; set; }
|
||||
public string TipoFactor { get; set; }
|
||||
public decimal TasaOCuota { get; set; }
|
||||
public decimal Importe { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ADSTimbrado.Modelos.SAT
|
||||
{
|
||||
[Serializable]
|
||||
public class CFDITrasladosLocales
|
||||
{
|
||||
public string ImpuestoLocalTraslado { get; set; }
|
||||
public decimal TasaTraslado { get; set; }
|
||||
public decimal Importe { get; set; }
|
||||
}
|
||||
}
|
||||
1031
ADSUtilService-borrar/ADSTimbradoLibrary/Modelos/SAT/Factura.cs
Normal file
1031
ADSUtilService-borrar/ADSTimbradoLibrary/Modelos/SAT/Factura.cs
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,11 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ADSTimbrado.Modelos.SAT
|
||||
{
|
||||
|
||||
public enum PacTimbrado { BIInform = 1, RealVirtualv = 2, ProFact = 3, GoCFDIv = 4, PADEv = 5 }
|
||||
}
|
||||
@@ -0,0 +1,144 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ADSTimbrado.Modelos.SAT
|
||||
{
|
||||
|
||||
public abstract class SATEmpresa
|
||||
{
|
||||
private SATEmpresa() { }
|
||||
|
||||
/// <summary>
|
||||
/// </summary>
|
||||
/// <param name="ArchivoLLaveGET"> $@"{UsuarioActual.Empresa.Ruta}Certificados\{UsuarioActual.Empresa.ArchivoKey}";
|
||||
/// ArchivoLLave = $@"{UsuarioActual.Empresa.Ruta}Certificados\CSD01_AAA010101AAA.key";
|
||||
/// </param>
|
||||
/// <param name="ArchivoCertificado">$@"{UsuarioActual.Empresa.Ruta}Certificados\{UsuarioActual.Empresa.ArchivoCer}";
|
||||
/// ArchivoLLave = $@"{UsuarioActual.Empresa.Ruta}Certificados\CSD01_AAA010101AAA.cer";</param>
|
||||
/// <param name="ArchivoPFX">$@"{UsuarioActual.Empresa.Ruta}Certificados\{UsuarioActual.Empresa.ArchivoPfx}";</param>
|
||||
/// <param name="ArchivoCertificadoClave">UsuarioActual.Empresa.ContraseñaKey;</param>
|
||||
/// <param name="EmisorRFC">UsuarioActual.Empresa.RFC;</param>
|
||||
/// <param name="UrlServicioBIInform33">"http://portalbiinform.com.mx/srvCFDi33/service1.asmx"; </param>
|
||||
/// <param name="RutaArchivoXML">$@"{UsuarioActual.Empresa.Ruta}XML\{Ventas.TipoDocto}\";</param>
|
||||
/// <param name="NombreArchivoXML">$"{ObjCFDITimbre.Comprobante.SerieFolio}";</param>
|
||||
/// <param name="UsuarioServicio">UsuarioActual.Empresa.BIUsuario;</param>
|
||||
/// <param name="ClaveServicio">UsuarioActual.Empresa.BIContraseña;</param>
|
||||
/// <param name="FacturaProduccion"> UsuarioActual.Empresa.FacturaProduccion || UsuarioActual.CveEmpresa == 1</param>
|
||||
public SATEmpresa(string ArchivoLLaveGET, string ArchivoCertificado, string ArchivoPFX, string ArchivoCertificadoClave, string EmisorRFC, string UrlServicioBIInform33,
|
||||
string RutaArchivoXML, string NombreArchivoXML, string UsuarioServicio, string ClaveServicio, bool FacturaProduccion)
|
||||
{
|
||||
}
|
||||
/// <summary>
|
||||
/// Return $@"{UsuarioActual.Empresa.Ruta}Certificados\{UsuarioActual.Empresa.ArchivoKey}";
|
||||
/// Return ArchivoLLave = $@"{UsuarioActual.Empresa.Ruta}Certificados\CSD01_AAA010101AAA.key";
|
||||
/// </summary>
|
||||
public string ArchivoLLaveGET { get; set; }
|
||||
/// <summary>
|
||||
/// Return $@"{UsuarioActual.Empresa.Ruta}Certificados\{UsuarioActual.Empresa.ArchivoCer}";
|
||||
/// Return ArchivoLLave = $@"{UsuarioActual.Empresa.Ruta}Certificados\CSD01_AAA010101AAA.cer";
|
||||
/// </summary>
|
||||
public string ArchivoCertificado { get; set; }
|
||||
/// <summary>UsaAC
|
||||
/// Return $@"{UsuarioActual.Empresa.Ruta}Certificados\{UsuarioActual.Empresa.ArchivoPfx}";
|
||||
/// </summary>
|
||||
public string ArchivoPFX { get; set; }
|
||||
/// <summary>
|
||||
/// Return UsuarioActual.Empresa.ContraseñaKey;
|
||||
/// </summary>
|
||||
public string ArchivoCertificadoClave { get; set; }
|
||||
/// <summary>
|
||||
/// Return UsuarioActual.Empresa.RFC;;
|
||||
/// </summary>
|
||||
public string EmisorRFC { get; set; }
|
||||
/// <summary>
|
||||
/// Return "http://portalbiinform.com.mx/srvCFDi33/service1.asmx";
|
||||
/// </summary>
|
||||
public string UrlServicioBIInform33 { get; set; }
|
||||
/// <summary>
|
||||
/// Return "";
|
||||
/// </summary>
|
||||
public string UrlServicioGoCFDIv { get; set; }
|
||||
/// <summary>
|
||||
/// Return $@"{UsuarioActual.Empresa.Ruta}XML\{Ventas.TipoDocto}\";
|
||||
/// </summary>
|
||||
public string RutaArchivoXML { get; set; }
|
||||
/// <summary>
|
||||
/// Return $"{ObjCFDITimbre.Comprobante.SerieFolio}";
|
||||
/// </summary>
|
||||
public string NombreArchivoXML { get; set; }
|
||||
/// <summary>
|
||||
/// Return UsuarioActual.Empresa.BIUsuario;
|
||||
/// </summary>
|
||||
public string UsuarioServicio { get; set; }
|
||||
/// <summary>
|
||||
/// Return UsuarioActual.Empresa.BIContraseña;
|
||||
/// </summary>
|
||||
public string ClaveServicio { get; set; }
|
||||
/// <summary>
|
||||
/// Return UsuarioActual.Empresa.FacturaProduccion || UsuarioActual.CveEmpresa == 1
|
||||
/// </summary>
|
||||
public bool FacturaProduccion { get; set; }
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Return UsuarioActual.Empresa.Empresa;
|
||||
/// </summary>
|
||||
public string Empresanombre { get; set; }
|
||||
/// <summary>
|
||||
/// Return UsuarioActual.Empresa.CodigoRegimenFiscal
|
||||
/// </summary>
|
||||
public string CodigoRegimenFiscal { get; set; }
|
||||
/// <summary>
|
||||
/// Return $@"{UsuarioActual.Empresa.Ruta}CBB\";
|
||||
/// </summary>
|
||||
public string RutaCBBDir { get; set; }
|
||||
/// <summary>
|
||||
/// Return $@"{ObjCFDITimbre.Comprobante.SerieFolio}.jpg";
|
||||
/// </summary>
|
||||
public string RutaCBBName { get; set; }
|
||||
/// <summary>
|
||||
/// Return UsuarioActual.Empresa.Ruta+ @"Certificados\"
|
||||
/// </summary>
|
||||
public string EmpresaRutaCertificados { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Return CveEmpresa
|
||||
/// </summary>
|
||||
public int CveEmpresa { get; set; }
|
||||
|
||||
public bool UsaAC { get; set; }
|
||||
public bool Funcionalidad_529 { get; set; }
|
||||
|
||||
//public PacTimbrado cvePacEspecial { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// ClsVentas ObjVentas = new ClsVentas();
|
||||
/// if (!ObjVentas.UpdateEstatusFactura(3, FolioFiscal, "", ObjCFDITimbre.Comprobante.Fecha,facturaCFDI.CveVenta, CvePAC: 1))
|
||||
/// Retorno = "No se pudo registrar el folio fiscal";
|
||||
/// ObjVentas.Dispose();
|
||||
/// CBB.GenerarCBB(empresa.EmisorRFC, ObjCFDITimbre.Receptor.RFC, facturaCFDI.TotalTC, FolioFiscal, empresa.RutaCBB);
|
||||
/// if (facturaCFDI.Cliente.Ford_GSDB != "")
|
||||
//{
|
||||
/// string RutaCadena = string.Format("{0}{1}.xml", RutaArchivo, NombreArchivoXML); // If(UsuarioActual.Empresa.FacturaProduccion, String.Format("{0}XML\{1}\{2}.xml", Ruta, Ventas.SerieFolio), String.Format("{0}XML\{1}\{2}.xml", Ruta, Ventas.TipoDocto, Ventas.SerieFolio))
|
||||
/// string FolioFactura = "";
|
||||
/// if (UsuarioActual.CveEmpresa == 8)
|
||||
/// FolioFactura = facturaCFDI.Folio.ToString(); // sogo, pordefault manda el folio de la factura
|
||||
/// GeneraAddendaFord(RutaCadena, FolioFactura, facturaCFDI.FordASN, facturaCFDI.FordGSDB);
|
||||
///}
|
||||
/// </summary>
|
||||
public abstract string UpdateEstatusFactura(string FolioFiscal, CFDITimbre ObjCFDITimbre, Factura facturaCFDI, int CvePAC);
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Return ;
|
||||
/// </summary>
|
||||
///
|
||||
public abstract string Timbre();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ADSTimbrado.Modelos.SAT
|
||||
{
|
||||
public class TimbradoResult
|
||||
{
|
||||
public TimbradoResult()
|
||||
{
|
||||
_isOK = false;
|
||||
_errorLog = new List<string>();
|
||||
xmlCFDI = "";
|
||||
uuid = "";
|
||||
}
|
||||
public bool _isOK { get; set; }
|
||||
public bool isOK { get { return _isOK; } }
|
||||
public List<string> _errorLog { get; set; }
|
||||
public List<string> errorLog { get { return _errorLog; } }
|
||||
/// <summary>
|
||||
/// XML generado, puede que se muestre incluso sin que se haya timbrado la factura, esto para efecto de revisión
|
||||
/// </summary>
|
||||
public string xmlCFDI { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Folio Fiscal factura
|
||||
/// </summary>
|
||||
public string uuid { get; set; }
|
||||
|
||||
public string lastError { get { if (_errorLog != null && _errorLog.Count > 0) { return _errorLog[_errorLog.Count - 1]; } else { return ""; } } }
|
||||
|
||||
public void GuardaLogTimbrado(string titulo, string message, int codigo, int cvepac)
|
||||
{
|
||||
_errorLog.Add(string.Format("{1}({2}){0}{5:dd-MM-yyyy HH:mm} [pac:{4}]{0}{3}{0}", "/r/n", titulo, codigo, message, cvepac, DateTime.Now));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
[assembly: AssemblyTitle("ADSTimbradoLibrary")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("ADSTimbradoLibrary")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2021")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// Setting ComVisible to false makes the types in this assembly not visible
|
||||
// to COM components. If you need to access a type in this assembly from
|
||||
// COM, set the ComVisible attribute to true on that type.
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
||||
[assembly: Guid("948075ab-24c5-4f4b-a983-2266beb5c7ba")]
|
||||
|
||||
// Version information for an assembly consists of the following four values:
|
||||
//
|
||||
// Major Version
|
||||
// Minor Version
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||
870
ADSUtilService-borrar/ADSTimbradoLibrary/Timbrado.cs
Normal file
870
ADSUtilService-borrar/ADSTimbradoLibrary/Timbrado.cs
Normal file
@@ -0,0 +1,870 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using ADSTimbrado.Modelos.SAT;
|
||||
|
||||
namespace ADSTimbrado
|
||||
{
|
||||
|
||||
public class Timbrado
|
||||
{
|
||||
private static string comentadobymeborrarparaencontrar = "";
|
||||
private static string vbLf="\n";
|
||||
#region Propiedades
|
||||
//private List<string> _errorLog;
|
||||
//public List<string> errorLog { get { return _errorLog == null ? new List<string>() : _errorLog; } }
|
||||
//public string lastError { get { if (_errorLog != null && _errorLog.Count > 0) { return _errorLog[_errorLog.Count - 1]; } else { return ""; } } }
|
||||
|
||||
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
//VerificarVigenciaSAT
|
||||
//CFDICancelar
|
||||
//PreparaTimbrePago
|
||||
|
||||
#region Timbrado
|
||||
//TimbrarFactura
|
||||
|
||||
/// <summary>
|
||||
/// Timbrar Factura
|
||||
/// </summary>
|
||||
/// <param name="facturaCFDI">Factura a timbrar</param>
|
||||
/// <param name="CvePac">Pac a Timbrar
|
||||
/// 1:
|
||||
/// 2:
|
||||
/// 3:
|
||||
/// 4:
|
||||
/// 5:</param>
|
||||
/// <returns></returns>
|
||||
public static TimbradoResult TimbrarFactura(Factura facturaCFDI, TimbradoEmpresa empresa, PacTimbrado pacTimbre)
|
||||
{
|
||||
TimbradoResult Retorno = new TimbradoResult();
|
||||
switch (pacTimbre)
|
||||
{
|
||||
case PacTimbrado.BIInform:
|
||||
{
|
||||
Retorno = TimbrarFacturaBIInform33(facturaCFDI, empresa);
|
||||
break;
|
||||
}
|
||||
case PacTimbrado.RealVirtualv:
|
||||
{
|
||||
Retorno = TimbrarFacturaRealVirtualv33(facturaCFDI, empresa);
|
||||
break;
|
||||
}
|
||||
case PacTimbrado.ProFact:
|
||||
{
|
||||
Retorno = TimbrarFacturaProFact(facturaCFDI, empresa);
|
||||
break;
|
||||
}
|
||||
case PacTimbrado.GoCFDIv:
|
||||
{
|
||||
Retorno = TimbrarFacturaGoCFDIv33(facturaCFDI, empresa);
|
||||
break;
|
||||
}
|
||||
case PacTimbrado.PADEv: { Retorno = TimbrarFacturaPADEv33(facturaCFDI, empresa); break; }
|
||||
}
|
||||
return Retorno;
|
||||
}
|
||||
|
||||
public static TimbradoResult TimbrarFacturaBIInform33(Factura facturaCFDI, TimbradoEmpresa empresa)
|
||||
{
|
||||
TimbradoResult Retorno = new TimbradoResult();
|
||||
|
||||
CFDITimbre ObjCFDITimbre = facturaCFDI.Timbre;
|
||||
string ArchivoLLave = empresa.ArchivoLLaveGET;
|
||||
string ArchivoCertificado = empresa.ArchivoCertificado;
|
||||
string ArchivoPFX = empresa.ArchivoPFX;
|
||||
string UsuarioServicio = empresa.EmisorRFC;
|
||||
string ClaveServicio = empresa.EmisorRFC.ToLower();
|
||||
string Clave = empresa.ArchivoCertificadoClave;
|
||||
string EmisorRFC = empresa.EmisorRFC;
|
||||
string UrlServicio = empresa.UrlServicioBIInform33;
|
||||
string RutaArchivo = empresa.RutaArchivoXML;
|
||||
string NombreArchivoXML = empresa.NombreArchivoXML;
|
||||
//bool TimbraProduccion = true;
|
||||
if (!empresa.FacturaProduccion)
|
||||
{
|
||||
UsuarioServicio = empresa.UsuarioServicio;
|
||||
ClaveServicio = empresa.ClaveServicio;
|
||||
Clave = "12345678a";
|
||||
EmisorRFC = "AAA010101AAA";
|
||||
UrlServicio = "http://portalmacropro.com.mx/srvCFDi33prueba/service1.asmx";
|
||||
//TimbraProduccion = false;
|
||||
|
||||
}
|
||||
|
||||
ClbNegBICFDv3_3.ClsNegEDI CFDi = new ClbNegBICFDv3_3.ClsNegEDI();
|
||||
ClbNegBICFDv3_3.ClsNegAddFemsa ObjFemsa = new ClbNegBICFDv3_3.ClsNegAddFemsa();
|
||||
ClbNegBICFDv3_3.ClsNegEDICompDet ObjDetallista = new ClbNegBICFDv3_3.ClsNegEDICompDet();
|
||||
ClbNegBICFDv3_3.ClsNegEDICompImplocal ImpLoc = new ClbNegBICFDv3_3.ClsNegEDICompImplocal();
|
||||
string Msg = string.Empty;
|
||||
// Nodo Comprobante
|
||||
ClbNegBICFDv3_3.TipoDeComprobante clbcomp = ObjCFDITimbre.Comprobante.TipoComprobante == "I" ? ClbNegBICFDv3_3.TipoDeComprobante.I : ObjCFDITimbre.Comprobante.TipoComprobante == "E" ? ClbNegBICFDv3_3.TipoDeComprobante.E : ObjCFDITimbre.Comprobante.TipoComprobante == "P" ? ClbNegBICFDv3_3.TipoDeComprobante.P : ClbNegBICFDv3_3.TipoDeComprobante.T;
|
||||
Msg = CFDi.comprobantecfd(0, 0, ObjCFDITimbre.Comprobante.Serie, ObjCFDITimbre.Comprobante.Folio.ToString(), ObjCFDITimbre.Comprobante.Fecha, ObjCFDITimbre.Comprobante.FormadePago, ObjCFDITimbre.Comprobante.CondicionesdePago, ObjCFDITimbre.Comprobante.Subtotal, ObjCFDITimbre.Comprobante.Descuentos, ObjCFDITimbre.Comprobante.TipoCambio.ToDecimal(), ObjCFDITimbre.Comprobante.Moneda, ObjCFDITimbre.Comprobante.Total, ObjCFDITimbre.Comprobante.MetodoPago, clbcomp, ObjCFDITimbre.Comprobante.LugarExpedicion, ObjCFDITimbre.Comprobante.Confirmacion);
|
||||
|
||||
if (string.IsNullOrEmpty(Msg))
|
||||
{
|
||||
// Nodo emisor
|
||||
Msg = CFDi.EmisorCfd(empresa.FacturaProduccion ? empresa.EmisorRFC : "AAA010101AAA", empresa.Empresanombre, empresa.CodigoRegimenFiscal);
|
||||
if (Msg == string.Empty)
|
||||
{
|
||||
|
||||
// Nodo receptor
|
||||
Msg = CFDi.ReceptorCfd(ObjCFDITimbre.Receptor.RFC, ObjCFDITimbre.Receptor.Nombre, "", "",facturaCFDI.ClaveUsoCFDI);
|
||||
if (Msg == string.Empty)
|
||||
{
|
||||
|
||||
// Nodo conceptos, se agregan los PS
|
||||
bool HasErrorConceptos = false;
|
||||
|
||||
if (ObjCFDITimbre.Conceptos != null && ObjCFDITimbre.Conceptos.Count > 0)
|
||||
{
|
||||
foreach (CFDIConceptos concep in ObjCFDITimbre.Conceptos)
|
||||
{
|
||||
CFDi.ConceptosCfd(concep.ClaveProdServ, concep.Cantidad, concep.Unidad, concep.Noidentificacion, concep.Descripcion, concep.ValorUnitario, concep.Importe, concep.ClaveUnidad, concep.Descuento);
|
||||
foreach (CFDIConceptosImpuestos imp in concep.Impuestos)
|
||||
{
|
||||
ClbNegBICFDv3_3.Impuesto clbImp = imp.Impuesto == "002" ? ClbNegBICFDv3_3.Impuesto.IVA : imp.Impuesto == "003" ? ClbNegBICFDv3_3.Impuesto.IEPS : ClbNegBICFDv3_3.Impuesto.ISR;
|
||||
ClbNegBICFDv3_3.TipoFactor clbTipo = imp.TipoFactor == "Tasa" ? ClbNegBICFDv3_3.TipoFactor.Tasa : imp.TipoFactor == "Cuota" ? ClbNegBICFDv3_3.TipoFactor.Cuota : ClbNegBICFDv3_3.TipoFactor.Exento;
|
||||
int Posicion = imp.TasaOCuota.ToString().IndexOf(".");
|
||||
if (imp.TrasladooRetencion == "T")
|
||||
CFDi.ConceptosTrasladosCfd(imp.Base, clbImp, clbTipo, imp.TasaOCuota.ToString().PadRight(imp.TasaOCuota.ToString().Length + (6 - imp.TasaOCuota.ToString().Substring(Posicion, imp.TasaOCuota.ToString().Length - 1).Length + 1), Convert.ToChar("0")), imp.Importe);
|
||||
else
|
||||
CFDi.ConceptosRetencionesCfd(imp.Base, clbImp, clbTipo, imp.TasaOCuota.ToString().PadRight(imp.TasaOCuota.ToString().Length + (6 - imp.TasaOCuota.ToString().Substring(Posicion, imp.TasaOCuota.ToString().Length - 1).Length + 1), Convert.ToChar("0")), imp.Importe);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!HasErrorConceptos)
|
||||
{
|
||||
// Nodo Impuestos, se agrega el total de impuestos
|
||||
Msg = CFDi.ImpuestosCfd(facturaCFDI.RetIVATC +facturaCFDI.RetISRTC,facturaCFDI.IVATC);
|
||||
if (Msg == string.Empty)
|
||||
{
|
||||
bool HasErrorRetenciones = false;
|
||||
// Nodo Impuestos-retenciones
|
||||
foreach (var Ret in ObjCFDITimbre.Retenciones)
|
||||
{
|
||||
ClbNegBICFDv3_3.Impuesto clbImp = Ret.Impuesto == "002" ? ClbNegBICFDv3_3.Impuesto.IVA : Ret.Impuesto == "003" ? ClbNegBICFDv3_3.Impuesto.IEPS : ClbNegBICFDv3_3.Impuesto.ISR;
|
||||
Msg = CFDi.ImpuestosRetencionesCfd(clbImp, Ret.Importe);
|
||||
}
|
||||
|
||||
if (!HasErrorRetenciones)
|
||||
{
|
||||
// Nodo Impuestos-traslado
|
||||
bool HasErrorIVA = false;
|
||||
// 'se acumulan los importes
|
||||
foreach (var Tras in ObjCFDITimbre.Traslados)
|
||||
{
|
||||
int Posicion = Tras.TasaOCuota.ToString().IndexOf(".");
|
||||
ClbNegBICFDv3_3.TipoFactor tipfact = Tras.TipoFactor == "Tasa" ? ClbNegBICFDv3_3.TipoFactor.Tasa : Tras.TipoFactor == "Cuota" ? ClbNegBICFDv3_3.TipoFactor.Cuota : ClbNegBICFDv3_3.TipoFactor.Exento;
|
||||
Msg = CFDi.ImpuestosTrasladosCfd(ClbNegBICFDv3_3.Impuesto.IVA, Tras.TasaOCuota.ToString().PadRight(Tras.TasaOCuota.ToString().Length + (6 - Tras.TasaOCuota.ToString().Substring(Posicion, Tras.TasaOCuota.ToString().Length - 1).Length + 1), Convert.ToChar("0")), Tras.Importe, tipfact);
|
||||
}
|
||||
if (!HasErrorIVA)
|
||||
{
|
||||
// Nodo Impuestos locales
|
||||
// JJMQ 20150826: Se habilitó de nueva cuenta impuestos locales
|
||||
bool HasErrorImpuestosLocales = false;
|
||||
if (ObjCFDITimbre.RetencionesLocales.Sum(x => x.Importe) > 0)
|
||||
{
|
||||
foreach (CFDIRetencionesLocales ret in ObjCFDITimbre.RetencionesLocales)
|
||||
{
|
||||
if (ret.Importe > 0)
|
||||
{
|
||||
Msg = ImpLoc.RetencionesLocales(ret.ImpuestoLocalRetenido, ret.TasaRetencion, ret.Importe);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
CFDi.CompImplocal = ImpLoc;
|
||||
if (Msg != string.Empty)
|
||||
HasErrorImpuestosLocales = true;
|
||||
|
||||
if (!HasErrorImpuestosLocales)
|
||||
{
|
||||
// Agrega Adenda FEMSA
|
||||
bool HasErrorFEMSA = false;
|
||||
if (facturaCFDI.Cliente.AplicaFEMSA)
|
||||
{
|
||||
Msg = ObjFemsa.Carga(facturaCFDI.FemsaFactura.FEMSA_Version,facturaCFDI.ClaseDoctoSat,facturaCFDI.FemsaFactura.FEMSA_NumSociedad,facturaCFDI.FemsaFactura.FEMSA_NumProveedor,facturaCFDI.FemsaFactura.FEMSA_NumPedido,facturaCFDI.MonedaAbreviatura,facturaCFDI.FemsaFactura.FEMSA_NumEntrada,facturaCFDI.FemsaFactura.FEMSA_NumRemision,facturaCFDI.FemsaFactura.FEMSA_NumSocio,facturaCFDI.FemsaFactura.FEMSA_CentroCosto,facturaCFDI.FemsaFactura.FEMSA_IPeriodoLiquidacion,facturaCFDI.FemsaFactura.FEMSA_FPeriodoLiquidacion,facturaCFDI.FemsaFactura.FEMSA_CodRetencion1,facturaCFDI.FemsaFactura.FEMSA_CodRetencion2,facturaCFDI.FemsaFactura.FEMSA_Mail);
|
||||
if (Msg != string.Empty)
|
||||
HasErrorFEMSA = true;
|
||||
}
|
||||
|
||||
if (!HasErrorFEMSA)
|
||||
{
|
||||
if (facturaCFDI.Cliente.AplicaFEMSA)
|
||||
Msg = CFDi.AddendaFemsa(ObjFemsa);
|
||||
if (Msg == string.Empty)
|
||||
{
|
||||
// Agrega Complemento Detallista
|
||||
bool HasErrorDetallista = false;
|
||||
if (facturaCFDI.Cliente.AplicaDetallista)
|
||||
{
|
||||
// Desarrollar Detallista
|
||||
if (Msg != string.Empty)
|
||||
HasErrorDetallista = true;
|
||||
// 1
|
||||
Msg = ObjDetallista._1_1R_requestForPaymentIdentification(ClbNegBICFDv3_3.CompDetEntityType.INVOICE);
|
||||
if (Msg != string.Empty)
|
||||
HasErrorDetallista = true;
|
||||
// 2
|
||||
List<string> LstInstruccionComercial = new List<string>();
|
||||
LstInstruccionComercial.Add(facturaCFDI.TotalTC.ToString().ToDouble().Texto2Letras().ToUpper());
|
||||
Msg = ObjDetallista._2_1O_SpecialInstruction(ClbNegBICFDv3_3.CompDetCode.ZZZ, LstInstruccionComercial);
|
||||
if (Msg != string.Empty)
|
||||
HasErrorDetallista = true;
|
||||
// 3
|
||||
Msg = ObjDetallista._3_1R_OrderIdentification_ReferenceIdentification("ON",facturaCFDI.Det_OrdenCompra);
|
||||
if (Msg != string.Empty)
|
||||
HasErrorDetallista = true;
|
||||
Msg = ObjDetallista._3_2O_OrderIdentification_ReferenceDate(facturaCFDI.Det_FechaOrdenCompra.ToDate());
|
||||
if (Msg != string.Empty)
|
||||
HasErrorDetallista = true;
|
||||
// 4
|
||||
Msg = ObjDetallista._4_1R_AdditionalInformation_ReferenceIdentification("DQ",facturaCFDI.Det_ContraRecibo);
|
||||
if (Msg != string.Empty)
|
||||
HasErrorDetallista = true;
|
||||
// 5
|
||||
Msg = ObjDetallista._5_1R_DeliveryNote_ReferenceIdentification(facturaCFDI.Det_ContraRecibo);
|
||||
if (Msg != string.Empty)
|
||||
HasErrorDetallista = true;
|
||||
Msg = ObjDetallista._5_2O_DeliveryNote_ReferenceDate(facturaCFDI.Det_FechaOrdenCompra.ToDate());
|
||||
if (Msg != string.Empty)
|
||||
HasErrorDetallista = true;
|
||||
// 6
|
||||
Msg = ObjDetallista._6_1R_Buyer(facturaCFDI.Cliente.Detallista_GLNComprador,facturaCFDI.Cliente.Detallista_Departamento);
|
||||
if (Msg != string.Empty)
|
||||
HasErrorDetallista = true;
|
||||
// 7
|
||||
Msg = ObjDetallista._7_1R_Seller(facturaCFDI.Cliente.Detallista_GLNVendedor, "SELLER_ASSIGNED_IDENTIFIER_FOR_A_PARTY",facturaCFDI.Cliente.Detallista_NumProveedor);
|
||||
if (Msg != string.Empty)
|
||||
HasErrorDetallista = true;
|
||||
// 8
|
||||
Msg = ObjDetallista._8_1O_AllowanceCharge(ClbNegBICFDv3_3.CompDetNetAllowanceChargeType.ALLOWANCE_GLOBAL, ClbNegBICFDv3_3.CompDetNetSettlementType.OFF_INVOICE, "0", ClbNegBICFDv3_3.CompDetNetSpecialServicesType.AJ, ClbNegBICFDv3_3.CompDetNetMonetaryAmountOrPercentageBase.INVOICE_VALUE,facturaCFDI.DescuentoTC > 0 &&facturaCFDI.SubTotalTC > 0 ? (facturaCFDI.DescuentoTC * 100) / facturaCFDI.SubTotalTC : 0);
|
||||
if (Msg != string.Empty)
|
||||
HasErrorDetallista = true;
|
||||
// 9
|
||||
int LineNumber = 1;
|
||||
if (ObjCFDITimbre.Conceptos != null && ObjCFDITimbre.Conceptos.Count > 0)
|
||||
{
|
||||
foreach (DataRow Row in facturaCFDI.DtDetalle.Rows)
|
||||
{
|
||||
string PS = Row["PS"].ToString().Length == 1 ? Row["Obs"].ToString() : Row["PS"].ToString().Length == 0 ? "" : Row["PS"].ToString() + " " + Row["Obs"].ToString() + (Row["Obs"].ToString().Trim().Length > 0 ? vbLf : "" + vbLf);
|
||||
Msg = ObjDetallista._9_1R_LineItem("SimpleInvoidLineItemType", LineNumber, Row["Codigo"].ToString(), ClbNegBICFDv3_3.CompDetAlternateTradeItemIdentification.SUPPLIER_ASSIGNED, Row["Codigo"].ToString(), ClbNegBICFDv3_3.CompDetNetLanguage.ES, (Row["Codigo"].ToString() + (Row["Codigo"].ToString().Length > 0 ? "-" : "") + PS).Length > 35 ? (Row["Codigo"].ToString() + (Row["Codigo"].ToString().Length > 0 ? "-" : "") + PS).Substring(0, 34) : (Row["Codigo"].ToString() + (Row["Codigo"].ToString().Length > 0 ? "-" : "") + PS), (Row["UM"].ToString().ToLower() == "no aplica" ? "NA" : Row["UM"].ToString()), Row["Cantidad"].ToString(), Row["PU"].ToString().ToDecimal(), Row["PU"].ToString().ToDecimal() * (1 + Row["IVA"].ToString().ToDecimal()), Row["Cantidad"].ToString().ToDecimal() * Row["PU"].ToString().ToDecimal(), (Row["Cantidad"].ToString().ToDecimal() * Row["PU"].ToString().ToDecimal()) * (1 + Row["IVA"].ToString().ToDecimal()));
|
||||
LineNumber = LineNumber + 1;
|
||||
}
|
||||
}
|
||||
if (Msg != string.Empty)
|
||||
HasErrorDetallista = true;
|
||||
// 10
|
||||
Msg = ObjDetallista._10_1R_TotalAmount(facturaCFDI.SubTotalTC);
|
||||
if (Msg != string.Empty)
|
||||
HasErrorDetallista = true;
|
||||
// 11
|
||||
Msg = ObjDetallista._11_1R_TotalAllowanceCharge(ClbNegBICFDv3_3.CompDetNetAllowanceOrChargeType.ALLOWANCE, ClbNegBICFDv3_3.CompDetNetSpecialServicesType.AA,facturaCFDI.DescuentoTC);
|
||||
if (Msg != string.Empty)
|
||||
HasErrorDetallista = true;
|
||||
}
|
||||
if (!HasErrorDetallista)
|
||||
{
|
||||
if (facturaCFDI.Cliente.AplicaDetallista)
|
||||
Msg = CFDi.ClomplementoDetallistaCfd(ObjDetallista);
|
||||
if (Msg != string.Empty)
|
||||
HasErrorDetallista = true;
|
||||
// Timbrar
|
||||
|
||||
// Web Services de producción: http://biinform.com.mx/srvCFDi/service1.asmx
|
||||
// Web Services de pruebasd: http://biinform.com.mx/srvCFDiPrueba/service1.asmx
|
||||
|
||||
|
||||
|
||||
|
||||
if (!System.IO.Directory.Exists(empresa.RutaArchivoXML)){
|
||||
|
||||
System.IO.Directory.CreateDirectory(empresa.RutaArchivoXML);
|
||||
}
|
||||
|
||||
// GENERAR TIMBRE
|
||||
CFDi.Generar(ArchivoPFX, empresa.ArchivoCertificadoClave, ArchivoCertificado, $"{RutaArchivo }{NombreArchivoXML}.xml", empresa.EmpresaRutaCertificados, UsuarioServicio, ClaveServicio, UrlServicio, true);
|
||||
|
||||
|
||||
if (CFDi.MsgError != string.Empty)
|
||||
{
|
||||
Retorno.GuardaLogTimbrado("Titulo", $"Ocurrió un error al generar el timbre, el mensaje del SAT fue: {CFDi.MsgError}. Emp:{empresa.CveEmpresa}. MetPag: {facturaCFDI.ClaveMetodoPagoSAT}", 0, (int)PacTimbrado.BIInform);
|
||||
}
|
||||
else
|
||||
{
|
||||
ClbNegBICFDv3_3.ClsNegCBBGenerar CBB = new ClbNegBICFDv3_3.ClsNegCBBGenerar();
|
||||
DateTime FechaCertificacion;
|
||||
string FolioFiscal, NoSerieCertificado, NoSerieCertificadoContribuyente, SelloCFDi, SelloSAT;
|
||||
|
||||
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;
|
||||
|
||||
|
||||
empresa.UpdateEstatusFactura(FolioFiscal, ObjCFDITimbre, facturaCFDI, (int)PacTimbrado.BIInform);
|
||||
CBB.GenerarCBB(empresa.EmisorRFC, ObjCFDITimbre.Receptor.RFC, facturaCFDI.TotalTC, FolioFiscal, empresa.RutaCBB);
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Retorno.GuardaLogTimbrado("Titulo", "El SAT regresó el siguiente mensaje: " + Msg + ". Objeto: Complemento ", 0, (int)PacTimbrado.BIInform);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Retorno.GuardaLogTimbrado("Titulo", "El SAT regresó el siguiente mensaje: " + Msg + ". Objeto: AddendaFemsa", 0, (int)PacTimbrado.BIInform);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Retorno.GuardaLogTimbrado("Titulo", "El SAT regresó el siguiente mensaje: " + Msg + ". Objeto: AddendaFemsa", 0, (int)PacTimbrado.BIInform);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Retorno.GuardaLogTimbrado("Titulo", "El SAT regresó el siguiente mensaje: " + Msg + ". Objeto: RetencionesLocales", 0, (int)PacTimbrado.BIInform);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Retorno.GuardaLogTimbrado("Titulo", "El SAT regresó el siguiente mensaje: " + Msg + ". Objeto: ImpuestosTrasladoCfd", 0, (int)PacTimbrado.BIInform);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Retorno.GuardaLogTimbrado("Titulo", "El SAT regresó el siguiente mensaje: " + Msg + ". Objeto: ImpuestosRetencionesCfd ", 0, (int)PacTimbrado.BIInform);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Retorno.GuardaLogTimbrado("Titulo", "El SAT regresó el siguiente mensaje: " + Msg + ". Objeto: ImpuestosCfd", 0, (int)PacTimbrado.BIInform);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Retorno.GuardaLogTimbrado("Titulo", "El SAT regresó el siguiente mensaje: " + Msg + ". Objeto: ConceptosCfd" , 0, (int)PacTimbrado.BIInform);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Retorno.GuardaLogTimbrado("Titulo", "El SAT regresó el siguiente mensaje: " + Msg + ". Objeto: ReceptorCfd", 0, (int)PacTimbrado.BIInform);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Retorno.GuardaLogTimbrado("Titulo", "El SAT regresó el siguiente mensaje: " + Msg + ". Objeto: EmisorCfd", 0, (int)PacTimbrado.BIInform);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Retorno.GuardaLogTimbrado("Titulo", "El SAT regresó el siguiente mensaje: " + Msg + ". Objeto: Comprobante", 0, (int)PacTimbrado.BIInform);
|
||||
}
|
||||
|
||||
Retorno._isOK =Retorno._errorLog.Count==0;
|
||||
return Retorno;
|
||||
}
|
||||
|
||||
public static TimbradoResult TimbrarFacturaRealVirtualv33(Factura facturaCFDI, TimbradoEmpresa empresa)
|
||||
{
|
||||
TimbradoResult Retorno = new TimbradoResult();
|
||||
|
||||
return Retorno;
|
||||
}
|
||||
public static TimbradoResult TimbrarFacturaProFact(Factura facturaCFDI, TimbradoEmpresa empresa)
|
||||
{
|
||||
TimbradoResult Retorno = new TimbradoResult();
|
||||
|
||||
return Retorno;
|
||||
}
|
||||
public static TimbradoResult TimbrarFacturaGoCFDIv33(Factura facturaCFDI, TimbradoEmpresa empresa)
|
||||
{
|
||||
TimbradoResult result = new TimbradoResult();
|
||||
|
||||
|
||||
CFDITimbre ObjCFDITimbre = facturaCFDI.Timbre;
|
||||
string ArchivoLLave = empresa.ArchivoLLaveGET;
|
||||
string ArchivoCertificado = empresa.ArchivoCertificado;
|
||||
string UsuarioServicio = empresa.UsuarioServicio;
|
||||
string ClaveServicio = empresa.ClaveServicio;
|
||||
string Clave = empresa.ArchivoCertificadoClave;
|
||||
string EmisorRFC = empresa.EmisorRFC;
|
||||
string UrlServicio = empresa.UrlServicioGoCFDIv; // Produccion
|
||||
string RutaArchivo = empresa.RutaArchivoXML;
|
||||
string NombreArchivoXML = empresa.NombreArchivoXML;
|
||||
decimal SubTotal = 0;
|
||||
bool TimbraProduccion = true;
|
||||
|
||||
byte[] llaveByte;
|
||||
byte[] certByte;
|
||||
string llaveBase64=null;
|
||||
string certBase64=null;
|
||||
GoFac.GoCfdi cfdi = new GoFac.GoCfdi();
|
||||
string complemento = "";
|
||||
string complementoConcepto = "";
|
||||
if (!Directory.Exists(RutaArchivo)) { Directory.CreateDirectory(RutaArchivo); }
|
||||
|
||||
|
||||
if (!empresa.FacturaProduccion)
|
||||
{
|
||||
EmisorRFC = "AAA010101AAA";
|
||||
Clave = "12345678a";
|
||||
TimbraProduccion = false;
|
||||
}
|
||||
if (!File.Exists(ArchivoCertificado))
|
||||
{
|
||||
result.GuardaLogTimbrado("Titulo", "El archivo de certificado no existe", 0, (int)PacTimbrado.GoCFDIv);
|
||||
}
|
||||
else
|
||||
{
|
||||
try
|
||||
{
|
||||
certByte = System.IO.File.ReadAllBytes(ArchivoCertificado);
|
||||
certBase64 = Convert.ToBase64String(certByte);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
result.GuardaLogTimbrado("Titulo", $"Error al leer la llave privada: {ex.Message}", 0, (int)PacTimbrado.GoCFDIv);
|
||||
}
|
||||
}
|
||||
if (!File.Exists(ArchivoLLave))
|
||||
{
|
||||
result.GuardaLogTimbrado("Titulo", "El archivo de llave privada no existe", 0, (int)PacTimbrado.GoCFDIv);
|
||||
}
|
||||
else
|
||||
{
|
||||
try
|
||||
{
|
||||
llaveByte = System.IO.File.ReadAllBytes(ArchivoLLave);
|
||||
llaveBase64 = Convert.ToBase64String(llaveByte);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
result.GuardaLogTimbrado("Titulo", $"Error al leer la llave privada: {ex.Message}", 0, (int)PacTimbrado.GoCFDIv);
|
||||
}
|
||||
}
|
||||
if (string.IsNullOrEmpty(empresa.ArchivoCertificadoClave))
|
||||
{
|
||||
result.GuardaLogTimbrado("Titulo", "La clave no puede ser vacía", 0, (int)PacTimbrado.GoCFDIv);
|
||||
}
|
||||
if (result._errorLog.Count > 0)
|
||||
{
|
||||
return result;
|
||||
}
|
||||
|
||||
cfdi.CertificadoArchivo(ArchivoCertificado);
|
||||
{
|
||||
//if (CvePACEspecial == -1)
|
||||
// CvePACEspecial = UsuarioActual.Empresa.CvePAC;
|
||||
//System.Diagnostics.Stopwatch sw = new System.Diagnostics.Stopwatch();
|
||||
//long swmili = 0;
|
||||
//StringBuilder swTiempo = new StringBuilder();
|
||||
//sw.Start();
|
||||
//string Retorno = "";
|
||||
//CFDITimbre ObjCFDITimbre = facturaCFDI.Timbre;
|
||||
// 'Sucursal matriz de la empresa
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
cfdi.Comprobante33(ObjCFDITimbre.Comprobante.Serie, ObjCFDITimbre.Comprobante.Folio, ObjCFDITimbre.Comprobante.Fecha.ToString("yyyy-MM-ddTHH:mm:ss"), ObjCFDITimbre.Comprobante.FormadePago, ObjCFDITimbre.Comprobante.CondicionesdePago, ObjCFDITimbre.Comprobante.Subtotal.ToString().ToDouble(), ObjCFDITimbre.Comprobante.Descuentos.ToString().ToDouble(), ObjCFDITimbre.Comprobante.Moneda, ObjCFDITimbre.Comprobante.TipoCambio, ObjCFDITimbre.Comprobante.Total.ToString().ToDouble(), ObjCFDITimbre.Comprobante.TipoComprobante, ObjCFDITimbre.Comprobante.MetodoPago, ObjCFDITimbre.Comprobante.LugarExpedicion, ObjCFDITimbre.Comprobante.Confirmacion);
|
||||
|
||||
if (ObjCFDITimbre.CFDIRelacionados.TipoRelacion != "")
|
||||
{
|
||||
cfdi.CfdiRelacionados(ObjCFDITimbre.CFDIRelacionados.TipoRelacion);
|
||||
foreach (string uid in ObjCFDITimbre.CFDIRelacionados.UUID)
|
||||
cfdi.CfdiRelacionado(uid);
|
||||
}
|
||||
// cfdi.agregarCfdiRelacionados()
|
||||
cfdi.Emisor(EmisorRFC, empresa.Empresanombre, empresa.CodigoRegimenFiscal);
|
||||
|
||||
|
||||
|
||||
cfdi.Receptor(ObjCFDITimbre.Receptor.RFC, ObjCFDITimbre.Receptor.Nombre, ObjCFDITimbre.Receptor.ResidenciaFiscal, ObjCFDITimbre.Receptor.NumeroRegistroTributario, ObjCFDITimbre.Receptor.UsoCFDI);
|
||||
|
||||
|
||||
|
||||
|
||||
// Nodo conceptos, se agregan los PS
|
||||
|
||||
if (ObjCFDITimbre.Conceptos != null && ObjCFDITimbre.Conceptos.Count > 0)
|
||||
{
|
||||
foreach (CFDIConceptos concep in ObjCFDITimbre.Conceptos)
|
||||
{
|
||||
cfdi.Concepto(concep.ClaveProdServ, concep.Noidentificacion, concep.Cantidad.ToString().ToDouble(), concep.ClaveUnidad, concep.Unidad, concep.Descripcion, concep.ValorUnitario.ToString().ToDouble(), concep.Importe.ToString().ToDouble(), concep.Descuento.ToString().ToDouble());
|
||||
foreach (CFDIConceptosImpuestos imp in concep.Impuestos)
|
||||
{
|
||||
if (imp.TrasladooRetencion == "T")
|
||||
cfdi.ImpuestoConceptoTraslado(imp.Base.ToString().ToDouble(), imp.Impuesto, imp.TipoFactor, imp.TasaOCuota.ToString().ToDouble(), imp.Importe.ToString().ToDouble());
|
||||
else
|
||||
cfdi.ImpuestoConceptoRetenido(imp.Base.ToString().ToDouble(), imp.Impuesto, imp.TipoFactor, imp.TasaOCuota.ToString().ToDouble(), imp.Importe.ToString().ToDouble());
|
||||
}
|
||||
if (concep.CuentaPredial != "")
|
||||
cfdi.CuentaPredial(concep.CuentaPredial);
|
||||
if (concep.NumeroPedimento != "")
|
||||
cfdi.InformacionAduanera(concep.NumeroPedimento);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (ObjCFDITimbre.Comprobante.TipoComprobante.Contiene("I", "E"))
|
||||
{
|
||||
|
||||
// SI NO ES FACTURA EN 0 AGREGA LOS IMPUESTOS
|
||||
if (facturaCFDI.Total != 0 || (ObjCFDITimbre.TotalImpuestosRetenidos > 0 || ObjCFDITimbre.TotalImpuestosTrasladados > 0))
|
||||
cfdi.Impuestos(ObjCFDITimbre.TotalImpuestosRetenidos.ToString().ToDouble(), ObjCFDITimbre.TotalImpuestosTrasladados.ToString().ToDouble());
|
||||
|
||||
|
||||
if (ObjCFDITimbre.Retenciones.Sum(x => x.Importe) > 0)
|
||||
{
|
||||
// 'se acumulan los importes
|
||||
foreach (var Ret in ObjCFDITimbre.Retenciones)
|
||||
cfdi.Retencion(Ret.Impuesto, Ret.Importe.ToString().ToDouble());
|
||||
}
|
||||
|
||||
// 'se acumulan los importes
|
||||
foreach (var Tras in ObjCFDITimbre.Traslados)
|
||||
cfdi.Traslado(Tras.Impuesto, Tras.TipoFactor, Tras.TasaOCuota.ToString().ToDouble(), Tras.Importe.ToString().ToDouble());
|
||||
|
||||
|
||||
if (ObjCFDITimbre.RetencionesLocales.Sum(x => x.Importe) > 0 || ObjCFDITimbre.TrasladosLocales.Sum(x => x.Importe) > 0)
|
||||
{
|
||||
cfdi.ImpuestosLocales(ObjCFDITimbre.RetencionesLocales.Sum(x => x.Importe).ToString().ToDouble(), ObjCFDITimbre.TrasladosLocales.Sum(x => x.Importe).ToString().ToDouble());
|
||||
|
||||
foreach (CFDIRetencionesLocales ret in ObjCFDITimbre.RetencionesLocales)
|
||||
{
|
||||
if (ret.Importe > 0)
|
||||
cfdi.RetencionLocal(ret.ImpuestoLocalRetenido, ret.TasaRetencion.ToString().ToDouble(), ret.Importe.ToString().ToDouble());
|
||||
}
|
||||
|
||||
foreach (CFDITrasladosLocales ret in ObjCFDITimbre.TrasladosLocales)
|
||||
{
|
||||
if (ret.Importe > 0)
|
||||
cfdi.TrasladoLocal(ret.ImpuestoLocalTraslado, ret.TasaTraslado.ToString().ToDouble(), ret.Importe.ToString().ToDouble());
|
||||
}
|
||||
}
|
||||
|
||||
if (facturaCFDI.CveComplementoTimbrado > 0)
|
||||
{
|
||||
switch (facturaCFDI.CveComplementoTimbrado)
|
||||
{
|
||||
case 5 // INE Proceso Ordinario Directivo Estatal"
|
||||
:
|
||||
{
|
||||
cfdi.Ine11("Ordinario", "Directivo Estatal", "0");
|
||||
|
||||
cfdi.IneEntidad(facturaCFDI.ComplementoINE.INEEntidad, "");
|
||||
cfdi.IneContabilidad(facturaCFDI.ComplementoINE.INEIdContabilidad);
|
||||
break;
|
||||
}
|
||||
|
||||
case 6 // INE Proceso Ordinario Ejecutivo Estatal"
|
||||
:
|
||||
{
|
||||
cfdi.Ine11("Ordinario", "Ejecutivo Estatal", "0");
|
||||
|
||||
cfdi.IneEntidad(facturaCFDI.ComplementoINE.INEEntidad, "");
|
||||
cfdi.IneContabilidad(facturaCFDI.ComplementoINE.INEIdContabilidad);
|
||||
break;
|
||||
}
|
||||
|
||||
case 7 // INE Proceso Ordinario Ejecutivo Nacional"
|
||||
:
|
||||
{
|
||||
cfdi.Ine11("Ordinario", "Ejecutivo Nacional", facturaCFDI.ComplementoINE.INEIdContabilidad.ToString());
|
||||
break;
|
||||
}
|
||||
|
||||
case 8 // INE PreCampaña
|
||||
:
|
||||
{
|
||||
cfdi.Ine11(facturaCFDI.ComplementoINE.INETipoProceso, "", "0");
|
||||
|
||||
cfdi.IneEntidad(facturaCFDI.ComplementoINE.INEEntidad, facturaCFDI.ComplementoINE.INETipoComite);
|
||||
cfdi.IneContabilidad(facturaCFDI.ComplementoINE.INEIdContabilidad);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
if (facturaCFDI.Cliente.AplicaComercioExterior & ObjCFDITimbre.Complementos.ComercioExterior11.AplicaComercioExteriorSubProyecto)
|
||||
{
|
||||
if (ObjCFDITimbre.Complementos.ComercioExterior11 != null)
|
||||
{
|
||||
|
||||
// DATOS GENERALES
|
||||
cfdi.ComercioExterior11(ObjCFDITimbre.Complementos.ComercioExterior11.MotivoTraslado, ObjCFDITimbre.Complementos.ComercioExterior11.TipoOperacion, ObjCFDITimbre.Complementos.ComercioExterior11.ClavedePedimento, ObjCFDITimbre.Complementos.ComercioExterior11.CertificadoOrigen, ObjCFDITimbre.Complementos.ComercioExterior11.NumCertificadoOrigen, ObjCFDITimbre.Complementos.ComercioExterior11.NumeroExportadorConfiable, ObjCFDITimbre.Complementos.ComercioExterior11.Incoterm, ObjCFDITimbre.Complementos.ComercioExterior11.Subdivision, ObjCFDITimbre.Complementos.ComercioExterior11.Observaciones, ObjCFDITimbre.Complementos.ComercioExterior11.TipoCambioUSD.ToString().ToDouble(), ObjCFDITimbre.Complementos.ComercioExterior11.TotalUSD.ToString().ToDouble());
|
||||
// EMISOR
|
||||
cfdi.ComercioExterior11Emisor(EmisorRFC.Length >= 12 ? "" : ObjCFDITimbre.Complementos.ComercioExterior11.Emisor.CURP);
|
||||
cfdi.ComercioExterior11Domicilio(ObjCFDITimbre.Complementos.ComercioExterior11.Emisor.Calle, ObjCFDITimbre.Complementos.ComercioExterior11.Emisor.NumeroExterior, ObjCFDITimbre.Complementos.ComercioExterior11.Emisor.NumeroInterior, ObjCFDITimbre.Complementos.ComercioExterior11.Emisor.Colonia, ObjCFDITimbre.Complementos.ComercioExterior11.Emisor.Localidad, ObjCFDITimbre.Complementos.ComercioExterior11.Emisor.Referencia, ObjCFDITimbre.Complementos.ComercioExterior11.Emisor.Municipio, ObjCFDITimbre.Complementos.ComercioExterior11.Emisor.Estado, ObjCFDITimbre.Complementos.ComercioExterior11.Emisor.Pais, ObjCFDITimbre.Complementos.ComercioExterior11.Emisor.CP);
|
||||
// RECEPTOR
|
||||
cfdi.ComercioExterior11Receptor(ObjCFDITimbre.Complementos.ComercioExterior11.Receptor.NumRegIdTrib);
|
||||
cfdi.ComercioExterior11DomicilioReceptor(ObjCFDITimbre.Complementos.ComercioExterior11.Receptor.Calle, ObjCFDITimbre.Complementos.ComercioExterior11.Receptor.NumeroExterior, ObjCFDITimbre.Complementos.ComercioExterior11.Receptor.NumeroInterior, ObjCFDITimbre.Complementos.ComercioExterior11.Receptor.Colonia, ObjCFDITimbre.Complementos.ComercioExterior11.Receptor.Localidad, ObjCFDITimbre.Complementos.ComercioExterior11.Receptor.Referencia, ObjCFDITimbre.Complementos.ComercioExterior11.Receptor.Municipio, ObjCFDITimbre.Complementos.ComercioExterior11.Receptor.Estado, ObjCFDITimbre.Complementos.ComercioExterior11.Receptor.Pais, ObjCFDITimbre.Complementos.ComercioExterior11.Receptor.CP);
|
||||
cfdi.ComercioExterior11Destinatario(ObjCFDITimbre.Complementos.ComercioExterior11.Destinatario.NumRegIdTrib, ObjCFDITimbre.Complementos.ComercioExterior11.Destinatario.Nombre, ObjCFDITimbre.Complementos.ComercioExterior11.Destinatario.Calle, ObjCFDITimbre.Complementos.ComercioExterior11.Destinatario.NumeroExterior, ObjCFDITimbre.Complementos.ComercioExterior11.Destinatario.NumeroInterior, ObjCFDITimbre.Complementos.ComercioExterior11.Destinatario.Colonia, ObjCFDITimbre.Complementos.ComercioExterior11.Destinatario.Localidad, ObjCFDITimbre.Complementos.ComercioExterior11.Destinatario.Referencia, ObjCFDITimbre.Complementos.ComercioExterior11.Destinatario.Municipio, ObjCFDITimbre.Complementos.ComercioExterior11.Destinatario.Estado, ObjCFDITimbre.Complementos.ComercioExterior11.Destinatario.Pais, ObjCFDITimbre.Complementos.ComercioExterior11.Destinatario.CP);
|
||||
// MERCANCIAS
|
||||
if (ObjCFDITimbre.Complementos.ComercioExterior11.Mercancias != null && ObjCFDITimbre.Complementos.ComercioExterior11.Mercancias.Count > 0)
|
||||
{
|
||||
foreach (CFDIComercioExterior11Mercancias concep in ObjCFDITimbre.Complementos.ComercioExterior11.Mercancias)
|
||||
{
|
||||
cfdi.ComercioExterior11Mercancia(concep.NoIdentificacion, concep.FraccionArancelaria, concep.CantidadAduana.ToString().ToDouble(), concep.UnidadAduana, concep.ValorUnitarioAduana.ToString().ToDouble(), concep.ValorDolares.ToString().ToDouble());
|
||||
if (concep.DescripcionesEspecificas.Marca != "")
|
||||
cfdi.ComercioExterior11MercanciaDescripcionesEspeciales(concep.DescripcionesEspecificas.Marca, concep.DescripcionesEspecificas.Modelo, concep.DescripcionesEspecificas.SubModelo, concep.DescripcionesEspecificas.NumeroSerie);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (ObjCFDITimbre.Comprobante.TipoComprobante == "P")
|
||||
{
|
||||
cfdi.Pago(ObjCFDITimbre.ComplementoPagos.FechaPago.ToString("yyyy-MM-ddTHH:mm:ss"), ObjCFDITimbre.ComplementoPagos.FormaDePagoP, ObjCFDITimbre.ComplementoPagos.MonedaP, ObjCFDITimbre.ComplementoPagos.TipoCambioP.ToString().ToDouble(), ObjCFDITimbre.ComplementoPagos.Monto.ToString().ToDouble(), ObjCFDITimbre.ComplementoPagos.NumOperacion, ObjCFDITimbre.ComplementoPagos.RfcEmisorCtaOrd, ObjCFDITimbre.ComplementoPagos.NomBancoOrdExt, ObjCFDITimbre.ComplementoPagos.CtaOrdenante, ObjCFDITimbre.ComplementoPagos.RfcEmisorCtaBen, ObjCFDITimbre.ComplementoPagos.CtaBeneficiario, ObjCFDITimbre.ComplementoPagos.TipoCadPago, ObjCFDITimbre.ComplementoPagos.CertPago, ObjCFDITimbre.ComplementoPagos.CadPago, ObjCFDITimbre.ComplementoPagos.SelloPago);
|
||||
|
||||
|
||||
if (ObjCFDITimbre.ComplementoPagos.DocumentosRelacionados.Count > 0)
|
||||
{
|
||||
foreach (CFDIComplementoPagosDocsRelacionados doc in ObjCFDITimbre.ComplementoPagos.DocumentosRelacionados)
|
||||
cfdi.PagoDoctoRelacionado(doc.IdDocumento, doc.Serie, doc.Folio, doc.MonedaDR, doc.TipoCambioDR.ToString().ToDouble(), doc.MetodoDePagoDR, doc.NumParcialidad, doc.ImpSaldoAnt.ToString().ToDouble(), doc.ImpPagado.ToString().ToDouble(), doc.ImpSaldoInsoluto.ToString().ToDouble());
|
||||
|
||||
// Estos impuestos aplicarían para anticipos
|
||||
if (ObjCFDITimbre.ComplementoPagos.TotalImpuestosRetenidos > 0 || ObjCFDITimbre.ComplementoPagos.TotalImpuestosTrasladados > 0)
|
||||
{
|
||||
cfdi.PagoImpuestos(ObjCFDITimbre.ComplementoPagos.TotalImpuestosRetenidos.ToString().ToDouble(), ObjCFDITimbre.ComplementoPagos.TotalImpuestosTrasladados.ToString().ToDouble());
|
||||
if ((ObjCFDITimbre.ComplementoPagos.Impuestos).Where(x => x.TrasladooRetencion == "R").Count() > 0)
|
||||
{
|
||||
foreach (CFDIConceptosImpuestos Ret in (ObjCFDITimbre.ComplementoPagos.Impuestos).Where(x => x.TrasladooRetencion == "R"))
|
||||
cfdi.PagoRetencion(Ret.Impuesto, Ret.Importe.ToString().ToDouble());
|
||||
}
|
||||
if ((ObjCFDITimbre.ComplementoPagos.Impuestos).Where(x => x.TrasladooRetencion == "T").Count() > 0)
|
||||
{
|
||||
foreach (CFDIConceptosImpuestos Tra in (ObjCFDITimbre.ComplementoPagos.Impuestos).Where(x => x.TrasladooRetencion == "T"))
|
||||
cfdi.PagoTraslado(Tra.Impuesto, Tra.TipoFactor, Tra.TasaOCuota.ToString().ToDouble(), Tra.Importe.ToString().ToDouble());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (ObjCFDITimbre.Comprobante.TipoComprobante == "N")
|
||||
{
|
||||
|
||||
// cfdi.Esquema.AgregarEsquema("http://www.sat.gob.mx/nomina12 http://www.sat.gob.mx/sitio_internet/cfd/nomina/nomina12.xsd")
|
||||
cfdi.Nomina12(ObjCFDITimbre.Nomina.TipoNomina, ObjCFDITimbre.Nomina.FechaPago.ToString("yyyy-MM-dd"), ObjCFDITimbre.Nomina.FechaInicio.ToDate().ToString("yyyy-MM-dd"), ObjCFDITimbre.Nomina.FechaFin.ToDate().ToString("yyyy-MM-dd"), ObjCFDITimbre.Nomina.NumDiasPagados, ObjCFDITimbre.Nomina.Percepciones != null && ObjCFDITimbre.Nomina.Percepciones.Count > 0 ? ObjCFDITimbre.Nomina.TotalPercepciones.ToString().ToDouble() : 0, ObjCFDITimbre.Nomina.Deducciones != null && ObjCFDITimbre.Nomina.Deducciones.Count > 0 ? ObjCFDITimbre.Nomina.TotalDeducciones.ToString().ToDouble() : 0, ObjCFDITimbre.Nomina.OtrosPagos != null && ObjCFDITimbre.Nomina.OtrosPagos.Count > 0 ? ObjCFDITimbre.Nomina.TotalOtrosPagos.ToString().ToDouble() : 0);
|
||||
|
||||
cfdi.Nomina12Emisor(ObjCFDITimbre.Emisor.CURP, ObjCFDITimbre.Nomina.Receptor.TipoContrato == "99" ? "" : ObjCFDITimbre.Emisor.RegistroPatronal, ObjCFDITimbre.Emisor.RFC);
|
||||
|
||||
comentadobymeborrarparaencontrar = "";
|
||||
//if (UsuarioActual.Empresa.UsaAC) { cfdi.Nomina12EntidadSNCF("IF", 90); }
|
||||
|
||||
|
||||
|
||||
cfdi.Nomina12Receptor(ObjCFDITimbre.Nomina.Receptor.CURP, ObjCFDITimbre.Nomina.Receptor.NSS, ObjCFDITimbre.Nomina.Receptor.FechaInicioContrato.ToDate().ToString("yyyy-MM-dd"), ObjCFDITimbre.Nomina.Receptor.Antiguedad, ObjCFDITimbre.Nomina.Receptor.TipoContrato, ObjCFDITimbre.Nomina.Receptor.Sindicalizado, ObjCFDITimbre.Nomina.Receptor.CodigoTipoJornada, ObjCFDITimbre.Nomina.Receptor.CodigoRegimenContratacion, ObjCFDITimbre.Nomina.Receptor.CodigoEmpleado, ObjCFDITimbre.Nomina.Receptor.Departamento, ObjCFDITimbre.Nomina.Receptor.Puesto, ObjCFDITimbre.Nomina.Receptor.CodigoRiesgoPuesto, ObjCFDITimbre.Nomina.TipoNomina == "E" ? "99" : ObjCFDITimbre.Nomina.Receptor.TipoPeriodo, ObjCFDITimbre.Nomina.Receptor.CodigoBanco, ObjCFDITimbre.Nomina.Receptor.NumeroCuenta, ObjCFDITimbre.Nomina.Receptor.SBC.ToString().ToDouble(), ObjCFDITimbre.Nomina.Receptor.SDI.ToString().ToDouble(), ObjCFDITimbre.Nomina.Receptor.CodigoEntidadFederativa);
|
||||
}
|
||||
if (ObjCFDITimbre.Nomina != null)
|
||||
{
|
||||
if (ObjCFDITimbre.Nomina.Percepciones != null && ObjCFDITimbre.Nomina.Percepciones.Count > 0)
|
||||
{
|
||||
cfdi.Nomina12Percepciones(ObjCFDITimbre.Nomina.TotalSueldos.ToString().ToDouble(), ObjCFDITimbre.Nomina.TotalIndemnizacion.ToString().ToDouble(), ObjCFDITimbre.Nomina.TotalJubilacion.ToString().ToDouble(), ObjCFDITimbre.Nomina.TotalPercepcionesGravado.ToString().ToDouble(), ObjCFDITimbre.Nomina.TotalPercepcionesExento.ToString().ToDouble());
|
||||
foreach (CFDINominaPercepciones percep in ObjCFDITimbre.Nomina.Percepciones)
|
||||
cfdi.Nomina12Percepcion(percep.TipoPercepcion, percep.Clave, percep.Concepto, Math.Round(percep.ImporteGravado.ToString().ToDouble(), 2), Math.Round(percep.ImporteExento.ToString().ToDouble(), 2));
|
||||
}
|
||||
|
||||
// deducciones al final
|
||||
if (ObjCFDITimbre.Nomina.Deducciones != null && ObjCFDITimbre.Nomina.Deducciones.Count > 0)
|
||||
{
|
||||
cfdi.Nomina12Deducciones(ObjCFDITimbre.Nomina.TotalDeduccionesOtras.ToString().ToDouble(), Math.Round(ObjCFDITimbre.Nomina.TotalDeduccionesImpuestosRetenidos.ToString().ToDouble(), 2));
|
||||
foreach (CFDINominaDeducciones deduc in ObjCFDITimbre.Nomina.Deducciones)
|
||||
cfdi.Nomina12Deduccion(deduc.TipoDeduccion, deduc.Clave, deduc.Concepto, Math.Round(deduc.Importe.ToString().ToDouble(), 2));
|
||||
}
|
||||
|
||||
if (ObjCFDITimbre.Nomina.HorasExtras != null && ObjCFDITimbre.Nomina.HorasExtras.Count > 0)
|
||||
{
|
||||
foreach (CFDINominaHorasExtras HoraExtra in ObjCFDITimbre.Nomina.HorasExtras)
|
||||
cfdi.Nomina12HorasExtra(HoraExtra.Dias.ToEntero(), HoraExtra.TipoHoras, HoraExtra.HorasExtra, HoraExtra.ImportePagado.ToString().ToDouble());
|
||||
}
|
||||
|
||||
if (ObjCFDITimbre.Nomina.Incapacidades != null && ObjCFDITimbre.Nomina.Incapacidades.Count > 0)
|
||||
{
|
||||
foreach (CFDINominaIncapacidades Incap in ObjCFDITimbre.Nomina.Incapacidades)
|
||||
cfdi.Nomina12Incapacidad(Incap.DiasIncapacidad.ToEntero(), Incap.TipoIncapacidad, Incap.Importe.ToString().ToDouble());
|
||||
}
|
||||
|
||||
if (ObjCFDITimbre.Nomina.OtrosPagos != null)
|
||||
{
|
||||
// cfdi.agregarNominaOtrosPagosOtroPago12("002", "002", "Subsidio", "10.00");
|
||||
// cfdi.agregarNominaOtrosPagosOtroPagoSubsidioAlEmpleo12("10.00");
|
||||
if (ObjCFDITimbre.Nomina.OtrosPagos != null && ObjCFDITimbre.Nomina.OtrosPagos.Count > 0)
|
||||
{
|
||||
foreach (CFDINominaOtrosPagos otpag in ObjCFDITimbre.Nomina.OtrosPagos)
|
||||
{
|
||||
cfdi.Nomina12OtroPago(otpag.TipoOtroPago, otpag.Clave, otpag.Concepto, otpag.Importe.ToString().ToDouble());
|
||||
if (otpag.TipoOtroPago == "002")
|
||||
cfdi.Nomina12SubsidioAlEmpleo(otpag.Subsidiocausado.ToString().ToDouble());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool ArchivoGenerado = false;
|
||||
try
|
||||
{
|
||||
cfdi.GenerarXMLB64(llaveBase64, Clave);
|
||||
ArchivoGenerado = true;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
comentadobymeborrarparaencontrar = "";
|
||||
//Retorno = cfdi.MensajeError;
|
||||
//if (Retorno == "" || Information.IsNothing(Retorno)) { Retorno = $"llaveBase64 ={llaveBase64} <br/>Clave ={Clave} <br/> {ex.ToString()}"; }
|
||||
//MensajeErrorCFDI = Retorno;
|
||||
}
|
||||
|
||||
|
||||
if (ArchivoGenerado)
|
||||
{
|
||||
cfdi.TimbrarCfdi(UsuarioServicio, ClaveServicio, UrlServicio, TimbraProduccion);
|
||||
|
||||
// Verifica el error
|
||||
if (cfdi.CodigoError == 0)
|
||||
{
|
||||
string FolioFiscal;
|
||||
|
||||
result.uuid = cfdi.UUID;
|
||||
FolioFiscal = cfdi.UUID; // obtenerAtributo(cfdi.XmlTimbrado, "TimbreFiscalDigital", "UUID") 'XmlDoc.DocumentElement("cfdi:Complemento").FirstChild.Attributes("UUID").InnerText
|
||||
|
||||
if (FolioFiscal != "")
|
||||
{
|
||||
cfdi.EscribirXML(cfdi.Xml, RutaArchivo, NombreArchivoXML);
|
||||
|
||||
comentadobymeborrarparaencontrar = "";
|
||||
//if (ObjCFDITimbre.Comprobante.TipoComprobante != "P")
|
||||
//{
|
||||
|
||||
// // Actualiza Estatus Factura
|
||||
// if (facturaCFDI.CveVenta > 0)
|
||||
// {
|
||||
// using (ClsVentas ObjVentas = new ClsVentas())
|
||||
// {
|
||||
// if (ObjfacturaCFDI.UpdateEstatusFactura(3, FolioFiscal, "", ObjCFDITimbre.Comprobante.Fecha, facturaCFDI.CveVenta, CvePAC: CvePACEspecial)) { Retorno = ""; }
|
||||
// else { Retorno = "Error"; }
|
||||
// }
|
||||
|
||||
// // Genero la addenda Ford
|
||||
// if (facturaCFDI.Cliente.Ford_GSDB != "")
|
||||
// {
|
||||
// string RutaCadena = string.Format("{0}{1}.xml", RutaArchivo, NombreArchivoXML); // If(UsuarioActual.Empresa.FacturaProduccion, String.Format("{0}XML\{1}\{2}.xml", Ruta, facturaCFDI.SerieFolio), String.Format("{0}XML\{1}\{2}.xml", Ruta, facturaCFDI.TipoDocto, facturaCFDI.SerieFolio))
|
||||
|
||||
// string FolioFactura = "";
|
||||
// if (UsuarioActual.CveEmpresa == 8)
|
||||
// FolioFactura = facturaCFDI.Folio.ToString(); // sogo, pordefault manda el folio de la factura
|
||||
// GeneraAddendaFord(RutaCadena, FolioFactura, facturaCFDI.FordASN, facturaCFDI.FordGSDB);
|
||||
// }
|
||||
// }
|
||||
|
||||
//}
|
||||
// if (ObjCFDITimbre.Comprobante.TipoComprobante == "N")
|
||||
// {
|
||||
// using (ClsNominas ObjNomina2 = new ClsNominas())
|
||||
// {
|
||||
// if (ObjNomina2.UpdateEstatusNomNominas(3, CvePACEspecial, FolioFiscal, "", ("01/01/2000").ToDate, ObjCFDITimbre.Nomina.CveNomina, 0, 0, 0, 0, 0))
|
||||
// Retorno = "";
|
||||
// else
|
||||
// Retorno = "Error";
|
||||
// }
|
||||
// }
|
||||
|
||||
// if (ObjCFDITimbre.Comprobante.TipoComprobante == "T")
|
||||
// {
|
||||
// using (ClsInventarios ObjInv = new ClsInventarios())
|
||||
// {
|
||||
// if (ObjInv.UpdateMovimientoTimbrado(facturaCFDI.Inv_CveMovimiento, 1, FolioFiscal, MinFecha))
|
||||
// Retorno = "";
|
||||
// else
|
||||
// Retorno = "Error";
|
||||
// }
|
||||
// }
|
||||
|
||||
//if (!System.IO.Directory.Exists($@"{UsuarioActual.Empresa.Ruta}CBB\")) { System.IO.Directory.CreateDirectory($@"{UsuarioActual.Empresa.Ruta}CBB\"); }
|
||||
|
||||
//try
|
||||
//{
|
||||
// string RutaCBB = $@"{UsuarioActual.Empresa.Ruta}CBB\{ObjCFDITimbre.Comprobante.SerieFolio}.jpg";
|
||||
// byte[] b = cfdi.QrCode($"?re={UsuarioActual.Empresa.RFC}&rr={ObjCFDITimbre.Receptor.RFC}&tt={string.Format("{0,12:F6}", ObjCFDITimbre.Comprobante.Total).Trim()}&id={FolioFiscal}");
|
||||
// File.WriteAllBytes(RutaCBB, b);
|
||||
//}
|
||||
//catch (Exception ex)
|
||||
//{
|
||||
// OnError("Ocurrió un error al generar el QR", ex);
|
||||
//}
|
||||
//Retorno = "";
|
||||
}
|
||||
else
|
||||
{
|
||||
comentadobymeborrarparaencontrar = "";
|
||||
//Retorno = "No se pudo timbrar ante el SAT. UUID no generado.";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
comentadobymeborrarparaencontrar = "";
|
||||
//Retorno = cfdi.MensajeError;
|
||||
//MensajeErrorCFDI = cfdi.MensajeError;
|
||||
if (cfdi.Xml != "") { cfdi.EscribirXML(cfdi.Xml, RutaArchivo, NombreArchivoXML); }
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
result._isOK = (result._errorLog.Count==0);
|
||||
return result;
|
||||
}
|
||||
public static TimbradoResult TimbrarFacturaPADEv33(Factura facturaCFDI, TimbradoEmpresa empresa)
|
||||
{
|
||||
TimbradoResult Retorno = new TimbradoResult();
|
||||
|
||||
return Retorno;
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//obtenerAtributo
|
||||
//TimbrarFacturaProFact
|
||||
//GeneraAddenda7Eleven
|
||||
//GeneraAddendaFord
|
||||
//GeneraAddendaFord
|
||||
//DecodeBase64
|
||||
//CodificarABase64
|
||||
//
|
||||
//
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
4163
ADSUtilService-borrar/ADSTimbradoLibrary/TimbradoDll.cs
Normal file
4163
ADSUtilService-borrar/ADSTimbradoLibrary/TimbradoDll.cs
Normal file
File diff suppressed because it is too large
Load Diff
134
ADSUtilService-borrar/ADSTimbradoLibrary/TimbradoEmpresa.cs
Normal file
134
ADSUtilService-borrar/ADSTimbradoLibrary/TimbradoEmpresa.cs
Normal file
@@ -0,0 +1,134 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using ADSTimbrado.Modelos.SAT;
|
||||
namespace ADSTimbrado
|
||||
{
|
||||
public abstract class TimbradoEmpresa
|
||||
{
|
||||
private TimbradoEmpresa() { }
|
||||
|
||||
/// <summary>
|
||||
/// </summary>
|
||||
/// <param name="ArchivoLLaveGET"> $@"{UsuarioActual.Empresa.Ruta}Certificados\{UsuarioActual.Empresa.ArchivoKey}";
|
||||
/// ArchivoLLave = $@"{UsuarioActual.Empresa.Ruta}Certificados\CSD01_AAA010101AAA.key";
|
||||
/// </param>
|
||||
/// <param name="ArchivoCertificado">$@"{UsuarioActual.Empresa.Ruta}Certificados\{UsuarioActual.Empresa.ArchivoCer}";
|
||||
/// ArchivoLLave = $@"{UsuarioActual.Empresa.Ruta}Certificados\CSD01_AAA010101AAA.cer";</param>
|
||||
/// <param name="ArchivoPFX">$@"{UsuarioActual.Empresa.Ruta}Certificados\{UsuarioActual.Empresa.ArchivoPfx}";</param>
|
||||
/// <param name="ArchivoCertificadoClave">UsuarioActual.Empresa.ContraseñaKey;</param>
|
||||
/// <param name="EmisorRFC">UsuarioActual.Empresa.RFC;</param>
|
||||
/// <param name="UrlServicioBIInform33">"http://portalbiinform.com.mx/srvCFDi33/service1.asmx"; </param>
|
||||
/// <param name="RutaArchivoXML">$@"{UsuarioActual.Empresa.Ruta}XML\{Ventas.TipoDocto}\";</param>
|
||||
/// <param name="NombreArchivoXML">$"{ObjCFDITimbre.Comprobante.SerieFolio}";</param>
|
||||
/// <param name="UsuarioServicio">UsuarioActual.Empresa.BIUsuario;</param>
|
||||
/// <param name="ClaveServicio">UsuarioActual.Empresa.BIContraseña;</param>
|
||||
/// <param name="FacturaProduccion"> UsuarioActual.Empresa.FacturaProduccion || UsuarioActual.CveEmpresa == 1</param>
|
||||
public TimbradoEmpresa(string ArchivoLLaveGET, string ArchivoCertificado, string ArchivoPFX, string ArchivoCertificadoClave, string EmisorRFC, string UrlServicioBIInform33,
|
||||
string RutaArchivoXML, string NombreArchivoXML, string UsuarioServicio, string ClaveServicio, bool FacturaProduccion)
|
||||
{
|
||||
}
|
||||
/// <summary>
|
||||
/// Return $@"{UsuarioActual.Empresa.Ruta}Certificados\{UsuarioActual.Empresa.ArchivoKey}";
|
||||
/// Return ArchivoLLave = $@"{UsuarioActual.Empresa.Ruta}Certificados\CSD01_AAA010101AAA.key";
|
||||
/// </summary>
|
||||
public string ArchivoLLaveGET { get; set; }
|
||||
/// <summary>
|
||||
/// Return $@"{UsuarioActual.Empresa.Ruta}Certificados\{UsuarioActual.Empresa.ArchivoCer}";
|
||||
/// Return ArchivoLLave = $@"{UsuarioActual.Empresa.Ruta}Certificados\CSD01_AAA010101AAA.cer";
|
||||
/// </summary>
|
||||
public string ArchivoCertificado { get; set; }
|
||||
/// <summary>
|
||||
/// Return $@"{UsuarioActual.Empresa.Ruta}Certificados\{UsuarioActual.Empresa.ArchivoPfx}";
|
||||
/// </summary>
|
||||
public string ArchivoPFX { get; set; }
|
||||
/// <summary>
|
||||
/// Return UsuarioActual.Empresa.ContraseñaKey;
|
||||
/// </summary>
|
||||
public string ArchivoCertificadoClave { get; set; }
|
||||
/// <summary>
|
||||
/// Return UsuarioActual.Empresa.RFC;;
|
||||
/// </summary>
|
||||
public string EmisorRFC { get; set; }
|
||||
/// <summary>
|
||||
/// Return "http://portalbiinform.com.mx/srvCFDi33/service1.asmx";
|
||||
/// </summary>
|
||||
public string UrlServicioBIInform33 { get; set; }
|
||||
/// <summary>
|
||||
/// Return "";
|
||||
/// </summary>
|
||||
public string UrlServicioGoCFDIv { get; set; }
|
||||
/// <summary>
|
||||
/// Return $@"{UsuarioActual.Empresa.Ruta}XML\{Ventas.TipoDocto}\";
|
||||
/// </summary>
|
||||
public string RutaArchivoXML { get; set; }
|
||||
/// <summary>
|
||||
/// Return $"{ObjCFDITimbre.Comprobante.SerieFolio}";
|
||||
/// </summary>
|
||||
public string NombreArchivoXML { get; set; }
|
||||
/// <summary>
|
||||
/// Return UsuarioActual.Empresa.BIUsuario;
|
||||
/// </summary>
|
||||
public string UsuarioServicio { get; set; }
|
||||
/// <summary>
|
||||
/// Return UsuarioActual.Empresa.BIContraseña;
|
||||
/// </summary>
|
||||
public string ClaveServicio { get; set; }
|
||||
/// <summary>
|
||||
/// Return UsuarioActual.Empresa.FacturaProduccion || UsuarioActual.CveEmpresa == 1
|
||||
/// </summary>
|
||||
public bool FacturaProduccion { get; set; }
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Return UsuarioActual.Empresa.Empresa;
|
||||
/// </summary>
|
||||
public string Empresanombre { get; set; }
|
||||
/// <summary>
|
||||
/// Return UsuarioActual.Empresa.CodigoRegimenFiscal
|
||||
/// </summary>
|
||||
public string CodigoRegimenFiscal { get; set; }
|
||||
/// <summary>
|
||||
/// Return $@"{UsuarioActual.Empresa.Ruta}CBB\{ObjCFDITimbre.Comprobante.SerieFolio}.jpg";
|
||||
/// </summary>
|
||||
public string RutaCBB { get; set; }
|
||||
/// <summary>
|
||||
/// Return UsuarioActual.Empresa.Ruta+ @"Certificados\"
|
||||
/// </summary>
|
||||
public string EmpresaRutaCertificados { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Return CveEmpresa
|
||||
/// </summary>
|
||||
public int CveEmpresa { get; set; }
|
||||
|
||||
//public PacTimbrado cvePacEspecial { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// ClsVentas ObjVentas = new ClsVentas();
|
||||
/// if (!ObjVentas.UpdateEstatusFactura(3, FolioFiscal, "", ObjCFDITimbre.Comprobante.Fecha,facturaCFDI.CveVenta, CvePAC: 1))
|
||||
/// Retorno = "No se pudo registrar el folio fiscal";
|
||||
/// ObjVentas.Dispose();
|
||||
/// CBB.GenerarCBB(empresa.EmisorRFC, ObjCFDITimbre.Receptor.RFC, facturaCFDI.TotalTC, FolioFiscal, empresa.RutaCBB);
|
||||
/// if (facturaCFDI.Cliente.Ford_GSDB != "")
|
||||
//{
|
||||
/// string RutaCadena = string.Format("{0}{1}.xml", RutaArchivo, NombreArchivoXML); // If(UsuarioActual.Empresa.FacturaProduccion, String.Format("{0}XML\{1}\{2}.xml", Ruta, Ventas.SerieFolio), String.Format("{0}XML\{1}\{2}.xml", Ruta, Ventas.TipoDocto, Ventas.SerieFolio))
|
||||
/// string FolioFactura = "";
|
||||
/// if (UsuarioActual.CveEmpresa == 8)
|
||||
/// FolioFactura = facturaCFDI.Folio.ToString(); // sogo, pordefault manda el folio de la factura
|
||||
/// GeneraAddendaFord(RutaCadena, FolioFactura, facturaCFDI.FordASN, facturaCFDI.FordGSDB);
|
||||
///}
|
||||
/// </summary>
|
||||
public abstract string UpdateEstatusFactura(string FolioFiscal,CFDITimbre ObjCFDITimbre, Factura facturaCFDI, int CvePAC);
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Return ;
|
||||
/// </summary>
|
||||
///
|
||||
public abstract string Timbre();
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user