Passed
Push — master ( 7e1394...576ed2 )
by Joe Nilson
03:54 queued 15s
created
Lib/PlantillasPDF/PlantillaDOM.php 1 patch
Spacing   +87 added lines, -88 removed lines patch added patch discarded remove patch
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
         // TODO: Implement addInvoiceHeader() method.
43 43
         $html = $this->getInvoiceHeaderBilling($model)
44 44
             . $this->getInvoiceHeaderShipping($model);
45
-        $this->writeHTML('<table class="table-big table-border"><tr>' . $html . '</tr></table><br/>');
45
+        $this->writeHTML('<table class="table-big table-border"><tr>'.$html.'</tr></table><br/>');
46 46
     }
47 47
 
48 48
     public function addInvoiceLines($model)
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
 
53 53
         $tHead = '<thead><tr>';
54 54
         foreach ($this->getInvoiceLineFields() as $field) {
55
-            $tHead .= '<th class="' . $field['css'] . '" align="' . $field['align'] . '">' . $field['title'] . '</th>';
55
+            $tHead .= '<th class="'.$field['css'].'" align="'.$field['align'].'">'.$field['title'].'</th>';
56 56
         }
57 57
         $tHead .= '</tr></thead>';
58 58
 
@@ -64,20 +64,20 @@  discard block
 block discarded – undo
64 64
             $line->numlinea = $numLinea;
65 65
             $tBody .= '<tr>';
66 66
             foreach ($this->getInvoiceLineFields() as $field) {
67
-                $tBody .= '<td class="' . $field['css'] . '" align="' . $field['align'] . '" valign="top">' . $this->getInvoiceLineValue($model, $line, $field) . '</td>';
67
+                $tBody .= '<td class="'.$field['css'].'" align="'.$field['align'].'" valign="top">'.$this->getInvoiceLineValue($model, $line, $field).'</td>';
68 68
             }
69 69
             $tBody .= '</tr>';
70 70
             $numLinea++;
71 71
 
72 72
             if (property_exists($line, 'salto_pagina') && $line->salto_pagina) {
73
-                $this->writeHTML('<div class="table-lines"><table class="table-big table-list">' . $tHead . $tBody . '</table></div>');
73
+                $this->writeHTML('<div class="table-lines"><table class="table-big table-list">'.$tHead.$tBody.'</table></div>');
74 74
                 $this->writeHTML($this->getInvoiceTotalsPartial($model, $tLines, 'mt-20'));
75 75
                 $this->mpdf->AddPage();
76 76
                 $tBody = '';
77 77
             }
78 78
         }
79 79
 
80
-        $this->writeHTML('<div class="table-lines"><table class="table-big table-list">' . $tHead . $tBody . '</table></div>');
80
+        $this->writeHTML('<div class="table-lines"><table class="table-big table-list">'.$tHead.$tBody.'</table></div>');
81 81
 
82 82
         // clonamos el documento y añadimos los totales para ver si salta de página
83 83
         $copier = new DeepCopy();
@@ -96,28 +96,28 @@  discard block
 block discarded – undo
96 96
     protected function css(): string
97 97
     {
98 98
         return parent::css()
99
-            . '.title {border-bottom: 2px solid ' . $this->get('color1') . ';}'
100
-            . '.table-border {border-top: 1px solid ' . $this->get('color1') . '; border-bottom: 1px solid ' . $this->get('color1') . ';}'
101
-            . '.table-dual {border-top: 1px solid ' . $this->get('color1') . '; border-bottom: 1px solid ' . $this->get('color1') . ';}'
102
-            . '.table-list {border-spacing: 0px; border-top: 1px solid ' . $this->get('color1') . '; border-bottom: 1px solid ' . $this->get('color1') . ';}'
103
-            . '.table-list tr:nth-child(even) {background-color: ' . $this->get('color3') . ';}'
104
-            . '.table-list th {background-color: ' . $this->get('color1') . '; color: ' . $this->get('color2') . '; padding: 5px; text-transform: uppercase;}'
99
+            . '.title {border-bottom: 2px solid '.$this->get('color1').';}'
100
+            . '.table-border {border-top: 1px solid '.$this->get('color1').'; border-bottom: 1px solid '.$this->get('color1').';}'
101
+            . '.table-dual {border-top: 1px solid '.$this->get('color1').'; border-bottom: 1px solid '.$this->get('color1').';}'
102
+            . '.table-list {border-spacing: 0px; border-top: 1px solid '.$this->get('color1').'; border-bottom: 1px solid '.$this->get('color1').';}'
103
+            . '.table-list tr:nth-child(even) {background-color: '.$this->get('color3').';}'
104
+            . '.table-list th {background-color: '.$this->get('color1').'; color: '.$this->get('color2').'; padding: 5px; text-transform: uppercase;}'
105 105
             . '.table-list td {padding: 5px;}'
106 106
             . '.thanks-title {'
107
-            . 'font-size: ' . $this->get('titlefontsize') . 'px; font-weight: bold; color: ' . $this->get('color1') . '; '
108
-            . 'text-align: right; width: 50%; padding: 15px; border-right: 1px solid ' . $this->get('color1') . ';'
107
+            . 'font-size: '.$this->get('titlefontsize').'px; font-weight: bold; color: '.$this->get('color1').'; '
108
+            . 'text-align: right; width: 50%; padding: 15px; border-right: 1px solid '.$this->get('color1').';'
109 109
             . '}'
110 110
             . '.color-navy {color: navy;}'
111 111
             . '.color-blue {color: blue;}'
112
-            . '.color-template {color: ' . $this->get('color1') .';}'
112
+            . '.color-template {color: '.$this->get('color1').';}'
113 113
             . '.thanks-text {padding: 15px;}'
114
-            . '.imagetext {margin-top: 15px; text-align: ' . $this->get('endalign') . ';}'
115
-            . '.imagefooter {text-align: ' . $this->get('footeralign') . ';}';
114
+            . '.imagetext {margin-top: 15px; text-align: '.$this->get('endalign').';}'
115
+            . '.imagefooter {text-align: '.$this->get('footeralign').';}';
116 116
     }
