@@ -122,7 +122,7 @@ discard block |
||
122 | 122 | ; |
123 | 123 | $company = $rutExists |
124 | 124 | ? $this->requestData['RutCompania'] |
125 | - . '-' . $this->requestData['DvCompania'] |
|
125 | + . '-'.$this->requestData['DvCompania'] |
|
126 | 126 | : null |
127 | 127 | ; |
128 | 128 | |
@@ -132,7 +132,7 @@ discard block |
||
132 | 132 | ; |
133 | 133 | $recipient = $rutExists |
134 | 134 | ? $this->requestData['RutReceptor'] |
135 | - . '-' . $this->requestData['DvReceptor'] |
|
135 | + . '-'.$this->requestData['DvReceptor'] |
|
136 | 136 | : null |
137 | 137 | ; |
138 | 138 |
@@ -150,7 +150,7 @@ |
||
150 | 150 | $number = $matches[1]; |
151 | 151 | |
152 | 152 | // Formato ISO: YYYY/MM/DDTHH:MM:SS |
153 | - $datetime = $matches[2] . 'T' . $matches[3]; |
|
153 | + $datetime = $matches[2].'T'.$matches[3]; |
|
154 | 154 | |
155 | 155 | // Convertir la fecha al formato ISO con guiones en vez de barras |
156 | 156 | $datetimeISO = str_replace('/', '-', $datetime); |
@@ -118,7 +118,7 @@ discard block |
||
118 | 118 | |
119 | 119 | // RUT de la empresa que realizó la consulta del envío. |
120 | 120 | $company = isset($this->requestData['Rut']) && isset($this->requestData['Dv']) |
121 | - ? $this->requestData['Rut'] . '-' . $this->requestData['Dv'] |
|
121 | + ? $this->requestData['Rut'].'-'.$this->requestData['Dv'] |
|
122 | 122 | : null |
123 | 123 | ; |
124 | 124 | |
@@ -168,7 +168,7 @@ discard block |
||
168 | 168 | } |
169 | 169 | |
170 | 170 | return $data['description'] |
171 | - ? ($data['status'] . ' - ' . $data['description']) |
|
171 | + ? ($data['status'].' - '.$data['description']) |
|
172 | 172 | : $data['status'] |
173 | 173 | ; |
174 | 174 | } |
@@ -113,7 +113,7 @@ discard block |
||
113 | 113 | // Crear el archivo que se enviará en el sistema de archivos para poder |
114 | 114 | // adjuntarlo en la solicitud mediante curl al SII. |
115 | 115 | [$filepath, $mimetype] = $this->createXmlFile($xml, $compress); |
116 | - $filename = $company . '_' . basename($filepath); |
|
116 | + $filename = $company.'_'.basename($filepath); |
|
117 | 117 | |
118 | 118 | // Preparar los datos que se enviarán mediante POST al SII. |
119 | 119 | $data = [ |
@@ -217,7 +217,7 @@ discard block |
||
217 | 217 | // Ver si vienen detalles del error. |
218 | 218 | $error = $response['DETAIL']['ERROR'] ?? null; |
219 | 219 | if ($error !== null) { |
220 | - $message .= ' ' . implode(' ', $error); |
|
220 | + $message .= ' '.implode(' ', $error); |
|
221 | 221 | } |
222 | 222 | |
223 | 223 | // Lanzar una excepción con el mensaje de error determinado. |
@@ -251,7 +251,7 @@ discard block |
||
251 | 251 | $headers = [ |
252 | 252 | 'User-Agent: Mozilla/4.0 (compatible; PROG 1.0; LibreDTE)', |
253 | 253 | 'Referer: https://www.libredte.cl', |
254 | - 'Cookie: TOKEN=' . $token, |
|
254 | + 'Cookie: TOKEN='.$token, |
|
255 | 255 | ]; |
256 | 256 | |
257 | 257 | // Inicializar curl. |
@@ -322,7 +322,7 @@ discard block |
||
322 | 322 | // asume (y no valida) que el contenido del XML en $xml viene ya |
323 | 323 | // codificado en ISO-8859-1. |
324 | 324 | if (!str_contains($xml, '<?xml')) { |
325 | - $xml = '<?xml version="1.0" encoding="ISO-8859-1"?>' . "\n" . $xml; |
|
325 | + $xml = '<?xml version="1.0" encoding="ISO-8859-1"?>'."\n".$xml; |
|
326 | 326 | } |
327 | 327 | |
328 | 328 | // Comprimir el XML si es necesario. En caso de error al comprimir se |
@@ -365,7 +365,7 @@ discard block |
||
365 | 365 | $filepath = tempnam($tempDir, $prefix); |
366 | 366 | |
367 | 367 | // Renombrar la ruta asignando la extensión al archivo. |
368 | - $realFilepath = $filepath . ($compress ? '.xml.gz' : '.xml'); |
|
368 | + $realFilepath = $filepath.($compress ? '.xml.gz' : '.xml'); |
|
369 | 369 | rename($filepath, $realFilepath); |
370 | 370 | |
371 | 371 | // Entregar la ruta que se determinó para el archivo. |
@@ -336,7 +336,7 @@ discard block |
||
336 | 336 | } |
337 | 337 | |
338 | 338 | // Los folios vencen en 6 meses (6 * 30 días). |
339 | - return date('Y-m-d', strtotime($fecha_autorizacion. ' + 180 days')); |
|
339 | + return date('Y-m-d', strtotime($fecha_autorizacion.' + 180 days')); |
|
340 | 340 | } |
341 | 341 | |
342 | 342 | /** |
@@ -380,7 +380,7 @@ discard block |
||
380 | 380 | $timestamp .= 'T00:00:00'; |
381 | 381 | } |
382 | 382 | |
383 | - return $timestamp < ($this->getFechaVencimiento() . 'T00:00:00'); |
|
383 | + return $timestamp < ($this->getFechaVencimiento().'T00:00:00'); |
|
384 | 384 | } |
385 | 385 | |
386 | 386 | /** |
@@ -571,7 +571,7 @@ discard block |
||
571 | 571 | return null; |
572 | 572 | } |
573 | 573 | |
574 | - $filename = $idk . '.cer'; |
|
574 | + $filename = $idk.'.cer'; |
|
575 | 575 | $filepath = PathManager::getCertificatesPath($filename); |
576 | 576 | |
577 | 577 | if ($filepath === null) { |
@@ -303,7 +303,7 @@ discard block |
||
303 | 303 | * |
304 | 304 | * @return int|float Monto total del documento. |
305 | 305 | */ |
306 | - public function getMontoTotal(): int|float |
|
306 | + public function getMontoTotal(): int | float |
|
307 | 307 | { |
308 | 308 | $data = $this->getData(); |
309 | 309 | $monto = $data['Encabezado']['Totales']['MntTotal']; |
@@ -494,7 +494,7 @@ discard block |
||
494 | 494 | public function getXmlSignatureNode(): XmlSignatureNode |
495 | 495 | { |
496 | 496 | $tag = $this->getXmlDocument()->documentElement->tagName; |
497 | - $xpath = '/*[local-name()="' . $tag . '"]/*[local-name()="Signature"]'; |
|
497 | + $xpath = '/*[local-name()="'.$tag.'"]/*[local-name()="Signature"]'; |
|
498 | 498 | $signatureElement = XmlUtils::xpath($this->getXmlDocument(), $xpath)->item(0); |
499 | 499 | if ($signatureElement === null) { |
500 | 500 | throw new SignatureException('El documento XML del DTE no se encuentra firmado (no se encontró el nodo "Signature").'); |
@@ -44,10 +44,10 @@ discard block |
||
44 | 44 | * @return int|float Valor redondeado según la moneda y decimales a usar. |
45 | 45 | */ |
46 | 46 | protected function round( |
47 | - int|float $amount, |
|
48 | - string|null|false $currency = null, |
|
47 | + int | float $amount, |
|
48 | + string | null | false $currency = null, |
|
49 | 49 | int $decimals = 4 |
50 | - ): int|float { |
|
50 | + ): int | float { |
|
51 | 51 | return (!$currency || $currency === 'PESO CL') |
52 | 52 | ? (int) round($amount) |
53 | 53 | : (float) round($amount, $decimals) |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | * @param int|false|null $tasa Tasa del IVA. |
71 | 71 | * @return array Arreglo con el neto y el IVA en índices 0 y 1. |
72 | 72 | */ |
73 | - protected function calcularNetoIVA($total, int|false|null $tasa = null): array |
|
73 | + protected function calcularNetoIVA($total, int | false | null $tasa = null): array |
|
74 | 74 | { |
75 | 75 | // Si no existe tasa es porque no hay Neto e IVA (doc exento). |
76 | 76 | if ($tasa === 0 || $tasa === false) { |
@@ -124,7 +124,7 @@ |
||
124 | 124 | } |
125 | 125 | if (empty($d['MontoItem'])) { |
126 | 126 | $d['MontoItem'] = $this->round( |
127 | - (float) $d['QtyItem'] * (float)$d['PrcItem'], |
|
127 | + (float) $d['QtyItem'] * (float) $d['PrcItem'], |
|
128 | 128 | $data['Encabezado']['Totales']['TpoMoneda'] |
129 | 129 | ); |
130 | 130 |
@@ -76,9 +76,9 @@ |
||
76 | 76 | |
77 | 77 | // Limpiar datos del emisor. |
78 | 78 | if (!empty($data['Encabezado']['Emisor']['Acteco'])) { |
79 | - if (strlen((string)$data['Encabezado']['Emisor']['Acteco']) === 5) { |
|
79 | + if (strlen((string) $data['Encabezado']['Emisor']['Acteco']) === 5) { |
|
80 | 80 | $data['Encabezado']['Emisor']['Acteco'] = |
81 | - '0' . $data['Encabezado']['Emisor']['Acteco'] |
|
81 | + '0'.$data['Encabezado']['Emisor']['Acteco'] |
|
82 | 82 | ; |
83 | 83 | } |
84 | 84 | } |