Code Duplication    Length = 7-8 lines in 2 locations

lib/Sii/Dte.php 2 locations

@@ 423-430 (lines=8) @@
420
            return false;
421
        }
422
        // verificar que existan datos para el timbre
423
        if (!$this->xml->xpath('/DTE/'.$this->tipo_general.'/Encabezado/IdDoc/FchEmis')->item(0)) {
424
            \sasco\LibreDTE\Log::write(
425
                \sasco\LibreDTE\Estado::DTE_FALTA_FCHEMIS,
426
                \sasco\LibreDTE\Estado::get(\sasco\LibreDTE\Estado::DTE_FALTA_FCHEMIS, $this->getID())
427
            );
428
            \sasco\LibreDTE\Log::write('Falta FchEmis del DTE '.$this->getID());
429
            return false;
430
        }
431
        if (!$this->xml->xpath('/DTE/'.$this->tipo_general.'/Encabezado/Totales/MntTotal')->item(0)) {
432
            \sasco\LibreDTE\Log::write(
433
                \sasco\LibreDTE\Estado::DTE_FALTA_MNTTOTAL,
@@ 431-437 (lines=7) @@
428
            \sasco\LibreDTE\Log::write('Falta FchEmis del DTE '.$this->getID());
429
            return false;
430
        }
431
        if (!$this->xml->xpath('/DTE/'.$this->tipo_general.'/Encabezado/Totales/MntTotal')->item(0)) {
432
            \sasco\LibreDTE\Log::write(
433
                \sasco\LibreDTE\Estado::DTE_FALTA_MNTTOTAL,
434
                \sasco\LibreDTE\Estado::get(\sasco\LibreDTE\Estado::DTE_FALTA_MNTTOTAL, $this->getID())
435
            );
436
            return false;
437
        }
438
        // timbrar
439
        $RR = $this->xml->xpath('/DTE/'.$this->tipo_general.'/Encabezado/Receptor/RUTRecep')->item(0)->nodeValue;
440
        $RSR_nodo = $this->xml->xpath('/DTE/'.$this->tipo_general.'/Encabezado/Receptor/RznSocRecep');