@@ -63,11 +63,11 @@ discard block |
||
| 63 | 63 | // validar firma del SII sobre los folios |
| 64 | 64 | $firma = $this->getFirma(); |
| 65 | 65 | $idk = $this->getIDK(); |
| 66 | - if ($firma === false || $idk === false) { |
|
| 66 | + if ($firma===false || $idk===false) { |
|
| 67 | 67 | return false; |
| 68 | 68 | } |
| 69 | 69 | $pub_key = \sasco\LibreDTE\Sii::cert($idk); |
| 70 | - if ($pub_key === false || openssl_verify($this->xml->getFlattened('/AUTORIZACION/CAF/DA'), base64_decode($firma), $pub_key)!==1) { |
|
| 70 | + if ($pub_key===false || openssl_verify($this->xml->getFlattened('/AUTORIZACION/CAF/DA'), base64_decode($firma), $pub_key)!==1) { |
|
| 71 | 71 | \sasco\LibreDTE\Log::write( |
| 72 | 72 | \sasco\LibreDTE\Estado::FOLIOS_ERROR_FIRMA, |
| 73 | 73 | \sasco\LibreDTE\Estado::get(\sasco\LibreDTE\Estado::FOLIOS_ERROR_FIRMA) |
@@ -98,7 +98,7 @@ discard block |
||
| 98 | 98 | ); |
| 99 | 99 | return false; |
| 100 | 100 | } |
| 101 | - return $plain === $plain_firmado; |
|
| 101 | + return $plain===$plain_firmado; |
|
| 102 | 102 | } |
| 103 | 103 | |
| 104 | 104 | /** |
@@ -261,7 +261,7 @@ discard block |
||
| 261 | 261 | public function getCertificacion() |
| 262 | 262 | { |
| 263 | 263 | $idk = $this->getIDK(); |
| 264 | - return $idk ? $idk === 100 : null; |
|
| 264 | + return $idk ? $idk===100 : null; |
|
| 265 | 265 | } |
| 266 | 266 | |
| 267 | 267 | /** |
@@ -277,14 +277,14 @@ discard block |
||
| 277 | 277 | } |
| 278 | 278 | $fecha_autorizacion = $this->getFechaAutorizacion(); |
| 279 | 279 | $hoy = date('Y-m-d'); |
| 280 | - if ($fecha_autorizacion < '2018-07-01' and $hoy > '2018-12-31') { |
|
| 280 | + if ($fecha_autorizacion<'2018-07-01' and $hoy>'2018-12-31') { |
|
| 281 | 281 | return false; |
| 282 | 282 | } |
| 283 | - $vigencia = $fecha_autorizacion >= '2018-07-01' ? 6 : 18; |
|
| 283 | + $vigencia = $fecha_autorizacion>='2018-07-01' ? 6 : 18; |
|
| 284 | 284 | $d1 = new \DateTime($fecha_autorizacion); |
| 285 | 285 | $d2 = new \DateTime($hoy); |
| 286 | - $meses = $d1->diff($d2)->m + ($d1->diff($d2)->y*12); |
|
| 287 | - return $meses <= $vigencia; |
|
| 286 | + $meses = $d1->diff($d2)->m+($d1->diff($d2)->y * 12); |
|
| 287 | + return $meses<=$vigencia; |
|
| 288 | 288 | } |
| 289 | 289 | |
| 290 | 290 | /** |