update many things i dont remember whats things but reading all files i concluse this comit have many changes
This commit is contained in:
@@ -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));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user