@@ -22,7 +22,7 @@ discard block |
||
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 |
||
31 | 31 | private $residentesController; |
32 | 32 | public function __construct($orientation = 'L', $um = 'mm', $size = 'A5', $output = 'enviar', $archivo = 'doc.pdf', $user = 'cron') |
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 |
||
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 |
||
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 | } |
@@ -36,27 +36,27 @@ discard block |
||
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("Error al enviar el email: " . $mail->ErrorInfo); |
|
55 | + }else { |
|
56 | + $this->log->new_error("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('Imposible generar el PDF.'); |
61 | 61 | } |
62 | 62 | } |
@@ -69,7 +69,7 @@ discard block |
||
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 |
||
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("Error al enviar el email: " . $mail->ErrorInfo); |
|
107 | + }else { |
|
108 | + $this->log->new_error("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 |
@@ -40,7 +40,7 @@ discard block |
||
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']) { |
@@ -90,16 +90,16 @@ discard block |
||
90 | 90 | |
91 | 91 | $this->nuevoTotalFactura($factura, $residenteProg, $empresaTable); |
92 | 92 | if (!in_array($cliente_residente->email, [null, ''], true) && $jobDisponible->tipo_programacion === 'enviar') { |
93 | - $archivo = $factura->codigo . '_' . $factura->numero2 . '.pdf'; |
|
93 | + $archivo = $factura->codigo.'_'.$factura->numero2.'.pdf'; |
|
94 | 94 | $documento = new residentesFacturaDetallada('L', 'mm', 'A5', $jobDisponible->tipo_programacion, $archivo, 'cron'); |
95 | 95 | $documento->crearFactura($empresaTable, $factura, $cliente_residente); |
96 | 96 | } |
97 | 97 | ++$jobDisponible->facturas_generadas; |
98 | 98 | $jobDisponible->save(); |
99 | - } else { |
|
99 | + }else { |
|
100 | 100 | $this->log->new_error_msg('Imposible guardar la factura.'); |
101 | 101 | } |
102 | - } else { |
|
102 | + }else { |
|
103 | 103 | $this->log->new_error_msg('Cliente no encontrado.'); |
104 | 104 | } |
105 | 105 | } |
@@ -179,7 +179,7 @@ discard block |
||
179 | 179 | $residenteProgramado->idfactura = $factura->idfactura; |
180 | 180 | $residenteProgramado->procesado = true; |
181 | 181 | $residenteProgramado->save(); |
182 | - } else { |
|
182 | + }else { |
|
183 | 183 | $factura->delete(); |
184 | 184 | } |
185 | 185 | } |
@@ -235,7 +235,7 @@ discard block |
||
235 | 235 | if ($empresaTable->contintegrada) { |
236 | 236 | $asiento_factura = new asiento_factura(); |
237 | 237 | $asiento_factura->generar_asiento_venta($factura); |
238 | - } else { |
|
238 | + }else { |
|
239 | 239 | /// de todas formas forzamos la generación de las líneas de iva |
240 | 240 | $factura->get_lineas_iva(); |
241 | 241 | } |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | $this->estado = $t['estado']; |
63 | 63 | $this->fecha_creacion = $t['fecha_creacion']; |
64 | 64 | $this->fecha_modificacion = $t['fecha_modificacion']; |
65 | - } else { |
|
65 | + }else { |
|
66 | 66 | $this->id = null; |
67 | 67 | $this->descripcion = ''; |
68 | 68 | $this->tipo_programacion = 'generar'; |
@@ -113,7 +113,7 @@ discard block |
||
113 | 113 | "WHERE id = ".$this->intval($this->id).";"; |
114 | 114 | $data = $this->db->exec($sql); |
115 | 115 | return $data; |
116 | - } else { |
|
116 | + }else { |
|
117 | 117 | $sql = "INSERT INTO ".$this->table_name. |
118 | 118 | " (descripcion, tipo_programacion, forma_pago, formato_factura, fecha_envio, hora_envio, residentes_facturar, ". |
119 | 119 | "facturas_generadas, usuario_creacion, fecha_creacion, estado) VALUES (". |
@@ -130,7 +130,7 @@ discard block |
||
130 | 130 | $this->var2str($this->estado).");"; |
131 | 131 | if ($this->db->exec($sql)) { |
132 | 132 | return $this->db->lastval(); |
133 | - } else { |
|
133 | + }else { |
|
134 | 134 | return false; |
135 | 135 | } |
136 | 136 | } |
@@ -122,7 +122,7 @@ discard block |
||
122 | 122 | foreach ($extensiones as $ext) { |
123 | 123 | $fsext0 = new fs_extension($ext); |
124 | 124 | if (!$fsext0->save()) { |
125 | - $this->new_error_msg('Imposible guardar los datos de la extensión ' . $ext['name'] . '.'); |
|
125 | + $this->new_error_msg('Imposible guardar los datos de la extensión '.$ext['name'].'.'); |
|
126 | 126 | } |
127 | 127 | } |
128 | 128 | } |
@@ -173,7 +173,7 @@ discard block |
||
173 | 173 | } |
174 | 174 | if ($estado === true) { |
175 | 175 | $this->new_message('Programación eliminada correctamente.'); |
176 | - } else { |
|
176 | + }else { |
|
177 | 177 | $this->new_error_msg('La Programación no pudo ser eliminada, verifique los datos o sus permisos.'); |
178 | 178 | } |
179 | 179 | } |
@@ -194,7 +194,7 @@ discard block |
||
194 | 194 | } |
195 | 195 | if ($estado === true) { |
196 | 196 | $this->new_message('Programación reiniciada correctamente.'); |
197 | - } else { |
|
197 | + }else { |
|
198 | 198 | $this->new_error_msg('La Programación no pudo ser reiniciada, verifique los datos o sus permisos.'); |
199 | 199 | } |
200 | 200 | } |
@@ -202,7 +202,7 @@ discard block |
||
202 | 202 | public function guardarProgramacion() |
203 | 203 | { |
204 | 204 | $residentesProcesar = $this->cantidadResidentesProcesar(); |
205 | - $cantidadResidentesProcesar = count($residentesProcesar); |
|
205 | + $cantidadResidentesProcesar = count($residentesProcesar); |
|
206 | 206 | $idProgramacion = $this->cabeceraProgramacion($cantidadResidentesProcesar); |
207 | 207 | |
208 | 208 | if ($idProgramacion) { |
@@ -295,7 +295,7 @@ discard block |
||
295 | 295 | $edificacionesDisponibles = $edificaciones_residentes->get_by_field('id_edificacion', $edificacion); |
296 | 296 | foreach ($edificacionesDisponibles as $edif) { |
297 | 297 | if ($edif->ocupado === true) { |
298 | - $residentesDisponibles[] = ['id_edificacion'=>$edif->id_edificacion,'codcliente'=>$edif->codcliente]; |
|
298 | + $residentesDisponibles[] = ['id_edificacion'=>$edif->id_edificacion, 'codcliente'=>$edif->codcliente]; |
|
299 | 299 | } |
300 | 300 | } |
301 | 301 | $this->cargarResidentesFacturables($residentesDisponibles, $listaResidentes); |