117 117
 
118 118
     protected function getSubjectIdFiscalStr(BusinessDocument $model): string
119 119
     {
120
-        return empty($model->cifnif) ? '' : '<b>' . $model->getSubject()->tipoidfiscal . '</b>: ' . $model->cifnif;
120
+        return empty($model->cifnif) ? '' : '<b>'.$model->getSubject()->tipoidfiscal.'</b>: '.$model->cifnif;
121 121
     }
122 122
 
123 123
     protected function getInvoiceHeaderBilling($model): string
@@ -129,13 +129,13 @@  discard block
 block discarded – undo
129 129
         $subject = $model->getSubject();
130 130
         $address = isset($model->codproveedor) && !isset($model->direccion) ? $subject->getDefaultAddress() : $model;
131 131
         $customerCode = $this->get('showcustomercode') ? $model->subjectColumnValue() : '';
132
-        $customerEmail = $this->get('showcustomeremail') && !empty($subject->email) ? '<br>' . Tools::lang()->trans('email') . ': ' . $subject->email : '';
132
+        $customerEmail = $this->get('showcustomeremail') && !empty($subject->email) ? '<br>'.Tools::lang()->trans('email').': '.$subject->email : '';
133 133
         $break = empty($model->cifnif) ? '' : '<br/>';
134 134
         return '<td align="left" valign="top">'
135
-            . '<br/><b> ' . $this->getSubjectTitle($model) . ':</b> ' . $customerCode
136
-            . $this->getSubjectName($model) . $break . $this->getSubjectIdFiscalStr($model)
137
-            . '<br/><b>' . Tools::lang()->trans('address'). ':</b> ' .$this->combineAddress($address) . $this->getInvoiceHeaderBillingPhones($subject)
138
-            . '<br/><b>' . Tools::lang()->trans('email'). ':</b> ' .$customerEmail
135
+            . '<br/><b> '.$this->getSubjectTitle($model).':</b> '.$customerCode
136
+            . $this->getSubjectName($model).$break.$this->getSubjectIdFiscalStr($model)
137
+            . '<br/><b>'.Tools::lang()->trans('address').':</b> '.$this->combineAddress($address).$this->getInvoiceHeaderBillingPhones($subject)
138
+            . '<br/><b>'.Tools::lang()->trans('email').':</b> '.$customerEmail
139 139
             . '<br/>'
140 140
             . '</td>';
141 141
     }
@@ -155,8 +155,8 @@  discard block
 block discarded – undo
155 155
             return '';
156 156
         }
157 157
 
158
-        return '<td><b>' . Tools::lang()->trans('shipping-address') . '</b>'
159
-            . '<br/>' . $this->combineAddress($contacto, true) . '</td>';
158
+        return '<td><b>'.Tools::lang()->trans('shipping-address').'</b>'
159
+            . '<br/>'.$this->combineAddress($contacto, true).'</td>';
160 160
     }
161 161
 
162 162
     protected function getInvoiceHeaderBillingPhones($subject): string
@@ -170,7 +170,7 @@  discard block
 block discarded – undo
170 170
             return '';
171 171
         }
172 172
 
173
-        return '<br/>' . $strPhones;
173
+        return '<br/>'.$strPhones;
174 174
     }
175 175
 
176 176
     protected function headerLeft(): string
@@ -183,34 +183,34 @@  discard block
 block discarded – undo
183 183
             }
184 184
         }
185 185
 
186
-        $title = $this->showHeaderTitle ? '<h1 class="title">' . $this->get('headertitle') . '</h1>' . $this->spacer() : '';
186
+        $title = $this->showHeaderTitle ? '<h1 class="title">'.$this->get('headertitle').'</h1>'.$this->spacer() : '';
187 187
         if ($this->isSketchInvoice()) {
188
-            $title .= '<div class="color-red font-big font-bold">' . Tools::lang()->trans('invoice-is-sketch') . '</div>';
188
+            $title .= '<div class="color-red font-big font-bold">'.Tools::lang()->trans('invoice-is-sketch').'</div>';
189 189
         }
190 190
 
191 191
         $descTC = ($this->headerModel->tipocomprobante < 30) ? "<b>NCF:</b> " : "<b>e-NCF:</b> ";
192
-        $fechaVencimiento = ($this->headerModel->ncffechavencimiento !== null) ? '<b>Fecha Vencimiento:</b> ' . $this->headerModel->ncffechavencimiento : '';
193
-        $fechaEmision = '<b>Fecha Emisi&oacute;n:</b> ' . $this->headerModel->fecha;
192
+        $fechaVencimiento = ($this->headerModel->ncffechavencimiento !== null) ? '<b>Fecha Vencimiento:</b> '.$this->headerModel->ncffechavencimiento : '';
193
+        $fechaEmision = '<b>Fecha Emisi&oacute;n:</b> '.$this->headerModel->fecha;
194 194
 
195 195
         return '<table class="table-big">'
196 196
             . '<tr>'
197
-                . '<td valign="top"><img src="' . $this->logoPath . '" height="' . $this->get('logosize') . '"/>' . '</td>'
198
-                . '<td align="right" valign="top">' . $title . '</td>'
197
+                . '<td valign="top"><img src="'.$this->logoPath.'" height="'.$this->get('logosize').'"/>'.'</td>'
198
+                . '<td align="right" valign="top">'.$title.'</td>'
199 199
             . '</tr>'
200 200
             . '<tr>'
201 201
                 . '<td align="left" valign="top">'
