@@ -31,21 +31,21 @@ discard block |
||
| 31 | 31 | |
| 32 | 32 | class PurchasesFooterMod implements PurchasesModInterface |
| 33 | 33 | { |
| 34 | - public function apply(PurchaseDocument &$model, array $formData): void |
|
| 34 | + public function apply(PurchaseDocument & $model, array $formData): void |
|
| 35 | 35 | { |
| 36 | 36 | } |
| 37 | 37 | |
| 38 | - public function applyBefore(PurchaseDocument &$model, array $formData): void |
|
| 38 | + public function applyBefore(PurchaseDocument & $model, array $formData): void |
|
| 39 | 39 | { |
| 40 | 40 | if ($model->modelClassName() === 'FacturaProveedor') { |
| 41 | - $model->numeroncf = isset($formData['numeroncf']) ? (string)$formData['numeroncf'] : $model->numeroncf; |
|
| 42 | - $model->tipocomprobante = isset($formData['tipocomprobante']) ? (string)$formData['tipocomprobante'] : $model->tipocomprobante; |
|
| 43 | - $model->ncffechavencimiento = isset($formData['ncffechavencimiento']) ? (string)$formData['ncffechavencimiento'] : $model->ncffechavencimiento; |
|
| 44 | - $model->ncftipopago = isset($formData['ncftipopago']) ? (string)$formData['ncftipopago'] : $model->ncftipopago; |
|
| 45 | - $model->ncftipomovimiento = isset($formData['ncftipomovimiento']) ? (string)$formData['ncftipomovimiento'] : $model->ncftipomovimiento; |
|
| 46 | - $model->ncftipoanulacion = isset($formData['ncftipoanulacion']) ? (string)$formData['ncftipoanulacion'] : $model->ncftipoanulacion; |
|
| 47 | - $model->ecf_fecha_firma = isset($formData['ecf_fecha_firma']) ? (string)$formData['ecf_fecha_firma'] : $model->ecf_fecha_firma; |
|
| 48 | - $model->ecf_codigo_seguridad = isset($formData['ecf_codigo_seguridad']) ? (string)$formData['ecf_codigo_seguridad'] : $model->ecf_codigo_seguridad; |
|
| 41 | + $model->numeroncf = isset($formData['numeroncf']) ? (string) $formData['numeroncf'] : $model->numeroncf; |
|
| 42 | + $model->tipocomprobante = isset($formData['tipocomprobante']) ? (string) $formData['tipocomprobante'] : $model->tipocomprobante; |
|
| 43 | + $model->ncffechavencimiento = isset($formData['ncffechavencimiento']) ? (string) $formData['ncffechavencimiento'] : $model->ncffechavencimiento; |
|
| 44 | + $model->ncftipopago = isset($formData['ncftipopago']) ? (string) $formData['ncftipopago'] : $model->ncftipopago; |
|
| 45 | + $model->ncftipomovimiento = isset($formData['ncftipomovimiento']) ? (string) $formData['ncftipomovimiento'] : $model->ncftipomovimiento; |
|
| 46 | + $model->ncftipoanulacion = isset($formData['ncftipoanulacion']) ? (string) $formData['ncftipoanulacion'] : $model->ncftipoanulacion; |
|
| 47 | + $model->ecf_fecha_firma = isset($formData['ecf_fecha_firma']) ? (string) $formData['ecf_fecha_firma'] : $model->ecf_fecha_firma; |
|
| 48 | + $model->ecf_codigo_seguridad = isset($formData['ecf_codigo_seguridad']) ? (string) $formData['ecf_codigo_seguridad'] : $model->ecf_codigo_seguridad; |
|
| 49 | 49 | } |
| 50 | 50 | } |
| 51 | 51 | |
@@ -55,12 +55,12 @@ discard block |
||
| 55 | 55 | |
| 56 | 56 | public function newBtnFields(): array |
| 57 | 57 | { |
| 58 | - return ['btnLoadXmlEcf','btnLoadXmlAck','btnLoadPdfEcf']; |
|
| 58 | + return ['btnLoadXmlEcf', 'btnLoadXmlAck', 'btnLoadPdfEcf']; |
|
| 59 | 59 | } |
| 60 | 60 | |
| 61 | 61 | public function newFields(): array |
| 62 | 62 | { |
| 63 | - return ['numeroncf', 'tipocomprobante', 'ncffechavencimiento', 'ncftipopago', 'ncftipomovimiento', 'ncftipoanulacion', 'ecf_xml_firmado','ecf_fecha_firma','ecf_codigo_seguridad']; |
|
| 63 | + return ['numeroncf', 'tipocomprobante', 'ncffechavencimiento', 'ncftipopago', 'ncftipomovimiento', 'ncftipoanulacion', 'ecf_xml_firmado', 'ecf_fecha_firma', 'ecf_codigo_seguridad']; |
|
| 64 | 64 | } |
| 65 | 65 | |
| 66 | 66 | public function newModalFields(): array |
@@ -143,15 +143,14 @@ discard block |
||
| 143 | 143 | $options = ['<option value="">------</option>']; |
| 144 | 144 | foreach ($tipoComprobante as $row) { |
| 145 | 145 | $options[] = ($row->tipocomprobante === $invoiceTipoComprobante) ? |
| 146 | - '<option value="' . $row->tipocomprobante . '" selected="">' . $row->descripcion . '</option>' : |
|
| 147 | - '<option value="' . $row->tipocomprobante . '">' . $row->descripcion . '</option>'; |
|
| 146 | + '<option value="'.$row->tipocomprobante.'" selected="">'.$row->descripcion.'</option>' : '<option value="'.$row->tipocomprobante.'">'.$row->descripcion.'</option>'; |
|
| 148 | 147 | } |
| 149 | 148 | |
| 150 | 149 | $attributes = ($model->editable || $model->numeroncf === '') ? 'name="tipocomprobante" required=""' : 'disabled=""'; |
| 151 | 150 | return '<div class="col-sm-3">' |
| 152 | 151 | . '<div class="mb-3">' |
| 153 | 152 | . $i18n->trans('tipocomprobante') |
| 154 | - . '<select ' . $attributes . ' class="form-select">' . implode('', $options) . '</select>' |
|
| 153 | + . '<select '.$attributes.' class="form-select">'.implode('', $options).'</select>' |
|
| 155 | 154 | . '</div>' |
| 156 | 155 | . '</div>'; |
| 157 | 156 | } |
@@ -175,15 +174,14 @@ discard block |
||
| 175 | 174 | $options = ['<option value="">------</option>']; |
| 176 | 175 | foreach ($tipoPago as $row) { |
| 177 | 176 | $options[] = ($row->codigo === $invoiceTipoPago) ? |
| 178 | - '<option value="' . $row->codigo . '" selected="">' . $row->descripcion . '</option>' : |
|
| 179 | - '<option value="' . $row->codigo . '">' . $row->descripcion . '</option>'; |
|
| 177 | + '<option value="'.$row->codigo.'" selected="">'.$row->descripcion.'</option>' : '<option value="'.$row->codigo.'">'.$row->descripcion.'</option>'; |
|
| 180 | 178 | } |
| 181 | 179 | |
| 182 | 180 | $attributes = $model->editable ? 'name="ncftipopago" required=""' : 'disabled=""'; |
| 183 | 181 | return '<div class="col-sm-2">' |
| 184 | 182 | . '<div class="mb-3">' |
| 185 | 183 | . $i18n->trans('ncf-payment-type') |
| 186 | - . '<select ' . $attributes . ' class="form-select">' . implode('', $options) . '</select>' |
|
| 184 | + . '<select '.$attributes.' class="form-select">'.implode('', $options).'</select>' |
|
| 187 | 185 | . '</div>' |
| 188 | 186 | . '</div>'; |
| 189 | 187 | } |
@@ -201,15 +199,14 @@ discard block |
||
| 201 | 199 | $options = ['<option value="">------</option>']; |
| 202 | 200 | foreach ($tipoMovimiento as $row) { |
| 203 | 201 | $options[] = ($row->codigo === $invoiceTipoMovimiento) ? |
| 204 | - '<option value="' . $row->codigo . '" selected="">' . $row->descripcion . '</option>' : |
|
| 205 | - '<option value="' . $row->codigo . '">' . $row->descripcion . '</option>'; |
|
| 202 | + '<option value="'.$row->codigo.'" selected="">'.$row->descripcion.'</option>' : '<option value="'.$row->codigo.'">'.$row->descripcion.'</option>'; |
|
| 206 | 203 | } |
| 207 | 204 | |
| 208 | 205 | $attributes = $model->editable ? 'name="ncftipomovimiento" required=""' : 'disabled=""'; |
| 209 | 206 | return '<div class="col-sm-3">' |
| 210 | 207 | . '<div class="mb-3">' |
| 211 | 208 | . $i18n->trans('ncf-movement-type') |
| 212 | - . '<select ' . $attributes . ' class="form-select">' . implode('', $options) . '</select>' |
|
| 209 | + . '<select '.$attributes.' class="form-select">'.implode('', $options).'</select>' |
|
| 213 | 210 | . '</div>' |
| 214 | 211 | . '</div>'; |
| 215 | 212 | } |
@@ -227,15 +224,14 @@ discard block |
||
| 227 | 224 | $options = ['<option value="">------</option>']; |
| 228 | 225 | foreach ($tipoAnulacion as $row) { |
| 229 | 226 | $options[] = ($row->codigo === $invoiceTipoAnulacion) ? |
| 230 | - '<option value="' . $row->codigo . '" selected="">' . $row->descripcion . '</option>' : |
|
| 231 | - '<option value="' . $row->codigo . '">' . $row->descripcion . '</option>'; |
|
| 227 | + '<option value="'.$row->codigo.'" selected="">'.$row->descripcion.'</option>' : '<option value="'.$row->codigo.'">'.$row->descripcion.'</option>'; |
|
| 232 | 228 | } |
| 233 | 229 | |
| 234 | 230 | $attributes = $model->editable ? 'name="ncftipoanulacion"' : 'name="ncftipoanulacion" readonly=""'; |
| 235 | 231 | return '<div class="col-sm-2">' |
| 236 | 232 | . '<div class="mb-3">' |
| 237 | 233 | . $i18n->trans('ncf-cancellation-type') |
| 238 | - . '<select ' . $attributes . ' class="form-select">' . implode('', $options) . '</select>' |
|
| 234 | + . '<select '.$attributes.' class="form-select">'.implode('', $options).'</select>' |
|
| 239 | 235 | . '</div>' |
| 240 | 236 | . '</div>'; |
| 241 | 237 | } |
@@ -247,9 +243,9 @@ discard block |
||
| 247 | 243 | ? date('Y-m-d', strtotime($model->ncffechavencimiento)) |
| 248 | 244 | : ''; |
| 249 | 245 | return '<div class="col-sm-2">' |
| 250 | - . '<div class="mb-3">' . $i18n->trans('due-date') |
|
| 251 | - . '<input type="date" ' . $attributes . ' value="' |
|
| 252 | - . $ncfFechaVencimiento . '" class="form-control"/>' |
|
| 246 | + . '<div class="mb-3">'.$i18n->trans('due-date') |
|
| 247 | + . '<input type="date" '.$attributes.' value="' |
|
| 248 | + . $ncfFechaVencimiento.'" class="form-control"/>' |
|
| 253 | 249 | . '</div>' |
| 254 | 250 | . '</div>'; |
| 255 | 251 | } |
@@ -262,10 +258,10 @@ discard block |
||
| 262 | 258 | . '<div class="mb-3">' |
| 263 | 259 | . $i18n->trans('desc-numeroncf-purchases') |
| 264 | 260 | . '<div class="input-group">' |
| 265 | - . '<input type="text" ' . $attributes . ' value="' . $model->numeroncf . '" class="form-control"/>' |
|
| 266 | - . '<button class="btn ' . $btnColor . ' btn-spin-action" id="btnVerifyNCF"' |
|
| 261 | + . '<input type="text" '.$attributes.' value="'.$model->numeroncf.'" class="form-control"/>' |
|
| 262 | + . '<button class="btn '.$btnColor.' btn-spin-action" id="btnVerifyNCF"' |
|
| 267 | 263 | . 'onclick="purchasesNCFVerify()" ' |
| 268 | - . 'title="' . $i18n->trans('verify-numproveedor') |
|
| 264 | + . 'title="'.$i18n->trans('verify-numproveedor') |
|
| 269 | 265 | . '" type="button">' |
| 270 | 266 | . '<i id="iconBtnVerify" class="fa-solid fa-search fa-fw"></i>' |
| 271 | 267 | . '</button>' |
@@ -282,7 +278,7 @@ discard block |
||
| 282 | 278 | . '<div class="mb-4">' |
| 283 | 279 | . $i18n->trans('desc-ecf_fecha_firma') |
| 284 | 280 | . '<div class="input-group">' |
| 285 | - . '<input type="datetime-local" ' . $attributes . ' value="' . $model->ecf_fecha_firma . '" class="form-control"/>' |
|
| 281 | + . '<input type="datetime-local" '.$attributes.' value="'.$model->ecf_fecha_firma.'" class="form-control"/>' |
|
| 286 | 282 | . '</div>' |
| 287 | 283 | . '</div>' |
| 288 | 284 | . '</div>'; |
@@ -296,7 +292,7 @@ discard block |
||
| 296 | 292 | . '<div class="mb-4">' |
| 297 | 293 | . $i18n->trans('desc-ecf_codigo_seguridad') |
| 298 | 294 | . '<div class="input-group">' |
| 299 | - . '<input type="text" ' . $attributes . ' value="' . $model->ecf_codigo_seguridad . '" class="form-control"/>' |
|
| 295 | + . '<input type="text" '.$attributes.' value="'.$model->ecf_codigo_seguridad.'" class="form-control"/>' |
|
| 300 | 296 | . '</div>' |
| 301 | 297 | . '</div>' |
| 302 | 298 | . '</div>'; |
@@ -66,7 +66,7 @@ |
||
| 66 | 66 | $this->loadExtension(new Extension\Controller\EditSettings()); |
| 67 | 67 | |
| 68 | 68 | $route = Tools::config('route'); |
| 69 | - AssetManager::addJs($route . '/Plugins/fsRepublicaDominicana/Assets/JS/CommonDomFunctions.js'); |
|
| 69 | + AssetManager::addJs($route.'/Plugins/fsRepublicaDominicana/Assets/JS/CommonDomFunctions.js'); |
|
| 70 | 70 | |
| 71 | 71 | SalesLineHTML::addMod(new Mod\SalesLineMod()); |
| 72 | 72 | SalesFooterHTML::addMod(new Mod\SalesFooterMod()); |
@@ -27,7 +27,7 @@ discard block |
||
| 27 | 27 | protected function insertBusinessDocHeader($model): void |
| 28 | 28 | { |
| 29 | 29 | $headerData = [ |
| 30 | - 'title' => $this->i18n->trans($model->modelClassName() . '-min'), |
|
| 30 | + 'title' => $this->i18n->trans($model->modelClassName().'-min'), |
|
| 31 | 31 | 'subject' => $this->i18n->trans('customer'), |
| 32 | 32 | 'fieldName' => 'nombrecliente' |
| 33 | 33 | ]; |
@@ -41,7 +41,7 @@ discard block |
||
| 41 | 41 | $headerData['title'] = Tools::fixHtml($this->format->titulo); |
| 42 | 42 | } |
| 43 | 43 | |
| 44 | - $this->pdf->ezText("\n" . $headerData['title'] . ': ' . $model->numeroncf . "\n", self::FONT_SIZE + 6); |
|
| 44 | + $this->pdf->ezText("\n".$headerData['title'].': '.$model->numeroncf."\n", self::FONT_SIZE + 6); |
|
| 45 | 45 | $this->newLine(); |
| 46 | 46 | |
| 47 | 47 | $subject = $model->getSubject(); |
@@ -41,7 +41,7 @@ discard block |
||
| 41 | 41 | // TODO: Implement addInvoiceHeader() method. |
| 42 | 42 | $html = $this->getInvoiceHeaderBilling($model) |
| 43 | 43 | . $this->getInvoiceHeaderShipping($model); |
| 44 | - $this->writeHTML('<table class="table-big table-border"><tr>' . $html . '</tr></table><br/>'); |
|
| 44 | + $this->writeHTML('<table class="table-big table-border"><tr>'.$html.'</tr></table><br/>'); |
|
| 45 | 45 | } |
| 46 | 46 | |
| 47 | 47 | public function addInvoiceLines($model): void |
@@ -51,7 +51,7 @@ discard block |
||
| 51 | 51 | |
| 52 | 52 | $tHead = '<thead><tr>'; |
| 53 | 53 | foreach ($this->getInvoiceLineFields() as $field) { |
| 54 | - $tHead .= '<th class="' . $field['css'] . '" align="' . $field['align'] . '">' . $field['title'] . '</th>'; |
|
| 54 | + $tHead .= '<th class="'.$field['css'].'" align="'.$field['align'].'">'.$field['title'].'</th>'; |
|
| 55 | 55 | } |
| 56 | 56 | $tHead .= '</tr></thead>'; |
| 57 | 57 | |
@@ -63,20 +63,20 @@ discard block |
||
| 63 | 63 | $line->numlinea = $numLinea; |
| 64 | 64 | $tBody .= '<tr>'; |
| 65 | 65 | foreach ($this->getInvoiceLineFields() as $field) { |
| 66 | - $tBody .= '<td class="' . $field['css'] . '" align="' . $field['align'] . '" valign="top">' . $this->getInvoiceLineValue($model, $line, $field) . '</td>'; |
|
| 66 | + $tBody .= '<td class="'.$field['css'].'" align="'.$field['align'].'" valign="top">'.$this->getInvoiceLineValue($model, $line, $field).'</td>'; |
|
| 67 | 67 | } |
| 68 | 68 | $tBody .= '</tr>'; |
| 69 | 69 | $numLinea++; |
| 70 | 70 | |
| 71 | 71 | if (property_exists($line, 'salto_pagina') && $line->salto_pagina) { |
| 72 | - $this->writeHTML('<div class="table-lines"><table class="table-big table-list">' . $tHead . $tBody . '</table></div>'); |
|
| 72 | + $this->writeHTML('<div class="table-lines"><table class="table-big table-list">'.$tHead.$tBody.'</table></div>'); |
|
| 73 | 73 | $this->writeHTML($this->getInvoiceTotalsPartial($model, $tLines, 'mt-20')); |
| 74 | 74 | $this->mpdf->AddPage(); |
| 75 | 75 | $tBody = ''; |
| 76 | 76 | } |
| 77 | 77 | } |
| 78 | 78 | |
| 79 | - $this->writeHTML('<div class="table-lines"><table class="table-big table-list">' . $tHead . $tBody . '</table></div>'); |
|
| 79 | + $this->writeHTML('<div class="table-lines"><table class="table-big table-list">'.$tHead.$tBody.'</table></div>'); |
|
| 80 | 80 | |
| 81 | 81 | // clonamos el documento y añadimos los totales para ver si salta de página |
| 82 | 82 | $copier = new DeepCopy(); |
@@ -95,28 +95,28 @@ discard block |
||
| 95 | 95 | protected function css(): string |
| 96 | 96 | { |
| 97 | 97 | return parent::css() |
| 98 | - . '.title {border-bottom: 2px solid ' . $this->get('color1') . ';}' |
|
| 99 | - . '.table-border {border-top: 1px solid ' . $this->get('color1') . '; border-bottom: 1px solid ' . $this->get('color1') . ';}' |
|
| 100 | - . '.table-dual {border-top: 1px solid ' . $this->get('color1') . '; border-bottom: 1px solid ' . $this->get('color1') . ';}' |
|
| 101 | - . '.table-list {border-spacing: 0px; border-top: 1px solid ' . $this->get('color1') . '; border-bottom: 1px solid ' . $this->get('color1') . ';}' |
|
| 102 | - . '.table-list tr:nth-child(even) {background-color: ' . $this->get('color3') . ';}' |
|
| 103 | - . '.table-list th {background-color: ' . $this->get('color1') . '; color: ' . $this->get('color2') . '; padding: 5px; text-transform: uppercase;}' |
|
| 98 | + . '.title {border-bottom: 2px solid '.$this->get('color1').';}' |
|
| 99 | + . '.table-border {border-top: 1px solid '.$this->get('color1').'; border-bottom: 1px solid '.$this->get('color1').';}' |
|
| 100 | + . '.table-dual {border-top: 1px solid '.$this->get('color1').'; border-bottom: 1px solid '.$this->get('color1').';}' |
|
| 101 | + . '.table-list {border-spacing: 0px; border-top: 1px solid '.$this->get('color1').'; border-bottom: 1px solid '.$this->get('color1').';}' |
|
| 102 | + . '.table-list tr:nth-child(even) {background-color: '.$this->get('color3').';}' |
|
| 103 | + . '.table-list th {background-color: '.$this->get('color1').'; color: '.$this->get('color2').'; padding: 5px; text-transform: uppercase;}' |
|
| 104 | 104 | . '.table-list td {padding: 5px;}' |
| 105 | 105 | . '.thanks-title {' |
| 106 | - . 'font-size: ' . $this->get('titlefontsize') . 'px; font-weight: bold; color: ' . $this->get('color1') . '; ' |
|
| 107 | - . 'text-align: right; width: 50%; padding: 15px; border-end: 1px solid ' . $this->get('color1') . ';' |
|
| 106 | + . 'font-size: '.$this->get('titlefontsize').'px; font-weight: bold; color: '.$this->get('color1').'; ' |
|
| 107 | + . 'text-align: right; width: 50%; padding: 15px; border-end: 1px solid '.$this->get('color1').';' |
|
| 108 | 108 | . '}' |
| 109 | 109 | . '.color-navy {color: navy;}' |
| 110 | 110 | . '.color-blue {color: blue;}' |
| 111 | - . '.color-template {color: ' . $this->get('color1') .';}' |
|
| 111 | + . '.color-template {color: '.$this->get('color1').';}' |
|
| 112 | 112 | . '.thanks-text {padding: 15px;}' |
| 113 | - . '.imagetext {margin-top: 15px; text-align: ' . $this->get('endalign') . ';}' |
|
| 114 | - . '.imagefooter {text-align: ' . $this->get('footeralign') . ';}'; |
|
| 113 | + . '.imagetext {margin-top: 15px; text-align: '.$this->get('endalign').';}' |
|
| 114 | + . '.imagefooter {text-align: '.$this->get('footeralign').';}'; |
|
| 115 | 115 | } |
| 116 | 116 | |
| 117 | 117 | protected function getSubjectIdFiscalStr($model): string |
| 118 | 118 | { |
| 119 | - return empty($model->cifnif) ? '' : '<b>' . $model->getSubject()->tipoidfiscal . '</b>: ' . $model->cifnif; |
|
| 119 | + return empty($model->cifnif) ? '' : '<b>'.$model->getSubject()->tipoidfiscal.'</b>: '.$model->cifnif; |
|
| 120 | 120 | } |
| 121 | 121 | |
| 122 | 122 | protected function getInvoiceHeaderBilling($model): string |
@@ -128,13 +128,13 @@ discard block |
||
| 128 | 128 | $subject = $model->getSubject(); |
| 129 | 129 | $address = isset($model->codproveedor) && !isset($model->direccion) ? $subject->getDefaultAddress() : $model; |
| 130 | 130 | $customerCode = $this->get('showcustomercode') ? $model->subjectColumnValue() : ''; |
| 131 | - $customerEmail = $this->get('showcustomeremail') && !empty($subject->email) ? '<br>' . Tools::lang()->trans('email') . ': ' . $subject->email : ''; |
|
| 131 | + $customerEmail = $this->get('showcustomeremail') && !empty($subject->email) ? '<br>'.Tools::lang()->trans('email').': '.$subject->email : ''; |
|
| 132 | 132 | $break = empty($model->cifnif) ? '' : '<br/>'; |
| 133 | 133 | return '<td align="left" valign="top">' |
| 134 | - . '<br/><b> ' . $this->getSubjectTitle($model) . ':</b> ' . $customerCode |
|
| 135 | - . $this->getSubjectName($model) . $break . $this->getSubjectIdFiscalStr($model) |
|
| 136 | - . '<br/><b>' . Tools::lang()->trans('address'). ':</b> ' .$this->combineAddress($address) . $this->getInvoiceHeaderBillingPhones($subject) |
|
| 137 | - . '<br/><b>' . Tools::lang()->trans('email'). ':</b> ' .$customerEmail |
|
| 134 | + . '<br/><b> '.$this->getSubjectTitle($model).':</b> '.$customerCode |
|
| 135 | + . $this->getSubjectName($model).$break.$this->getSubjectIdFiscalStr($model) |
|
| 136 | + . '<br/><b>'.Tools::lang()->trans('address').':</b> '.$this->combineAddress($address).$this->getInvoiceHeaderBillingPhones($subject) |
|
| 137 | + . '<br/><b>'.Tools::lang()->trans('email').':</b> '.$customerEmail |
|
| 138 | 138 | . '<br/>' |
| 139 | 139 | . '</td>'; |
| 140 | 140 | } |
@@ -154,8 +154,8 @@ discard block |
||
| 154 | 154 | return ''; |
| 155 | 155 | } |
| 156 | 156 | |
| 157 | - return '<td><b>' . Tools::lang()->trans('shipping-address') . '</b>' |
|
| 158 | - . '<br/>' . $this->combineAddress($contacto, true) . '</td>'; |
|
| 157 | + return '<td><b>'.Tools::lang()->trans('shipping-address').'</b>' |
|
| 158 | + . '<br/>'.$this->combineAddress($contacto, true).'</td>'; |
|
| 159 | 159 | } |
| 160 | 160 | |
| 161 | 161 | protected function getInvoiceHeaderBillingPhones($subject): string |
@@ -169,7 +169,7 @@ discard block |
||
| 169 | 169 | return ''; |
| 170 | 170 | } |
| 171 | 171 | |
| 172 | - return '<br/>' . $strPhones; |
|
| 172 | + return '<br/>'.$strPhones; |
|
| 173 | 173 | } |
| 174 | 174 | |
| 175 | 175 | protected function headerLeft(): string |
@@ -182,34 +182,34 @@ discard block |
||
| 182 | 182 | } |
| 183 | 183 | } |
| 184 | 184 | |
| 185 | - $title = $this->showHeaderTitle ? '<h1 class="title">' . $this->get('headertitle') . '</h1>' . $this->spacer() : ''; |
|
| 185 | + $title = $this->showHeaderTitle ? '<h1 class="title">'.$this->get('headertitle').'</h1>'.$this->spacer() : ''; |
|
| 186 | 186 | if ($this->isSketchInvoice()) { |
| 187 | - $title .= '<div class="color-red font-big font-bold">' . Tools::lang()->trans('invoice-is-sketch') . '</div>'; |
|
| 187 | + $title .= '<div class="color-red font-big font-bold">'.Tools::lang()->trans('invoice-is-sketch').'</div>'; |
|
| 188 | 188 | } |
| 189 | 189 | |
| 190 | 190 | $descTC = ($this->headerModel->tipocomprobante < 30) ? "<b>NCF:</b> " : "<b>e-NCF:</b> "; |
| 191 | - $fechaVencimiento = ($this->headerModel->ncffechavencimiento !== null) ? '<b>Fecha Vencimiento:</b> ' . $this->headerModel->ncffechavencimiento : ''; |
|
| 192 | - $fechaEmision = '<b>Fecha Emisión:</b> ' . $this->headerModel->fecha; |
|
| 191 | + $fechaVencimiento = ($this->headerModel->ncffechavencimiento !== null) ? '<b>Fecha Vencimiento:</b> '.$this->headerModel->ncffechavencimiento : ''; |
|
| 192 | + $fechaEmision = '<b>Fecha Emisión:</b> '.$this->headerModel->fecha; |
|
| 193 | 193 | |
| 194 | 194 | return '<table class="table-big">' |
| 195 | 195 | . '<tr>' |
| 196 | - . '<td valign="top"><img src="' . $this->logoPath . '" height="' . $this->get('logosize') . '"/>' . '</td>' |
|
| 197 | - . '<td align="right" valign="top">' . $title . '</td>' |
|
| 196 | + . '<td valign="top"><img src="'.$this->logoPath.'" height="'.$this->get('logosize').'"/>'.'</td>' |
|
| 197 | + . '<td align="right" valign="top">'.$title.'</td>' |
|
| 198 | 198 | . '</tr>' |
| 199 | 199 | . '<tr>' |
| 200 | 200 | . '<td align="left" valign="top">' |
| 201 | - . '<p><b>' . $this->empresa->nombre . '</b>' |
|
| 202 | - . '<br/>' . $this->empresa->tipoidfiscal . ': ' . $this->empresa->cifnif |
|
| 203 | - . '<br/>' . Tools::lang()->trans('address') . ': ' . $this->combineAddress($this->empresa) . '</p>' |
|
| 204 | - . '<p>' . implode(' · ', $contactData) . '</p>' |
|
| 201 | + . '<p><b>'.$this->empresa->nombre.'</b>' |
|
| 202 | + . '<br/>'.$this->empresa->tipoidfiscal.': '.$this->empresa->cifnif |
|
| 203 | + . '<br/>'.Tools::lang()->trans('address').': '.$this->combineAddress($this->empresa).'</p>' |
|
| 204 | + . '<p>'.implode(' · ', $contactData).'</p>' |
|
| 205 | 205 | . $fechaEmision |
| 206 | 206 | . '</td>' |
| 207 | 207 | . '<td align="right" valign="top">' |
| 208 | - . '<div class="color-template font-big font-bold">' . $this->headerModel->descripcionTipoComprobante() . '</div>' |
|
| 208 | + . '<div class="color-template font-big font-bold">'.$this->headerModel->descripcionTipoComprobante().'</div>' |
|
| 209 | 209 | . $descTC |
| 210 | - . $this->headerModel->numeroncf . '<br/>' |
|
| 211 | - . $fechaVencimiento . '<br/>' |
|
| 212 | - . '<b>' . $i18n->trans('payment-method') . ':</b> ' |
|
| 210 | + . $this->headerModel->numeroncf.'<br/>' |
|
| 211 | + . $fechaVencimiento.'<br/>' |
|
| 212 | + . '<b>'.$i18n->trans('payment-method').':</b> ' |
|
| 213 | 213 | . PaymentMethodBankDataHelper::get($this->headerModel) |
| 214 | 214 | . '</td>' |
| 215 | 215 | . '</tr>' |
@@ -224,20 +224,20 @@ discard block |
||
| 224 | 224 | } |
| 225 | 225 | } |
| 226 | 226 | |
| 227 | - $title = $this->showHeaderTitle ? '<h1 class="title">' . $this->get('headertitle') . '</h1>' . $this->spacer() : ''; |
|
| 227 | + $title = $this->showHeaderTitle ? '<h1 class="title">'.$this->get('headertitle').'</h1>'.$this->spacer() : ''; |
|
| 228 | 228 | if ($this->isSketchInvoice()) { |
| 229 | - $title .= '<div class="color-red font-big font-bold">' . Tools::lang()->trans('invoice-is-sketch') . '</div>'; |
|
| 229 | + $title .= '<div class="color-red font-big font-bold">'.Tools::lang()->trans('invoice-is-sketch').'</div>'; |
|
| 230 | 230 | } |
| 231 | 231 | |
| 232 | 232 | return '<table class="table-big">' |
| 233 | 233 | . '<tr>' |
| 234 | - . '<td> Titulo ' . $title |
|
| 235 | - . '<p><b>' . $this->empresa->nombre . '</b>' |
|
| 236 | - . '<br/>' . $this->empresa->tipoidfiscal . ': ' . $this->empresa->cifnif |
|
| 237 | - . '<br/>' . $this->combineAddress($this->empresa) . '</p>' . $this->spacer() |
|
| 238 | - . '<p>' . implode(' · ', $contactData) . '</p>' |
|
| 234 | + . '<td> Titulo '.$title |
|
| 235 | + . '<p><b>'.$this->empresa->nombre.'</b>' |
|
| 236 | + . '<br/>'.$this->empresa->tipoidfiscal.': '.$this->empresa->cifnif |
|
| 237 | + . '<br/>'.$this->combineAddress($this->empresa).'</p>'.$this->spacer() |
|
| 238 | + . '<p>'.implode(' · ', $contactData).'</p>' |
|
| 239 | 239 | . '</td>' |
| 240 | - . '<td align="right"><img src="' . $this->logoPath . '" height="' . $this->get('logosize') . '"/></td>' |
|
| 240 | + . '<td align="right"><img src="'.$this->logoPath.'" height="'.$this->get('logosize').'"/></td>' |
|
| 241 | 241 | . '</tr>' |
| 242 | 242 | . '</table>'; |
| 243 | 243 | } |
@@ -246,13 +246,12 @@ discard block |
||
| 246 | 246 | { |
| 247 | 247 | $observations = ''; |
| 248 | 248 | if (!empty($this->getObservations($model))) { |
| 249 | - $observations .= '<p><b>' . Tools::lang()->trans('observations') . '</b><br/>' |
|
| 250 | - . $this->getObservations($model) . '</p>'; |
|
| 249 | + $observations .= '<p><b>'.Tools::lang()->trans('observations').'</b><br/>' |
|
| 250 | + . $this->getObservations($model).'</p>'; |
|
| 251 | 251 | } |
| 252 | 252 | |
| 253 | 253 | return $this->format->hidetotals ? |
| 254 | - $observations : |
|
| 255 | - $this->getInvoiceTotalsPartial($model, [], $css) . $observations; |
|
| 254 | + $observations : $this->getInvoiceTotalsPartial($model, [], $css).$observations; |
|
| 256 | 255 | } |
| 257 | 256 | |
| 258 | 257 | protected function getInvoiceTotalsPartial($model, array $lines = [], string $css = ''): string |
@@ -283,8 +282,8 @@ discard block |
||
| 283 | 282 | // pintamos los irpfs |
| 284 | 283 | foreach ($irpfs as $irpf) { |
| 285 | 284 | $trs .= '<tr>' |
| 286 | - . '<td align="right"><b>' . $irpf['name'] . '</b>:</td>' |
|
| 287 | - . '<td class="nowrap" align="right">' . Tools::money($irpf['total'], $model->coddivisa) . '</td>' |
|
| 285 | + . '<td align="right"><b>'.$irpf['name'].'</b>:</td>' |
|
| 286 | + . '<td class="nowrap" align="right">'.Tools::money($irpf['total'], $model->coddivisa).'</td>' |
|
| 288 | 287 | . '</tr>'; |
| 289 | 288 | } |
| 290 | 289 | |
@@ -308,15 +307,15 @@ discard block |
||
| 308 | 307 | case 'dtopor1': |
| 309 | 308 | case 'dtopor2': |
| 310 | 309 | $trs .= '<tr>' |
| 311 | - . '<td align="right"><b>' . $title . '</b>:</td>' |
|
| 312 | - . '<td class="nowrap" align="right">' . Tools::number($model->{$key}) . '%</td>' |
|
| 310 | + . '<td align="right"><b>'.$title.'</b>:</td>' |
|
| 311 | + . '<td class="nowrap" align="right">'.Tools::number($model->{$key}).'%</td>' |
|
| 313 | 312 | . '</tr>'; |
| 314 | 313 | break; |
| 315 | 314 | |
| 316 | 315 | case 'total': |
| 317 | 316 | $trs .= '<tr>' |
| 318 | - . '<td class="text-end"><b>' . $title . '</b>:</td>' |
|
| 319 | - . '<td class="text-end nowrap">' . Tools::money($model->{$key}, $model->coddivisa) . '</td>' |
|
| 317 | + . '<td class="text-end"><b>'.$title.'</b>:</td>' |
|
| 318 | + . '<td class="text-end nowrap">'.Tools::money($model->{$key}, $model->coddivisa).'</td>' |
|
| 320 | 319 | . '</tr>'; |
| 321 | 320 | break; |
| 322 | 321 | |
@@ -327,24 +326,24 @@ discard block |
||
| 327 | 326 | // no break |
| 328 | 327 | default: |
| 329 | 328 | $trs .= '<tr>' |
| 330 | - . '<td align="right"><b>' . $title . '</b>:</td>' |
|
| 331 | - . '<td class="nowrap" align="right">' . Tools::money($model->{$key}, $model->coddivisa) . '</td>' |
|
| 329 | + . '<td align="right"><b>'.$title.'</b>:</td>' |
|
| 330 | + . '<td class="nowrap" align="right">'.Tools::money($model->{$key}, $model->coddivisa).'</td>' |
|
| 332 | 331 | . '</tr>'; |
| 333 | 332 | break; |
| 334 | 333 | } |
| 335 | 334 | } |
| 336 | 335 | |
| 337 | - return '<table class="table-big table-border ' . $css . '">' |
|
| 336 | + return '<table class="table-big table-border '.$css.'">' |
|
| 338 | 337 | . '<tr>' |
| 339 | - . '<td> ' . $this->getInvoiceTaxes($model, $lines) . '</td>' |
|
| 340 | - . '<td align="right" valign="top"><table>' . $trs . '</table></td>' |
|
| 338 | + . '<td> '.$this->getInvoiceTaxes($model, $lines).'</td>' |
|
| 339 | + . '<td align="right" valign="top"><table>'.$trs.'</table></td>' |
|
| 341 | 340 | . '</tr>' |
| 342 | 341 | . '<tr>' |
| 343 | 342 | . '<td>' |
| 344 | 343 | . '</td>' |
| 345 | 344 | . '</tr>' |
| 346 | 345 | . '</table>' |
| 347 | - . ' <b>Son:</b> ' . $this->convert_to_words($model->total) . ' pesos dominicanos' |
|
| 346 | + . ' <b>Son:</b> '.$this->convert_to_words($model->total).' pesos dominicanos' |
|
| 348 | 347 | . '<br/>'; |
| 349 | 348 | } |
| 350 | 349 | |
@@ -364,43 +363,43 @@ discard block |
||
| 364 | 363 | $trs = ''; |
| 365 | 364 | foreach ($taxes['iva'] as $row) { |
| 366 | 365 | $trs .= '<tr>' |
| 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>'; |
|
| 366 | + . '<td class="nowrap" align="left">'.Impuestos::get($row['codimpuesto'])->descripcion.'</td>' |
|
| 367 | + . '<td class="nowrap" align="center">'.Tools::money($row['neto'], $model->coddivisa).'</td>' |
|
| 368 | + . '<td class="nowrap" align="center">'.Tools::number($row['iva']).'%</td>' |
|
| 369 | + . '<td class="nowrap" align="center">'.Tools::money($row['totaliva'], $model->coddivisa).'</td>'; |
|
| 371 | 370 | |
| 372 | 371 | if (empty($model->totalrecargo)) { |
| 373 | 372 | $trs .= '</tr>'; |
| 374 | 373 | continue; |
| 375 | 374 | } |
| 376 | 375 | |
| 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>' |
|
| 376 | + $trs .= '<td class="nowrap" align="center">'.(empty($row['recargo']) ? '-' : Tools::number($row['recargo']).'%').'</td>' |
|
| 377 | + . '<td class="nowrap" align="right">'.(empty($row['totalrecargo']) ? '-' : Tools::money($row['totalrecargo'])).'</td>' |
|
| 379 | 378 | . '</tr>'; |
| 380 | 379 | } |
| 381 | 380 | |
| 382 | 381 | if (empty($model->totalrecargo)) { |
| 383 | - return '<table class="' . $class . '">' |
|
| 382 | + return '<table class="'.$class.'">' |
|
| 384 | 383 | . '<thead>' |
| 385 | 384 | . '<tr>' |
| 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>' |
|
| 385 | + . '<th align="left">'.$i18n->trans('tax').'</th>' |
|
| 386 | + . '<th align="center">'.$i18n->trans('tax-base').'</th>' |
|
| 387 | + . '<th align="center">'.$i18n->trans('percentage').'</th>' |
|
| 388 | + . '<th align="center">'.$i18n->trans('amount').'</th>' |
|
| 390 | 389 | . '</tr>' |
| 391 | 390 | . '</thead>' |
| 392 | 391 | . $trs |
| 393 | 392 | . '</table>'; |
| 394 | 393 | } |
| 395 | 394 | |
| 396 | - return '<table class="' . $class . '">' |
|
| 395 | + return '<table class="'.$class.'">' |
|
| 397 | 396 | . '<tr>' |
| 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>' |
|
| 397 | + . '<th align="left">'.$i18n->trans('tax').'</th>' |
|
| 398 | + . '<th align="center">'.$i18n->trans('tax-base').'</th>' |
|
| 399 | + . '<th align="center">'.$i18n->trans('tax').'</th>' |
|
| 400 | + . '<th align="center">'.$i18n->trans('amount').'</th>' |
|
| 401 | + . '<th align="center">'.$i18n->trans('re').'</th>' |
|
| 402 | + . '<th align="right">'.$i18n->trans('amount').'</th>' |
|
| 404 | 403 | . '</tr>' |
| 405 | 404 | . $trs |
| 406 | 405 | . '</table>'; |
@@ -462,7 +461,7 @@ discard block |
||
| 462 | 461 | |
| 463 | 462 | if ($number < 100) { |
| 464 | 463 | return ucfirst($words[10 * floor($number / 10)] |
| 465 | - . ($number % 10 > 0 ? ' y ' . $words[$number % 10] : '')); |
|
| 464 | + . ($number % 10 > 0 ? ' y '.$words[$number % 10] : '')); |
|
| 466 | 465 | } |
| 467 | 466 | |
| 468 | 467 | if ($number < 1000) { |
@@ -474,23 +473,23 @@ discard block |
||
| 474 | 473 | |
| 475 | 474 | if ($number < 1000000) { |
| 476 | 475 | $thousands = floor($number / 1000); |
| 477 | - return ucfirst(($thousands > 1 ? $this->convert_to_words($thousands) . ' ' : '') |
|
| 476 | + return ucfirst(($thousands > 1 ? $this->convert_to_words($thousands).' ' : '') |
|
| 478 | 477 | . 'mil' |
| 479 | - . ($number % 1000 > 0 ? ' ' . $this->convert_to_words($number % 1000) : '')); |
|
| 478 | + . ($number % 1000 > 0 ? ' '.$this->convert_to_words($number % 1000) : '')); |
|
| 480 | 479 | } |
| 481 | 480 | |
| 482 | 481 | if ($number < 1000000000) { |
| 483 | 482 | $millions = floor($number / 1000000); |
| 484 | - return ucfirst(($millions > 1 ? $this->convert_to_words($millions) . ' ' : 'un ') |
|
| 483 | + return ucfirst(($millions > 1 ? $this->convert_to_words($millions).' ' : 'un ') |
|
| 485 | 484 | . 'millón' |
| 486 | 485 | . ($millions > 1 ? 'es' : '') |
| 487 | - . ($number % 1000000 > 0 ? ' ' . $this->convert_to_words($number % 1000000) : '')); |
|
| 486 | + . ($number % 1000000 > 0 ? ' '.$this->convert_to_words($number % 1000000) : '')); |
|
| 488 | 487 | } |
| 489 | 488 | |
| 490 | 489 | $billions = floor($number / 1000000000); |
| 491 | - return ucfirst(($billions > 1 ? $this->convert_to_words($billions) . ' ' : 'un ') |
|
| 490 | + return ucfirst(($billions > 1 ? $this->convert_to_words($billions).' ' : 'un ') |
|
| 492 | 491 | . 'billón' |
| 493 | 492 | . ($billions > 1 ? 'es' : '') |
| 494 | - . ($number % 1000000000 > 0 ? ' ' . $this->convert_to_words($number % 1000000000) : '')); |
|
| 493 | + . ($number % 1000000000 > 0 ? ' '.$this->convert_to_words($number % 1000000000) : '')); |
|
| 495 | 494 | } |
| 496 | 495 | } |
| 497 | 496 | \ No newline at end of file |