Passed
Push — master ( f39060...11ca94 )
by Joe Nilson
02:13
created
controller/documentos_residentes.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
         $this->envio_masivo = !(($this->filter_request('envio_masivo') === 'false'));
60 60
         $this->tipo_accion = $tipo_documento;
61 61
         $this->verificarCantidadFacturas();
62
-        $this->archivo = $tipo_documento.'_'.\date('dmYhis') . '.pdf';
62
+        $this->archivo = $tipo_documento.'_'.\date('dmYhis').'.pdf';
63 63
         if ($this->cliente_residente && $info_accion) {
64 64
             switch ($info_accion) {
65 65
                 case 'imprimir':
@@ -125,7 +125,7 @@  discard block
 block discarded – undo
125 125
             unset($lista_facturas[0]);
126 126
             $this->contador_facturas = count($lista_facturas);
127 127
             $this->facturas = implode(',', $lista_facturas);
128
-        } else {
128
+        }else {
129 129
             $this->contador_facturas = 0;
130 130
             $this->facturas = '';
131 131
         }
@@ -229,8 +229,8 @@  discard block
 block discarded – undo
229 229
         $this->envio_masivo = false;
230 230
         $this->existe_tesoreria();
231 231
         $this->cliente_residente = false;
232
-        if (!file_exists('tmp/' . FS_TMP_NAME . 'enviar') &&
233
-            !mkdir($concurrentDirectory = 'tmp/' . FS_TMP_NAME . 'enviar') &&
232
+        if (!file_exists('tmp/'.FS_TMP_NAME.'enviar') &&
233
+            !mkdir($concurrentDirectory = 'tmp/'.FS_TMP_NAME.'enviar') &&
234 234
             !is_dir($concurrentDirectory)) {
235 235
             throw new \RuntimeException(sprintf('Directory "%s" was not created', $concurrentDirectory));
236 236
         }
Please login to merge, or discard this patch.
extras/residentesEnviarMail.php 1 patch
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -36,27 +36,27 @@  discard block
 block discarded – undo
36 36
             $email = $customer->email;
37 37
             $this->log->new_message('Enviando factura a: '.$email);
38 38
             $mail->addAddress($email, $customer->nombre);
39
-            $elSubject = ' - Su Factura ' . $invoice->codigo . ' ' . $invoice->numero2;
40
-            $mail->Subject = fs_fix_html($companyInformation->nombre) . $elSubject;
39
+            $elSubject = ' - Su Factura '.$invoice->codigo.' '.$invoice->numero2;
40
+            $mail->Subject = fs_fix_html($companyInformation->nombre).$elSubject;
41 41
             $mail->AltBody = plantilla_email(
42 42
                 'factura',
43
-                $invoice->codigo . ' ' . $invoice->numero2,
43
+                $invoice->codigo.' '.$invoice->numero2,
44 44
                 $companyInformation->email_config['mail_firma']
45 45
             );
46 46
             $this->emailAdditionalInfo($mail, $customer);
47 47
             $mail->msgHTML(nl2br($mail->AltBody));
48 48
             $mail->isHTML(true);
49
-            $mail->addAttachment('tmp/' . FS_TMP_NAME . 'enviar/' . $archivo);
49
+            $mail->addAttachment('tmp/'.FS_TMP_NAME.'enviar/'.$archivo);
50 50
             $this->emailAdditionalAttachments($mail);
51 51
             if ($companyInformation->mail_connect($mail) && $mail->send()) {
52
-                $invoice->femail = \date('d-m-Y');;
52
+                $invoice->femail = \date('d-m-Y'); ;
53 53
                 $invoice->save();
54 54
                 $companyInformation->save_mail($mail);
55
-            } else {
56
-                $this->log->new_error_msg("Error al enviar el email: " . $mail->ErrorInfo);
55
+            }else {
56
+                $this->log->new_error_msg("Error al enviar el email: ".$mail->ErrorInfo);
57 57
             }
58
-            unlink('tmp/' . FS_TMP_NAME . 'enviar/' . $archivo);
59
-        } else {
58
+            unlink('tmp/'.FS_TMP_NAME.'enviar/'.$archivo);
59
+        }else {
60 60
             $this->log->new_error_msg('Imposible generar el PDF.');
61 61
         }
62 62
     }
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
                     trim($this->rc->filter_request('email_copia')),
70 70
                     $customer->nombre
71 71
                 );