202
-                . '<p><b>' . $this->empresa->nombre . '</b>'
203
-                . '<br/>' . $this->empresa->tipoidfiscal . ': ' . $this->empresa->cifnif
204
-                . '<br/>' . Tools::lang()->trans('address') . ': ' . $this->combineAddress($this->empresa) . '</p>'
205
-                . '<p>' . implode(' · ', $contactData) . '</p>'
202
+                . '<p><b>'.$this->empresa->nombre.'</b>'
203
+                . '<br/>'.$this->empresa->tipoidfiscal.': '.$this->empresa->cifnif
204
+                . '<br/>'.Tools::lang()->trans('address').': '.$this->combineAddress($this->empresa).'</p>'
205
+                . '<p>'.implode(' · ', $contactData).'</p>'
206 206
                 . $fechaEmision
207 207
                 . '</td>'
208 208
                 . '<td align="right" valign="top">'
209
-                .  '<div class="color-template font-big font-bold">' . $this->headerModel->descripcionTipoComprobante() . '</div>'
209
+                .  '<div class="color-template font-big font-bold">'.$this->headerModel->descripcionTipoComprobante().'</div>'
210 210
                 .  $descTC
211
-                .  $this->headerModel->numeroncf . '<br/>'
212
-                .  $fechaVencimiento . '<br/>'
213
-                .  '<b>' . $i18n->trans('payment-method') . ':</b> '
211
+                .  $this->headerModel->numeroncf.'<br/>'
212
+                .  $fechaVencimiento.'<br/>'
213
+                .  '<b>'.$i18n->trans('payment-method').':</b> '
214 214
                 .  PaymentMethodBankDataHelper::get($this->headerModel)
215 215
                 . '</td>'
216 216
             . '</tr>'
@@ -225,20 +225,20 @@  discard block
 block discarded – undo
225 225
             }
226 226
         }
227 227
 
228
-        $title = $this->showHeaderTitle ? '<h1 class="title">' . $this->get('headertitle') . '</h1>' . $this->spacer() : '';
228
+        $title = $this->showHeaderTitle ? '<h1 class="title">'.$this->get('headertitle').'</h1>'.$this->spacer() : '';
229 229
         if ($this->isSketchInvoice()) {
230
-            $title .= '<div class="color-red font-big font-bold">' . Tools::lang()->trans('invoice-is-sketch') . '</div>';
230
+            $title .= '<div class="color-red font-big font-bold">'.Tools::lang()->trans('invoice-is-sketch').'</div>';
231 231
         }
232 232
 
233 233
         return '<table class="table-big">'
234 234
             . '<tr>'
235
-            . '<td> Titulo ' . $title
236
-            . '<p><b>' . $this->empresa->nombre . '</b>'
237
-            . '<br/>' . $this->empresa->tipoidfiscal . ': ' . $this->empresa->cifnif
238
-            . '<br/>' . $this->combineAddress($this->empresa) . '</p>' . $this->spacer()
239
-            . '<p>' . implode(' · ', $contactData) . '</p>'
235
+            . '<td> Titulo '.$title
236
+            . '<p><b>'.$this->empresa->nombre.'</b>'
237
+            . '<br/>'.$this->empresa->tipoidfiscal.': '.$this->empresa->cifnif
238
+            . '<br/>'.$this->combineAddress($this->empresa).'</p>'.$this->spacer()
239
+            . '<p>'.implode(' · ', $contactData).'</p>'
240 240
             . '</td>'
241
-            . '<td align="right"><img src="' . $this->logoPath . '" height="' . $this->get('logosize') . '"/></td>'
241
+            . '<td align="right"><img src="'.$this->logoPath.'" height="'.$this->get('logosize').'"/></td>'
242 242
             . '</tr>'
243 243
             . '</table>';
244 244
     }
@@ -247,13 +247,12 @@  discard block
 block discarded – undo
247 247
     {
248 248
         $observations = '';
249 249
         if (!empty($this->getObservations($model))) {
250
-            $observations .= '<p><b>' . Tools::lang()->trans('observations') . '</b><br/>'
251
-                . $this->getObservations($model) . '</p>';
250
+            $observations .= '<p><b>'.Tools::lang()->trans('observations').'</b><br/>'
251
+                . $this->getObservations($model).'</p>';
252 252
         }
253 253
 
254 254
         return $this->format->hidetotals ?
255
-            $observations :
256
-            $this->getInvoiceTotalsPartial($model, [], $css) . $observations;
255
+            $observations : $this->getInvoiceTotalsPartial($model, [], $css).$observations;
257 256
     }
258 257
 
259 258
     protected function getInvoiceTotalsPartial($model, array $lines = [], string $css = ''): string
@@ -284,8 +283,8 @@  discard block
 block discarded – undo
284 283
         // pintamos los irpfs
285 284
         foreach ($irpfs as $irpf) {
286 285
             $trs .= '<tr>'
287
-                . '<td align="right"><b>' . $irpf['name'] . '</b>:</td>'
288
-                . '<td class="nowrap" align="right">' . Tools::money($irpf['total'], $model->coddivisa) . '</td>'
286
+                . '<td align="right"><b>'.$irpf['name'].'</b>:</td>'
287
+                . '<td class="nowrap" align="right">'.Tools::money($irpf['total'], $model->coddivisa).'</td>'
289 288
                 . '</tr>';
290 289
         }
291 290
 
@@ -309,15 +308,15 @@  discard block
 block discarded – undo
309 308
                 case 'dtopor1':
310 309
                 case 'dtopor2':
311 310
                     $trs .= '<tr>'
312
-                        . '<td align="right"><b>' . $title . '</b>:</td>'
313
-                        . '<td class="nowrap" align="right">' . Tools::number($model->{$key}) . '%</td>'
311
+                        . '<td align="right"><b>'.$title.'</b>:</td>'
312
+                        . '<td class="nowrap" align="right">'.Tools::number($model->{$key}).'%</td>'
314 313
                         . '</tr>';
315 314
                     break;
316 315
 
317 316
                 case 'total':
318 317
                     $trs .= '<tr>'
