Beispiel #1
0
        public FacturaEmitida Decodificar(String pathXml)
        {
            Comprobante comprobante;

            var xml = _operacionesStreams.ArchivoByteArray(pathXml);

            try
            {
                comprobante = _decodificar.DecodificarComprobante(pathXml);
            }
            catch (Exception ex)
            {
                throw ex;
            }

            try
            {
                _validar.ChecarUuidRepetido(comprobante);
            }
            catch (Exception ex)
            {
                File.Delete(pathXml);
                throw ex;
            }

            try
            {
                _validar.ChecarRfcReceptor(comprobante);
            }
            catch (Exception ex)
            {
                throw ex;
            }

            try
            {
                //_cfdiInfodextra.Validar(xml, comprobante.Emisor.Rfc);
            }
            catch (Exception ex)
            {
                throw ex;
            }

            FacturaEmitida factura;

            try
            {
                factura = _guardar.GuardarFacturaEmitida(comprobante, xml);
            }
            catch (Exception ex)
            {
                throw ex;
            }

            File.Delete(pathXml);

            return(factura);
        }