{"action":"created","issue":{"url":"https://api.github.com/repos/unRob/CFDI/issues/3","labels_url":"https://api.github.com/repos/unRob/CFDI/issues/3/labels{/name}","comments_url":"https://api.github.com/repos/unRob/CFDI/issues/3/comments","events_url":"https://api.github.com/repos/unRob/CFDI/issues/3/events","html_url":"https://github.com/unRob/CFDI/issues/3","id":38983590,"number":3,"title":"La propiedad subTotal es incorrecta cuando se lee XML donde el subTotal difiere de los conceptos","user":{"login":"lcarrasco","id":127025,"avatar_url":"https://avatars.githubusercontent.com/u/127025?v=3","gravatar_id":"","url":"https://api.github.com/users/lcarrasco","html_url":"https://github.com/lcarrasco","followers_url":"https://api.github.com/users/lcarrasco/followers","following_url":"https://api.github.com/users/lcarrasco/following{/other_user}","gists_url":"https://api.github.com/users/lcarrasco/gists{/gist_id}","starred_url":"https://api.github.com/users/lcarrasco/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lcarrasco/subscriptions","organizations_url":"https://api.github.com/users/lcarrasco/orgs","repos_url":"https://api.github.com/users/lcarrasco/repos","events_url":"https://api.github.com/users/lcarrasco/events{/privacy}","received_events_url":"https://api.github.com/users/lcarrasco/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2014-07-29T12:29:40Z","updated_at":"2015-07-01T00:06:18Z","closed_at":null,"body":"Al leer un XML, en mi caso de la CFE, este tiene un valor de subtotal y total que difiere de la suma de los importes calculados de los conceptos, me imagino por los subsidios que aplican, etc. creo que la manera correcta, al menos al leer el CFDI de un XML, es que siempre se respete la lectura de los valores  de `subTotal` y `Total`.\r\n\r\nAqui el XML de prueba (modificado por privacidad):\r\n\r\n```\r\n<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\r\n<cfdi:Comprobante xmlns:cfdi=\"http://www.sat.gob.mx/cfd/3\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" LugarExpedicion=\"Av. Guerrero y 16,No 800,,Colonia Centro,Madera,Madera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cYjy0+Jxr0mK7sAAwv/fuCQ+kmSDJvldzqatcN4PqoOtBP3EAx7G4lJ6mVM/6R9m5iQnKfN7038n6nxoyXirPyB1zLpwlJheXm5YANMKlph5eVruGC9VOy3wk+zJxVR67aNwIDAQABox0wGzAMBgNVHRMBAf8EAjAAMAsGA1UdDwQEAwIGwDANBgkqhkiG9w0BAQUFAAOCAQEAolMX2pwOgrR2wzWm1QyfoArhntE0PoFxMVz+gL2Hv55jOv927HvCEkzH3rp2iGTN8GtOLEhP14xrdeS0EXS9S0pi4M8C3khEpkrSDAN7gZhpz61UJNtkkasDZpt5OuAuzNwcFv5PShRI3obZaC+JL0T6HeUS2vqtJkI+OazcZhXjSetwzxbb29+bfeYYeZZnc23mJjhM2JVcMALzOTejPZu1ffuqvvOm2UuDtklFW/Gnp1DjzJ7mYyHBibAIloe8YgjVJcb+cLM5zja/qsJ8hu5YBEpkW8hrvNJOuKdpy6UBmZpFHdhPF2K8rBvF4ZJuI1+sJDGLQHlbAeJvxCgrHw==\" fecha=\"2014-02-19T15:17:52\" folio=\"000001234567\" formaDePago=\"Pago en una solo exhibicion\" metodoDePago=\"No Identificado\" noCertificado=\"00001000000300470059\" sello=\"XXX\" serie=\"CB\" subTotal=\"86.45\" tipoDeComprobante=\"ingreso\" total=\"87\" version=\"3.2\" xsi:schemaLocation=\"http://www.sat.gob.mx/cfd/3 http://www.sat.gob.mx/sitio_internet/cfd/3/cfdv32.xsd\">\r\n  <cfdi:Emisor nombre=\"Comision Federal de Electricidad\" rfc=\"CFE370814QI0\">\r\n           <cfdi:DomicilioFiscal calle=\"Av. Paseo de la Reforma\" codigoPostal=\"06600\" colonia=\"Juarez\" estado=\"D.F.\" municipio=\"Mexico D.F.\" noExterior=\"164\" pais=\"Mexico\"/>\r\n           <cfdi:RegimenFiscal Regimen=\"TITULO III DEL REGIMEN DE LAS PERSONAS MORALES CON FINES NO LUCRATIVOS\"/>\r\n     </cfdi:Emisor>\r\n  <cfdi:Receptor nombre=\"PEPE PECAS\" rfc=\"AAA010101AAA\">\r\n           <cfdi:Domicilio calle=\"DIRECCR\" estado=\"NOMESTR\" municipio=\"NOMPOBR\" pais=\"Mexico\"/>\r\n     </cfdi:Receptor>\r\n  <cfdi:Conceptos>\r\n           <cfdi:Concepto cantidad=\"163\" descripcion=\"ENERGIA\" importe=\"86.45\" unidad=\"NoAplica\" valorUnitario=\"86.45\"/>\r\n     </cfdi:Conceptos>\r\n  <cfdi:Impuestos>\r\n\t      <cfdi:Traslados>\r\n                   <cfdi:Traslado importe=\"0\" impuesto=\"IVA\" tasa=\"16\"/>\r\n               </cfdi:Traslados>\r\n\t</cfdi:Impuestos>\r\n  <cfdi:Complemento>\r\n        <tfd:TimbreFiscalDigital FechaTimbrado=\"2014-02-19T16:19:15\" UUID=\"AAAA\" noCertificadoSAT=\"00001000000300494998\" selloCFD=\"XXX\" selloSAT=\"QQQ\" version=\"1.0\" xsi:schemaLocation=\"http://www.sat.gob.mx/TimbreFiscalDigital http://www.sat.gob.mx/TimbreFiscalDigital/TimbreFiscalDigital.xsd\" xmlns:tfd=\"http://www.sat.gob.mx/TimbreFiscalDigital\"/>\r\n  </cfdi:Complemento>\r\n</cfdi:Comprobante>\r\n```"},"comment":{"url":"https://api.github.com/repos/unRob/CFDI/issues/comments/117375841","html_url":"https://github.com/unRob/CFDI/issues/3#issuecomment-117375841","issue_url":"https://api.github.com/repos/unRob/CFDI/issues/3","id":117375841,"user":{"login":"unRob","id":123365,"avatar_url":"https://avatars.githubusercontent.com/u/123365?v=3","gravatar_id":"","url":"https://api.github.com/users/unRob","html_url":"https://github.com/unRob","followers_url":"https://api.github.com/users/unRob/followers","following_url":"https://api.github.com/users/unRob/following{/other_user}","gists_url":"https://api.github.com/users/unRob/gists{/gist_id}","starred_url":"https://api.github.com/users/unRob/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/unRob/subscriptions","organizations_url":"https://api.github.com/users/unRob/orgs","repos_url":"https://api.github.com/users/unRob/repos","events_url":"https://api.github.com/users/unRob/events{/privacy}","received_events_url":"https://api.github.com/users/unRob/received_events","type":"User","site_admin":false},"created_at":"2015-07-01T00:06:18Z","updated_at":"2015-07-01T00:06:18Z","body":"@andresamayadiaz Suena muy interesante, pero no creo que esté dentro del scope de este gem. Por una parte, para eso hay [herramientas](http://www.rubydoc.info/github/sparklemotion/nokogiri/Nokogiri/XML/Schema) hechas y probadas, por otro lado, siempre se puede hacer un gem por separado con la funcionalidad que mencionas. "}}