319
-                        . '<td class="text-right"><b>' . $title . '</b>:</td>'
320
-                        . '<td class="text-right nowrap">' . Tools::money($model->{$key}, $model->coddivisa) . '</td>'
318
+                        . '<td class="text-right"><b>'.$title.'</b>:</td>'
319
+                        . '<td class="text-right nowrap">'.Tools::money($model->{$key}, $model->coddivisa).'</td>'
321 320
                         . '</tr>';
322 321
                     break;
323 322
 
@@ -328,24 +327,24 @@  discard block
 block discarded – undo
328 327
                 // no break
329 328
                 default:
330 329
                     $trs .= '<tr>'
331
-                        . '<td align="right"><b>' . $title . '</b>:</td>'
332
-                        . '<td class="nowrap" align="right">' . Tools::money($model->{$key}, $model->coddivisa) . '</td>'
330
+                        . '<td align="right"><b>'.$title.'</b>:</td>'
331
+                        . '<td class="nowrap" align="right">'.Tools::money($model->{$key}, $model->coddivisa).'</td>'
333 332
                         . '</tr>';
334 333
                     break;
335 334
             }
336 335
         }
337 336
 
338
-        return '<table class="table-big table-border ' . $css . '">'
337
+        return '<table class="table-big table-border '.$css.'">'
339 338
             . '<tr>'
340
-            . '<td> ' . $this->getInvoiceTaxes($model, $lines) . '</td>'
341
-            . '<td align="right" valign="top"><table>' . $trs . '</table></td>'
339
+            . '<td> '.$this->getInvoiceTaxes($model, $lines).'</td>'
340
+            . '<td align="right" valign="top"><table>'.$trs.'</table></td>'
342 341
             . '</tr>'
343 342
             . '<tr>'
344 343
             . '<td>'
345 344
             . '</td>'
346 345
             . '</tr>'
347 346
             . '</table>'
348
-            . '&nbsp;<b>Son:</b> ' .  $this->convert_to_words($model->total) . ' pesos dominicanos'
347
+            . '&nbsp;<b>Son:</b> '.$this->convert_to_words($model->total).' pesos dominicanos'
349 348
             . '<br/>';
350 349
     }
351 350
 
@@ -365,43 +364,43 @@  discard block
 block discarded – undo
365 364
         $trs = '';
366 365
         foreach ($taxes['iva'] as $row) {
367 366
             $trs .= '<tr>'
368
-                . '<td class="nowrap" align="left">' . Impuestos::get($row['codimpuesto'])->descripcion . '</td>'
369
-                . '<td class="nowrap" align="center">' . Tools::money($row['neto'], $model->coddivisa) . '</td>'
370
-                . '<td class="nowrap" align="center">' . Tools::number($row['iva']) . '%</td>'
371
-                . '<td class="nowrap" align="center">' . Tools::money($row['totaliva'], $model->coddivisa) . '</td>';
367
+                . '<td class="nowrap" align="left">'.Impuestos::get($row['codimpuesto'])->descripcion.'</td>'
368
+                . '<td class="nowrap" align="center">'.Tools::money($row['neto'], $model->coddivisa).'</td>'
369
+                . '<td class="nowrap" align="center">'.Tools::number($row['iva']).'%</td>'
370
+                . '<td class="nowrap" align="center">'.Tools::money($row['totaliva'], $model->coddivisa).'</td>';
372 371
 
373 372
             if (empty($model->totalrecargo)) {
374 373
                 $trs .= '</tr>';
375 374
                 continue;
376 375
             }
377 376
 
378
-            $trs .= '<td class="nowrap" align="center">' . (empty($row['recargo']) ? '-' : Tools::number($row['recargo']) . '%') . '</td>'
379
-                . '<td class="nowrap" align="right">' . (empty($row['totalrecargo']) ? '-' : Tools::money($row['totalrecargo'])) . '</td>'
377
+            $trs .= '<td class="nowrap" align="center">'.(empty($row['recargo']) ? '-' : Tools::number($row['recargo']).'%').'</td>'
378
+                . '<td class="nowrap" align="right">'.(empty($row['totalrecargo']) ? '-' : Tools::money($row['totalrecargo'])).'</td>'
380 379
                 . '</tr>';
381 380
         }
382 381
 
383 382
         if (empty($model->totalrecargo)) {
384
-            return '<table class="' . $class . '">'
383
+            return '<table class="'.$class.'">'
385 384
                 . '<thead>'
386 385
                 . '<tr>'
387
-                . '<th align="left">' . $i18n->trans('tax') . '</th>'
388
-                . '<th align="center">' . $i18n->trans('tax-base') . '</th>'
389
-                . '<th align="center">' . $i18n->trans('percentage') . '</th>'
390
-                . '<th align="center">' . $i18n->trans('amount') . '</th>'
386
+                . '<th align="left">'.$i18n->trans('tax').'</th>'
387
+                . '<th align="center">'.$i18n->trans('tax-base').'</th>'
388
+                . '<th align="center">'.$i18n->trans('percentage').'</th>'
389
+                . '<th align="center">'.$i18n->trans('amount').'</th>'
391 390
                 . '</tr>'
392 391
                 . '</thead>'
393 392
                 . $trs
394 393
                 . '</table>';
395 394
         }
396 395
 
397
-        return '<table class="' . $class . '">'
396
+        return '<table class="'.$class.'">'
398 397
             . '<tr>'
399
-            . '<th align="left">' . $i18n->trans('tax') . '</th>'
400
-            . '<th align="center">' . $i18n->trans('tax-base') . '</th>'
401
-            . '<th align="center">' . $i18n->trans('tax') . '</th>'
402
-            . '<th align="center">' . $i18n->trans('amount') . '</th>'
403
-            . '<th align="center">' . $i18n->trans('re') . '</th>'
404
-            . '<th align="right">' . $i18n->trans('amount') . '</th>'
398
+            . '<th align="left">'.$i18n->trans('tax').'</th>'
399
+            . '<th align="center">'.$i18n->trans('tax-base').'</th>'
400
+            . '<th align="center">'.$i18n->trans('tax').'</th>'
401
+            . '<th align="center">'.$i18n->trans('amount').'</th>'
402
+            . '<th align="center">'.$i18n->trans('re').'</th>'
403
+            . '<th align="right">'.$i18n->trans('amount').'</th>'
405 404
             . '</tr>'