72
-            } else {
72
+            }else {
73 73
                 $mail->addCC(
74 74
                     trim($this->rc->filter_request('email_copia')),
75 75
                     $customer->nombre
@@ -94,19 +94,19 @@  discard block
 block discarded – undo
94 94
             : $customer->email;
95 95
         $this->log->new_message('Enviando Estado de cuenta a: '.$email);
96 96
         $mail->addAddress($email, $customer->nombre);
97
-        $elSubject = ': Su Estado de cuenta al '. \date('d-m-Y');
98
-        $mail->Subject = fs_fix_html($empresa->nombre) . $elSubject;
97
+        $elSubject = ': Su Estado de cuenta al '.\date('d-m-Y');
98
+        $mail->Subject = fs_fix_html($empresa->nombre).$elSubject;
99 99
         $mail->AltBody = strip_tags($_POST['mensaje']);
100 100
         $this->emailAdditionalAttachments($mail);
101 101
         $mail->msgHTML(nl2br($mail->AltBody));
102 102
         $mail->isHTML(true);
103
-        $mail->addAttachment('tmp/' . FS_TMP_NAME . 'enviar/' . $archivo);
103
+        $mail->addAttachment('tmp/'.FS_TMP_NAME.'enviar/'.$archivo);
104 104
         $this->emailAdditionalAttachments($mail);
105 105
         if ($empresa->mail_connect($mail) && $mail->send()) {
106 106
             $empresa->save_mail($mail);
107
-        } else {
108
-            $this->log->new_error_msg("Error al enviar el email: " . $mail->ErrorInfo);
107
+        }else {
108
+            $this->log->new_error_msg("Error al enviar el email: ".$mail->ErrorInfo);
109 109
         }
110
-        unlink('tmp/' . FS_TMP_NAME . 'enviar/' . $archivo);
110
+        unlink('tmp/'.FS_TMP_NAME.'enviar/'.$archivo);
111 111
     }
112 112
 }
113 113
\ No newline at end of file
Please login to merge, or discard this patch.
extras/residentesEstadoCuenta.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -41,9 +41,9 @@  discard block
 block discarded – undo
41 41
     public function crearEstadoCuenta($pendiente, $pagado)
42 42
     {
43 43
         $this->documento->cliente_residente = $this->cliente_residente;
44
-        $this->documento->pdf->addInfo('Title', 'Pagos Residente ' .
44
+        $this->documento->pdf->addInfo('Title', 'Pagos Residente '.
45 45
             $this->cliente_residente->codcliente);
46
-        $this->documento->pdf->addInfo('Subject', 'Pagos del Residente ' .
46
+        $this->documento->pdf->addInfo('Subject', 'Pagos del Residente '.
47 47
             $this->cliente_residente->codcliente);
48 48
         $this->documento->pdf->addInfo('Author', $this->empresa->nombre);
49 49
         $this->documento->pdf->ezSetMargins(10, 10, 10, 10);
@@ -93,7 +93,7 @@  discard block
 block discarded – undo
93 93
         }
94 94
         $this->documento->set_y(80);
95 95
         if ($this->empresa->pie_factura) {
96
-            $this->documento->pdf->addText(20, 40, 8, fs_fix_html('<b>Generado por:</b> ' .
96
+            $this->documento->pdf->addText(20, 40, 8, fs_fix_html('<b>Generado por:</b> '.
97 97
                 $this->user->get_agente_fullname()), 0);
98 98
             $this->documento->pdf->addText(
99 99
                 10,
@@ -104,15 +104,15 @@  discard block
 block discarded – undo
104 104
         }
105 105
 
106 106
         if ($this->info_accion === 'enviar') {
107
-            $this->documento->save('tmp/' . FS_TMP_NAME . 'enviar/' . $this->archivo);
107
+            $this->documento->save('tmp/'.FS_TMP_NAME.'enviar/'.$this->archivo);
108 108
             $this->emailHelper->accountStatusEmail(
109 109
                 $this->empresa,
110 110
                 $this->cliente_residente,
111 111
                 $this->user,
112 112
                 $this->archivo
113 113
             );
114
-        } else {
115
-            $this->documento->show('documento_cobros_' . \date('dmYhis') . '.pdf');
114
+        }else {
115
+            $this->documento->show('documento_cobros_'.\date('dmYhis').'.pdf');
116 116
         }
117 117
     }
118 118
 }
119 119
\ No newline at end of file
Please login to merge, or discard this patch.
extras/residentesFacturaProgramada.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
     public function conceptoFacturable($codcliente, $referencia)
41 41
     {
42 42
         $sql = "SELECT count(referencia) as facturado from lineasfacturascli where referencia = ".
43
-            $this->var2str($referencia) .
43
+            $this->var2str($referencia).
44 44
             " AND idfactura IN (select idfactura from facturascli WHERE codcliente = ".$this->var2str($codcliente).");";
45 45
         $data = $this->db->select($sql);
46 46
         if (!$data[0]['facturado']) {
@@ -74,16 +74,16 @@  discard block
 block discarded – undo
74 74
 
75 75
                 $this->nuevoTotalFactura($factura, $residenteProg, $empresaTable);
76 76
                 if ($cliente_residente->email !== null) {
77
-                    $archivo = $factura->codigo . '_' . $factura->numero2 . '.pdf';
77
+                    $archivo = $factura->codigo.'_'.$factura->numero2.'.pdf';
78 78
                     $documento = new residentesFacturaDetallada('L', 'mm', 'A5', 'enviar', $archivo, 'cron');
79 79
                     $documento->crearFactura($empresaTable, $factura, $cliente_residente);
80 80
                 }
81 81
                 ++$jobDisponible->facturas_generadas;
82 82
                 $jobDisponible->save();
83
-            } else {
83
+            }else {
84 84
                 $this->log->new_error_msg('Imposible guardar la factura.');
85 85
             }
86
-        } else {
86
+        }else {
87 87
             $this->log->new_error_msg('Cliente no encontrado.');
88 88
         }
89 89
     }
@@ -163,7 +163,7 @@  discard block
 block discarded – undo
163 163
             $residenteProgramado->idfactura = $factura->idfactura;
164 164
             $residenteProgramado->procesado = true;
165 165
             $residenteProgramado->save();
166
-        } else {
166
+        }else {
167 167
             $factura->delete();
168 168
         }
169 169
     }
