@@ -82,7 +82,7 @@ discard block |
||
82 | 82 | $this->nueva_factura(); |
83 | 83 | } |
84 | 84 | $this->informacionResidente(); |
85 | - } else { |
|
85 | + }else { |
|
86 | 86 | $this->new_error_msg('Residente no encontrado.'); |
87 | 87 | } |
88 | 88 | } |
@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | |
98 | 98 | public function informacionResidente() |
99 | 99 | { |
100 | - $this->page->title = 'Residente ' . $this->residente->nombre; |
|
100 | + $this->page->title = 'Residente '.$this->residente->nombre; |
|
101 | 101 | $factura = new factura_cliente(); |
102 | 102 | $facts = $factura->all_from_cliente($this->residente->codcliente); |
103 | 103 | $this->facturas = array(); |
@@ -107,10 +107,10 @@ discard block |
||
107 | 107 | $fac->referencias = ""; |
108 | 108 | foreach ($fac->get_lineas() as $linea) { |
109 | 109 | if ($linea->referencia) { |
110 | - $fac->referencias .= $linea->referencia . " "; |
|
110 | + $fac->referencias .= $linea->referencia." "; |
|
111 | 111 | $this->validarArticulos($articulos_cobrados, $fac, $linea); |
112 | - } else { |
|
113 | - $fac->referencias .= $linea->descripcion . " "; |
|
112 | + }else { |
|
113 | + $fac->referencias .= $linea->descripcion." "; |
|
114 | 114 | } |
115 | 115 | } |
116 | 116 | $this->facturas[] = $fac; |
@@ -171,10 +171,10 @@ discard block |
||
171 | 171 | $this->lineasLibresFactura($factura, 'otro2'); |
172 | 172 | |
173 | 173 | $this->totalFactura($factura); |
174 | - } else { |
|
174 | + }else { |
|
175 | 175 | $this->new_error_msg('Imposible guardar la factura.'); |
176 | 176 | } |
177 | - } else { |
|
177 | + }else { |
|
178 | 178 | $this->new_error_msg('Cliente no encontrado.'); |
179 | 179 | } |
180 | 180 | } |
@@ -239,15 +239,15 @@ discard block |
||
239 | 239 | $art0 = new articulo(); |
240 | 240 | $lineas = \filter_input(INPUT_POST, 'numlineas'); |
241 | 241 | for ($x = 0; $x < $lineas; $x++) { |
242 | - $referencia = \filter_input(INPUT_POST, 'referencia_' . $x); |
|
243 | - $importe = \filter_input(INPUT_POST, 'importe_' . $x); |
|
244 | - $impuesto = \filter_input(INPUT_POST, 'impuesto_' . $x); |
|
242 | + $referencia = \filter_input(INPUT_POST, 'referencia_'.$x); |
|
243 | + $importe = \filter_input(INPUT_POST, 'importe_'.$x); |
|
244 | + $impuesto = \filter_input(INPUT_POST, 'impuesto_'.$x); |
|
245 | 245 | $art = $art0->get($referencia); |
246 | - if ((float)$importe) { |
|
246 | + if ((float) $importe) { |
|
247 | 247 | $linea = new linea_factura_cliente(); |
248 | 248 | $linea->idfactura = $factura->idfactura; |
249 | 249 | $linea->referencia = $referencia; |
250 | - $linea->descripcion = ($art) ? $art->descripcion : $referencia . ' Articulo libre'; |
|
250 | + $linea->descripcion = ($art) ? $art->descripcion : $referencia.' Articulo libre'; |
|
251 | 251 | $linea->cantidad = 1; |
252 | 252 | $imp = $this->impuesto->get($impuesto); |
253 | 253 | if ($imp) { |
@@ -278,7 +278,7 @@ discard block |
||
278 | 278 | $linea->codimpuesto = $imp->codimpuesto; |
279 | 279 | $linea->iva = $imp->iva; |
280 | 280 | $linea->pvpsindto = $linea->pvptotal = $linea->pvpunitario = |
281 | - (100 * (float)\filter_input(INPUT_POST, $linea_nombre)) / (100 + $imp->iva); |
|
281 | + (100 * (float) \filter_input(INPUT_POST, $linea_nombre)) / (100 + $imp->iva); |
|
282 | 282 | |
283 | 283 | $articulo = (\filter_input(INPUT_POST, 'ref_'.$linea_nombre)) |
284 | 284 | ? $art0->get(\filter_input(INPUT_POST, 'ref_'.$linea_nombre)) |
@@ -304,19 +304,19 @@ discard block |
||
304 | 304 | $factura->totalrecargo = round($factura->totalrecargo, FS_NF0); |
305 | 305 | $factura->total = $factura->neto + $factura->totaliva - $factura->totalirpf + $factura->totalrecargo; |
306 | 306 | |
307 | - if (abs((float)(\filter_input(INPUT_POST, 'total_importe')) - $factura->total) > .01) { |
|
308 | - $this->new_error_msg("El total difiere entre la vista y el controlador (" . |
|
309 | - \filter_input(INPUT_POST, 'total_importe') . |
|
310 | - " frente a " . $factura->total . "). Debes informar del error."); |
|
307 | + if (abs((float) (\filter_input(INPUT_POST, 'total_importe')) - $factura->total) > .01) { |
|
308 | + $this->new_error_msg("El total difiere entre la vista y el controlador (". |
|
309 | + \filter_input(INPUT_POST, 'total_importe'). |
|
310 | + " frente a ".$factura->total."). Debes informar del error."); |
|
311 | 311 | $factura->delete(); |
312 | 312 | } elseif ($factura->save()) { |
313 | 313 | $this->generar_asiento($factura); |
314 | 314 | /// Función de ejecución de tareas post guardado correcto de la factura |
315 | 315 | fs_documento_post_save($factura); |
316 | - $this->new_message("<a href='" . $factura->url() . "'>Factura</a> guardada correctamente."); |
|
317 | - $this->new_change('Factura Cliente ' . $factura->codigo, $factura->url(), true); |
|
318 | - } else { |
|
319 | - $this->new_error_msg("¡Imposible actualizar la <a href='" . $factura->url() . "'>Factura</a>!"); |
|
316 | + $this->new_message("<a href='".$factura->url()."'>Factura</a> guardada correctamente."); |
|
317 | + $this->new_change('Factura Cliente '.$factura->codigo, $factura->url(), true); |
|
318 | + }else { |
|
319 | + $this->new_error_msg("¡Imposible actualizar la <a href='".$factura->url()."'>Factura</a>!"); |
|
320 | 320 | } |
321 | 321 | } |
322 | 322 | |
@@ -329,7 +329,7 @@ discard block |
||
329 | 329 | if ($this->empresa->contintegrada) { |
330 | 330 | $asiento_factura = new asiento_factura(); |
331 | 331 | $asiento_factura->generar_asiento_venta($factura); |
332 | - } else { |
|
332 | + }else { |
|
333 | 333 | /// de todas formas forzamos la generación de las líneas de iva |
334 | 334 | $factura->get_lineas_iva(); |
335 | 335 | } |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | $this->vehiculo_placa = $t['vehiculo_placa']; |
81 | 81 | $this->vehiculo_tipo = $t['vehiculo_tipo']; |
82 | 82 | $this->codigo_tarjeta = $t['codigo_tarjeta']; |
83 | - } else { |
|
83 | + }else { |
|
84 | 84 | $this->idvehiculo = null; |
85 | 85 | $this->codcliente = null; |
86 | 86 | $this->vehiculo_marca = null; |
@@ -120,7 +120,7 @@ discard block |
||
120 | 120 | $lista[] = $item; |
121 | 121 | } |
122 | 122 | return $lista; |
123 | - } else { |
|
123 | + }else { |
|
124 | 124 | return false; |
125 | 125 | } |
126 | 126 | } |
@@ -132,7 +132,7 @@ discard block |
||
132 | 132 | $data = $this->db->select($sql); |
133 | 133 | if ($data) { |
134 | 134 | return new residentes_vehiculos($data[0]); |
135 | - } else { |
|
135 | + }else { |
|
136 | 136 | return false; |
137 | 137 | } |
138 | 138 | } |
@@ -145,7 +145,7 @@ discard block |
||
145 | 145 | */ |
146 | 146 | public function get_by_field($field, $value) |
147 | 147 | { |
148 | - $query = (is_string($value))?$this->var2str($value):$this->intval($value); |
|
148 | + $query = (is_string($value)) ? $this->var2str($value) : $this->intval($value); |
|
149 | 149 | $sql = "SELECT * FROM ".$this->table_name." WHERE ".strtoupper(trim($field))." = ".$query.";"; |
150 | 150 | $data = $this->db->select($sql); |
151 | 151 | if ($data) { |
@@ -155,7 +155,7 @@ discard block |
||
155 | 155 | $lista[] = $item; |
156 | 156 | } |
157 | 157 | return $lista; |
158 | - } else { |
|
158 | + }else { |
|
159 | 159 | return false; |
160 | 160 | } |
161 | 161 | } |
@@ -164,7 +164,7 @@ discard block |
||
164 | 164 | { |
165 | 165 | if (is_null($this->idvehiculo)) { |
166 | 166 | return false; |
167 | - } else { |
|
167 | + }else { |
|
168 | 168 | return $this->get($this->codcliente, $this->idvehiculo); |
169 | 169 | } |
170 | 170 | } |
@@ -182,7 +182,7 @@ discard block |
||
182 | 182 | "WHERE idvehiculo = ".$this->intval($this->idvehiculo)." AND ". |
183 | 183 | "codcliente = ".$this->var2str($this->codcliente).";"; |
184 | 184 | return $this->db->exec($sql); |
185 | - } else { |
|
185 | + }else { |
|
186 | 186 | $sql = "INSERT INTO ".$this->table_name." (codcliente, vehiculo_marca, vehiculo_modelo, vehiculo_color, ". |
187 | 187 | "vehiculo_placa, vehiculo_tipo, codigo_tarjeta) VALUES (". |
188 | 188 | $this->var2str($this->codcliente).", ". |
@@ -194,7 +194,7 @@ discard block |
||
194 | 194 | $this->var2str($this->codigo_tarjeta).");"; |
195 | 195 | if ($this->db->exec($sql)) { |
196 | 196 | return $this->db->lastval(); |
197 | - } else { |
|
197 | + }else { |
|
198 | 198 | return false; |
199 | 199 | } |
200 | 200 | } |
@@ -209,17 +209,17 @@ discard block |
||
209 | 209 | $clilist = array(); |
210 | 210 | $query = mb_strtolower($this->no_html($busqueda), 'UTF8'); |
211 | 211 | |
212 | - $consulta = "SELECT * FROM " . $this->table_name . " WHERE "; |
|
212 | + $consulta = "SELECT * FROM ".$this->table_name." WHERE "; |
|
213 | 213 | if (is_numeric($query)) { |
214 | - $consulta .= "(codigo_tarjeta LIKE '%" . $query . "%' OR CAST(idvehiculo as CHAR) = '%" . $query . "%')"; |
|
215 | - } else { |
|
214 | + $consulta .= "(codigo_tarjeta LIKE '%".$query."%' OR CAST(idvehiculo as CHAR) = '%".$query."%')"; |
|
215 | + }else { |
|
216 | 216 | $buscar = str_replace(' ', '%', $query); |
217 | - $consulta .= "(lower(codigo_tarjeta) LIKE '%" . $buscar . |
|
218 | - "%' OR lower(vehiculo_color) LIKE '%" . $buscar . "%'" . |
|
219 | - " OR lower(vehiculo_marca) LIKE '%" . $buscar . |
|
220 | - "%' OR lower(vehiculo_modelo) LIKE '%" . $buscar . "%'" . |
|
221 | - " OR lower(vehiculo_placa) LIKE '%" . $buscar . |
|
222 | - "%' OR lower(vehiculo_tipo) LIKE '%" . $buscar . "%')"; |
|
217 | + $consulta .= "(lower(codigo_tarjeta) LIKE '%".$buscar. |
|
218 | + "%' OR lower(vehiculo_color) LIKE '%".$buscar."%'". |
|
219 | + " OR lower(vehiculo_marca) LIKE '%".$buscar. |
|
220 | + "%' OR lower(vehiculo_modelo) LIKE '%".$buscar."%'". |
|
221 | + " OR lower(vehiculo_placa) LIKE '%".$buscar. |
|
222 | + "%' OR lower(vehiculo_tipo) LIKE '%".$buscar."%')"; |
|
223 | 223 | } |
224 | 224 | $consulta .= " ORDER BY codcliente ASC"; |
225 | 225 |
@@ -110,9 +110,9 @@ |
||
110 | 110 | $jobDisponible->fecha_modificacion = \date('Y-m-d H:i:s'); |
111 | 111 | $jobDisponible->save(); |
112 | 112 | $this->startJob($jobDisponible); |
113 | - } else { |
|
113 | + }else { |
|
114 | 114 | echo " ** No coincide la hora de proceso con la de ejecucion de cron se omite el proceso ". |
115 | - $this->ahora . " " . $this->horaActual . " ** \n"; |
|
115 | + $this->ahora." ".$this->horaActual." ** \n"; |
|
116 | 116 | $this->log->new_advice(' ** No coincide la hora de proceso con la de ejecucion de cron se omite el proceso ** '); |
117 | 117 | } |
118 | 118 | } |
@@ -59,7 +59,7 @@ discard block |
||
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 |
||
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 |
||
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 | } |
@@ -41,9 +41,9 @@ discard block |
||
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 |
||
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 |
||
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 |
@@ -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 | } |