406 405
             . $trs
407 406
             . '</table>';
@@ -463,7 +462,7 @@  discard block
 block discarded – undo
463 462
 
464 463
         if ($number < 100) {
465 464
             return ucfirst($words[10 * floor($number / 10)]
466
-                . ($number % 10 > 0 ? ' y ' . $words[$number % 10] : ''));
465
+                . ($number % 10 > 0 ? ' y '.$words[$number % 10] : ''));
467 466
         }
468 467
 
469 468
         if ($number < 1000) {
@@ -475,23 +474,23 @@  discard block
 block discarded – undo
475 474
 
476 475
         if ($number < 1000000) {
477 476
             $thousands = floor($number / 1000);
478
-            return ucfirst(($thousands > 1 ? $this->convert_to_words($thousands) . ' ' : '')
477
+            return ucfirst(($thousands > 1 ? $this->convert_to_words($thousands).' ' : '')
479 478
                 . 'mil'
480
-                . ($number % 1000 > 0 ? ' ' . $this->convert_to_words($number % 1000) : ''));
479
+                . ($number % 1000 > 0 ? ' '.$this->convert_to_words($number % 1000) : ''));
481 480
         }
482 481
 
483 482
         if ($number < 1000000000) {
484 483
             $millions = floor($number / 1000000);
485
-            return ucfirst(($millions > 1 ? $this->convert_to_words($millions) . ' ' : 'un ')
484
+            return ucfirst(($millions > 1 ? $this->convert_to_words($millions).' ' : 'un ')
486 485
                 . 'millón'
487 486
                 . ($millions > 1 ? 'es' : '')
488
-                . ($number % 1000000 > 0 ? ' ' . $this->convert_to_words($number % 1000000) : ''));
487
+                . ($number % 1000000 > 0 ? ' '.$this->convert_to_words($number % 1000000) : ''));
489 488
         }
490 489
 
491 490
         $billions = floor($number / 1000000000);
492
-        return ucfirst(($billions > 1 ? $this->convert_to_words($billions) . ' ' : 'un ')
491
+        return ucfirst(($billions > 1 ? $this->convert_to_words($billions).' ' : 'un ')
493 492
             . 'billón'
494 493
             . ($billions > 1 ? 'es' : '')
495
-            . ($number % 1000000000 > 0 ? ' ' . $this->convert_to_words($number % 1000000000) : ''));
494
+            . ($number % 1000000000 > 0 ? ' '.$this->convert_to_words($number % 1000000000) : ''));
496 495
     }
497 496
 }
498 497
\ No newline at end of file
Please login to merge, or discard this patch.
Model/NCFTipo.php 1 patch
Spacing   +33 added lines, -33 removed lines patch added patch discarded remove patch
@@ -120,16 +120,16 @@  discard block
 block discarded – undo
120 120
             'tipocomprobante' => '17', 'descripcion' => 'COMPROBANTE PARA PAGOS AL EXTERIOR', 'clasemovimiento'=>'suma',
121 121
             'ventas'=>'N', 'compras'=>'Y', 'contribuyente'=>'Y', 'estado' => true
122 122
         ],
