@@ 477-483 (lines=7) @@ | ||
474 | } |
|
475 | $TED->getElementsByTagName('FRMT')->item(0)->nodeValue = base64_encode($timbre); |
|
476 | $xml = str_replace('<TED/>', trim(str_replace('<?xml version="1.0" encoding="ISO-8859-1"?>', '', $TED->saveXML())), $this->saveXML()); |
|
477 | if (!$this->loadXML($xml)) { |
|
478 | \sasco\LibreDTE\Log::write( |
|
479 | \sasco\LibreDTE\Estado::DTE_ERROR_TIMBRE, |
|
480 | \sasco\LibreDTE\Estado::get(\sasco\LibreDTE\Estado::DTE_ERROR_TIMBRE, $this->getID()) |
|
481 | ); |
|
482 | return false; |
|
483 | } |
|
484 | return true; |
|
485 | } |
|
486 | ||
@@ 499-505 (lines=7) @@ | ||
496 | $parent = $this->xml->getElementsByTagName($this->tipo_general)->item(0); |
|
497 | $this->xml->generate(['TmstFirma'=>$this->timestamp], null, $parent); |
|
498 | $xml = $Firma->signXML($this->xml->saveXML(), '#'.$this->id, $this->tipo_general); |
|
499 | if (!$xml) { |
|
500 | \sasco\LibreDTE\Log::write( |
|
501 | \sasco\LibreDTE\Estado::DTE_ERROR_FIRMA, |
|
502 | \sasco\LibreDTE\Estado::get(\sasco\LibreDTE\Estado::DTE_ERROR_FIRMA, $this->getID()) |
|
503 | ); |
|
504 | return false; |
|
505 | } |
|
506 | $this->loadXML($xml); |
|
507 | return true; |
|
508 | } |