@@ -219,7 +219,7 @@  discard block
 block discarded – undo
219 219
         if ($empresaTable->contintegrada) {
220 220
             $asiento_factura = new asiento_factura();
221 221
             $asiento_factura->generar_asiento_venta($factura);
222
-        } else {
222
+        }else {
223 223
             /// de todas formas forzamos la generación de las líneas de iva
224 224
             $factura->get_lineas_iva();
225 225
         }
Please login to merge, or discard this patch.
extras/residentesFacturaDetallada.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@  discard block
 block discarded – undo
22 22
 
23 23
 class residentesFacturaDetallada
24 24
 {
25
-    public $archivo ;
25
+    public $archivo;
26 26
     public $document;
27 27
     public $emailHelper;
28 28
     public $output;
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
     private $residentesController;
32 32
     public function __construct($orientation = 'L', $um = 'mm', $size = 'A5', $output = 'enviar', $archivo, $user)
33 33
     {
34
-        $this->archivo = ($archivo) ?: \date('dmYHis') . ".pdf";
34
+        $this->archivo = ($archivo) ?: \date('dmYHis').".pdf";
35 35
         $this->output = $output;
36 36
         $this->user = $user;
37 37
         $this->log = new fs_core_log();
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
         $datosFactura = $this->invoiceData($companyInformation, $invoice);
51 51
         $datosEmpresa = (array) $companyInformation;
52 52
         $customerInfo = (array) $customer;
53
-        $customerInfo['direccion'] = trim($customer->inmueble->codigo_externo()) . " numero " . $customer->inmueble->numero;
53
+        $customerInfo['direccion'] = trim($customer->inmueble->codigo_externo())." numero ".$customer->inmueble->numero;
54 54
         $this->document->createDocument($datosEmpresa, $datosFactura[0], $datosFactura[1], $customerInfo);
55 55
         $this->residentesController->cliente_residente = $customer;
56 56
         $pendiente = $this->residentesController->pagosFactura(false);
@@ -58,14 +58,14 @@  discard block
 block discarded – undo
58 58
         if ($this->output === 'enviar') {
59 59
             $this->document->Output(
60 60
                 'F',
61
-                'tmp/' . FS_TMP_NAME . 'enviar/' . $this->archivo,
61
+                'tmp/'.FS_TMP_NAME.'enviar/'.$this->archivo,
62 62
                 true
63 63
             );
64 64
             $this->emailHelper->invoiceEmail($companyInformation, $invoice, $customer, $this->user, $this->archivo);
65
-        } else {
65
+        }else {
66 66
             $this->document->Output(
67 67
                 'I',
68
-                'factura_' .$datosFactura[0]['numero2']. '_' . \date('dmYhis') . '.pdf'
68
+                'factura_'.$datosFactura[0]['numero2'].'_'.\date('dmYhis').'.pdf'
69 69
             );
70 70
         }
71 71
     }
Please login to merge, or discard this patch.