123
-        ['tipocomprobante' => '31', 'descripcion' => 'FACTURA DE CRÉDITO FISCAL ELECTRÓNICA', 'clasemovimiento' => 'suma', 'ventas' => 'Y', 'compras' => 'Y', 'contribuyente' => 'Y', 'estado' => true ],
124
-        ['tipocomprobante' => '32', 'descripcion' => 'FACTURA DE CONSUMO ELECTRÓNICA', 'clasemovimiento' => 'suma', 'ventas' => 'Y', 'compras' => 'Y', 'contribuyente' => 'Y', 'estado' => true ],
125
-        ['tipocomprobante' => '33', 'descripcion' => 'NOTA DE DÉBITO ELECTRÓNICA', 'clasemovimiento' => 'suma', 'ventas' => 'Y', 'compras' => 'Y', 'contribuyente' => 'N', 'estado' => true ],
126
-        ['tipocomprobante' => '34', 'descripcion' => 'NOTA DE CRÉDITO ELECTRÓNICA', 'clasemovimiento' => 'resta', 'ventas' => 'Y', 'compras' => 'Y', 'contribuyente' => 'N', 'estado' => true ],
127
-        ['tipocomprobante' => '41', 'descripcion' => 'COMPROBANTE ELECTRÓNICO DE COMPRAS', 'clasemovimiento' => 'suma', 'ventas' => 'N', 'compras' => 'Y', 'contribuyente' => 'Y', 'estado' => true ],
128
-        ['tipocomprobante' => '43', 'descripcion' => 'COMPROBANTE ELECTRÓNICO PARA GASTOS MENORES', 'clasemovimiento' => 'suma', 'ventas' => 'N', 'compras' => 'Y', 'contribuyente' => 'N', 'estado' => true ],
129
-        ['tipocomprobante' => '44', 'descripcion' => 'COMPROBANTE ELECTRÓNICO PARA REGÍMENES ESPECIALES', 'clasemovimiento' => 'suma', 'ventas' => 'Y', 'compras' => 'Y', 'contribuyente' => 'Y', 'estado' => true ],
130
-        ['tipocomprobante' => '45', 'descripcion' => 'COMPROBANTE ELECTRÓNICO GUBERNAMENTAL', 'clasemovimiento' => 'suma', 'ventas' => 'Y', 'compras' => 'Y', 'contribuyente' => 'Y', 'estado' => true ],
131
-        ['tipocomprobante' => '46', 'descripcion' => 'COMPROBANTE ELECTRÓNICO PARA EXPORTACIONES', 'clasemovimiento' => 'suma', 'ventas' => 'Y', 'compras' => 'Y', 'contribuyente' => 'Y', 'estado' => true ],
132
-        ['tipocomprobante' => '47', 'descripcion' => 'COMPROBANTE ELECTRÓNICO PARA PAGOS AL EXTERIOR', 'clasemovimiento' => 'suma', 'ventas' => 'N', 'compras' => 'Y', 'contribuyente' => 'Y', 'estado' => true ],
123
+        ['tipocomprobante' => '31', 'descripcion' => 'FACTURA DE CRÉDITO FISCAL ELECTRÓNICA', 'clasemovimiento' => 'suma', 'ventas' => 'Y', 'compras' => 'Y', 'contribuyente' => 'Y', 'estado' => true],
124
+        ['tipocomprobante' => '32', 'descripcion' => 'FACTURA DE CONSUMO ELECTRÓNICA', 'clasemovimiento' => 'suma', 'ventas' => 'Y', 'compras' => 'Y', 'contribuyente' => 'Y', 'estado' => true],
125
+        ['tipocomprobante' => '33', 'descripcion' => 'NOTA DE DÉBITO ELECTRÓNICA', 'clasemovimiento' => 'suma', 'ventas' => 'Y', 'compras' => 'Y', 'contribuyente' => 'N', 'estado' => true],
126
+        ['tipocomprobante' => '34', 'descripcion' => 'NOTA DE CRÉDITO ELECTRÓNICA', 'clasemovimiento' => 'resta', 'ventas' => 'Y', 'compras' => 'Y', 'contribuyente' => 'N', 'estado' => true],
127
+        ['tipocomprobante' => '41', 'descripcion' => 'COMPROBANTE ELECTRÓNICO DE COMPRAS', 'clasemovimiento' => 'suma', 'ventas' => 'N', 'compras' => 'Y', 'contribuyente' => 'Y', 'estado' => true],
128
+        ['tipocomprobante' => '43', 'descripcion' => 'COMPROBANTE ELECTRÓNICO PARA GASTOS MENORES', 'clasemovimiento' => 'suma', 'ventas' => 'N', 'compras' => 'Y', 'contribuyente' => 'N', 'estado' => true],
129
+        ['tipocomprobante' => '44', 'descripcion' => 'COMPROBANTE ELECTRÓNICO PARA REGÍMENES ESPECIALES', 'clasemovimiento' => 'suma', 'ventas' => 'Y', 'compras' => 'Y', 'contribuyente' => 'Y', 'estado' => true],
130
+        ['tipocomprobante' => '45', 'descripcion' => 'COMPROBANTE ELECTRÓNICO GUBERNAMENTAL', 'clasemovimiento' => 'suma', 'ventas' => 'Y', 'compras' => 'Y', 'contribuyente' => 'Y', 'estado' => true],
131
+        ['tipocomprobante' => '46', 'descripcion' => 'COMPROBANTE ELECTRÓNICO PARA EXPORTACIONES', 'clasemovimiento' => 'suma', 'ventas' => 'Y', 'compras' => 'Y', 'contribuyente' => 'Y', 'estado' => true],
132
+        ['tipocomprobante' => '47', 'descripcion' => 'COMPROBANTE ELECTRÓNICO PARA PAGOS AL EXTERIOR', 'clasemovimiento' => 'suma', 'ventas' => 'N', 'compras' => 'Y', 'contribuyente' => 'Y', 'estado' => true],
133 133
     );
134 134
     
