@@ -8,7 +8,7 @@ discard block |
||
| 8 | 8 | { |
| 9 | 9 | public function createViews(): Closure |
| 10 | 10 | { |
| 11 | - return function () { |
|
| 11 | + return function() { |
|
| 12 | 12 | // tu código aquí |
| 13 | 13 | // createViews() se ejecuta una vez realizado el createViews() del controlador. |
| 14 | 14 | parent::createViews(); |
@@ -18,7 +18,7 @@ discard block |
||
| 18 | 18 | |
| 19 | 19 | public function execAfterAction(): Closure |
| 20 | 20 | { |
| 21 | - return function ($action) { |
|
| 21 | + return function($action) { |
|
| 22 | 22 | // tu código aquí |
| 23 | 23 | // execAfterAction() se ejecuta tras el execAfterAction() del controlador. |
| 24 | 24 | }; |
@@ -26,7 +26,7 @@ discard block |
||
| 26 | 26 | |
| 27 | 27 | public function execPreviousAction(): Closure |
| 28 | 28 | { |
| 29 | - return function ($action) { |
|
| 29 | + return function($action) { |
|
| 30 | 30 | // tu código aquí |
| 31 | 31 | // execPreviousAction() se ejecuta después del execPreviousAction() del controlador. |
| 32 | 32 | // Si devolvemos false detenemos la ejecución del controlador. |
@@ -35,7 +35,7 @@ discard block |
||
| 35 | 35 | |
| 36 | 36 | public function loadData(): Closure |
| 37 | 37 | { |
| 38 | - return function ($viewName, $view) { |
|
| 38 | + return function($viewName, $view) { |
|
| 39 | 39 | // tu código aquí |
| 40 | 40 | // loadData() se ejecuta tras el loadData() del controlador. Recibe los parámetros $viewName y $view. |
| 41 | 41 | switch ($viewName) { |
@@ -30,16 +30,16 @@ discard block |
||
| 30 | 30 | { |
| 31 | 31 | public function createViews(): Closure |
| 32 | 32 | { |
| 33 | - return function () { |
|
| 33 | + return function() { |
|
| 34 | 34 | parent::createViews(); |
| 35 | - AssetManager::add('js', \FS_ROUTE . '/Plugins/fsRepublicaDominicana/Assets/JS/CommonModals.js'); |
|
| 36 | - AssetManager::add('js', \FS_ROUTE . '/Plugins/fsRepublicaDominicana/Assets/JS/CommonDomFunctions.js'); |
|
| 35 | + AssetManager::add('js', \FS_ROUTE.'/Plugins/fsRepublicaDominicana/Assets/JS/CommonModals.js'); |
|
| 36 | + AssetManager::add('js', \FS_ROUTE.'/Plugins/fsRepublicaDominicana/Assets/JS/CommonDomFunctions.js'); |
|
| 37 | 37 | }; |
| 38 | 38 | } |
| 39 | 39 | |
| 40 | 40 | public function execPreviousAction() |
| 41 | 41 | { |
| 42 | - return function ($action) { |
|
| 42 | + return function($action) { |
|
| 43 | 43 | switch ($action) { |
| 44 | 44 | case 'busca_tipo': |
| 45 | 45 | $this->setTemplate(false); |
@@ -59,7 +59,7 @@ discard block |
||
| 59 | 59 | break; |
| 60 | 60 | case "verifica_documento": |
| 61 | 61 | $this->setTemplate(false); |
| 62 | - CommonFunctionsDominicanRepublic::verifyDocument($_REQUEST['ncf'],$_REQUEST['proveedor']); |
|
| 62 | + CommonFunctionsDominicanRepublic::verifyDocument($_REQUEST['ncf'], $_REQUEST['proveedor']); |
|
| 63 | 63 | break; |
| 64 | 64 | case 'busca_correlativo': |
| 65 | 65 | $this->setTemplate(false); |
@@ -95,14 +95,14 @@ discard block |
||
| 95 | 95 | |
| 96 | 96 | public function ncftipo() |
| 97 | 97 | { |
| 98 | - return function () { |
|
| 98 | + return function() { |
|
| 99 | 99 | return NCFTipo::allVentas(); |
| 100 | 100 | }; |
| 101 | 101 | } |
| 102 | 102 | |
| 103 | 103 | public function ncftipoanulacion() |
| 104 | 104 | { |
| 105 | - return function () { |
|
| 105 | + return function() { |
|
| 106 | 106 | $tiposAnulacion = new NCFTipoAnulacion(); |
| 107 | 107 | return $tiposAnulacion->all(); |
| 108 | 108 | }; |
@@ -33,7 +33,7 @@ |
||
| 33 | 33 | $sqlType = " INDEX "; |
| 34 | 34 | $dataBase->exec("set FOREIGN_KEY_CHECKS=0;"); |
| 35 | 35 | } |
| 36 | - $result = $dataBase->exec("ALTER TABLE facturasprov DROP " . $sqlType . |
|
| 36 | + $result = $dataBase->exec("ALTER TABLE facturasprov DROP ".$sqlType. |
|
| 37 | 37 | " IF EXISTS uniq_empresancf_facturasprov;"); |
| 38 | 38 | if (strtoupper(FS_DB_TYPE) === 'MYSQL') { |
| 39 | 39 | $dataBase->exec("set FOREIGN_KEY_CHECKS=1;"); |
@@ -25,7 +25,7 @@ discard block |
||
| 25 | 25 | { |
| 26 | 26 | public function execAfterAction(): Closure |
| 27 | 27 | { |
| 28 | - return function($action) { |
|
| 28 | + return function($action) { |
|
| 29 | 29 | //return $action; |
| 30 | 30 | if ($action === 'fixfacturasprov') { |
| 31 | 31 | $dataBase = new DataBase(); |
@@ -49,7 +49,7 @@ discard block |
||
| 49 | 49 | } elseif ($action === 'fixfacturascli') { |
| 50 | 50 | Tools::log()->notice('fixfacturascli'); |
| 51 | 51 | } |
| 52 | - }; |
|
| 52 | + }; |
|
| 53 | 53 | } |
| 54 | 54 | |
| 55 | 55 | } |
| 56 | 56 | \ No newline at end of file |
@@ -184,7 +184,7 @@ |
||
| 184 | 184 | . $idempresa |
| 185 | 185 | . ' AND tipocomprobante = ' |
| 186 | 186 | . $dataBase->var2str($tipocomprobante) |
| 187 | - . ' AND estado = ' . $dataBase->var2str(true) |
|
| 187 | + . ' AND estado = '.$dataBase->var2str(true) |
|
| 188 | 188 | . ' AND correlativo <= secuenciafin ' |
| 189 | 189 | . ';'; |
| 190 | 190 | $data = $dataBase->select($sql); |
@@ -26,7 +26,7 @@ discard block |
||
| 26 | 26 | class SalesLineMod implements SalesLineModInterface |
| 27 | 27 | { |
| 28 | 28 | |
| 29 | - public function apply(SalesDocument &$model, array &$lines, array $formData) |
|
| 29 | + public function apply(SalesDocument & $model, array &$lines, array $formData) |
|
| 30 | 30 | { |
| 31 | 31 | // TODO: Implement apply() method. |
| 32 | 32 | } |
@@ -37,10 +37,10 @@ discard block |
||
| 37 | 37 | * @param string $id |
| 38 | 38 | * @return void |
| 39 | 39 | */ |
| 40 | - public function applyToLine(array $formData, SalesDocumentLine &$line, string $id) |
|
| 40 | + public function applyToLine(array $formData, SalesDocumentLine & $line, string $id) |
|
| 41 | 41 | { |
| 42 | - $line->rdtaxisc = $formData['rdtaxisc_' . $id] ?? null; |
|
| 43 | - $line->rdtaxcdt = $formData['rdtaxcdt_' . $id] ?? null; |
|
| 42 | + $line->rdtaxisc = $formData['rdtaxisc_'.$id] ?? null; |
|
| 43 | + $line->rdtaxcdt = $formData['rdtaxcdt_'.$id] ?? null; |
|
| 44 | 44 | } |
| 45 | 45 | |
| 46 | 46 | public function assets(): void |
@@ -86,8 +86,7 @@ discard block |
||
| 86 | 86 | protected function rdTax($i18n, $idlinea, $line, $model, $field): string |
| 87 | 87 | { |
| 88 | 88 | $attributes = $model->editable ? |
| 89 | - 'name="'. $field .'_' . $idlinea . '"' : |
|
| 90 | - 'disabled=""'; |
|
| 89 | + 'name="'.$field.'_'.$idlinea.'"' : 'disabled=""'; |
|
| 91 | 90 | |
| 92 | 91 | $title = $this->rdTaxTitle($i18n, $field); |
| 93 | 92 | $lineTax = $this->productoTaxValue($line->idproducto, $field); |
@@ -96,14 +95,14 @@ discard block |
||
| 96 | 95 | |
| 97 | 96 | return '<div class="col-6">' |
| 98 | 97 | . $title |
| 99 | - . '<input type="number" ' . $attributes . ' value="' . $fieldValue. '" class="form-control" readonly=""/>' |
|
| 98 | + . '<input type="number" '.$attributes.' value="'.$fieldValue.'" class="form-control" readonly=""/>' |
|
| 100 | 99 | . '</div>' |
| 101 | 100 | . '</div>'; |
| 102 | 101 | } |
| 103 | 102 | |
| 104 | 103 | protected function rdTaxTitle($i18n, $field): string |
| 105 | 104 | { |
| 106 | - return '<div class="mb-2">' . $i18n->trans($field); |
|
| 105 | + return '<div class="mb-2">'.$i18n->trans($field); |
|
| 107 | 106 | } |
| 108 | 107 | |
| 109 | 108 | protected function productoTaxValue($idproducto, $rdtaxid): ?ImpuestoProducto |
@@ -29,19 +29,19 @@ discard block |
||
| 29 | 29 | |
| 30 | 30 | class SalesFooterMod implements SalesModInterface |
| 31 | 31 | { |
| 32 | - public function apply(SalesDocument &$model, array $formData, User $user) |
|
| 32 | + public function apply(SalesDocument & $model, array $formData, User $user) |
|
| 33 | 33 | { |
| 34 | 34 | } |
| 35 | 35 | |
| 36 | - public function applyBefore(SalesDocument &$model, array $formData, User $user) |
|
| 36 | + public function applyBefore(SalesDocument & $model, array $formData, User $user) |
|
| 37 | 37 | { |
| 38 | 38 | if ($model->modelClassName() === 'FacturaCliente') { |
| 39 | - $model->numeroncf = isset($formData['numeroncf']) ? (string)$formData['numeroncf'] : $model->numeroncf; |
|
| 40 | - $model->tipocomprobante = isset($formData['tipocomprobante']) ? (string)$formData['tipocomprobante'] : $model->tipocomprobante; |
|
| 41 | - $model->ncffechavencimiento = isset($formData['ncffechavencimiento']) ? (string)$formData['ncffechavencimiento'] : $model->ncffechavencimiento; |
|
| 42 | - $model->ncftipopago = isset($formData['ncftipopago']) ? (string)$formData['ncftipopago'] : $model->ncftipopago; |
|
| 43 | - $model->ncftipomovimiento = isset($formData['ncftipomovimiento']) ? (string)$formData['ncftipomovimiento'] : $model->ncftipomovimiento; |
|
| 44 | - $model->ncftipoanulacion = isset($formData['ncftipoanulacion']) ? (string)$formData['ncftipoanulacion'] : $model->ncftipoanulacion; |
|
| 39 | + $model->numeroncf = isset($formData['numeroncf']) ? (string) $formData['numeroncf'] : $model->numeroncf; |
|
| 40 | + $model->tipocomprobante = isset($formData['tipocomprobante']) ? (string) $formData['tipocomprobante'] : $model->tipocomprobante; |
|
| 41 | + $model->ncffechavencimiento = isset($formData['ncffechavencimiento']) ? (string) $formData['ncffechavencimiento'] : $model->ncffechavencimiento; |
|
| 42 | + $model->ncftipopago = isset($formData['ncftipopago']) ? (string) $formData['ncftipopago'] : $model->ncftipopago; |
|
| 43 | + $model->ncftipomovimiento = isset($formData['ncftipomovimiento']) ? (string) $formData['ncftipomovimiento'] : $model->ncftipomovimiento; |
|
| 44 | + $model->ncftipoanulacion = isset($formData['ncftipoanulacion']) ? (string) $formData['ncftipoanulacion'] : $model->ncftipoanulacion; |
|
| 45 | 45 | } |
| 46 | 46 | } |
| 47 | 47 | |
@@ -119,18 +119,16 @@ discard block |
||
| 119 | 119 | $options = ['<option value="">------</option>']; |
| 120 | 120 | foreach ($tipoComprobante as $row) { |
| 121 | 121 | $options[] = ($row->tipocomprobante === $invoiceTipoComprobante) ? |
| 122 | - '<option value="' . $row->tipocomprobante . '" selected="">' . $row->descripcion . '</option>' : |
|
| 123 | - '<option value="' . $row->tipocomprobante . '">' . $row->descripcion . '</option>'; |
|
| 122 | + '<option value="'.$row->tipocomprobante.'" selected="">'.$row->descripcion.'</option>' : '<option value="'.$row->tipocomprobante.'">'.$row->descripcion.'</option>'; |
|
| 124 | 123 | } |
| 125 | 124 | |
| 126 | 125 | $attributes = ($model->editable || $model->numeroncf === '') ? |
| 127 | - 'id="tipocomprobante" name="tipocomprobante" required="" onChange="verificarCorrelativoNCF(this.value,\'Ventas\')"' : |
|
| 128 | - 'disabled=""'; |
|
| 126 | + 'id="tipocomprobante" name="tipocomprobante" required="" onChange="verificarCorrelativoNCF(this.value,\'Ventas\')"' : 'disabled=""'; |
|
| 129 | 127 | |
| 130 | 128 | return '<div class="col-sm-3">' |
| 131 | 129 | . '<div class="form-group">' |
| 132 | 130 | . $i18n->trans('tipocomprobante') |
| 133 | - . '<select ' . $attributes . ' class="form-control">' . implode('', $options) . '</select>' |
|
| 131 | + . '<select '.$attributes.' class="form-control">'.implode('', $options).'</select>' |
|
| 134 | 132 | . '</div>' |
| 135 | 133 | . '</div>'; |
| 136 | 134 | } |
@@ -154,15 +152,14 @@ discard block |
||
| 154 | 152 | $options = ['<option value="">------</option>']; |
| 155 | 153 | foreach ($tipoPago as $row) { |
| 156 | 154 | $options[] = ($row->codigo === $invoiceTipoPago) ? |
| 157 | - '<option value="' . $row->codigo . '" selected="">' . $row->descripcion . '</option>' : |
|
| 158 | - '<option value="' . $row->codigo . '">' . $row->descripcion . '</option>'; |
|
| 155 | + '<option value="'.$row->codigo.'" selected="">'.$row->descripcion.'</option>' : '<option value="'.$row->codigo.'">'.$row->descripcion.'</option>'; |
|
| 159 | 156 | } |
| 160 | 157 | |
| 161 | 158 | $attributes = $model->editable ? 'name="ncftipopago" required=""' : 'disabled=""'; |
| 162 | 159 | return '<div class="col-sm-2">' |
| 163 | 160 | . '<div class="form-group">' |
| 164 | 161 | . $i18n->trans('ncf-payment-type') |
| 165 | - . '<select ' . $attributes . ' class="form-control">' . implode('', $options) . '</select>' |
|
| 162 | + . '<select '.$attributes.' class="form-control">'.implode('', $options).'</select>' |
|
| 166 | 163 | . '</div>' |
| 167 | 164 | . '</div>'; |
| 168 | 165 | } |
@@ -180,15 +177,14 @@ discard block |
||
| 180 | 177 | $options = ['<option value="">------</option>']; |
| 181 | 178 | foreach ($tipoMovimiento as $row) { |
| 182 | 179 | $options[] = ($row->codigo === $invoiceTipoMovimiento) ? |
| 183 | - '<option value="' . $row->codigo . '" selected="">' . $row->descripcion . '</option>' : |
|
| 184 | - '<option value="' . $row->codigo . '">' . $row->descripcion . '</option>'; |
|
| 180 | + '<option value="'.$row->codigo.'" selected="">'.$row->descripcion.'</option>' : '<option value="'.$row->codigo.'">'.$row->descripcion.'</option>'; |
|
| 185 | 181 | } |
| 186 | 182 | |
| 187 | 183 | $attributes = $model->editable ? 'name="ncftipomovimiento" required=""' : 'disabled=""'; |
| 188 | 184 | return '<div class="col-sm-3">' |
| 189 | 185 | . '<div class="form-group">' |
| 190 | 186 | . $i18n->trans('ncf-movement-type') |
| 191 | - . '<select ' . $attributes . ' class="form-control">' . implode('', $options) . '</select>' |
|
| 187 | + . '<select '.$attributes.' class="form-control">'.implode('', $options).'</select>' |
|
| 192 | 188 | . '</div>' |
| 193 | 189 | . '</div>'; |
| 194 | 190 | } |
@@ -206,15 +202,14 @@ discard block |
||
| 206 | 202 | $options = ['<option value="">------</option>']; |
| 207 | 203 | foreach ($tipoAnulacion as $row) { |
| 208 | 204 | $options[] = ($row->codigo === $invoiceTipoAnulacion) ? |
| 209 | - '<option value="' . $row->codigo . '" selected="">' . $row->descripcion . '</option>' : |
|
| 210 | - '<option value="' . $row->codigo . '">' . $row->descripcion . '</option>'; |
|
| 205 | + '<option value="'.$row->codigo.'" selected="">'.$row->descripcion.'</option>' : '<option value="'.$row->codigo.'">'.$row->descripcion.'</option>'; |
|
| 211 | 206 | } |
| 212 | 207 | |
| 213 | 208 | $attributes = $model->editable ? 'name="ncftipoanulacion"' : 'disabled=""'; |
| 214 | 209 | return '<div class="col-sm-2">' |
| 215 | 210 | . '<div class="form-group">' |
| 216 | 211 | . $i18n->trans('ncf-cancellation-type') |
| 217 | - . '<select ' . $attributes . ' class="form-control">' . implode('', $options) . '</select>' |
|
| 212 | + . '<select '.$attributes.' class="form-control">'.implode('', $options).'</select>' |
|
| 218 | 213 | . '</div>' |
| 219 | 214 | . '</div>'; |
| 220 | 215 | } |
@@ -226,8 +221,8 @@ discard block |
||
| 226 | 221 | ? date('Y-m-d', strtotime($model->ncffechavencimiento)) |
| 227 | 222 | : ''; |
| 228 | 223 | return '<div class="col-sm-2">' |
| 229 | - . '<div class="form-group">' . $i18n->trans('due-date') |
|
| 230 | - . '<input type="date" ' . $attributes . ' value="' . $ncfFechaVencimiento . '" class="form-control"/>' |
|
| 224 | + . '<div class="form-group">'.$i18n->trans('due-date') |
|
| 225 | + . '<input type="date" '.$attributes.' value="'.$ncfFechaVencimiento.'" class="form-control"/>' |
|
| 231 | 226 | . '</div>' |
| 232 | 227 | . '</div>'; |
| 233 | 228 | } |
@@ -238,7 +233,7 @@ discard block |
||
| 238 | 233 | return empty($model->codcliente) ? '' : '<div class="col-sm">' |
| 239 | 234 | . '<div class="form-group">' |
| 240 | 235 | . $i18n->trans('desc-numeroncf-sales') |
| 241 | - . '<input type="text" ' . $attributes . ' value="' . $model->numeroncf . '" class="form-control"/>' |
|
| 236 | + . '<input type="text" '.$attributes.' value="'.$model->numeroncf.'" class="form-control"/>' |
|
| 242 | 237 | . '</div>' |
| 243 | 238 | . '</div>'; |
| 244 | 239 | } |
@@ -29,19 +29,19 @@ discard block |
||
| 29 | 29 | |
| 30 | 30 | class PurchasesFooterMod implements PurchasesModInterface |
| 31 | 31 | { |
| 32 | - public function apply(PurchaseDocument &$model, array $formData, User $user) |
|
| 32 | + public function apply(PurchaseDocument & $model, array $formData, User $user) |
|
| 33 | 33 | { |
| 34 | 34 | } |
| 35 | 35 | |
| 36 | - public function applyBefore(PurchaseDocument &$model, array $formData, User $user) |
|
| 36 | + public function applyBefore(PurchaseDocument & $model, array $formData, User $user) |
|
| 37 | 37 | { |
| 38 | 38 | if ($model->modelClassName() === 'FacturaProveedor') { |
| 39 | - $model->numeroncf = isset($formData['numeroncf']) ? (string)$formData['numeroncf'] : $model->numeroncf; |
|
| 40 | - $model->tipocomprobante = isset($formData['tipocomprobante']) ? (string)$formData['tipocomprobante'] : $model->tipocomprobante; |
|
| 41 | - $model->ncffechavencimiento = isset($formData['ncffechavencimiento']) ? (string)$formData['ncffechavencimiento'] : $model->ncffechavencimiento; |
|
| 42 | - $model->ncftipopago = isset($formData['ncftipopago']) ? (string)$formData['ncftipopago'] : $model->ncftipopago; |
|
| 43 | - $model->ncftipomovimiento = isset($formData['ncftipomovimiento']) ? (string)$formData['ncftipomovimiento'] : $model->ncftipomovimiento; |
|
| 44 | - $model->ncftipoanulacion = isset($formData['ncftipoanulacion']) ? (string)$formData['ncftipoanulacion'] : $model->ncftipoanulacion; |
|
| 39 | + $model->numeroncf = isset($formData['numeroncf']) ? (string) $formData['numeroncf'] : $model->numeroncf; |
|
| 40 | + $model->tipocomprobante = isset($formData['tipocomprobante']) ? (string) $formData['tipocomprobante'] : $model->tipocomprobante; |
|
| 41 | + $model->ncffechavencimiento = isset($formData['ncffechavencimiento']) ? (string) $formData['ncffechavencimiento'] : $model->ncffechavencimiento; |
|
| 42 | + $model->ncftipopago = isset($formData['ncftipopago']) ? (string) $formData['ncftipopago'] : $model->ncftipopago; |
|
| 43 | + $model->ncftipomovimiento = isset($formData['ncftipomovimiento']) ? (string) $formData['ncftipomovimiento'] : $model->ncftipomovimiento; |
|
| 44 | + $model->ncftipoanulacion = isset($formData['ncftipoanulacion']) ? (string) $formData['ncftipoanulacion'] : $model->ncftipoanulacion; |
|
| 45 | 45 | } |
| 46 | 46 | } |
| 47 | 47 | |
@@ -109,15 +109,14 @@ discard block |
||
| 109 | 109 | $options = ['<option value="">------</option>']; |
| 110 | 110 | foreach ($tipoComprobante as $row) { |
| 111 | 111 | $options[] = ($row->tipocomprobante === $invoiceTipoComprobante) ? |
| 112 | - '<option value="' . $row->tipocomprobante . '" selected="">' . $row->descripcion . '</option>' : |
|
| 113 | - '<option value="' . $row->tipocomprobante . '">' . $row->descripcion . '</option>'; |
|
| 112 | + '<option value="'.$row->tipocomprobante.'" selected="">'.$row->descripcion.'</option>' : '<option value="'.$row->tipocomprobante.'">'.$row->descripcion.'</option>'; |
|
| 114 | 113 | } |
| 115 | 114 | |
| 116 | 115 | $attributes = ($model->editable || $model->numeroncf === '') ? 'name="tipocomprobante" required=""' : 'disabled=""'; |
| 117 | 116 | return '<div class="col-sm-3">' |
| 118 | 117 | . '<div class="form-group">' |
| 119 | 118 | . $i18n->trans('tipocomprobante') |
| 120 | - . '<select ' . $attributes . ' class="form-control">' . implode('', $options) . '</select>' |
|
| 119 | + . '<select '.$attributes.' class="form-control">'.implode('', $options).'</select>' |
|
| 121 | 120 | . '</div>' |
| 122 | 121 | . '</div>'; |
| 123 | 122 | } |
@@ -141,15 +140,14 @@ discard block |
||
| 141 | 140 | $options = ['<option value="">------</option>']; |
| 142 | 141 | foreach ($tipoPago as $row) { |
| 143 | 142 | $options[] = ($row->codigo === $invoiceTipoPago) ? |
| 144 | - '<option value="' . $row->codigo . '" selected="">' . $row->descripcion . '</option>' : |
|
| 145 | - '<option value="' . $row->codigo . '">' . $row->descripcion . '</option>'; |
|
| 143 | + '<option value="'.$row->codigo.'" selected="">'.$row->descripcion.'</option>' : '<option value="'.$row->codigo.'">'.$row->descripcion.'</option>'; |
|
| 146 | 144 | } |
| 147 | 145 | |
| 148 | 146 | $attributes = $model->editable ? 'name="ncftipopago" required=""' : 'disabled=""'; |
| 149 | 147 | return '<div class="col-sm-2">' |
| 150 | 148 | . '<div class="form-group">' |
| 151 | 149 | . $i18n->trans('ncf-payment-type') |
| 152 | - . '<select ' . $attributes . ' class="form-control">' . implode('', $options) . '</select>' |
|
| 150 | + . '<select '.$attributes.' class="form-control">'.implode('', $options).'</select>' |
|
| 153 | 151 | . '</div>' |
| 154 | 152 | . '</div>'; |
| 155 | 153 | } |
@@ -167,15 +165,14 @@ discard block |
||
| 167 | 165 | $options = ['<option value="">------</option>']; |
| 168 | 166 | foreach ($tipoMovimiento as $row) { |
| 169 | 167 | $options[] = ($row->codigo === $invoiceTipoMovimiento) ? |
| 170 | - '<option value="' . $row->codigo . '" selected="">' . $row->descripcion . '</option>' : |
|
| 171 | - '<option value="' . $row->codigo . '">' . $row->descripcion . '</option>'; |
|
| 168 | + '<option value="'.$row->codigo.'" selected="">'.$row->descripcion.'</option>' : '<option value="'.$row->codigo.'">'.$row->descripcion.'</option>'; |
|
| 172 | 169 | } |
| 173 | 170 | |
| 174 | 171 | $attributes = $model->editable ? 'name="ncftipomovimiento" required=""' : 'disabled=""'; |
| 175 | 172 | return '<div class="col-sm-3">' |
| 176 | 173 | . '<div class="form-group">' |
| 177 | 174 | . $i18n->trans('ncf-movement-type') |
| 178 | - . '<select ' . $attributes . ' class="form-control">' . implode('', $options) . '</select>' |
|
| 175 | + . '<select '.$attributes.' class="form-control">'.implode('', $options).'</select>' |
|
| 179 | 176 | . '</div>' |
| 180 | 177 | . '</div>'; |
| 181 | 178 | } |
@@ -193,15 +190,14 @@ discard block |
||
| 193 | 190 | $options = ['<option value="">------</option>']; |
| 194 | 191 | foreach ($tipoAnulacion as $row) { |
| 195 | 192 | $options[] = ($row->codigo === $invoiceTipoAnulacion) ? |
| 196 | - '<option value="' . $row->codigo . '" selected="">' . $row->descripcion . '</option>' : |
|
| 197 | - '<option value="' . $row->codigo . '">' . $row->descripcion . '</option>'; |
|
| 193 | + '<option value="'.$row->codigo.'" selected="">'.$row->descripcion.'</option>' : '<option value="'.$row->codigo.'">'.$row->descripcion.'</option>'; |
|
| 198 | 194 | } |
| 199 | 195 | |
| 200 | 196 | $attributes = $model->editable ? 'name="ncftipoanulacion"' : 'name="ncftipoanulacion" readonly=""'; |
| 201 | 197 | return '<div class="col-sm-2">' |
| 202 | 198 | . '<div class="form-group">' |
| 203 | 199 | . $i18n->trans('ncf-cancellation-type') |
| 204 | - . '<select ' . $attributes . ' class="form-control">' . implode('', $options) . '</select>' |
|
| 200 | + . '<select '.$attributes.' class="form-control">'.implode('', $options).'</select>' |
|
| 205 | 201 | . '</div>' |
| 206 | 202 | . '</div>'; |
| 207 | 203 | } |
@@ -213,9 +209,9 @@ discard block |
||
| 213 | 209 | ? date('Y-m-d', strtotime($model->ncffechavencimiento)) |
| 214 | 210 | : ''; |
| 215 | 211 | return '<div class="col-sm-2">' |
| 216 | - . '<div class="form-group">' . $i18n->trans('due-date') |
|
| 217 | - . '<input type="date" ' . $attributes . ' value="' |
|
| 218 | - . $ncfFechaVencimiento . '" class="form-control"/>' |
|
| 212 | + . '<div class="form-group">'.$i18n->trans('due-date') |
|
| 213 | + . '<input type="date" '.$attributes.' value="' |
|
| 214 | + . $ncfFechaVencimiento.'" class="form-control"/>' |
|
| 219 | 215 | . '</div>' |
| 220 | 216 | . '</div>'; |
| 221 | 217 | } |
@@ -228,11 +224,11 @@ discard block |
||
| 228 | 224 | . '<div class="form-group">' |
| 229 | 225 | . $i18n->trans('desc-numeroncf-purchases') |
| 230 | 226 | . '<div class="input-group">' |
| 231 | - . '<input type="text" ' . $attributes . ' value="' . $model->numeroncf . '" class="form-control"/>' |
|
| 227 | + . '<input type="text" '.$attributes.' value="'.$model->numeroncf.'" class="form-control"/>' |
|
| 232 | 228 | . '<div class="input-group-append">' |
| 233 | - . '<button class="btn ' . $btnColor . ' btn-spin-action" id="btnVerifyNCF"' |
|
| 229 | + . '<button class="btn '.$btnColor.' btn-spin-action" id="btnVerifyNCF"' |
|
| 234 | 230 | . 'onclick="purchasesNCFVerify()" ' |
| 235 | - . 'title="' . $i18n->trans('verify-numproveedor') |
|
| 231 | + . 'title="'.$i18n->trans('verify-numproveedor') |
|
| 236 | 232 | . '" type="button">' |
| 237 | 233 | . '<i id="iconBtnVerify" class="fas fa-search fa-fw"></i>' |
| 238 | 234 | . '</button>' |
@@ -8,7 +8,7 @@ discard block |
||
| 8 | 8 | $files = []; |
| 9 | 9 | $langs = 'ca_ES,cs_CZ,de_DE,en_EN,es_AR,es_CL,es_CO,es_CR,es_DO,es_EC,es_ES,es_GT,es_MX,es_PA,es_PE,es_UY,eu_ES,fr_FR,gl_ES,it_IT,pl_PL,pt_BR,pt_PT,va_ES'; |
| 10 | 10 | foreach (explode(',', $langs) as $lang) { |
| 11 | - $files[] = $lang . '.json'; |
|
| 11 | + $files[] = $lang.'.json'; |
|
| 12 | 12 | } |
| 13 | 13 | foreach (scandir(__DIR__, SCANDIR_SORT_ASCENDING) as $filename) { |
| 14 | 14 | if (is_file($filename) && substr($filename, -5) === '.json' && false === in_array($filename, $files)) { |
@@ -18,25 +18,25 @@ discard block |
||
| 18 | 18 | |
| 19 | 19 | // download json from facturascripts.com |
| 20 | 20 | foreach ($files as $filename) { |
| 21 | - $url = "https://facturascripts.com/EditLanguage?action=json&idproject=176&code=" . substr($filename, 0, -5); |
|
| 21 | + $url = "https://facturascripts.com/EditLanguage?action=json&idproject=176&code=".substr($filename, 0, -5); |
|
| 22 | 22 | $newContent = file_get_contents($url); |
| 23 | 23 | if (empty($newContent)) { |
| 24 | 24 | if (file_exists($filename)) { |
| 25 | 25 | unlink($filename); |
| 26 | - echo "Remove " . $filename . "\n"; |
|
| 26 | + echo "Remove ".$filename."\n"; |
|
| 27 | 27 | continue; |
| 28 | 28 | } |
| 29 | 29 | |
| 30 | - echo "Empty " . $filename . "\n"; |
|
| 30 | + echo "Empty ".$filename."\n"; |
|
| 31 | 31 | continue; |
| 32 | 32 | } |
| 33 | 33 | |
| 34 | 34 | $oldContent = file_exists($filename) ? file_get_contents($filename) : ''; |
| 35 | 35 | if (strlen($newContent) > 10 && $newContent !== $oldContent) { |
| 36 | - echo "Download " . $filename . "\n"; |
|
| 36 | + echo "Download ".$filename."\n"; |
|
| 37 | 37 | file_put_contents($filename, $newContent); |
| 38 | 38 | continue; |
| 39 | 39 | } |
| 40 | 40 | |
| 41 | - echo "Skip " . $filename . "\n"; |
|
| 41 | + echo "Skip ".$filename."\n"; |
|
| 42 | 42 | } |
| 43 | 43 | \ No newline at end of file |
@@ -34,7 +34,7 @@ discard block |
||
| 34 | 34 | $ticket = new Ticket(); |
| 35 | 35 | $ticket->idprinter = $printer->id; |
| 36 | 36 | $ticket->nick = $user->nick; |
| 37 | - $ticket->title = self::$i18n->trans($model->modelClassName() . '-min') . ' RepDominicana.php' . $model->codigo; |
|
| 37 | + $ticket->title = self::$i18n->trans($model->modelClassName().'-min').' RepDominicana.php'.$model->codigo; |
|
| 38 | 38 | |
| 39 | 39 | static::setHeader($model, $printer, $ticket->title); |
| 40 | 40 | static::setBody($model, $printer); |
@@ -67,36 +67,36 @@ discard block |
||
| 67 | 67 | |
| 68 | 68 | // imprimimos el nombre corto de la empresa |
| 69 | 69 | if ($printer->print_comp_shortname) { |
| 70 | - static::$escpos->text(static::sanitize($company->nombrecorto) . "\n"); |
|
| 70 | + static::$escpos->text(static::sanitize($company->nombrecorto)."\n"); |
|
| 71 | 71 | static::$escpos->setTextSize($printer->head_font_size, $printer->head_font_size); |
| 72 | 72 | |
| 73 | 73 | // imprimimos el nombre de la empresa |
| 74 | - static::$escpos->text(static::sanitize($company->nombre) . "\n"); |
|
| 74 | + static::$escpos->text(static::sanitize($company->nombre)."\n"); |
|
| 75 | 75 | } else { |
| 76 | 76 | // imprimimos el nombre de la empresa |
| 77 | - static::$escpos->text(static::sanitize($company->nombre) . "\n"); |
|
| 77 | + static::$escpos->text(static::sanitize($company->nombre)."\n"); |
|
| 78 | 78 | static::$escpos->setTextSize($printer->head_font_size, $printer->head_font_size); |
| 79 | 79 | } |
| 80 | 80 | |
| 81 | 81 | static::$escpos->setJustification(); |
| 82 | 82 | |
| 83 | 83 | // imprimimos la dirección de la empresa |
| 84 | - static::$escpos->text(static::sanitize($company->direccion) . "\n"); |
|
| 85 | - static::$escpos->text(static::sanitize("CP: " . $company->codpostal . ', ' . $company->ciudad) . "\n"); |
|
| 86 | - static::$escpos->text(static::sanitize($company->tipoidfiscal . ': ' . $company->cifnif) . "\n\n"); |
|
| 84 | + static::$escpos->text(static::sanitize($company->direccion)."\n"); |
|
| 85 | + static::$escpos->text(static::sanitize("CP: ".$company->codpostal.', '.$company->ciudad)."\n"); |
|
| 86 | + static::$escpos->text(static::sanitize($company->tipoidfiscal.': '.$company->cifnif)."\n\n"); |
|
| 87 | 87 | |
| 88 | 88 | if ($printer->print_comp_tlf) { |
| 89 | 89 | if (false === empty($company->telefono1) && false === empty($company->telefono2)) { |
| 90 | - static::$escpos->text(static::sanitize($company->telefono1 . ' / ' . $company->telefono2) . "\n"); |
|
| 90 | + static::$escpos->text(static::sanitize($company->telefono1.' / '.$company->telefono2)."\n"); |
|
| 91 | 91 | } elseif (false === empty($company->telefono1)) { |
| 92 | - static::$escpos->text(static::sanitize($company->telefono1) . "\n"); |
|
| 92 | + static::$escpos->text(static::sanitize($company->telefono1)."\n"); |
|
| 93 | 93 | } elseif (false === empty($company->telefono2)) { |
| 94 | - static::$escpos->text(static::sanitize($company->telefono2) . "\n"); |
|
| 94 | + static::$escpos->text(static::sanitize($company->telefono2)."\n"); |
|
| 95 | 95 | } |
| 96 | 96 | } |
| 97 | 97 | |
| 98 | 98 | // imprimimos el título del documento |
| 99 | - static::$escpos->text(static::sanitize($title) . "\n"); |
|
| 99 | + static::$escpos->text(static::sanitize($title)."\n"); |
|
| 100 | 100 | |
| 101 | 101 | static::setHeaderTPV($model, $printer); |
| 102 | 102 | |
@@ -114,28 +114,28 @@ discard block |
||
| 114 | 114 | ) |
| 115 | 115 | ) { |
| 116 | 116 | static::$escpos->text(static::sanitize( |
| 117 | - static::$i18n->trans('date') . ': ' . $model->fecha . ' ' . $model->hora |
|
| 118 | - ) . "\n"); |
|
| 117 | + static::$i18n->trans('date').': '.$model->fecha.' '.$model->hora |
|
| 118 | + )."\n"); |
|
| 119 | 119 | static::$escpos->text(static::sanitize( |
| 120 | - static::$i18n->trans('customer') . ': ' . $model->nombrecliente |
|
| 121 | - ) . "\n\n"); |
|
| 120 | + static::$i18n->trans('customer').': '.$model->nombrecliente |
|
| 121 | + )."\n\n"); |
|
| 122 | 122 | |
| 123 | 123 | if ($model->modelClassName() === 'FacturaCliente') { |
| 124 | 124 | if (property_exists($model, 'numeroncf') && $model->numeroncf) { |
| 125 | 125 | static::$escpos->text(static::sanitize( |
| 126 | - static::$i18n->trans('ncf-number') . ': ' . $model->numeroncf |
|
| 127 | - )) . "\n"; |
|
| 126 | + static::$i18n->trans('ncf-number').': '.$model->numeroncf |
|
| 127 | + ))."\n"; |
|
| 128 | 128 | } |
| 129 | 129 | if (property_exists($model, 'tipocomprobante') && $model->tipocomprobante) { |
| 130 | 130 | static::$escpos->text(static::sanitize( |
| 131 | - static::$i18n->trans('tipo_comprobante') . ': ' . |
|
| 131 | + static::$i18n->trans('tipo_comprobante').': '. |
|
| 132 | 132 | static::getTipoComprobanteRD($model->tipocomprobante) |
| 133 | - )) . "\n"; |
|
| 133 | + ))."\n"; |
|
| 134 | 134 | } |
| 135 | 135 | if (property_exists($model, 'ncffechavencimiento') && $model->ncffechavencimiento) { |
| 136 | 136 | static::$escpos->text(static::sanitize( |
| 137 | - static::$i18n->trans('due-date') . ': ' . $model->ncffechavencimiento |
|
| 138 | - )) . "\n"; |
|
| 137 | + static::$i18n->trans('due-date').': '.$model->ncffechavencimiento |
|
| 138 | + ))."\n"; |
|
| 139 | 139 | } |
| 140 | 140 | } |
| 141 | 141 | } |
@@ -143,7 +143,7 @@ discard block |
||
| 143 | 143 | // añadimos la cabecera |
| 144 | 144 | if ($printer->head) { |
| 145 | 145 | static::$escpos->setJustification(Printer::JUSTIFY_CENTER); |
| 146 | - static::$escpos->text(static::sanitize($printer->head) . "\n\n"); |
|
| 146 | + static::$escpos->text(static::sanitize($printer->head)."\n\n"); |
|
| 147 | 147 | static::$escpos->setJustification(); |
| 148 | 148 | } |
| 149 | 149 | } |