135 135
     /**
@@ -168,27 +168,27 @@  discard block
 block discarded – undo
168 168
         parent::install();
169 169
         $sql = "INSERT INTO rd_ncftipo (".
170 170
             "tipocomprobante, descripcion, estado, clasemovimiento, ventas, compras, contribuyente".
171
-            " ) VALUES " .
172
-            "('01','FACTURA DE CREDITO FISCAL',true, 'suma','Y','Y','Y')," .
173
-            "('02','FACTURA DE CONSUMO',true, 'suma','Y','Y','Y')," .
174
-            "('03','NOTA DE DEBITO',true, 'suma','Y','Y','N')," .
175
-            "('04','NOTA DE CREDITO',true, 'resta','Y','Y','N')," .
176
-            "('11','COMPROBANTE DE COMPRAS',true, 'suma','N','Y','Y')," .
177
-            "('12','REGISTRO UNICO DE INGRESOS',true, 'suma','Y','N','N')," .
178
-            "('13','COMPROBANTE PARA GASTOS MENORES',true, 'suma','N','Y','N')," .
179
-            "('14','COMPROBANTE DE REGIMENES ESPECIALES',true, 'suma','Y','Y','Y')," .
180
-            "('15','COMPROBANTE GUBERNAMENTAL',true, 'suma','Y','Y','Y')," .
181
-            "('16','COMPROBANTE PARA EXPORTACIONES',true, 'suma','Y','N','Y')," .
182
-            "('17','COMPROBANTE PARA PAGOS AL EXTERIOR',true, 'suma','N', 'Y','Y')," .
183
-            "('31','FACTURA DE CRÉDITO FISCAL ELECTRÓNICA',true,'suma','Y','Y','Y')," .
184
-            "('32','FACTURA DE CONSUMO ELECTRÓNICA',true,'suma','Y','Y','Y')," .
185
-            "('33','NOTA DE DÉBITO ELECTRÓNICA',true,'suma','Y','Y','N')," .
186
-            "('34','NOTA DE CRÉDITO ELECTRÓNICA',true,'resta','Y','Y','N')," .
187
-            "('41','COMPROBANTE ELECTRÓNICO DE COMPRAS',true,'suma','N','Y','Y')," .
188
-            "('43','COMPROBANTE ELECTRÓNICO PARA GASTOS MENORES',true,'suma','N','Y','N')," .
189
-            "('44','COMPROBANTE ELECTRÓNICO PARA REGÍMENES ESPECIALES',true,'suma','Y','Y','Y')," .
190
-            "('45','COMPROBANTE ELECTRÓNICO GUBERNAMENTAL',true,'suma','Y','Y','Y')," .
191
-            "('46','COMPROBANTE ELECTRÓNICO PARA EXPORTACIONES',true,'suma','Y','Y','Y')," .
171
+            " ) VALUES ".
172
+            "('01','FACTURA DE CREDITO FISCAL',true, 'suma','Y','Y','Y'),".
173
+            "('02','FACTURA DE CONSUMO',true, 'suma','Y','Y','Y'),".
174
+            "('03','NOTA DE DEBITO',true, 'suma','Y','Y','N'),".
175
+            "('04','NOTA DE CREDITO',true, 'resta','Y','Y','N'),".
176
+            "('11','COMPROBANTE DE COMPRAS',true, 'suma','N','Y','Y'),".
177
+            "('12','REGISTRO UNICO DE INGRESOS',true, 'suma','Y','N','N'),".
178
+            "('13','COMPROBANTE PARA GASTOS MENORES',true, 'suma','N','Y','N'),".
179
+            "('14','COMPROBANTE DE REGIMENES ESPECIALES',true, 'suma','Y','Y','Y'),".
180
+            "('15','COMPROBANTE GUBERNAMENTAL',true, 'suma','Y','Y','Y'),".
181
+            "('16','COMPROBANTE PARA EXPORTACIONES',true, 'suma','Y','N','Y'),".
182
+            "('17','COMPROBANTE PARA PAGOS AL EXTERIOR',true, 'suma','N', 'Y','Y'),".
183
+            "('31','FACTURA DE CRÉDITO FISCAL ELECTRÓNICA',true,'suma','Y','Y','Y'),".
184
+            "('32','FACTURA DE CONSUMO ELECTRÓNICA',true,'suma','Y','Y','Y'),".
185
+            "('33','NOTA DE DÉBITO ELECTRÓNICA',true,'suma','Y','Y','N'),".
186
+            "('34','NOTA DE CRÉDITO ELECTRÓNICA',true,'resta','Y','Y','N'),".
187
+            "('41','COMPROBANTE ELECTRÓNICO DE COMPRAS',true,'suma','N','Y','Y'),".
188
+            "('43','COMPROBANTE ELECTRÓNICO PARA GASTOS MENORES',true,'suma','N','Y','N'),".
189
+            "('44','COMPROBANTE ELECTRÓNICO PARA REGÍMENES ESPECIALES',true,'suma','Y','Y','Y'),".
190
+            "('45','COMPROBANTE ELECTRÓNICO GUBERNAMENTAL',true,'suma','Y','Y','Y'),".
191
+            "('46','COMPROBANTE ELECTRÓNICO PARA EXPORTACIONES',true,'suma','Y','Y','Y'),".
192 192
             "('47','COMPROBANTE ELECTRÓNICO PARA PAGOS AL EXTERIOR',true,'suma','N','Y','Y');";
193 193
         return($sql);
194 194
     }
@@ -196,7 +196,7 @@  discard block
 block discarded – undo
196 196
     public function restoreData()
197 197
     {
198 198
         $dataBase = new DataBase();
199
-        $sqlClean = "DELETE FROM " . $this->tableName() . ";";
199
+        $sqlClean = "DELETE FROM ".$this->tableName().";";
200 200
         $dataBase->exec($sqlClean);
201 201
         foreach ($this->arrayComprobantes as $arrayItem) {
202 202
             $initialData = new NCFTipo($arrayItem);
@@ -207,7 +207,7 @@  discard block
 block discarded – undo
207 207
 
208 208
     public function allFor($type = "ventas", $movimiento = "suma")
209 209
     {
210
-        $where = [new DataBaseWhere($type, 'Y'),new DataBaseWhere('clasemovimiento', $movimiento)];
210
+        $where = [new DataBaseWhere($type, 'Y'), new DataBaseWhere('clasemovimiento', $movimiento)];
211 211
         return $this->all($where, ['tipocomprobante' => 'ASC'], 0, 50);
212 212
     }
213 213
 
Please login to merge, or discard this patch.
Init.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
         $this->loadExtension(new Extension\Controller\EditProducto());
65 65
         $this->loadExtension(new Extension\Controller\EditSettings());
66 66
 
67
-        AssetManager::add('js', \FS_ROUTE . '/Plugins/fsRepublicaDominicana/Assets/JS/CommonDomFunctions.js');
67
+        AssetManager::add('js', \FS_ROUTE.'/Plugins/fsRepublicaDominicana/Assets/JS/CommonDomFunctions.js');
68 68
         SalesLineHTML::addMod(new Mod\SalesLineMod());
69 69
         SalesFooterHTML::addMod(new Mod\SalesFooterMod());
70 70
         PurchasesFooterHTML::addMod(new Mod\PurchasesFooterMod());
@@ -145,22 +145,22 @@  discard block
 block discarded – undo
145 145
     private function actualizarECF(): void
146 146
     {
147 147
         $arrayECF = [
148
-            ['tipocomprobante' => '31', 'descripcion' => 'FACTURA DE CRÉDITO FISCAL ELECTRÓNICA', 'clasemovimiento'=> 'suma', 'ventas' => 'Y', 'compras' => 'Y', 'contribuyente' => 'Y', 'estado' => true ],
149
-            ['tipocomprobante' => '32', 'descripcion' => 'FACTURA DE CONSUMO ELECTRÓNICA', 'clasemovimiento'=> 'suma', 'ventas' => 'Y', 'compras' => 'Y', 'contribuyente' => 'Y', 'estado' => true ],
150
-            ['tipocomprobante' => '33', 'descripcion' => 'NOTA DE DÉBITO ELECTRÓNICA', 'clasemovimiento'=> 'suma', 'ventas' => 'Y', 'compras' => 'Y', 'contribuyente' => 'N', 'estado' => true ],
151
-            ['tipocomprobante' => '34', 'descripcion' => 'NOTA DE CRÉDITO ELECTRÓNICA', 'clasemovimiento'=> 'resta', 'ventas' => 'Y', 'compras' => 'Y', 'contribuyente' => 'N', 'estado' => true ],
152
-            ['tipocomprobante' => '41', 'descripcion' => 'COMPROBANTE ELECTRÓNICO DE COMPRAS', 'clasemovimiento'=> 'suma', 'ventas' => 'N', 'compras' => 'Y', 'contribuyente' => 'Y', 'estado' => true ],
153
-            ['tipocomprobante' => '43', 'descripcion' => 'COMPROBANTE ELECTRÓNICO PARA GASTOS MENORES', 'clasemovimiento'=> 'suma', 'ventas' => 'N', 'compras' => 'Y', 'contribuyente' => 'N', 'estado' => true ],
154
-            ['tipocomprobante' => '44', 'descripcion' => 'COMPROBANTE ELECTRÓNICO PARA REGÍMENES ESPECIALES', 'clasemovimiento'=> 'suma', 'ventas' => 'Y', 'compras' => 'Y', 'contribuyente' => 'Y', 'estado' => true ],
155
-            ['tipocomprobante' => '45', 'descripcion' => 'COMPROBANTE ELECTRÓNICO GUBERNAMENTAL', 'clasemovimiento'=> 'suma', 'ventas' => 'Y', 'compras' => 'Y', 'contribuyente' => 'Y', 'estado' => true ],
156
-            ['tipocomprobante' => '46', 'descripcion' => 'COMPROBANTE ELECTRÓNICO PARA EXPORTACIONES', 'clasemovimiento'=> 'suma', 'ventas' => 'Y', 'compras' => 'Y', 'contribuyente' => 'Y', 'estado' => true ],
157
-            ['tipocomprobante' => '47', 'descripcion' => 'COMPROBANTE ELECTRÓNICO PARA PAGOS AL EXTERIOR', 'clasemovimiento'=> 'suma', 'ventas' => 'N', 'compras' => 'Y', 'contribuyente' => 'Y', 'estado' => true ],
148
+            ['tipocomprobante' => '31', 'descripcion' => 'FACTURA DE CRÉDITO FISCAL ELECTRÓNICA', 'clasemovimiento'=> 'suma', 'ventas' => 'Y', 'compras' => 'Y', 'contribuyente' => 'Y', 'estado' => true],
149
+            ['tipocomprobante' => '32', 'descripcion' => 'FACTURA DE CONSUMO ELECTRÓNICA', 'clasemovimiento'=> 'suma', 'ventas' => 'Y', 'compras' => 'Y', 'contribuyente' => 'Y', 'estado' => true],
150
+            ['tipocomprobante' => '33', 'descripcion' => 'NOTA DE DÉBITO ELECTRÓNICA', 'clasemovimiento'=> 'suma', 'ventas' => 'Y', 'compras' => 'Y', 'contribuyente' => 'N', 'estado' => true],
151
+            ['tipocomprobante' => '34', 'descripcion' => 'NOTA DE CRÉDITO ELECTRÓNICA', 'clasemovimiento'=> 'resta', 'ventas' => 'Y', 'compras' => 'Y', 'contribuyente' => 'N', 'estado' => true],
152
+            ['tipocomprobante' => '41', 'descripcion' => 'COMPROBANTE ELECTRÓNICO DE COMPRAS', 'clasemovimiento'=> 'suma', 'ventas' => 'N', 'compras' => 'Y', 'contribuyente' => 'Y', 'estado' => true],
153
+            ['tipocomprobante' => '43', 'descripcion' => 'COMPROBANTE ELECTRÓNICO PARA GASTOS MENORES', 'clasemovimiento'=> 'suma', 'ventas' => 'N', 'compras' => 'Y', 'contribuyente' => 'N', 'estado' => true],
154
+            ['tipocomprobante' => '44', 'descripcion' => 'COMPROBANTE ELECTRÓNICO PARA REGÍMENES ESPECIALES', 'clasemovimiento'=> 'suma', 'ventas' => 'Y', 'compras' => 'Y', 'contribuyente' => 'Y', 'estado' => true],
155
+            ['tipocomprobante' => '45', 'descripcion' => 'COMPROBANTE ELECTRÓNICO GUBERNAMENTAL', 'clasemovimiento'=> 'suma', 'ventas' => 'Y', 'compras' => 'Y', 'contribuyente' => 'Y', 'estado' => true],
156
+            ['tipocomprobante' => '46', 'descripcion' => 'COMPROBANTE ELECTRÓNICO PARA EXPORTACIONES', 'clasemovimiento'=> 'suma', 'ventas' => 'Y', 'compras' => 'Y', 'contribuyente' => 'Y', 'estado' => true],
157
+            ['tipocomprobante' => '47', 'descripcion' => 'COMPROBANTE ELECTRÓNICO PARA PAGOS AL EXTERIOR', 'clasemovimiento'=> 'suma', 'ventas' => 'N', 'compras' => 'Y', 'contribuyente' => 'Y', 'estado' => true],
158 158
         ];
159 159
 
160 160
         $tipoComprobantes = new NCFTipo();
161 161
         foreach ($arrayECF as $ecf) {
162 162
             $registro = $tipoComprobantes->get($ecf['tipocomprobante']);
163
-            if($registro === false) {
163
+            if ($registro === false) {
164 164
                 $registro = new NCFTipo();
165 165
                 $registro->tipocomprobante = $ecf['tipocomprobante'];
166 166
                 $registro->descripcion = $ecf['descripcion'];
Please login to merge, or discard this patch.